THEff: TH implementation of effects.
This package implements effects, as alternative to monad transformers. Actually, the effects themselves are created without the use of TH, but the binding of nested effects described by mkEff splice. For example.
mkEff "MyReader" ''Reader ''Int ''Lift mkEff "SomeState" ''State ''Bool ''MyReader mkEff "OtherRdr" ''Reader ''Float ''SomeState main:: IO () main = do r <- runMyReader 100 $ runSomeState False $ runOtherRdr pi $ do i :: Int <- ask -- MyReader f :: Float <- ask -- OtherRdr b <- get -- SomeState put $ not b -- SomeState lift $ putStrLn "print from effect!" -- Lift return $ show $ fromIntegral i * f print r
For more information about extensible effects , see the original paper at http://okmij.org/ftp/Haskell/extensible/exteff.pdf. But, this package is significantly different from the original. It uses a chains of ordinary GADTs created by TH. No Typeable, unsafe... , ExistentialQuantification ...
Modules
[Index]
Downloads
- THEff-0.1.1.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
Versions [RSS] | 0.1.0.1, 0.1.1.0, 0.1.3, 0.1.4 |
---|---|
Dependencies | base (>=4.8 && <4.9), template-haskell (>=2.4 && <2.11) [details] |
License | BSD-3-Clause |
Author | Kolodezny Diver |
Maintainer | kolodeznydiver@gmail.com |
Category | Control, Effect, TH |
Source repo | head: git clone https://github.com/KolodeznyDiver/THEff.git |
Uploaded | by kolodeznydiver at 2015-08-31T13:23:05Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 3178 total (3 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] |