Hi,
Can someone please explain how IO operations do not fit in the pure category of mathematical function in that they have to be implemented via Monads.
For e.g. the getLine function has the type IOString and it reads the input from the user. Now as I see it the output of getLine will always be same if the input remain same (i.e. for input "X" getLine will always return "X" ) which is the constraint on mathematical functions.
Therefore I don't see why monads are necessary for implementing IO in pure languages.
I can understand why Date and Random functions have be implemented via monads because their output will always change.
Thanks,