[GHC] #11642: Typechecker doesn't use evidence available from pattern synonym?

GHC ghc-devs at haskell.org
Thu Feb 25 21:11:18 UTC 2016


#11642: Typechecker doesn't use evidence available from pattern synonym?
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  7.10.3
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 The problem isn't actually the pattern synonym at all. Even the
 straightforward nested-case approach fails in the same way,
 {{{#!hs
 buildApp :: TypeRepX -> TypeRepX -> TypeRepX
 buildApp (TypeRepX f) (TypeRepX x) =
   case typeRepKind f of
     TypeApp (TypeApp ty arg) res ->
       case eqTypeRep trArrow ty of
         Just HRefl ->
           case eqTypeRep arg x of
             Just HRefl ->
               TypeRepX $ TypeApp f x
 }}}

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


More information about the ghc-tickets mailing list