MIT licensed by Oleg Kiselyov, Amr Sabry, Cameron Swords, Ben Foppa
Maintained by [email protected]
This version can be pinned in stack with:extensible-effects-2.1.0.0@sha256:461d46e28ae3548a498658c98d783de99fdbbbefe5e0584aa0871f2f8486f0da,6517

extensible-effects is based on the work Extensible Effects: An Alternative to Monad Transformers. Please read the paper and the followup freer paper for details. Additional explanation behind the approach can be found on Oleg’s website.

Build Status Join the chat at https://gitter.im/suhailshergill/extensible-effects Stories in Ready Stories in progress

Advantages

  • Effects can be added, removed, and interwoven without changes to code not dealing with those effects.

Limitations

Current implementation only supports GHC version 7.8 and above

This is not a fundamental limitation of the design or the approach, but there is an overhead with making the code compatible across a large number of GHC versions. If this is needed, patches are welcome :)

Disadvantages

Ambiguity-Flexibility tradeoff

  • The extensibility comes at the cost of some ambiguity. Note, however, that the extensibility can be traded back, but that detracts from some of the advantages. For details see section 4.1 in the paper. This issue manifests itself in a few ways:
    • Common functions can’t be grouped using typeclasses, e.g. the ask and getState functions can’t be grouped with some

      class Get t a where
        ask :: Member (t a) r => Eff r a
      

      ask is inherently ambiguous, since the type signature only provides a constraint on t, and nothing more. To specify fully, a parameter involving the type t would need to be added, which would defeat the point of having the grouping in the first place.

    • Code requires greater number of type annotations. For details see #31.