[GHC] #9918: GHC chooses an instance between two overlapping, but cannot resolve a clause within the similar closed type family

GHC ghc-devs at haskell.org
Tue Dec 30 11:41:44 UTC 2014


#9918: GHC chooses an instance between two overlapping, but cannot resolve a
clause within the similar closed type family
-------------------------------------+-------------------------------------
        Reporter:  qnikst            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.3
      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 qnikst):

 Replying to [comment:10 simonpj]:

 Taking into account that this undecidability is used for purpose in number
 of libraries,
 (regions and hlists first comes into my mind, but there should be others)
 it worth to have
 a way to have this undecidability even in case if strenghtened "surely-
 apart" check will be used by default.
 And definitely this change will introduce some level of breakage in
 libraries.

 If "sulery-apart" check will be strengthened then `{-# UNDECIDABLE Foo
 #-}` solution looks very nice.
 And of cause per-type-family it looks much better (in the same sense as
 `XOverlappingInstances` that were deprecated in favor of `{-# OVERLAPPABLE
 #-}` pragma).
 And as far as I understand then in order to reach consistency it should be
 possible to use this pragma with closed type families and as a result
 first program will be accepted? In this case solution will be very good
 for me, as it will have a consistency by default and allow to switch from
 OverlappingInstances to closed type families in our case.

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


More information about the ghc-tickets mailing list