Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Wieczerkowski
curry-libs
Commits
ecf5f3e8
Commit
ecf5f3e8
authored
Oct 19, 2019
by
Kai-Oliver Prott
Browse files
Add liftM3 to Control.Monad
parent
8019368c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Control/Monad.curry
View file @
ecf5f3e8
...
@@ -2,7 +2,7 @@ module Control.Monad
...
@@ -2,7 +2,7 @@ module Control.Monad
( Functor(..), Applicative(..), Monad(..)
( Functor(..), Applicative(..), Monad(..)
, filterM, (>=>), (<=<), forever, mapAndUnzipM, zipWithM
, filterM, (>=>), (<=<), forever, mapAndUnzipM, zipWithM
, zipWithM_, foldM, foldM_, replicateM, replicateM_
, zipWithM_, foldM, foldM_, replicateM, replicateM_
, when, unless
, when, unless
, liftM3
) where
) where
import Control.Applicative
import Control.Applicative
...
@@ -81,3 +81,11 @@ replicateM_ cnt0 f =
...
@@ -81,3 +81,11 @@ replicateM_ cnt0 f =
--- The reverse of 'when'.
--- The reverse of 'when'.
unless :: (Applicative f) => Bool -> f () -> f ()
unless :: (Applicative f) => Bool -> f () -> f ()
unless p s = if p then pure () else s
unless p s = if p then pure () else s
liftM3 :: Monad m => (a -> b -> c -> d) -> m a -> m b -> m c -> m d
liftM3 f ma mb mc = do
a <- ma
b <- mb
c <- mc
return (f a b c)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment