in reply to Here you go: an example of top-down FP
in thread TMTOWTDI... and most of them are wrong
I hope you will trust me that it was quick and easy. (It took much longer to write this explanation than the code.)
Of course, and thankyou. This would make a really good addition to the GHC docs.
Actually, I think it could easily replace The User's Guide in it's entirety for the first 2 months after new users get their hands on it.
(It took much longer to write this explanation than the code.)
And it will probably take me much longer still to understand it :)
One question. In your first pass you use 'interact', which later gets dropped in favour of your own 'control'. Where does 'interact come from? It does not appear to be a part of prelude?