maam-0.3.0.0: Monadic Abstracting Abstract Machines (MAAM) built on Galois Transformers

Safe HaskellNone
LanguageHaskell2010

FP.Prelude.Effects

Documentation

class MonadMonoid m where Source

Methods

mnull :: m a Source

(<⧺>) :: m a -> m a -> m a infixr 4 Source

Instances

class MonadBot m where Source

Methods

mbot :: m a Source

class MonadJoin m where Source

Methods

(<⊔>) :: m a -> m a -> m a infixr 4 Source

class MonadTop m where Source

Methods

mtop :: m a Source

class MonadMeet m where Source

Methods

(<⊓>) :: m a -> m a -> m a infixr 5 Source

mnullMaybe :: (Monad m, MonadMonoid m) => Maybe a -> m a Source

mbotMaybe :: (Monad m, MonadBot m) => Maybe a -> m a Source

mconcat :: (MonadMonoid m, ToFold (m a) t) => t -> m a Source

mlist :: (Monad m, MonadMonoid m, ToFold a t) => t -> m a Source

msum :: (MonadJoinLattice m, ToFold (m a) t) => t -> m a Source

mset :: (Monad m, MonadJoinLattice m, ToFold a t) => t -> m a Source

type MonadRWS r o s m = (MonadReader r m, MonadWriter o m, MonadState s m) Source

effMaybe :: MonadFailure m => m (Maybe a) -> m a Source

abort :: (Monad m, MonadFailure m) => m a Source

abortMaybe :: (Monad m, MonadFailure m) => Maybe a -> m a Source

obsMaybe :: MonadFailure m => m a -> m (Maybe a) Source

(<|>) :: (Monad m, MonadFailure m) => m a -> m a -> m a Source

tries :: (Monad m, MonadFailure m) => [m a] -> m a Source

newtype ErrorT e m a Source

Constructors

ErrorT 

Fields

runErrorT :: m (e a)
 

class MonadError e m | m -> e where Source

Methods

errorE :: ErrorT e m m Source

errorI :: m ErrorT e m Source

Instances

mapError :: Functor m => (e1 -> e2) -> ErrorT e1 m a -> ErrorT e2 m a Source

effError :: MonadError e m => m (e a) -> m a Source

throw :: (Monad m, MonadError e m) => e -> m a Source

throwSum :: (Monad m, MonadError e m) => (e a) -> m a Source

throwMaybe :: (Monad m, MonadError e m) => e -> Maybe a -> m a Source

obsError :: MonadError e m => m a -> m (e a) Source

catch :: (Monad m, MonadError e m) => m a -> (e -> m a) -> m a Source

newtype ReaderT r m a Source

Constructors

ReaderT 

Fields

runReaderT :: r -> m a
 

runReaderTWith :: r -> ReaderT r m a -> m a Source

effReader :: MonadReader r m => (r -> m a) -> m a Source

ask :: (Monad m, MonadReader r m) => m r Source

askL :: (Monad m, MonadReader r m) => Lens r a -> m a Source

obsReader :: MonadReader r m => m a -> r -> m a Source

local :: MonadReader r m => (r -> r) -> m a -> m a Source

localOn :: MonadReader r m => m a -> (r -> r) -> m a Source

newtype WriterT o m a Source

Constructors

WriterT 

Fields

runWriterT :: m (a, o)
 

execWriterT :: Functor m => WriterT o m a -> m o Source

mapOutput :: Functor m => (o₁ -> o₂) -> WriterT o₁ m a -> WriterT o₂ m a Source

effWriter :: MonadWriter o m => m (a, o) -> m a Source

tell :: (Monad m, MonadWriter o m) => o -> m () Source

obsWriter :: MonadWriter o m => m a -> m (a, o) Source

hijack :: MonadWriter o m => m a -> m (a, o) Source

newtype StateT s m a Source

Constructors

StateT 

Fields

runStateT :: s -> m (a, s)
 

runStateTWith :: s -> StateT s m a -> m (a, s) Source

evalStateTWith :: Functor m => s -> StateT s m a -> m a Source

