2 ms·
Yep! It's as if Haskell had an I/O DSL that built a data structure - a tree with all interaction with the outside world - and the runtime interpreted this data
by nextaccountic 4y ago
Yep! It's as if Haskell had an I/O DSL that built a data structure - a tree with all interaction with the outside world - and the runtime interpreted this data structure. (of course the compiler is allowed to optimize that away). That way, Haskell can achieve purity - it does I/O by building an IO value technically using pure functions!
Haskell then decided to use this DSL for arbitrary types, again just to build data structures. Then, people noticed that monads were really cool.