[Haskell-cafe] curious about sum

Henk-Jan van Tuyl hjgtuyl at chello.nl
Wed Jun 17 14:07:01 EDT 2009


On Wed, 17 Jun 2009 18:22:51 +0200, Henk-Jan van Tuyl <hjgtuyl at chello.nl>  
wrote:

> On Wed, 17 Jun 2009 13:32:40 +0200, Yitzchak Gale <gale at sefer.org> wrote:
>
>> Henk-Jan van Tuyl wrote:
>>> reverse
>>> maximum
>>> minimum
>>
>> Oh yes, please fix those also!
>
> maximum' = foldl' max 0 [1 .. 999999]
> minimum' = foldl' min 0 [1 .. 999999]
>

Of course I meant:
   maximum' xs = foldl1' max xs
   minimum' xs = foldl1' min xs

-- 
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--




More information about the Haskell-Cafe mailing list