On Tue, 30 Mar 2004, Keith Wansbrough wrote:

> > My question was why he doesn't believe that. My definition
> >   data (Num a) => VList a = VList [a]
> >  clearly states that VLists will ever get types of class Num as
> > parameters. 
> 
> Ah.  Constraints on datatype declarations are a misfeature of Haskell, and 
> have no useful effect.  You shouldn't use them.

Ok.

Btw. ghc suggests:
VectorSpace.lhs:37:
    Could not deduce (Num a) from the context (VectorSpace VList)
      arising from the literal `0' at VectorSpace.lhs:37
    Probable fix:
        Add (Num a) to the class or instance method `zero'
                                    ^^^^^^^^^^^^^^^

I know how to add context information to the signature in a class
definition. But how can I add context information at the point of
instantation of a method?


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to