darcs-2.18.3: a distributed, interactive, smart revision control system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Util.IndexedMonad

Synopsis

Documentation

class Monad m where Source #

An alternative monad class, indexed by a "from" and "to" state.

Methods

return :: a -> m i i a Source #

(>>=) :: m i j a -> (a -> m j k b) -> m i k b Source #

(>>) :: m i j a -> m j k b -> m i k b Source #

Instances

Instances details
Monad m => Monad (ReaderT r m) Source # 
Instance details

Defined in Darcs.Util.IndexedMonad

Methods

return :: a -> ReaderT r m i i a Source #

(>>=) :: ReaderT r m i j a -> (a -> ReaderT r m j k b) -> ReaderT r m i k b Source #

(>>) :: ReaderT r m i j a -> ReaderT r m j k b -> ReaderT r m i k b Source #

class LiftIx t where Source #

A class for indexed monad transformers, going from normal Haskell monads into our indexed monads.

Methods

liftIx :: m a -> t m i i a Source #

when :: Monad m => Bool -> m i i () -> m i i () Source #

ifThenElse :: Bool -> a -> a -> a Source #

class Monad m => MonadReader r m | m -> r where Source #

An indexed version of the standard MonadReader class

Methods

ask :: m i i r Source #

local :: (r -> r) -> m i i a -> m i i a Source #

Instances

Instances details
Monad m => MonadReader r (ReaderT r m) Source # 
Instance details

Defined in Darcs.Util.IndexedMonad

Methods

ask :: ReaderT r m i i r Source #

local :: (r -> r) -> ReaderT r m i i a -> ReaderT r m i i a Source #

newtype ReaderT r m i j a Source #

An indexed version of the standard ReaderT transformer

Constructors

ReaderT 

Fields

Instances

Instances details
Monad m => MonadReader r (ReaderT r m) Source # 
Instance details

Defined in Darcs.Util.IndexedMonad

Methods

ask :: ReaderT r m i i r Source #

local :: (r -> r) -> ReaderT r m i i a -> ReaderT r m i i a Source #

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

Defined in Darcs.Util.IndexedMonad

Methods

return :: a -> ReaderT r m i i a Source #

(>>=) :: ReaderT r m i j a -> (a -> ReaderT r m j k b) -> ReaderT r m i k b Source #

(>>) :: ReaderT r m i j a -> ReaderT r m j k b -> ReaderT r m i k b Source #

asks :: MonadReader r m => (r -> a) -> m i i a Source #