
Andrew Coppin writes:
Dan Weston wrote:
[...] and facilitates "borrow-from-the-future" techniques where useful with infinite data structures or recursive algorithms.
And this, gentlemen, is just one of the reasons why Haskell gets labelled as "scary".
It's very hard to explain what this enigmatic riddle-like statement actually *means* without a very long exposition. (Heck, *I* haven't worked out how to "borrow from the future" yet...)
Scary - schmary... If you want to be afraid of, say, Santa Claus, that's OK, you are a free man. But, perhaps before saying that you haven't worked out something, *try* to work it out. Read something about Richard Bird's circular programs. A nice Web article (Lloyd Allison) is here: http://www.csse.monash.edu.au/~lloyd/tildeFP/1989SPE/ A really complicated application by Janis Voigtländer http://wwwtcs.inf.tu-dresden.de/~voigt/HOSC.pdf will probably kill you, so don't. But The Web is full of articles. You can even read one or two of my own productions. I - sorry for shameless auto-ad - cited this paper *twice*, once it was after *your* similar statement... http://users.info.unicaen.fr/~karczma/arpap/lazypi.pdf It is called "The Most Unreliable Technique in the World to Compute PI", and it has been written explicitly for fun and instruction. That's a possible answer to your dilemma. Another one shows something even worse than borrowing from the future, namely "going backwards in time", applied to the Automatic Differentiation in Reverse Mode. http://users.info.unicaen.fr/~karczma/arpap/revpearl.pdf And, please, avoid saying that something is scary or difficult, unless you are really sure. Jerzy Karczmarczuk