hasktorch-gradually-typed-0.2.0.0: experimental project for hasktorch
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Fresh

Synopsis

Documentation

newtype Successor a Source #

Constructors

Successor 

Fields

  • suc :: a -> a
     

newtype FreshT e m a Source #

The monad transformer for generating fresh values.

Constructors

FreshT 

Fields

Instances

Instances details
MFunctor (FreshT e :: (Type -> Type) -> Type -> TYPE LiftedRep) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> FreshT e m b -> FreshT e n b Source #

Monad m => MonadFresh e (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: FreshT e m e Source #

MonadError e m => MonadError e (FreshT e' m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

throwError :: e -> FreshT e' m a Source #

catchError :: FreshT e' m a -> (e -> FreshT e' m a) -> FreshT e' m a Source #

MonadReader r m => MonadReader r (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

ask :: FreshT e m r Source #

local :: (r -> r) -> FreshT e m a -> FreshT e m a Source #

reader :: (r -> a) -> FreshT e m a Source #

MonadState s m => MonadState s (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

get :: FreshT e m s Source #

put :: s -> FreshT e m () Source #

state :: (s -> (a, s)) -> FreshT e m a Source #

MonadWriter w m => MonadWriter w (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

writer :: (a, w) -> FreshT e m a Source #

tell :: w -> FreshT e m () Source #

listen :: FreshT e m a -> FreshT e m (a, w) Source #

pass :: FreshT e m (a, w -> w) -> FreshT e m a Source #

MonadTrans (FreshT e) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

lift :: Monad m => m a -> FreshT e m a Source #

MonadFix m => MonadFix (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

mfix :: (a -> FreshT e m a) -> FreshT e m a Source #

MonadIO m => MonadIO (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

liftIO :: IO a -> FreshT e m a Source #

(Monad m, Functor m, MonadPlus m) => Alternative (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

empty :: FreshT e m a Source #

(<|>) :: FreshT e m a -> FreshT e m a -> FreshT e m a Source #

some :: FreshT e m a -> FreshT e m [a] Source #

many :: FreshT e m a -> FreshT e m [a] Source #

(Functor f, Monad f) => Applicative (FreshT e f) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

pure :: a -> FreshT e f a Source #

(<*>) :: FreshT e f (a -> b) -> FreshT e f a -> FreshT e f b Source #

liftA2 :: (a -> b -> c) -> FreshT e f a -> FreshT e f b -> FreshT e f c Source #

(*>) :: FreshT e f a -> FreshT e f b -> FreshT e f b Source #

(<*) :: FreshT e f a -> FreshT e f b -> FreshT e f a Source #

Functor m => Functor (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fmap :: (a -> b) -> FreshT e m a -> FreshT e m b Source #

(<$) :: a -> FreshT e m b -> FreshT e m a Source #

Monad m => Monad (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

(>>=) :: FreshT e m a -> (a -> FreshT e m b) -> FreshT e m b Source #

(>>) :: FreshT e m a -> FreshT e m b -> FreshT e m b Source #

return :: a -> FreshT e m a Source #

MonadPlus m => MonadPlus (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

mzero :: FreshT e m a Source #

mplus :: FreshT e m a -> FreshT e m a -> FreshT e m a Source #

MonadGen m => MonadGen (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Associated Types

type GenBase (FreshT e m) :: Type -> Type Source #

Methods

toGenT :: FreshT e m a -> GenT (GenBase (FreshT e m)) a Source #

fromGenT :: GenT (GenBase (FreshT e m)) a -> FreshT e m a Source #

MonadCont m => MonadCont (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

callCC :: ((a -> FreshT e m b) -> FreshT e m a) -> FreshT e m a Source #

type GenBase (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

type GenBase (FreshT e m) = FreshT e (GenBase m)

successor :: forall e. (e -> e) -> Successor e Source #

enumSucc :: forall e. Enum e => Successor e Source #

runFreshT :: forall e m a. (Enum e, Monad m) => FreshT e m a -> m a Source #

Run a FreshT computation starting from the value toEnum 0

runFresh :: forall e a. Enum e => Fresh e a -> a Source #

Run a Fresh computation starting from the value toEnum 0

runFreshTFrom :: forall e m a. (Monad m, Enum e) => e -> FreshT e m a -> m a Source #

Run a FreshT computation starting from a specific value e.

runFreshFrom :: forall e a. Enum e => e -> Fresh e a -> a Source #

Run a Fresh computation starting from a specific value e.

runFreshTWith :: forall e m a. Monad m => Successor e -> e -> FreshT e m a -> m a Source #

Run a FreshT computation starting from a specific value e with a the next fresh value determined by Successor e.

runFreshWith :: forall e a. Successor e -> e -> Fresh e a -> a Source #

Run a FreshT computation starting from a specific value e with a the next fresh value determined by Successor e.

class Monad m => MonadFresh e m | m -> e where Source #

The MTL style class for generating fresh values

Methods

fresh :: m e Source #

Generate a fresh value e, fresh should never produce the same value within a monadic computation.

Instances

Instances details
MonadFresh e m => MonadFresh e (MaybeT m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: MaybeT m e Source #

Monad m => MonadFresh e (FreshT e m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: FreshT e m e Source #

MonadFresh e m => MonadFresh e (ExceptT e' m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: ExceptT e' m e Source #

MonadFresh e m => MonadFresh e (IdentityT m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: IdentityT m e Source #

MonadFresh e m => MonadFresh e (ReaderT s m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: ReaderT s m e Source #

MonadFresh e m => MonadFresh e (StateT s m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: StateT s m e Source #

(MonadFresh e m, Monoid s) => MonadFresh e (WriterT s m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: WriterT s m e Source #

MonadFresh e m => MonadFresh e (ContT r m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: ContT r m e Source #

(Monoid w, MonadFresh e m) => MonadFresh e (RWST r w s m) Source # 
Instance details

Defined in Control.Monad.Fresh

Methods

fresh :: RWST r w s m e Source #