
12 Jul
2005
12 Jul
'05
9:08 a.m.
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