Homepage
Sign in / Sign up
Homepage
Twelve Monads of Christmas
A festive Haskell ramble.
Start at Day 1: IO, Our Ugly Friend
Overview
Follow
Twelve Monads of Christmas
An overview
Ben Clifford
Dec 21, 2016
Day 12: Cont — Spaghetti
A continuation is “the rest of the program” represented as a value that you can do value things to: stick it in a variable, store it in a…
Ben Clifford
Dec 21, 2016
Day 11: Key — Typesafe Dynamic Typing
I saw mention of this at Haskell eXchange 2016. I haven’t done anything with it, but it intrigued me so I decided to include a post in this…
Ben Clifford
Dec 19, 2016
Day 10: Eff — Extensible Effects
Free monads let you take a data type that represents instructions, or (approximately the same) effects that you want to happen, and then…
Ben Clifford
Dec 16, 2016
Day 9: Freer — Free Monads
On day 5, I wrote about how to make a set monad — first build a sequence of instructions that describe how to build a Set, and then…
Ben Clifford
Dec 16, 2016
Day 8: LogicT — A List Transformer
The list monad lets you perform non-deterministic searches for a solution to a problem. At each step of your program, you can provide a…
Ben Clifford
Dec 14, 2016
Day 7: Haxl — The Reader Monad, When Reads Are Expensive
In the Reader monad, all you can do is query the environment by asking for the whole environment. If you only want a little bit of that…
Ben Clifford
Dec 13, 2016
Day 6: Conduit — Streamy Co-routines for Piping Together Computations
Lazy evaluation lets us compose two different computations without thinking too much about who is “in control”: we can generate primes…
Ben Clifford
Dec 13, 2016
Day 5: Set — These Are Harder Than You’d First Expect
Sets are a bit like lists, and so you can probably imagine that there should be a Monad instance for them. The first part of this post will…
Ben Clifford
Dec 11, 2016
Day 4: Reader, Writer, State — Wiring Together Functions
Reader, Writer and State usually come presented together, because they’re very similar: these monads wire together functions by adding in…
Ben Clifford
Dec 11, 2016
Day 3: Maybe — Mini-Lists, or Mini-Exceptions
Day 3: Maybe — Mini-Lists, or Mini-Exceptions
Maybe is like [] but “smaller” — Maybe t can store zero or one elements of type t, but not more.
Ben Clifford
Dec 9, 2016
Day 2: [] — Seeing the rest of a program run
Here’s a list comprehension:
Ben Clifford
Dec 8, 2016
Day 1: IO — Our Ugly Friend
Here’s a program:
Ben Clifford
Dec 7, 2016
About Twelve Monads of Christmas
Latest Stories
Archive
About Medium
Terms
Privacy