summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/should_compile/T14098.hs
blob: ecb01029eb17fae4c89448ec6b58a7ebc20c91fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# Language GADTs #-}
module T14098 where

data App f a where
  App :: f a -> App f (Maybe a)

data Ty a where
  TBool :: Ty Bool
  TInt  :: Ty Int

data T f a where
  C :: T Ty (Maybe Bool)

f1 :: T f a -> App f a -> ()
f1 C (App TBool) = ()

f2 :: T f a -> App f a -> ()
f2 C (App x)
  | TBool <- x
  = ()

g :: T f a -> App f a -> ()
g C (App x) = case x of
                TBool -> ()