[Haskell-cafe] mapM for vectors
Khudyakov Alexey
alexey.skladnoy at gmail.com
Thu Apr 8 13:16:12 EDT 2010
Hello
I found that there is no monadic map for vector. It's possible to define to
define such map using conversion to list, but I suppose it's not efficient. I
didn't make any measurements.
> mapM' :: Monad m => (a -> m b) -> V.Vector a -> m (V.Vector b)
> mapM' f = return . V.fromList <=< mapM f . V.toList
Any suggestions about implementation of such function?
Specifically I want to use Random monad.
--
Khudyakov Alexey
More information about the Haskell-Cafe
mailing list