Dear ghc,
it was said long before (Simon P. Jones had agreed) that the prelude
functions
foldl, minimum, maximum, sum, product
need more careful implementation - on the subject of un-needed
laziness.
Still, ghc-4.02 computes minimum [1..61000] to Stack overflow.
Please, could you change this to
minimum [] = error...
minimum [x] = x
minimum (x:y:xs) = if x < y then minimum (x:xs)
else minimum (y:xs)
Similarly - with minimumBy, maximum(By), sum, product.
For, now, in my program, i am forced to re-define these functions and
hide the ghc ones. This looks like annoying complications of simplest
things.
It was also said, that it worths to change the foldl implementation
to
foldl k z xs = f z xs where f z [] = z
f z (x:xs) = f (k z x) xs
What do you think of all this?
------------------
Sergey Mechveliani
[EMAIL PROTECTED]