[Haskell-beginners] type of zipWithPlus

Russ Abbott russ.abbott at gmail.com
Thu Sep 30 14:59:28 EDT 2010


When I define zipWithPlus at the top level of GHCi, the type is as shown.

> let zipWithPlus = zipWith (+)
zipWithPlus :: [Integer] -> [Integer] -> [Integer]

Why isn't it:  (Num a)  => a -> a-> a

  I was unable to find a way to get the type to be more general.  I tried
various declarations within the let using (Num a)  => a -> a-> a but none of
them were accepted.

Thanks.
-- Russ Abbott
______________________________________
  Professor, Computer Science
  California State University, Los Angeles

  Google voice: 424-242-USA0 (last character is zero)
  blog: http://russabbott.blogspot.com/
  vita:  http://sites.google.com/site/russabbott/
______________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100930/ff1392c1/attachment.html


More information about the Beginners mailing list