"Monads for functional programming" in Python