Running out of memory in a simple monad

Richard Uhtenwoldt ru@river.org
Sun, 01 Dec 2002 14:47:51 -0800


David Bergman writes:

>Should I imply that the IO monad is "pretty damned useless" in Hugs
>then, since the loop does not run in constant space there?

my statement was too broad.  allow me to amend it.

some are using Haskell for "systems programming", as a better C
than C.  some, including me, would like to see more of that,
with Haskell or another pure functional language with an IO monad
taking systems programmers away from the C and C++ communities.

Hugs is completely useless for *that*.


for an example of Haskell as a better C than C, see Chak's Gtk+
bindings.  to use them you must write your whole GUI in the IO monad
in a style where the basic data structures and control structures
closely resemble what you would write in C.

see
http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html
and note how most of the functions are in the IO monad.

many Haskellers have a negative opinion of such heavy use of the
IO monad, but in systems programming you need more control over
when (relative to other interactions) your program performs an
interaction with a file, network or UI resource than is available
in Haskell without the IO monad.

--
Richard Uhtenwoldt
"It's a mammal thing; you wouldn't understand."