[Haskell-cafe] Can't explain this error

Dinh Tien Tuan Anh tuananhbirm at hotmail.com
Tue Jul 12 09:22:30 EDT 2005


oh damn, thank you


>From: Jon Fairbairn <Jon.Fairbairn at cl.cam.ac.uk>
>To: "Dinh Tien Tuan Anh" <tuananhbirm at hotmail.com>
>CC: robdockins at fastmail.fm, haskell-cafe at 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



More information about the Haskell-Cafe mailing list