[Haskell-beginners] type of zipWithPlus
Sebastian Hungerecker
sepp2k at googlemail.com
Sat Oct 2 07:22:48 EDT 2010
On 01.10.2010 05:43, Russ Abbott wrote:
>> let (zipWithPlus :: Num a => [a] -> [a] -> [a]) = zipWith (+)
>>
> <interactive>:1:5:
> Illegal signature in pattern: (Num a) => [a] -> [a] -> [a]
> Use -XScopedTypeVariables to permit it
>
It works if you write it as:
let zipWithPlus :: Num a => [a] -> [a] -> [a]; zipWithPlus = zipWith (+)
I.e. writing it exactly as you would in a file (inside a do-block),
but with a semicolon where the linebreak would be.
More information about the Beginners
mailing list