3 ms·
I found the way Clean deals with IO simpler to learn than Haskell's Monads. (But then, I learned Clean before I learned Haskell. They have a nice Jump-n-Run i
by eru 18y ago
I found the way Clean deals with IO simpler to learn than Haskell's Monads. (But then, I learned Clean before I learned Haskell. They have a nice Jump-n-Run in their example directory.)
Clean employs linear logic, that is you can only have one copy of the 'World' in your program. Look at the printing function as an example: It takes your old World and transforms it into a new World, that has something printed to the screen.
Of course such a view of the outside world is quite autistic. But it works as long as you manage to have only one World around in your program.
The IO Monad in Haskell could have been implemented with linear logic. (And in GHC it is, I think.)
More information at http://homepages.inf.ed.ac.uk/wadler/papers/monadsdeclare/monadsdeclare.ps http://homepages.inf.ed.ac.uk/wadler/papers/monadsdeclare/mo...
The original papers are surprisingly accessible. I prefer them to the tutorials.