
Andrew Coppin writes:
I've seen comments in various places that monads allow you to "borrow things from the future".
That sounds completely absurd to me... can anybody explain?
Actually, "borrowing from the future" - in an interpretation which is close to my own interests - doesn't need monads, but *laziness*. If you find this absurd, I propose that you have a look on something a bit light, my paper on a quite crazy way to compute PI with a high precision. The algorithm (not mine, but of Bailey, Borwein and Plouffe) is a masterpiece of numerical math, but its implementation relies on a mad borrowing from the future. http://users.info.unicaen.fr/~karczma/arpap/lazypi.pdf If you don't choke, try another one, the reverse automatic differentiation algorithm, implemented using a variant of the Wadler's "counter-temporal" state monad. http://users.info.unicaen.fr/~karczma/arpap/revdf1.pdf It is quite serious, although inefficient, and has some affinities to the lazy processing of inherited attributes during parsing. More recently, Barak Pearlmutter and Jeff Siskind worked on similar issues, but I am not sure whether they submitted something ready for the audience. Please check it out. Jerzy Karczmarczuk