Basement.Compat.MonadTrans

basement-0.0.15: Foundation scrap box of array & string

License | BSD-style
Maintainer | Psychohistorians
Stability | experimental
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Basement.Compat.MonadTrans

Description

An internal and really simple monad transformers, without any bells and whistse.

Synopsis

- newtype State s m a = State {
  - runState :: s -> m (a, s)
  }
- newtype Reader r m a = Reader {
  - runReader :: r -> m a
  }

# Documentation

newtype State s m a #

Simple State monad

Constructors

State |
Fields runState :: s -> m (a, s)

#### Instances

Instances details

Monad m => Applicative (State s m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods pure :: a -> State s m a # (<*>) :: State s m (a -> b) -> State s m a -> State s m b # liftA2 :: (a -> b -> c) -> State s m a -> State s m b -> State s m c # (*>) :: State s m a -> State s m b -> State s m b # (<*) :: State s m a -> State s m b -> State s m a #
Monad m => Functor (State s m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods fmap :: (a -> b) -> State s m a -> State s m b # (<$) :: a -> State s m b -> State s m a #
Monad m => Monad (State r m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods (>>=) :: State r m a -> (a -> State r m b) -> State r m b # (>>) :: State r m a -> State r m b -> State r m b # return :: a -> State r m a #

newtype Reader r m a #

Simple Reader monad

Constructors

Reader |
Fields runReader :: r -> m a

#### Instances

Instances details

Monad m => Applicative (Reader r m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods pure :: a -> Reader r m a # (<*>) :: Reader r m (a -> b) -> Reader r m a -> Reader r m b # liftA2 :: (a -> b -> c) -> Reader r m a -> Reader r m b -> Reader r m c # (*>) :: Reader r m a -> Reader r m b -> Reader r m b # (<*) :: Reader r m a -> Reader r m b -> Reader r m a #
Monad m => Functor (Reader r m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods fmap :: (a -> b) -> Reader r m a -> Reader r m b # (<$) :: a -> Reader r m b -> Reader r m a #
Monad m => Monad (Reader r m) # |
Instance details Defined in Basement.Compat.MonadTrans Methods (>>=) :: Reader r m a -> (a -> Reader r m b) -> Reader r m b # (>>) :: Reader r m a -> Reader r m b -> Reader r m b # return :: a -> Reader r m a #