[GHC] #14878: Can't witness transitivity ((.)) of isomorphism of Constraints

GHC ghc-devs at haskell.org
Mon Mar 5 19:54:19 UTC 2018


#14878: Can't witness transitivity ((.)) of isomorphism of Constraints
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.5
      Resolution:  invalid           |             Keywords:
                                     |  QuantifiedConstraints, wipT2893
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 Iceland_jack):

 This can additionally be witnessed by carrying the witness and composing
 it explicitly

 {{{#!hs
 type Cat ob = ob -> ob -> Type

 data ImpliesC :: Cat Constraint where
   ImpliesC :: (a => b) => ImpliesC a b

 data IsoC :: Cat Constraint where
   IsoC :: ImpliesC a b -> ImpliesC b a -> IsoC a b

 instance Category ImpliesC where
   id :: ImpliesC a a
   id = ImpliesC

   (.) :: ImpliesC b c -> ImpliesC a b -> ImpliesC a c
   ImpliesC . ImpliesC = ImpliesC

 instance Category IsoC where
   id :: IsoC a a
   id = IsoC id id

   (.) :: IsoC b c -> IsoC a b -> IsoC a c
   IsoC bc cb . IsoC ab ba = IsoC (bc . ab) (ba . cb)
 }}}

 `IsoC` can be parameterised by the category `IsoC :: Cat ob -> Cat ob`.

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


More information about the ghc-tickets mailing list