[Haskell-cafe] Can't explain this error

Dinh Tien Tuan Anh tuananhbirm at hotmail.com
Tue Jul 12 08:39:49 EDT 2005


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)]]

and got this error:
**** Expression                   : map (y:) parts(x-y)
**** Term                           : map
**** Type                            : (e->f) -> [e] -> [f]
**** Does not match            : a -> b -> c -> d

why do i have this error ? How to fix it ?

Thanks a lot

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger 7.0 today! 
http://messenger.msn.co.uk



More information about the Haskell-Cafe mailing list