PureConf

PureConf

On theory and practice of PureScript

Jordan Martinez

@JordanMartinez

Using Monad Transformers without understanding them

Submitted Jan 11, 2022

Do you understand Monads and “do notation,” but still do not understand Monad Transformers? Do you want to use a framework or library, but it has been scaring you off because it uses a monad transformer? Then this talk is for you.

This talk answers two questions:

  • what problem do monad transformers solve?
  • how do I use monad transformers to solve that problem?

This talk will

  • show examples of common monad transformers and their equivalent “untransformed” versions
  • show how to “sugar” a concrete type into a monad transformer
  • explain why the order of monad transformers matter
  • show how to write programs using monad transformers and their corresponding type classes

This talk will not explain why monad transformers actually work. But, it will be easier for you to learn why they work after watching this talk.

By the end of this talk, you will

  • understand when to use transformers
  • be able to use ExceptT, ReaderT, and StateT
  • have an intuition for how “Tagless Final” works

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

FP-Juspay is a forum to dive deep and contribute to the world of Functional Programming - Frameworks, Applications and People. more

Supported by

Community sponsor

Welcome to the MLabs page! We are a Haskell consultancy and a collection of real FP geeks. We are hiring Haskellers, Purescripters and other FP enthusiasts all year round. If you love Haskell and are looking for a job or internship, you apply here: https://apply.workable.com/mlabs/j/63DAAA4AEF/ more

Promoted

nilenso is a boutique technology consultancy based in Bangalore. Over the past 9 years, we have worked on projects in e-commerce, logistics, machine learning, data science, healthcare, payments and education. You can read about some our recent projects here: https://nilenso.com/recent-tech.html. Ou… more

Promoted