[GHC] #7543: Constraint synonym instances
GHC
ghc-devs at haskell.org
Mon Mar 16 15:36:53 UTC 2015
#7543: Constraint synonym instances
-------------------------------------+-------------------------------------
Reporter: monoidal | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by goldfire):
The other thing we could do is support this feature at synonym-definition
time. When defining a type synonym such that the head of the RHS is a
class, record this fact in the `TyCon` and corresponding iface info. If
such a synonym appears as the head of an instance declaration, we use this
tidbit to do the name lookup.
This would be easier to explain, at least, and wouldn't require much
upheaval either. Actually, this is probably simpler than my idea in
comment:7.
About looking up instances: we really need to move beyond `grep` for this
sort of thing! Of course, I exclusively use `grep` for this sort of
thing... because I don't have a better option to hand. But that's a story
for another day. In the meantime, worrying about obfuscation via synonyms
is valid, but also not something that (I believe) should hold this up.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7543#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list