Copyright | (c) Fumiaki Kinoshita 2017 |
---|---|

License | BSD3 |

Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |

Safe Haskell | None |

Language | Haskell2010 |

Default monad runners and `MonadIO`

, `MonadReader`

, `MonadWriter`

,
`MonadState`

, `MonadError`

instances

- type ReaderDef r = "Reader" >: ReaderEff r
- runReaderDef :: Eff (ReaderDef r ': xs) a -> r -> Eff xs a
- type StateDef s = "State" >: State s
- runStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs (a, s)
- evalStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs a
- execStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs s
- type WriterDef w = "Writer" >: WriterEff w
- runWriterDef :: Monoid w => Eff (WriterDef w ': xs) a -> Eff xs (a, w)
- execWriterDef :: Monoid w => Eff (WriterDef w ': xs) a -> Eff xs w
- type MaybeDef = "Either" >: EitherEff ()
- runMaybeDef :: Eff (MaybeDef ': xs) a -> Eff xs (Maybe a)
- type EitherDef e = "Either" >: EitherEff e
- runEitherDef :: Eff (EitherDef e ': xs) a -> Eff xs (Either e a)

# Documentation

runReaderDef :: Eff (ReaderDef r ': xs) a -> r -> Eff xs a Source #

Specialised version of `runReaderEff`

compatible with the `MonadReader`

instance.

runStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs (a, s) Source #

`runStateEff`

specialised for the `MonadState`

instance.

evalStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs a Source #

`evalStateEff`

specialised for the `MonadState`

instance.

execStateDef :: Eff (StateDef s ': xs) a -> s -> Eff xs s Source #

`execStateEff`

specialised for the `MonadState`

instance.

runWriterDef :: Monoid w => Eff (WriterDef w ': xs) a -> Eff xs (a, w) Source #

`runWriterDef`

specialised for the `MonadWriter`

instance.

execWriterDef :: Monoid w => Eff (WriterDef w ': xs) a -> Eff xs w Source #

`execWriterDef`

specialised for the `MonadWriter`

instance.

runEitherDef :: Eff (EitherDef e ': xs) a -> Eff xs (Either e a) Source #

Similar to `runExceptT`

, but on `Eff`

# Orphan instances

Associate (* -> *) Symbol "Either" (Const * e) xs => MonadError e (Eff Symbol xs) Source # | |

Associate (* -> *) Symbol "Reader" ((:~:) * r) xs => MonadReader r (Eff Symbol xs) Source # | |

Associate (* -> *) Symbol "State" (State s) xs => MonadState s (Eff Symbol xs) Source # | |

(Monoid w, Associate (* -> *) Symbol "Writer" ((,) w) xs) => MonadWriter w (Eff Symbol xs) Source # | |

Associate (* -> *) Symbol "IO" IO xs => MonadIO (Eff Symbol xs) Source # | |

(Monoid e, Associate (* -> *) Symbol "Either" (Const * e) xs) => Alternative (Eff Symbol xs) Source # | A bit dubious |

(Monoid e, Associate (* -> *) Symbol "Either" (Const * e) xs) => MonadPlus (Eff Symbol xs) Source # | |