> long = sum . map (const 1) How's this? /JongKeun
-----Original Message----- From: William Lee Irwin III [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 31, 2002 5:18 AM To: Artie Gold Cc: Cesar Augusto Acosta Minoli; [EMAIL PROTECTED] Subject: Re: Question About lists On Mon, Dec 30, 2002 at 01:47:37PM -0600, Artie Gold wrote: > One suggestion, though is that you're working too hard; there's really > no reason to define a locally defined function. The much simpler: > long [] = 0 > long (x:xs) = 1 + long xs > will do quite nicely. > HTH, > --ag There is already a length function in List and/or the Prelude. Bill _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
