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

Safe HaskellNone
LanguageHaskell2010

Control.Super.Monad.Prelude

Contents

Description

A replacement of the standard Prelude for supermonads. Should provide all of the functions also provided in the original prelude without the functions related specifically to Monads. The functions related to Monads are replaced with their supermonad counterparts.

A replacement for the functions in Control.Monad can be found in Control.Super.Monad.Functions.

Synopsis

Supermonads

Replacement functions

mapM_ :: (Return n, ReturnCts n, Bind m n n, BindCts m n n) => (a -> m b) -> [a] -> n () Source #

mapM ignoring the result.

sequence_ :: (Return n, ReturnCts n, Bind m n n, BindCts m n n) => [m b] -> n () Source #

sequence ignoring the result.

(=<<) :: (Bind m n p, BindCts m n p) => (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, Bind m n n, BindCts m n n) => (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, Bind m n n, BindCts m n n) => [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