Re: A question concerning functional dependencies

2002-09-02 Thread Ashley Yakeley
At 2002-09-02 07:47, Dylan Thurston wrote: >GHC (and Hugs) check for potential conflicts like this unless you >explicitly allow overlapping instances. AFAIK, even with overlapping instances allowed, GHC will still complain if there's a fundep. See

Re: A question concerning functional dependencies

2002-09-02 Thread Dylan Thurston
On Mon, Sep 02, 2002 at 03:11:58AM -0700, Ashley Yakeley wrote: > At 2002-09-02 02:46, Jerzy Karczmarczuk wrote: > > >class Module v s | v->s . > ... > >instance Num s => Module (v->s) s > ... > >instance ...=> Module ((v->s)->(v->s)) s > ... > >But GHCi yells that two instances in view of the

Re: A question concerning functional dependencies

2002-09-02 Thread Ashley Yakeley
At 2002-09-02 02:46, Jerzy Karczmarczuk wrote: >class Module v s | v->s . ... >instance Num s => Module (v->s) s ... >instance ...=> Module ((v->s)->(v->s)) s ... >But GHCi yells that two instances in view of the functional >dependency declared are in conflict. GHCi is correct. Bear in mind G

A question concerning functional dependencies

2002-09-02 Thread Jerzy Karczmarczuk
I wanted to write a small package implementing vector spaces, etc. A part of it is class Module v s where (*>) :: s->v->v defining the multiplication of a vector by a scalar: w = a*>v Now, as in many other circumstances, concrete vectors are based on concrete scalars, and I defined really: