Control.Monad.Supply

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Control.Monad.Supply

Description

Fresh variable supply

# Documentation

newtype SupplyT (m :: Type -> Type) a #

Constructors

SupplyT |
Fields unSupplyT :: StateT Integer m a

#### Instances

Instances details

MonadTrans SupplyT # |
Instance details Defined in Control.Monad.Supply Methods lift :: Monad m => m a -> SupplyT m a #
MonadError e m => MonadError e (SupplyT m) # |
Instance details Defined in Control.Monad.Supply Methods throwError :: e -> SupplyT m a # catchError :: SupplyT m a -> (e -> SupplyT m a) -> SupplyT m a #
MonadReader r m => MonadReader r (SupplyT m) # |
Instance details Defined in Control.Monad.Supply Methods ask :: SupplyT m r # local :: (r -> r) -> SupplyT m a -> SupplyT m a # reader :: (r -> a) -> SupplyT m a #
MonadWriter w m => MonadWriter w (SupplyT m) # |
Instance details Defined in Control.Monad.Supply 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 #
MonadPlus m => Alternative (SupplyT m) # |
Instance details Defined in Control.Monad.Supply Methods empty :: SupplyT m a # (<|>) :: SupplyT m a -> SupplyT m a -> SupplyT m a # some :: SupplyT m a -> SupplyT m [a] # many :: SupplyT m a -> SupplyT m [a] #
Monad m => Applicative (SupplyT m) # |
Instance details Defined in Control.Monad.Supply 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 #
Functor m => Functor (SupplyT m) # |
Instance details Defined in Control.Monad.Supply Methods fmap :: (a -> b) -> SupplyT m a -> SupplyT m b # (<$) :: a -> SupplyT m b -> SupplyT m a #
Monad m => Monad (SupplyT m) # |
Instance details Defined in Control.Monad.Supply 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 #
MonadPlus m => MonadPlus (SupplyT m) # |
Instance details Defined in Control.Monad.Supply Methods mzero :: SupplyT m a # mplus :: SupplyT m a -> SupplyT m a -> SupplyT m a #
Monad m => MonadSupply (SupplyT m) # |
Instance details Defined in Control.Monad.Supply.Class Methods fresh :: SupplyT m Integer # peek :: SupplyT m Integer #

runSupplyT :: Integer -> SupplyT m a -> m (a, Integer) #

evalSupplyT :: Functor m => Integer -> SupplyT m a -> m a #

type Supply = SupplyT Identity #

runSupply :: Integer -> Supply a -> (a, Integer) #