... | ... | @@ -21,7 +21,7 @@ Ideally the following functions could be desugared into `fmap` with a `Functor` |
|
|
{-# LANGUAGE MonadComprehensions #-}
|
|
|
|
|
|
fmapM :: Functor f => (a -> b) -> f a -> f b
|
|
|
fmapM f xs = [ f x | x <- xs ]
|
|
|
fmapM f xs = [f x | x <- xs ]
|
|
|
|
|
|
fmapDo :: Functor f => (a -> b) -> f a -> f b
|
|
|
fmapDo f xs = do
|
... | ... | @@ -39,7 +39,7 @@ The following are equivalent to, and could be safely replaced with, `liftA3`: |
|
|
|
|
|
```wiki
|
|
|
threeM :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
|
|
|
threeM f a1 a2 a3 = [ f x1 x2 x3 | x1 <- a1, x2 <- a2, x3 <- a3 ]
|
|
|
threeM f a1 a2 a3 = [f x1 x2 x3 | x1 <- a1, x2 <- a2, x3 <- a3 ]
|
|
|
|
|
|
threeDo :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
|
|
|
threeDo f a1 a2 a3 = do
|
... | ... | |