[GHC] #9902: Type family, pattern not matching

GHC ghc-devs at haskell.org
Thu Dec 18 17:25:49 UTC 2014


#9902: Type family, pattern not matching
-------------------------------------+-------------------------------------
              Reporter:  erisco      |            Owner:
                  Type:  bug         |           Status:  closed
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
  (Type checker)                     |         Keywords:
            Resolution:  invalid     |     Architecture:  x86_64 (amd64)
      Operating System:  MacOS X     |       Difficulty:  Unknown
       Type of failure:  GHC         |       Blocked By:
  rejects valid program              |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Your problem is that `(:.:)` is too polymorphic.  Try this:
 {{{
 data (:.:) (g :: kb -> *) (f :: ka -> kb) (x :: ka)
 }}}
 Then I think everything works.

 As you have it, `(:.:)` has kind
 {{{
 (:.:) :: forall k1 k1 k3. k1 -> k2 -> k3 -> *
 }}}
 When you use it on the RHS of the first equation of `(:+:)`, the kinds of
 the RHS are not fully determined, so you get `AnyK`.

 Try using `-fprint-explicit-kinds` to see all this.

 Do re-open if you think there's a bug.

 Simon

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


More information about the ghc-tickets mailing list