The effects package

[Tags:bsd3, library]

Control.Effects is a library for programming with effects, like in the the Eff language by Andrej Bauer and Matija Pretnar. Effects can be used instead of monad transformers.

See the home page for some example code.


[Skip to Readme]

Properties

Versions 0, 0.1, 0.2, 0.2.1, 0.2.2
Dependencies base (>=3 && <5), containers (==0.4.*), newtype (==0.2.*), void [details]
License BSD3
Author Sjoerd Visscher
Maintainer sjoerd@w3future.com
Stability experimental
Category Control, Monads
Home page http://github.com/sjoerdvisscher/effects
Bug tracker http://github.com/sjoerdvisscher/effects/issues
Source repository head: git clone git://github.com/sjoerdvisscher/effects.git
Uploaded Sat Dec 3 15:49:26 UTC 2011 by SjoerdVisscher
Distributions NixOS:0.2.2
Downloads 1125 total (12 in the last 30 days)
Votes
0 []
Status Docs not available [build log]
All reported builds failed as of 2015-11-17 [all 5 reports]

Modules

  • Control
    • Control.Effects
      • Control.Effects.Cont
      • Control.Effects.Either
      • Control.Effects.Error
      • Control.Effects.NonDet
      • Control.Effects.State
      • Control.Effects.Writer

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for effects

Readme for effects-0.2.1

Control.Effects

Control.Effects is a Haskell library for programming with effects, like in the the Eff language by Andrej Bauer and Matija Pretnar. Effects can be used instead of monad transformers, they are designed to be easier to use and to define.

Installation

cabal install effects

Using effects

Here's an example how to use the state effect from Control.Effects.State.

example :: (Int, Int)
example = run $ do
  with (ref 5) $ \x -> do
    with (ref 10) $ \y -> do
      x =: (+) <$> get x <*> get y
      y =: (+) <$> get x <*> get y
      (,) <$> get x <*> get y

Every instance of an effect is given a name (x and y in this example), which makes is possible to easily mix several instances of the same effect.

For more examples see examples.hs.