CR> let's see whether we can get from the initial version to the
CR> suggested final version without any magic, in a somewhat long
CR> sequence of minor rewrites/refactorings.

Great! Thanks a lot, Claus. It's always interesting and enjoyable to
see somebody explaining your own way of reasoning (well, not exactly,
but the idea is the same).

CR> next, we can make use of the fact that pattern match failure in
CR> do-notation invokes fail in the monad, by defining 'fail msg =
CR> mzero'

My bad, I forgot about "fail".

CR> whereas my only test was "does it still compile?",

So was mine.

CR> which gives no assurance that the code transformations were indeed
CR> refactorings.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to