Eli Bendersky's
Follow
Monads in Lean
This post demonstrates how to use monads in the Lean programming language
(Lean 4, to be specific). If you're not familiar with Lean, this part of the
language is very similar to other functional programming languages, like
Haskell or OCaml.Motivating example - evaluating expressionsSuppose we want to write a …