3 ms·
> Haskell introduces monads not so that you can have them but so that you can not have them! Another way of looking at this which is perhaps not so brain-twist
by nybble41 5y ago
> Haskell introduces monads not so that you can have them but so that you can not have them!
Another way of looking at this which is perhaps not so brain-twisting is that in most languages you start out with the ability to perform arbitrary side effects at any point in the program, which gives the programmer a lot of power but makes the program hard to reason about. In Haskell the "default state" is pure functions, which are great for reasoning about your program but much less powerful (no side effects). To this we can selectively add Functor, Applicable, and Monad instances to recover the ability to express side effects to varying degrees while still keeping most of the program pure. The fact that you have a choice about how much monadic code to introduce into your program is why monads are such a big topic in Haskell.