Thanks. I tried the first two, which worked.
Previously I had tried:
> 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
I tried setting -XScopedTypeVariables. When I ran it again I got a different error message:
Prelude> let (zipWithPlus :: Num a => [a] -> [a] -> [a]) = zipWith (+)
<interactive>:1:5:
Illegal polymorphic or qualified type:
forall a. (Num a) => [a] -> [a] -> [a]
Perhaps you intended to use -XRankNTypes or -XRank2Types
In a pattern type signature: (Num a) => [a] -> [a] -> [a]
In the pattern: zipWithPlus :: (Num a) => [a] -> [a] -> [a]
In a pattern binding:
(zipWithPlus :: (Num a) => [a] -> [a] -> [a]) = zipWith (+)
On Thu, Sep 30, 2010 at 12:48 PM, Daniel Fischer
<daniel.is.fischer@web.de> wrote:
let zipWithPlus xs ys = zipWith (+) xs ys