ML Has Monads: It's All About Modules
2025-06-24
The common perception that Haskell's use of monads is a unique language feature is challenged. The author argues that monads are a matter of library design, not language design, achievable in any modular language. The article uses ML to demonstrate how monads, including the Option and IO monads, can be implemented using its module system. While acknowledging ML's capacity for monads, the author suggests that their default omission stems from potential drawbacks like hindering code flexibility and transitioning between functional and monadic styles.
Development
Modules