3 ms·
In Haskell, you have to opt-in to side-effects (monadic do-blocks). In OCaml, you have to opt-in to lazy evaluation.
by TuringTest 8y ago
In Haskell, you have to opt-in to side-effects (monadic do-blocks).
In OCaml, you have to opt-in to lazy evaluation.
- cannabis_sam 8y agoIn (GHC) haskell you also have opt-in strictness (per module or per variable)
- the_duke 8y agoDo blocks don't allow side effects, they are just syntactic sugar that makes composing monadic operations easier. Haskell does have escape hatches with unsafePerformIO and IORef/STRef
- TuringTest 8y agoYeah, but monadic composing is what make I/O and other side effects stylistic and understandable.