Type wildcards, was: Re: [Haskell] GHC Error question

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Thu Dec 7 07:49:56 EST 2006


Lennart Augustsson wrote:

> Speaking of wishlist, I'd also like to see context synonyms, e.g.,
> context C a = (Ord a, Num a)
> 
> The current situation is quite bad, there's no way to abstract
> contexts. 

except by writing extra classes that encode the context,
see for example class NFAC:
http://141.57.11.163/cgi-bin/cvsweb/lib/Autolib/NFA/Data.hs.drift?rev=1.16

but this is of course only a hack, and it duplicates information
since you have to repeat the context in  the default instance.
At least this happens only in one place, so it is useful.
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------



More information about the Glasgow-haskell-users mailing list