[Haskell-cafe] Re: Definition of hidden instance members (bug
in GHC or Hugs+Yhc)
Simon Peyton-Jones
simonpj at microsoft.com
Mon Jul 7 06:43:00 EDT 2008
I think GHC is right here. See
http://haskell.org/onlinereport/decls.html#instance-decls
esp the bit starting "It is illegal to give a binding..."
Simon
| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Neil
| Mitchell
| Sent: 06 July 2008 00:03
| To: Haskell Cafe
| Subject: [Haskell-cafe] Re: Definition of hidden instance members (bug in GHC or Hugs+Yhc)
|
| > This is either a GHC bug, or a Yhc+Hugs bug - I'm not sure which, but
| > the compilers disagree:
| >
| > import Prelude hiding ((==))
| > data Foo = Foo
| > instance Eq Foo where
| > (==) a b = True
|
| I was thinking that GHC's behaviour seems more sensible, but the
| following fails:
|
| import qualified Module as M
|
| instance MClass Foo where
| M.foo = undefined
|
| M. is not allowed as a prefix of a function, which makes resolving
| ambiguities hard unless the compiler solves the issue for you (as Hugs
| and Yhc do)
|
| Thanks
|
| Neil
| _______________________________________________
| 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