---------- Forwarded message ---------- From: Jeff Heard <jefferson.r.he...@gmail.com> Date: Thu, Jan 8, 2009 at 12:26 PM Subject: Re: [Haskell-cafe] Defining methods generically for a class To: Cristiano Paris <fr...@theshire.org>
Not really... I'm not testing if each of the items a are equal, but rather that in the context of them being a Region, they are equal.As long "dim" (which is in the class) can be defined, then equality is defined over all types Region. On Thu, Jan 8, 2009 at 12:16 PM, Cristiano Paris <fr...@theshire.org> wrote: > On Thu, Jan 8, 2009 at 6:04 PM, Jeff Heard <jefferson.r.he...@gmail.com> > wrote: >> ... >> How do I declare all Regions to be Eqs without putting it in the class >> body (since I define a function over all Regions that is independent >> of datatype that is an instance of Region)? > > Would this be a solution? > > class Eq a => Region a where > ... > > Cristiano > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe