-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Milestone
Description
Unboxed vectors can't be Traversable due to the Unbox constraint on the element type, but it would be very useful if there were an analogous generic traverse method:
traverse :: (Applicative f, Vector v a, Vector v b) => (a -> f b) -> v a -> f (v b)
Even better would be if it were efficient, i.e., didn't just convert to and from lists (like the Traversable instance for boxed vectors does) -- but I'm not sure if this is even possible.
sequence
comes close, except that it requires Monad m
and Vector v (m a)
, which will typically not hold for unboxed vectors.
Daniel-Diaz