# THEff: TH implementation of effects.

[ 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

main:: IO ()
main = do
$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 ...