blob: 29811d5ad7113368d07b4d3a23c52860750fcf92 (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
-- Test the printing of an `IfacePatSyn`
-- We test all valid combinations of:
-- universal type variables yes/no
-- "required" context yes/no
-- existential type variables yes/no
-- "provided" context yes/no
-- -fprint-explicit-foralls yes/no
:set -XPatternSynonyms
:set -XGADTs
data Ex where MkEx :: a -> Ex
data ExProv where MkExProv :: (Show a) => a -> ExProv
data UnivProv a where MkUnivProv :: (Show a) => a -> UnivProv a
pattern P <- True
pattern Pe x <- MkEx x
pattern Pu x <- x
pattern Pue x y <- (x, MkEx y)
pattern Pur x <- [x, 1]
pattern Purp x y <- ([x, 1], MkUnivProv y)
pattern Pure x y <- ([x, 1], MkEx y)
pattern Purep x y <- ([x, 1], MkExProv y)
pattern Pep x <- MkExProv x
pattern Pup x <- MkUnivProv x
pattern Puep x y <- (MkExProv x, y)
putStrLn "without -fprint-explicit-foralls"
putStrLn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
:info P
:info Pe
:info Pu
:info Pue
:info Pur
:info Purp
:info Pure
:info Purep
:info Pep
:info Pup
:info Puep
putStrLn "\nwith -fprint-explicit-foralls"
putStrLn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
:set -fprint-explicit-foralls
:info P
:info Pe
:info Pu
:info Pue
:info Pur
:info Purp
:info Pure
:info Purep
:info Pep
:info Pup
:info Puep
|