magnASCII.dev Simone Magnaschi
Senior Full Stack Web Dev
Bookmarks tagged with #haskell.
Show all

Functors to Monads: A Story of Shapes · in Code

For many years now I’ve been using a mental model and intuition that has guided me well for understanding and teaching and using functors, applicatives, monads, and other related Haskell abstractions, as well as for approaching learning new ones. Sometimes when teaching Haskell I talk about this concept and assume everyone already has heard it, but I realize that it’s something universal yet easy to miss depending on how you’re learning it. So, here it is: how I understand the Functor and other related abstractions and free constructions in Haskell. The crux is this: instead of thinking about what fmap changes, ask: what does fmap keep constant? This isn’t a rigorous understanding and isn’t going to explain every aspect about every Functor, and will probably only be useful if you already know a little bit about Functors in Haskell. But it’s a nice intuition trick that has yet to majorly mislead me.
Saved on: 2024-11-12

caiorss/Functional-Programming: Functional Programming concepts, examples and patterns illustrated in Haskell, Ocaml and Python

Functional Programming concepts, examples and patterns illustrated in Haskell, Ocaml and Python - caiorss/Functional-Programming
Tags: #haskell
Saved on: 2015-04-28
❤️
</>
2026