imperative-edsl-0.8.2: Deep embedding of imperative programs with code generation
Safe HaskellNone
LanguageHaskell2010

Control.Monads

Synopsis

Documentation

newtype SupplyT m a Source #

Constructors

SupplyT 

Fields

Instances

Instances details
MonadTrans SupplyT Source # 
Instance details

Defined in Control.Monads

Methods

lift :: Monad m => m a -> SupplyT m a #

MonadReader r m => MonadReader r (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

ask :: SupplyT m r #

local :: (r -> r) -> SupplyT m a -> SupplyT m a #

reader :: (r -> a) -> SupplyT m a #

MonadState s m => MonadState s (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

get :: SupplyT m s #

put :: s -> SupplyT m () #

state :: (s -> (a, s)) -> SupplyT m a #

MonadWriter w m => MonadWriter w (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

writer :: (a, w) -> SupplyT m a #

tell :: w -> SupplyT m () #

listen :: SupplyT m a -> SupplyT m (a, w) #

pass :: SupplyT m (a, w -> w) -> SupplyT m a #

Monad m => Monad (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

(>>=) :: SupplyT m a -> (a -> SupplyT m b) -> SupplyT m b #

(>>) :: SupplyT m a -> SupplyT m b -> SupplyT m b #

return :: a -> SupplyT m a #

Functor m => Functor (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

fmap :: (a -> b) -> SupplyT m a -> SupplyT m b #

(<$) :: a -> SupplyT m b -> SupplyT m a #

MonadFix m => MonadFix (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

mfix :: (a -> SupplyT m a) -> SupplyT m a #

Monad m => Applicative (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

pure :: a -> SupplyT m a #

(<*>) :: SupplyT m (a -> b) -> SupplyT m a -> SupplyT m b #

liftA2 :: (a -> b -> c) -> SupplyT m a -> SupplyT m b -> SupplyT m c #

(*>) :: SupplyT m a -> SupplyT m b -> SupplyT m b #

(<*) :: SupplyT m a -> SupplyT m b -> SupplyT m a #

MonadIO m => MonadIO (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

liftIO :: IO a -> SupplyT m a #

MonadException m => MonadException (SupplyT m) Source # 
Instance details

Defined in Control.Monads

Methods

throw :: Exception e => e -> SupplyT m a #

catch :: Exception e => SupplyT m a -> (e -> SupplyT m a) -> SupplyT m a #

finally :: SupplyT m a -> SupplyT m b -> SupplyT m a #

Monad m => MonadSupply (SupplyT m) Source # 
Instance details

Defined in Control.Monads

class Monad m => MonadSupply m where Source #

Minimal complete definition

Nothing

Methods

fresh :: m Integer Source #

Create a fresh variable identifier

default fresh :: (m ~ t n, MonadTrans t, MonadSupply n) => m Integer Source #

Instances

Instances details
MonadSupply m => MonadSupply (ExceptionT m) Source # 
Instance details

Defined in Control.Monads

Monad m => MonadSupply (SupplyT m) Source # 
Instance details

Defined in Control.Monads

MonadSupply m => MonadSupply (StateT s m) Source # 
Instance details

Defined in Control.Monads

Methods

fresh :: StateT s m Integer Source #

MonadSupply m => MonadSupply (ReaderT r m) Source # 
Instance details

Defined in Control.Monads

Methods

fresh :: ReaderT r m Integer Source #

MonadSupply m => MonadSupply (StateT s m) Source # 
Instance details

Defined in Control.Monads

Methods

fresh :: StateT s m Integer Source #

(MonadSupply m, Monoid w) => MonadSupply (WriterT w m) Source # 
Instance details

Defined in Control.Monads

Methods

fresh :: WriterT w m Integer Source #

runSupplyT :: Monad m => SupplyT m a -> m a Source #

type Loc = Integer Source #

Program location

newtype TickT m a Source #

Tick monad

Constructors

TickT 

Fields

Instances

Instances details
MonadTrans TickT Source # 
Instance details

Defined in Control.Monads

Methods

lift :: Monad m => m a -> TickT m a #

MonadReader r m => MonadReader r (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

ask :: TickT m r #

local :: (r -> r) -> TickT m a -> TickT m a #

reader :: (r -> a) -> TickT m a #

MonadState s m => MonadState s (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

get :: TickT m s #

put :: s -> TickT m () #

state :: (s -> (a, s)) -> TickT m a #

MonadWriter w m => MonadWriter w (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

writer :: (a, w) -> TickT m a #

tell :: w -> TickT m () #

listen :: TickT m a -> TickT m (a, w) #

pass :: TickT m (a, w -> w) -> TickT m a #

Monad m => Monad (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

(>>=) :: TickT m a -> (a -> TickT m b) -> TickT m b #

(>>) :: TickT m a -> TickT m b -> TickT m b #

return :: a -> TickT m a #

Functor m => Functor (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

fmap :: (a -> b) -> TickT m a -> TickT m b #

(<$) :: a -> TickT m b -> TickT m a #

MonadFix m => MonadFix (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

mfix :: (a -> TickT m a) -> TickT m a #

Monad m => Applicative (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

pure :: a -> TickT m a #

(<*>) :: TickT m (a -> b) -> TickT m a -> TickT m b #

liftA2 :: (a -> b -> c) -> TickT m a -> TickT m b -> TickT m c #

(*>) :: TickT m a -> TickT m b -> TickT m b #

(<*) :: TickT m a -> TickT m b -> TickT m a #

Monad m => MonadTick (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: TickT m () Source #

loc :: TickT m Loc Source #

class Monad m => MonadTick m where Source #

Minimal complete definition

Nothing

Methods

tick :: m () Source #

default tick :: (m ~ t n, MonadTrans t, MonadTick n) => m () Source #

loc :: m Loc Source #

default loc :: (m ~ t n, MonadTrans t, MonadTick n) => m Loc Source #

Instances

Instances details
Monad m => MonadTick (TickT m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: TickT m () Source #

loc :: TickT m Loc Source #

MonadTick m => MonadTick (StateT s m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: StateT s m () Source #

loc :: StateT s m Loc Source #

MonadTick m => MonadTick (ReaderT r m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: ReaderT r m () Source #

loc :: ReaderT r m Loc Source #

MonadTick m => MonadTick (StateT s m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: StateT s m () Source #

loc :: StateT s m Loc Source #

(MonadTick m, Monoid w) => MonadTick (WriterT w m) Source # 
Instance details

Defined in Control.Monads

Methods

tick :: WriterT w m () Source #

loc :: WriterT w m Loc Source #

runTickT :: Monad m => TickT m a -> m a Source #

runTick :: Tick a -> a Source #

freshStr :: MonadSupply m => String -> m String Source #

Create a fresh string identifier with the given prefix