[GHC] #15147: Type checker plugin receives Wanteds that are not completely unflattened

GHC ghc-devs at haskell.org
Mon Jun 4 20:24:50 UTC 2018


#15147: Type checker plugin receives Wanteds that are not completely unflattened
-------------------------------------+-------------------------------------
        Reporter:  nfrisby           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.4.1
  checker)                           |             Keywords:
      Resolution:                    |  TypeCheckerPlugins
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 adamgundry):

 Replying to [comment:10 nfrisby]:
 > My plugin is responsible for reducing some type families. Receiving
 flattened Wanteds appeals to me because all of the tyfam applications
 (except those under forall? hmmm) would be FunEq constraints, so I
 wouldn't have to seek them out in the types.
 >
 > So perhaps if there were a separate mechanism for the plugin to declare
 a custom "reducer" for a type family, that might eliminate my interest in
 flattened Wanteds.

 I've wanted such a thing as well
 ([wiki:Plugins/TypeChecker#Underdiscussion:Definingtypefamilies some
 discussion here]). It's not completely obvious what the right design is,
 though, because GHC's current type family reduction implementation is pure
 so it doesn't fit nicely with `TcPluginM`.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15147#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list