846ca90c277db48c2b971e4518bf7e6504c7c142
[ghc.git] / testsuite / tests / patsyn / should_run / ex-prov-run.hs
1 -- Pattern synonyms
2
3 {-# LANGUAGE PatternSynonyms, GADTs #-}
4 module Main where
5
6 data T a where
7 MkT :: (Eq b) => a -> b -> T a
8
9 pattern P x y <- MkT x y
10
11 f :: T Bool -> Bool
12 f (P x y) = x && y == y
13
14 data Crazy = Crazy
15
16 instance Eq Crazy where
17 _ == _ = False
18
19 main = do
20 print (f $ MkT True True)
21 print (f $ MkT True Crazy)