effectful-core-2.6.1.0: An easy to use, performant extensible effects library.
Safe HaskellNone
LanguageHaskell2010

Effectful.Internal.MTL

Description

Definitions and instances for MTL compatibility.

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

data Error e (a :: Type -> Type) b where Source #

Provide the ability to handle errors of type e.

Constructors

ThrowErrorWith :: forall e (a :: Type -> Type) b. (e -> String) -> e -> Error e a b

Since: 2.4.0.0

CatchError :: forall (a :: Type -> Type) b e. a b -> (CallStack -> e -> a b) -> Error e a b 

Instances

Instances details
type DispatchOf (Error e) Source # 
Instance details

Defined in Effectful.Internal.MTL

data Reader r (a :: Type -> Type) b where Source #

Constructors

Ask :: forall r (a :: Type -> Type). Reader r a r 
Local :: forall r (a :: Type -> Type) b. (r -> r) -> a b -> Reader r a b 

Instances

Instances details
type DispatchOf (Reader r) Source # 
Instance details

Defined in Effectful.Internal.MTL

data State s (a :: Type -> Type) b where Source #

Provide access to a mutable value of type s.

Constructors

Get :: forall s (a :: Type -> Type). State s a s 
Put :: forall s (a :: Type -> Type). s -> State s a () 
State :: forall s b (a :: Type -> Type). (s -> (b, s)) -> State s a b 
StateM :: forall s (a :: Type -> Type) b. (s -> a (b, s)) -> State s a b 

Instances

Instances details
type DispatchOf (State s) Source # 
Instance details

Defined in Effectful.Internal.MTL

data Writer w (a :: Type -> Type) b where Source #

Provide access to a write only value of type w.

Constructors

Tell :: forall w (a :: Type -> Type). w -> Writer w a () 
Listen :: forall (a :: Type -> Type) a1 w. a a1 -> Writer w a (a1, w) 

Instances

Instances details
type DispatchOf (Writer w) Source # 
Instance details

Defined in Effectful.Internal.MTL

Orphan instances

(Show e, Error e :> es, MonadError e (Eff es)) => MonadError e (Eff es) Source #

Instance included for compatibility with existing code.

Instance details

Methods

throwError :: e -> Eff es a #

catchError :: Eff es a -> (e -> Eff es a) -> Eff es a #

(Reader r :> es, MonadReader r (Eff es)) => MonadReader r (Eff es) Source #

Instance included for compatibility with existing code.

Instance details

Methods

ask :: Eff es r #

local :: (r -> r) -> Eff es a -> Eff es a #

reader :: (r -> a) -> Eff es a #

(State s :> es, MonadState s (Eff es)) => MonadState s (Eff es) Source #

Instance included for compatibility with existing code.

Instance details

Methods

get :: Eff es s #

put :: s -> Eff es () #

state :: (s -> (a, s)) -> Eff es a #

(Monoid w, Writer w :> es, MonadWriter w (Eff es)) => MonadWriter w (Eff es) Source #

Instance included for compatibility with existing code.

Instance details

Methods

writer :: (a, w) -> Eff es a #

tell :: w -> Eff es () #

listen :: Eff es a -> Eff es (a, w) #

pass :: Eff es (a, w -> w) -> Eff es a #