
2 Jul
2011
2 Jul
'11
4 a.m.
On Sat, Jul 2, 2011 at 9:55 AM, Chaddaï Fouché
On Fri, Jul 1, 2011 at 10:48 PM, Alexey G
wrote: Try this:
mapM (\x -> getDeviceInfo x >>= print . name) [0..10]
mapM_ (getDeviceInfo >=> print . name) [0..10]
Or maybe, to be more consistent order-wise :
mapM_ (print . name <=< getDeviceInfo) [0..10]
(>=>) :: (a -> m b) -> (b -> m c) -> a -> m c
Oops, forgot the constraint : (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) -- Jedaï