Why is scanr strict in its third argument?

2017-11-09 Thread Geraint Jones
There are two things you might think of when you think of scanr; or rather, there are two things I think of: a specification scanr f e = map (foldr f e) . tails and an implementation scanr f e = foldr g [e] where g x yss@(ys:_) = f x ys : yss Of course these two differ, because

bus error in Integer calculations

2016-12-08 Thread Geraint Jones
I have this little demo which I use for sixth formers which includes calculating in fairly rapid order the sum of the digits of the 10^9th Fibonacci number. (I haven't got enough physical memory to do the same for the 10^10th number without thrashing...) It fell over on a flashy new macbook I

Re: strictness of interpreted haskell implementations

2009-05-04 Thread Geraint Jones
Sorry to revive a year-old thread, but... On Fri, 25 Apr 2008 at 20:17:53 +0100 Duncan Coutts wrote: On Fri, 2008-04-25 at 09:08 -0700, Don Stewart wrote: Geraint.Jones: Are there well-known differences in the implementations of Haskell in ghci and hugs? I've got some moderately

strictness of interpreted haskell implementations

2008-04-25 Thread Geraint Jones
Are there well-known differences in the implementations of Haskell in ghci and hugs? I've got some moderately intricate code (simulations of pipelined processors) that behave differently - apparently because ghci Haskell is stricter than hugs Haskell, and I cannot find any obviously relevant