[Haskell] Re: Global Variables and IO initializers
MR K P SCHUPKE
k.schupke at imperial.ac.uk
Fri Nov 5 09:45:58 EST 2004
>The point is to avoid threading global state to IO actions manually.
>Programming langages exist in order to conveniently write programs in,
>not only to admire their beauty.
So if you are not interested in beauty, why not use the IO monad! If
something is IO then declare it. You should not lie to the type system,
or try to cheat it. It is your friend, and will help prevent errors
in code.
The point is to write correct error free programs, If you find the
requirements too constrictive you should use another language. We
don't need yet another Visual Basic/Java/C whatever.
I see no problem with threading global state to IO actions, that
is after all making clear in the function type what is happening!
If you hide this from the type system, it can only lead to problems
in the long run.
Keean.
More information about the Haskell
mailing list