execStateTWith :: Functor m => s -> StateT s m a -> m s Source

stateLens :: Functor m => Lens s₁ s₂ -> StateT s₂ m StateT s₁ m Source

effState :: MonadState s m => (s -> m (a, s)) -> m a Source

get :: (Monad m, MonadState s m) => m s Source

getL :: (Monad m, MonadState s m) => Lens s a -> m a Source

put :: (Monad m, MonadState s m) => s -> m () Source

putL :: (Monad m, MonadState s m) => Lens s a -> a -> m () Source

modifyM :: (Monad m, MonadState s m) => (s -> m s) -> m () Source

modifyLM :: (Monad m, MonadState s m) => Lens s a -> (a -> m a) -> m () Source

modify :: (Monad m, MonadState s m) => (s -> s) -> m () Source

modifyL :: (Monad m, MonadState s m) => Lens s a -> (a -> a) -> m () Source

getAndPut :: (Monad m, MonadState s m) => s -> m s Source

getAndPutL :: (Monad m, MonadState s m) => Lens s a -> a -> m a Source

next :: (Monad m, MonadState s m, Peano s) => m s Source

nextL :: (Monad m, MonadState s m, Peano a) => Lens s a -> m a Source

bump :: (Monad m, MonadState s m, Peano s) => m () Source

bumpL :: (Monad m, MonadState s m, Peano a) => Lens s a -> m () Source

obsState :: MonadState s m => m a -> s -> m (a, s) Source

localize :: (Monad m, MonadState s m) => m a -> m (a, s) Source

class MonadFlowAppend s m | m -> s where Source

class MonadFlowJoin s m | m -> s where Source

newtype ContT r m a Source

Constructors

ContT 

Fields

runContT :: (a -> m r) -> m r
 

Instances

class MonadCont r m | m -> r where Source

Methods

contE :: ContT r m m Source

contI :: m ContT r m Source

evalContT :: Monad m => ContT r m r -> m r Source

effCont :: MonadCont r m => ((a -> m r) -> m r) -> m a Source

callCC :: MonadCont r m => ((a -> m r) -> m r) -> m a Source

obsCont :: MonadCont r m => m a -> (a -> m r) -> m r Source

withC :: MonadCont r m => (a -> m r) -> m a -> m r Source

reset :: (Monad m, MonadCont r m) => m r -> m r Source

modifyC :: (Monad m, MonadCont r m) => (r -> m r) -> m a -> m a Source

newtype OpaqueContT k r m a Source

Constructors

OpaqueContT 

Fields

runOpaqueContT :: k r m a -> m r
 

Instances

Isomorphic3 * (* -> *) (ContFun * r) (k r) => FunctorIsoFunctor (OpaqueContT * * k r) Source 

class MonadOpaqueCont k r m | m -> k, m -> r where Source

newtype ContFun r m a Source

Constructors

ContFun 

Fields

runContFun :: a -> m r
 

runOpaqueContTWith :: k r m a -> OpaqueContT k r m a -> m r Source

evalOpaqueContT :: (Monad m, Isomorphic3 (ContFun r) (k r)) => OpaqueContT k r m r -> m r Source

runMetaContT :: Isomorphic3 (ContFun r) (k r) => OpaqueContT k r m a -> (a -> m r) -> m r Source

runMetaContTWith :: Isomorphic3 (ContFun r) (k r) => (a -> m r) -> OpaqueContT k r m a -> m r Source

metaContT :: Isomorphic3 (ContFun r) (k r) => ((a -> m r) -> m r) -> OpaqueContT k r m a Source

meta :: Isomorphic3 (ContFun r) (k r) => OpaqueContT k r m ContT r m Source

effOpaqueCont :: MonadOpaqueCont k r m => (k r m a -> m r) -> m a Source

callCCOpaque :: MonadOpaqueCont k r m => (k r m a -> m r) -> m a Source

obsOpaqueCont :: MonadOpaqueCont k r m => m a -> k r m a -> m r Source

withCOpaque :: MonadOpaqueCont k r m => k r m a -> m a -> m r Source