Perfect! Problem solved and now I understand about "kinds" of types.
instance Rect (PRect a) a where ...
works if "Num a" is added to it, like:
instance Num a => Rect (PRect a) a where ...
(GHC has pretty informative error messages)
Thank you for great answers!
/johan
_
Am Donnerstag, 30. Juni 2005 14:07 schrieb Johan Holmquist:
> [...]
> Anyone:
>
> However, I haven't been able to make PRect an instance of this class (with
> extensions).
If I understand your problem correctly, you may use the new Rect class (the
one which is declared as class Num b => Rect a b
Johan Holmquist <[EMAIL PROTECTED]> writes:
> > class Num b => Rect a b | a -> b where
> > instance Rect IRect Int where
>
> However, I haven't been able to make PRect an instance of this class (with
> extensions). I might not have grasped this yet, but I came to think; if the
> old class decla
The School of Computer Science has one vacancy for an EPSRC funded
3-year PhD scholarship.
Applicants must have a first class or upper second degree (or the
equivalent from an overseas
institution), and must fulfill the EPSRC citizenship requirements
(roughly, they must be citizens
of the UK or
> This type declaration for 'm' probably doesn't mean what you think it
> does. I think what you want is "m takes an item of type 'a' and returns
> an item of a particular type in the Num class, but I'm not going to tell
> you which one", but what this declaration really means "m takes an item
> o