Open
Description
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 Yield
s followed by Done
). I don't know that there's any way around that annoyance.
Metadata
Metadata
Assignees
Labels
No labels