4 ms·
Type classes and monadic IO (and having a type system being able to express monads as a thing).
by kryptiskt 6y ago
Type classes and monadic IO (and having a type system being able to express monads as a thing).
- AnimalMuppet 6y agoDidn't stuff in the 80s have the ability to express monads, but nobody had yet realized that they were useful?
- kryptiskt 6y agoYou can express particular monads, but to have a Monad class/trait for all monads you need first class type constructors (also known as higher-kinded types), and that is not common even today.
- momentoftop 6y agoSML has always let you abstract over type-constructors using modules, and it was always routine to do so. You can express monads abstractly in this way, and some people have (Ocaml, but the SML is the same modulo syntax): http://batteries.forge.ocamlcore.org/doc.preview:batteries-beta1/html/api/Monad.S.html http://batteries.forge.ocamlcore.org/doc.preview:batteries-b... But the sort of code you would write in Haskell gets very noisy without typeclasses, and it's just not an obviously good way to program in a language that's intended to be impure and strict.