Our great sponsors
-
effectful
An easy to use, fast extensible effects library with seamless integration with the existing Haskell ecosystem.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
The writeup of the issues with WriterT at https://github.com/haskell-effectful/effectful/blob/master/transformers.md is excellent, I would have much appreciated this 15-ish years back when I was stumbling through those problems and eventually settled on what everyone seems to settle on, which is restricted State. Though the transformers/mtl docs seem much improved from the old days, if they just linked to that description it have made so much clearer to me. The concrete examples with memory use make it very clear.
For a more complicated real-world scenario you can have a look at https://github.com/haskell-effectful/hpqtypes-effectful.
cleff and effectful are very similar, to the point that I offered to join forces (for the record, majority of the conversation refers to things that are no longer true for both libraries as we inspired each other to fix most quirks :). The main difference is the internal environment - in effectful it's mutable, while in cleff it's immutable. All differences pretty much grow from this. The main ones: