Copyright | (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.; 2017 Alexis King |
---|---|
License | BSD3 |
Maintainer | Alexis King <lexi.lambda@gmail.com> |
Stability | experimental |
Portability | GHC specific language extensions. |
Safe Haskell | None |
Language | Haskell2010 |
Composable handler for Error effects. Communicates success/failure via an
Either
type.
Using http://okmij.org/ftp/Haskell/extensible/Eff1.hs as a starting point.
Synopsis
- newtype Error e r where
- throwError :: forall e effs a. Member (Error e) effs => e -> Eff effs a
- runError :: forall e effs a. Eff (Error e ': effs) a -> Eff effs (Either e a)
- catchError :: forall e effs a. Member (Error e) effs => Eff effs a -> (e -> Eff effs a) -> Eff effs a
- handleError :: forall e effs a. Eff (Error e ': effs) a -> (e -> Eff effs a) -> Eff effs a
Documentation
throwError :: forall e effs a. Member (Error e) effs => e -> Eff effs a Source #
Throws an error carrying information of type e :: *
.