[Haskell-cafe] Typeclasses and instances

Simon Peyton-Jones simonpj at microsoft.com
Fri Mar 18 08:01:23 EST 2005

Strange.  This is a bug in GHC that crept in when I implemented GADTs.
It turns out to be slightly structural; fixing it will change the
interface-file format.  So it won't get fixed in 6.4; but will in the
HEAD.    That doesn't bother me; the context on a data/newtype decl is a
strange thing anyway; only useful for generating extra errors...   but
yes, it's a bug thanks for pointing it out.


| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org
[mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Mark
| Carroll
| Sent: 17 March 2005 19:58
| To: haskell-cafe at haskell.org
| Subject: Re: [Haskell-cafe] Typeclasses and instances
| Another note, with more help from friends:
| It turns out that GHC 6.4 will let me do,
| 	newtype Floating a => Test a = Test [a] deriving Show
| 	x = Test [False, True]
| but, if I change "newtype" to "data", it then says,
| 	No instance for (Floating Bool)
| I'm not sure I quite understand what's going on.
| -- Mark
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list