effin: A Typeable-free implementation of extensible effects
This package implements extensible effects, and alternative to monad transformers. The original paper can be found at http://okmij.org/ftp/Haskell/extensible/exteff.pdf. The main differences between this library and the one described in the paper are that this library does not use the Typeable type class, and has a simpler API for handling effects.
For example, the following code implements a handler for exceptions:
runException :: Effect (Exception e ': es) a -> Effect es (Either e a)
runException = eliminate
(\x -> return (Right x))
(\(Exception e) -> return (Left e))Compare this to the corresponding code in extensible-effects (http://hackage.haskell.org/package/extensible-effects):
runExc :: Typeable e => Eff (Exc e :> r) a -> Eff r (Either e a)
runExc = loop . admin
where
loop (Val x) = return (Right x)
loop (E u) = handleRelay u loop (\(Exc e) -> return (Left e))In particular, effect implementors are not required to do any recursion, thereby making effect handlers more composeable.
Modules
[Index]
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| mtl | Enable MTL support | Enabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- effin-0.2.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.2.0.0, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.3.0.1, 0.3.0.2, 0.3.0.3 |
|---|---|
| Dependencies | base (>=4.7 && <4.8), mtl (>=2.1 && <3) [details] |
| License | BSD-3-Clause |
| Copyright | (c) 2014 Anthony Vandikas |
| Author | Anthony Vandikas |
| Maintainer | yellpika@gmail.com |
| Uploaded | by AnthonyVandikas at 2014-05-22T02:32:16Z |
| Category | Control, Effect |
| Home page | https://github.com/YellPika/effin |
| Source repo | head: git clone git://github.com/YellPika/effin.git |
| Distributions | |
| Reverse Dependencies | 3 direct, 0 indirect [details] |
| Downloads | 8979 total (31 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs uploaded by user Build status unknown [no reports yet] |