Freeing Free Monads with Free ADTs

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • purescript-freer-free

    Boilerplate-eliminator when working with free monads.

  • There are many great articles on why Free Monads are the bee's knees, notably by Gabriel Gonzalez here and here. At the end of this article, I'll give a couple of reasons that I like to use them. But here, I'd like to talk about why they are super annoying - you have to write all those functions! And even worse, you have to do it twice! Once to make the free monad, and once to transform it into the execution monad (ie Aff or IO or Identity or whatever). That's what purescript-freer-free fixes.

  • purescript-free

    Free monads, Cofree comonads, Yoneda and Coyoneda functors, and the Trampoline monad.

  • Those are the elements of the program, and we mix and match them as we please. The way we transform those into a free monad is using purescript-free. In the "bad old days" (meaning a couple days ago, before purescript-freer-free was released) we'd use a function from purescript-free called liftF to turn the ADT above into a monad.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • purescript-aff

    An asynchronous effect monad for PureScript

  • So I find that free monads allow for better testability and easier swapping of implementations in certain situations. That said, we also have services at Meeshkan that are so tightly coupled to the Aff monad that making a free monad just takes too much time, so we just roll with Aff and write a good end-to-end test.

  • purescript-run

    An extensible-effects implementation

  • purescript-run: Federate free monads together into an uber-monad using the Variant pattern.

  • purescript-freet

    Free monad transformers

  • 'purescript-freet`: Make your free monad part of a monadic stack.

  • 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.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts