[Haskell-cafe] Lazy series [was : Preventing sharing]

Jerzy Karczmarczuk jerzy.karczmarczuk at unicaen.fr
Fri Jan 8 23:24:23 UTC 2016

Le 08/01/2016 21:33, Tom Ellis a écrit :
> On Fri, Jan 08, 2016 at 03:18:38PM -0500, Doug McIlroy wrote:
> 	exps = 1 + integral exps
> Can you explain why the first line won't work for lazy lists in a strict
> language?  It seems perfectly fine to me.
> Tom
If I understand well the issue, simply because at the RHS exps is not a 
thunk, it is evaluated, which breaks down the co-recursivity of the 
definition, even if the operators are delayed.

In a strict language you would have to use a kind of macros to make it work.

Good, old days...

I believe I wrote a paper on lazy power series already  in 1996 (but 
Douglas McI. hasn't read it).
(Theoretical Computer Science 187, pp. 203–219, (1997).)
I still have a copy:

and I tried hard to do some Computer Algebra with that, trying to 
implement by force  some lazy algorithms in a strict CA language MuPAD 
(similar to Maple, with strong OO structure). It was clumsy and almost 
nobody was convinced, when I presented this in Paderborn, the home of MuPAD.

Then MuPad quit the free software world, got attached to MathWorks, and 
I simply forgot this experiment. I tried to convince some students to 
continue it using Mathematica (Hold, HoldRest, etc. permit to construct 
delayed lists; in general, a rewriting system seems better adapted to 
such kind of implementation, than purely procedural languages), but the 
results were ugly, and my dear students asked me to give them some other 

Jerzy Karczmarczuk

More information about the Haskell-Cafe mailing list