summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/shadow-bindings.script
blob: 6918ad929828ad0855de0abfb30dd274bd2c859d (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
-- Exercising the behaviour of :show bindings and shadowing
let foo = True
foo && True
putStrLn "Expecting foo = True"
:show bindings

let foo = False
foo && True
putStrLn "Expecting foo = False"
:show bindings
:reload

data T = A | B
:show bindings
-- shadow T
data T = C
putStrLn "Expecting T and Ghci1.T"
:show bindings
:reload

data T = A | B
-- shadow just A and B
data T' = A | B'
putStrLn "Expecting T and T'"
:show bindings
:reload


data T = A | B
-- shadow all
data T = A | B | C
putStrLn "Expecting only T, no Ghci1.T"
:show bindings
:reload


-- Now with record selectors
data T = A {foo :: Bool}
putStrLn "Expecting T and foo with function type"
:show bindings
let foo = True
putStrLn "Expecting T and foo :: Bool"
:show bindings
data T = A
putStrLn "Expecting foo, T"
:show bindings