
Hi Curt,
Thanks for the tips. Looks like return () would be a good candidate for that null statement I was seeking earlier.
Michael
--- On Sun, 10/25/09, Curt Sampson
Those nested IF/THEN/ELSEs are real killers. I kind of use them to sort out my thoughts, then end up with a nested mess. The restructuring to WHENs went smoothly and looks a lot cleaner besides.
Indeed. Monadic control flow is one of the basic keys to being able
to write nice code in Haskell; it's the moral equivalant of using
polymorphism rather than than "case" or "switch" in OO languages. (Well,
some would disagree, but that gets into the whole OO vs. functional
debate.)
You'll probably want to spend some time with one of the zillion monad
tutorials at some point (I like "All About Monads") to learn more about
these things.
BTW, look up the source code for "when". :-)
http://haskell.org/ghc/docs/latest/html/libraries/base/src/Control-Monad.htm...
cjs
--
Curt Sampson