| ▲ | deterministic an hour ago | |
I used to be a big Haskell fan and had a lot of fun writing and using monads. And I agree that once you get them, the basic idea is quite simple. I’ve even used monads to prove a small compiler correct in Lean. But in practice, I think monads are a poor tool for large-scale software development. I spent a long time trying to build a large game in Haskell and eventually gave up out of frustration with the complexity they introduced. Monads make sense as a way to manage effects in pure languages like Haskell/Lean/Idris/Agda. But outside that context, I don’t think the additional abstraction is worth the cost. Understanding how monads work is one thing. Understanding why they’re needed in the first place, and when they’re not, is another. | ||
| ▲ | djtango 42 minutes ago | parent [-] | |
OCaml isn't pure and neither is F# iirc do you see a bit less monad heavy code in large codebases there? What sort of situations would you want to give up a little purity or error handling at the type level? Maybe at a boundary where you can just write a very ugly imperative but quarantined section to give it a simpler type? | ||