[GHC] #15379: Don't reject user-written instances of KnownNat and friends in hsig files

GHC ghc-devs at haskell.org
Tue Jul 17 05:27:29 UTC 2018


#15379: Don't reject user-written instances of KnownNat and friends in hsig files
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  backpack
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 ppk):

 Just reporting the things that I learned here (thanks to discussions with
 @mpickering on IRC)

 1. With the minor change, the overlapping instance error is thrown only
 for inbuilt type
    classes like `KnownNat` and `KnownSymbol` but ''not for'' Show

 2. Overlapping instance is ''not a problem'' for `Typeable`, the other
 builtin type class that
    is affected by this change.

 This means that there is something in the witnessing of `KnownNat` and
 `KnownSymbol` that
 is making it see multiple instances. I have updated the test case with all
 these special classes
 so that we keep track of these differences.

 In addition @ezyang just mentioned that it is not clear whether the
 uniform code will work with both hsboot and hsig files. Since we are not
 confident about the hsboot part, I will only handle the hsig files in the
 patches to come.

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


More information about the ghc-tickets mailing list