[GHC] #14366: Type family equation refuses to unify wildcard type patterns

GHC ghc-devs at haskell.org
Sat Nov 4 20:54:06 UTC 2017


#14366: Type family equation refuses to unify wildcard type patterns
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |             Keywords:  TypeFamilies,
      Resolution:                    |  TypeInType
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 RyanGlScott):

 Here's a much simpler example that is rejected due to this limitation:

 {{{#!hs
 {-# LANGUAGE TypeFamilies #-}
 module Bug where

 type family F (a :: *) :: * where
   F (a :: _) = a
 }}}
 {{{
 $ /opt/ghc/8.2.1/bin/ghci Bug.hs
 GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/ryanglscott/.ghci
 [1 of 1] Compiling Bug              ( Bug.hs, interpreted )

 Bug.hs:5:5: error:
     • Expected a type, but ‘a’ has kind ‘_’
     • In the first argument of ‘F’, namely ‘(a :: _)’
       In the type family declaration for ‘F’
   |
 5 |   F (a :: _) = a
   |     ^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list