Re: [Haskell-cafe] Re: Problem with fundeps.

2005-01-03 Thread Keean Schupke
I would suggest defining types for unit and functions... data Scalar a = Scalar a data Function c v = Function c v instance VSpace a (Scalar a) ... -- replaces 'a' instance VSpace a (Function c a) ... -- replaces c -> a instance VSpace a v => a (Function c v) ... -- replaces c -> v Here Scalar is j

[Haskell-cafe] Re: Problem with fundeps.

2005-01-02 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > This is what I want. For a given set of vectors, the associated > scalars are unique, otherwise I would have problems with norm. > But I have problems anyway... > >> instance Vspace a a where This says, for any vector type "a", the ass

Re: [Haskell-cafe] Re: Problem with fundeps.

2005-01-02 Thread Marcin 'Qrczak' Kowalczyk
[EMAIL PROTECTED] writes: > This is what I want. For a given set of vectors, the associated > scalars are unique, otherwise I would have problems with norm. In the instance Vspace a a the compiler doesn't know that "a" is supposed to be a scalar only. It matches vector types (functions) too. And

[Haskell-cafe] Re: Problem with fundeps.

2005-01-02 Thread karczma
Ashley Yakeley writes: GHCi is correct to complain: class Vspace a v | v -> a OK, the first parameter ("a") depends on the second ("v"). This is what I want. For a given set of vectors, the associated scalars are unique, otherwise I would have problems with norm. But I have problems anyway...

[Haskell-cafe] Re: Problem with fundeps.

2005-01-02 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: GHCi is correct to complain: > class Vspace a v | v -> a OK, the first parameter ("a") depends on the second ("v"). > instance Vspace a a where And this determines it: the first parameter must always be the same as the second. > insta