[GHC] #13733: Simplify constraints on RULES LHS
GHC
ghc-devs at haskell.org
Mon May 22 21:10:52 UTC 2017
#13733: Simplify constraints on RULES LHS
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by nomeata):
Another view is that the problem is that the user cannot even specify the
desired rule, namely one that matches
{{{
GHC.Classes.$fEq[]_$c== @ Integer GHC.Integer.Type.$fEqInteger
}}}
and maybe the problem should be attacked from this angle.
There is precedent in the way `coerce` works on the LHS of a rule: If it
appears on the LHS, the compiler assumes the user wants to match any Core-
level cast (`x |> c`), and thus inlines `coerce`, and even changes the
free variable of the rule so that it can match unlifted coercions (see
Note [Getting the map/coerce RULE to work]).
In that sense, solving constraints on the LHS is not really monkeying or a
plaster, but it is what what we have to do to allow the user to write
rules that match a specific instance method.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13733#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list