[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: [Haskell-cafe] mapM for vectors
From: Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date: 2010-04-08 17:16:12
Message-ID: 201004082116.13026.alexey.skladnoy () gmail ! com
[Download RAW message or body]
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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic