[GHC] #12731: Generic type class has type family; leads to big dep_finsts

GHC ghc-devs at haskell.org
Tue Oct 18 13:20:17 UTC 2016


#12731: Generic type class has type family; leads to big dep_finsts
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      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 goldfire):

 What a great blog post to link to. (Although it did remind me of reading
 Neal Stephenson's novel ''Anathem'', which takes place in an alternate
 universe where just about all technical concepts have been renamed.) I
 will summarize it: The author proposes and does an in-depth comparison of
 several approaches that can be used to avoid incoherence of either type
 families or classes (it's the same problem) by doing local checks instead
 of a check at module-import-graph join points. All of these rules prohibit
 orphan instances of any kind, but are otherwise much subtler than I would
 have guessed.

 While we could explore this possibility (does anyone use orphan type
 family instances?), I see a simpler approach: treat `Generic` like we do
 `Typeable`, by requiring that GHC provide the instances. Does anyone hand-
 write `Generic` instances? If we know that GHC has written the instances,
 then we can be sure of coherence.

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


More information about the ghc-tickets mailing list