
oh damn, thank you
From: Jon Fairbairn
To: "Dinh Tien Tuan Anh" CC: robdockins@fastmail.fm, haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Can't explain this error Date: Tue, 12 Jul 2005 14:08:00 +0100 On 2005-07-12 at 12:39-0000 "Dinh Tien Tuan Anh" wrote:
i have just encountered another type error. This program tries to print out partitions of a positive integer (i
guess)
parts 0 = [[]] parts x = [concat (map (y:) parts(x-y) | y<-[1..(x `div` 2)]]
^
suspicious spacing! That's the same as
parts x = [concat (map (y:) parts (x-y) | y<-[1..(x `div` 2)]]
ie you are giving map three arguments when it expects two, which is what the type error says.
-- Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
_________________________________________________________________ Winks & nudges are here - download MSN Messenger 7.0 today! http://messenger.msn.co.uk