Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I generate an IO Vector? #175

Closed
tomjaguarpaw opened this issue Jun 16, 2017 · 4 comments
Closed

How do I generate an IO Vector? #175

tomjaguarpaw opened this issue Jun 16, 2017 · 4 comments

Comments

@tomjaguarpaw
Copy link
Member

Data.Vector has generate :: Int -> (Int -> a) -> Vector a but I don't see an equivalent in Data.Vector.Mutable. What am I missing?

@cartazio
Copy link
Contributor

cartazio commented Jun 17, 2017 via email

@tomjaguarpaw
Copy link
Member Author

So if someone submitted a PR to add generate it would likely be accepted?

@dolio
Copy link
Contributor

dolio commented Jun 17, 2017

I think the API for mutable vectors is lacking a lot of utilities, so yeah, I'd accept it.

It may be that there's a rewrite rule in place to turn any Vector construction into a corresponding MVector construction (because if you think about it, building an immutable vector has to be building a mutable vector and then freezing). However, off hand I don't know what it is, and it isn't the most obvious thing to try. I could take a look if you'd be interested in that, though.

@Shimuuar
Copy link
Contributor

Closed in favor of #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants