I’m pleased to announce cleff, a new extensible effects library for Haskell: https://github.com/re-xyr/cleff.
It has several key features that distinguishes it from other libraries:
- It has an API similar to
polysemyandfreer-simple, i.e. you can write effect interpreters as simple case-splitting functions. This means effects are low-boilerplate, easy to understand, and that users of similar libraries can easily get along withcleff. - It supports higher-order effects implementation, and provides a set of easy-to-use combinators for that. The expressiveness of these combinators are on par with
polysemy'sTacticslanguage, and also harder to use incorrectly. - It uses a
ReaderT IOmonad as the underlyingEffmonad implementation, instead of free monads.- Therefore, the overhead of effects is reduced greatly (and gives pretty impressive microbenchmark results).
- IO-based effect implementations provides good interaction with exceptions and concurrency (no more losing changes to
Statedue to exceptions).
The library and documentation are already available on Hackage: https://hackage.haskell.org/package/cleff.