What programming task provided your breakthrough with monads?

haskell, monads

Solution

When I realized that I could use monad for both parsing and interpreting, I was able to write my first mini-interpreter for a LUA-like dynamic programming language in F# on the first try. First-class continuations!, environment, mutable state, debugging - All just a big monad transformer stack.

Problem

In a recent blog post about a probability monad he'd written, Mark Dominus wrote, "So I feel like I've finally arrived, monadwise." My first monadic program was an awkward solution to Problem 32 from Project Euler using parsec and the Maybe monad. What were you working on when the light finally turned on for you? Provide at least a sketch of the code you wrote. Knowing what you know now, how would you improve it and why?

Original source

Related problems