summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci046.script
blob: f07e06f330480e52300ab129f624215b9c0bda8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--Testing type families and their shadowing
:set -XTypeFamilies
data HTrue
data HFalse
type family AND a b
type instance AND HTrue  HTrue  = HTrue
type instance AND HTrue  HFalse = HFalse
type instance AND HFalse HTrue  = HFalse
type instance AND HFalse HFalse = HFalse
type family OR a b
type instance OR HTrue  HTrue  = HTrue
type instance OR HTrue  HFalse = HTrue
type instance OR HFalse HTrue  = HTrue
type instance OR HFalse HFalse = HFalse
:t undefined :: AND HTrue HTrue
:t undefined :: AND (OR HFalse HTrue) (OR HTrue HFalse)
let t = undefined :: AND HTrue HTrue
let f = undefined :: AND HTrue HFalse
type instance AND HTrue  HTrue  = HFalse
:t t
let t = undefined :: AND HTrue HTrue
:t t