summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn/should_run/ex-prov-run.hs
blob: e10bd22d2ba27a8ab386531bc728d0ddc9a351c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Pattern synonyms

{-# LANGUAGE PatternSynonyms, GADTs #-}
module Main where

data T a where
        MkT :: (Eq b) => a -> b -> T a

pattern P x y <- MkT x y

f :: T Bool -> Bool
f (P x y) = x && y == y

data Crazy = Crazy

instance Eq Crazy where
    _ == _ = False

main = do
    print (f $ MkT True True)
    print (f $ MkT True Crazy)