On 30/07/13 20:40, Riaan Rottier wrote:
You might also notice that mapM has the same type as map, but with 'm'
appearing in every return position.
map :: (a -> b) -> [a] -> [b]
mapM :: (a -> m b) -> [a] -> m [b]
This is the same pattern as was seen in earlier functions:
filter :: (a -> Bool) -> [a] -> [a]
filterM :: (a -> m Bool) -> [a] -> m [a]
replicate :: Int -> a -> [a]
reeplicate :: Int -> a -> m [a]
find :: (a -> Bool) -> [a] -> Maybe a
findM :: (a -> m Bool) -> [a] -> m (Maybe a)