[GHC] #11984: Pattern match incompleteness / inaccessibility discrepancy

GHC ghc-devs at haskell.org
Wed Sep 20 01:16:25 UTC 2017


#11984: Pattern match incompleteness / inaccessibility discrepancy
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14098            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 In case you're reading this ticket and looking for a workaround, you can
 add an extra `case` to make it compile without warnings:

 {{{#!hs
 {-# LANGUAGE PolyKinds, TypeOperators, DataKinds, TypeFamilies, GADTs #-}

 module Bug where

 data family Sing (a :: k)

 data Schema = Sch [Bool]

 data instance Sing (x :: Schema) where
   SSch :: Sing x -> Sing ('Sch x)

 data instance Sing (x :: [k]) where
   SNil :: Sing '[]
   SCons :: Sing a -> Sing b -> Sing (a ': b)

 data G a where
   GCons :: G ('Sch (a ': b))

 eval :: G s -> Sing s -> ()
 eval GCons s =
         case s of
           SSch y -> case y of
                       SCons _ _ -> undefined
 }}}

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


More information about the ghc-tickets mailing list