The THEff package

[ Tags: bsd3, control, effect, library, th ] [ Propose Tags ]

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, no unsafe... , no ExistentialQuantification ...


[Skip to Readme]

Properties

Versions 0.1.0.1, 0.1.1.0, 0.1.3, 0.1.4
Change log changelog
Dependencies base (>=4.7 && <5), template-haskell (>=2.11) [details]
License BSD3
Author Kolodezny Diver
Maintainer kolodeznydiver@gmail.com
Category Control, Effect, TH
Source repository head: git clone https://github.com/KolodeznyDiver/THEff.git
Uploaded Sun Jan 22 20:06:42 UTC 2017 by kolodeznydiver
Distributions NixOS:0.1.4
Downloads 404 total (22 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-01-22 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for THEff-0.1.4

[back to package description]

THEff

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 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 ...