On Mon, 10 Jul 2006, David Roundy wrote:
class Vec v where
(.+.) :: v - v - v
instance Vec [Double] where
xs .+. ys = zipWith (+) xs ys
instance Vec Double where
x .+. y = x + y
P.S. This is with ghc 6.4.1. And oddly enough, if you make the instance
instance Num a =
The problem isn't with lists specifically, but with any instance that
applies types (rather than type variables) to a type constructor
From section 4.3.2 of The Haskell 98 Report: The type (T u1 ... uk)
must take the form of a type constructor T applied to simple type
variables u1, ... uk.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Spencer Janssen
The problem isn't with lists specifically, but with any instance that
applies types (rather than type variables) to a type constructor
From section 4.3.2 of The Haskell 98 Report: The type (T u1 ... uk)
must
On 7/10/06, Bayley, Alistair [EMAIL PROTECTED] wrote:
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Spencer Janssen
The problem isn't with lists specifically, but with any instance that
applies types (rather than type variables) to a type constructor
From section 4.3.2
David Roundy wrote:
I'm sure I'm missing something lame here, but can someone tell me why
we apparently can't declare a list to be an instance of a class in
Haskell 98?
I think it is a feature of H98 intended to disallow any
possibility of overlapping instances. If you have...
On 10/07/06, Sebastian Sylvan [EMAIL PROTECTED] wrote:
Double is not a type variable.
I.e. [a] is okay, but [Double] isn't.
--
-David House, [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org