
"blaat blaat"
wrote: However, given that observation, the fact that IO is a monad I find to be a _rather arbitrary design decision_; why not define a small term language which may be passed to the OS?
Derek Elkins
That would be confusing to use or restrictive (unless done exceedingly well perhaps), it would be awkward to define, and it would pretty much require arbitrary design decisions (what should be included in this language? what are it's semantics? etc).
In fact, between language versions 1.0 and 1.2, Haskell had exactly this small term language for I/O. The result of a program was a stream of explicitly constructed 'Request's to be passed to the environment, whilst the input to the program was a stream of 'Response's from the environment. As you say, the term language was somewhat arbitrary and restricted, so the language designers abandoned it in favour of the more extensible monadic model in Haskell 1.3 onwards. Regards, Malcolm