Skip to content

Instantly share code, notes, and snippets.

View huyvohcmc's full-sized avatar
✏️
taking notes

Huy Vo huyvohcmc

✏️
taking notes
  • Thinkei
  • Ho Chi Minh City, Vietnam
  • 02:49 (UTC +07:00)
  • X @huyvohcmc
View GitHub Profile
@cscalfani
cscalfani / ThinkAboutMonads.md
Last active December 4, 2022 20:58
How to think about monads

How to think about Monads

UPDATE 2021: I wrote this long before I wrote my book Functional Programming Made Easier: A Step-by-step Guide. For a much more in depth discussion on Monads see Chapter 18.

Initially, Monads are the biggest, scariest thing about Functional Programming and especially Haskell. I've used monads for quite some time now, but I didn't have a very good model for what they really are. I read Philip Wadler's paper Monads for functional programming and I still didnt quite see the pattern.

It wasn't until I read the blog post You Could Have Invented Monads! (And Maybe You Already Have.) that I started to see things more clearly.

This is a distillation of those works and most likely an oversimplification in an attempt to make things easier to understand. Nuance can come later. What we need when first le