| ▲ | whateveracct 2 days ago | ||||||||||||||||||||||||||||||||||||||||
Actually, the IO monad in haskell desugars to RealWorld -> (a, RealWorld) Where RealWorld is a "token" that is just meant to be threaded through. You cannot create one yourself, so you have to be given one. Thus, that function argument colors IO. Every PL feature is just an extension to System F. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | jerf 2 days ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||
As I said to another comment, this isn't a place for architecture astronautics or squinting until one thing looks like another. It's all assembler under the hood in the end and that language not only doesn't have color, it doesn't have types in any practical sense of the term. At the level of Haskell itself, IO is a color and IO is not a function argument. The compiled code is all assembler. The Haskell may itself be an interpreter for a language that has no color. Above it there is no color, below it it may be implementing something without colors, but at the level of Haskell itself, IO is a color. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||