Copyright | (c) Fumiaki Kinoshita 2018 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Default monad runners and MonadIO
, MonadReader
, MonadWriter
,
MonadState
, MonadError
instances
Synopsis
- 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
(Monoid w, Associate "Writer" ((,) w) xs) => MonadWriter w (Eff xs) Source # | |
Associate "State" (State s) xs => MonadState s (Eff xs) Source # | |
Associate "Reader" ((:~:) r) xs => MonadReader r (Eff xs) Source # | |
Associate "Either" (Const e :: Type -> Type) xs => MonadError e (Eff xs) Source # | |
throwError :: e -> Eff xs a # catchError :: Eff xs a -> (e -> Eff xs a) -> Eff xs a # | |
(Monoid e, Associate "Either" (Const e :: Type -> Type) xs) => Alternative (Eff xs) Source # | A bit dubious |
(Monoid e, Associate "Either" (Const e :: Type -> Type) xs) => MonadPlus (Eff xs) Source # | |
(MonadIO m, Associate "IO" m xs) => MonadIO (Eff xs) Source # | |
(MonadThrow m, Associate "IO" m xs) => MonadThrow (Eff xs) Source # | |
(MonadCatch m, Associate "IO" m xs) => MonadCatch (Eff xs) Source # | |
(MonadResource m, Associate "IO" m xs) => MonadResource (Eff xs) Source # | |
liftResourceT :: ResourceT IO a -> Eff xs a # |