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

Can we get generateA? #144

Open
treeowl opened this issue Nov 29, 2016 · 0 comments
Open

Can we get generateA? #144

treeowl opened this issue Nov 29, 2016 · 0 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Nov 29, 2016

generateA :: Applicative f => Int -> (Int -> f a) -> f (Vector a)
-- specification
generateA n f = sequenceA (generate n f)

The Monad m constraint on generateM seems to flow from unstreamM. unstreamM, in turn, absolutely requires a Monad m constraint because of the way general streams are structured. For generating vectors, this all seems a bit sad, since the exact shape of the result stream is known in advance (a specific number of Yields followed by Done). I don't know that there's any way around that annoyance.

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

1 participant