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
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
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
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