Safe Haskell | None |
---|---|
Language | Haskell2010 |
Custom prelude to use if supermonads need to support constrained monads as well.
- module Control.Super.Monad.Constrained
- mapM_ :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] (), FunctorCts n [b] [b]) => (a -> m b) -> [a] -> n ()
- sequence_ :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] (), FunctorCts n [b] [b]) => [m b] -> n ()
- (=<<) :: (Bind m n p, BindCts m n p a b) => (a -> n b) -> m a -> p b
- mapM :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] [b]) => (a -> m b) -> [a] -> n [b]
- sequence :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] [b]) => [m b] -> n [b]
- ifThenElse :: Bool -> a -> a -> a
- module Control.Super.Monad.PreludeWithoutMonad
Supermonads
Replacement functions
mapM_ :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] (), FunctorCts n [b] [b]) => (a -> m b) -> [a] -> n () Source #
mapM
ignoring the result.
sequence_ :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] (), FunctorCts n [b] [b]) => [m b] -> n () Source #
sequence
ignoring the result.
(=<<) :: (Bind m n p, BindCts m n p a b) => (a -> n b) -> m a -> p b infixr 1 Source #
Same as >>=
, but with the arguments interchanged.
Traversable replacement functions
mapM :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] [b]) => (a -> m b) -> [a] -> n [b] Source #
Map the given function on each element of the list and collect the results.
sequence :: (Return n, ReturnCts n [b], Bind m n n, BindCts m n n b [b], FunctorCts n [b] [b]) => [m b] -> n [b] Source #
Execute all computations in the list in order and returns the list of results.
Fix rebindable syntax
ifThenElse :: Bool -> a -> a -> a Source #
Standard implementation of if-then-else. Necessary because we are
going to use RebindableSyntax
together with this prelude.