
4 May
2003
4 May
'03
11:19 p.m.
Liyang HU wrote:
Given that you've already taken care of the empty case, (and assuming you think the maximum of an empty list is indeed zero) can't you just use foldr1 instead of foldr? (foldr1 f l is equivalent to foldr f (head l) (tail l))
Thanks. Didn't know about foldr1 but should've thought of the definition.
Have fun in your adventures with Haskell, :) /Liyang
Yeah...I thought I'd try it again after doing a basic course on it a few years ago and liking the language. Now I want to do something practical with it. -- sashan http://sashan.netfirms.com -------------------------------------------------- Brain: Here we are, Pinky--at the dawn of time! Pinky: Narf, Brain. Wake me at the noon of time.