supermonad-0.2.0.1: Plugin and base library to support supermonads in Haskell

Safe HaskellNone
LanguageHaskell2010

Control.Super.Monad.Constrained.Prelude

Contents

Description

Custom prelude to use if supermonads need to support constrained monads as well.

Synopsis

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.

Prelude functions