summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci038.script
blob: c534cfc5b27c8f2b02e77054d3beb93841987d6c (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
-- Tests for ":show imports" and import/:module
:l shell.hs
:def shell (\s -> do shell s; return "")
:l

:show imports
import Prelude
:show imports
:shell echo "== map in scope due to explicit 'import Prelude'"
:t map
import Prelude ()
:show imports
:shell echo "== still in scope, 'import Prelude ()' is subsumed by 'import Prelude'"
:t map
:module -Prelude
:show imports
:shell echo "== still in scope, implicit import of Prelude"
:t map
import Prelude ()
:show imports
:shell echo "== not in scope now"
:t map

:module -Prelude
:show imports
:load ghci038.hs

:t x
:show imports
:shell echo ":m -Foo"
:m -Foo
:show imports
:t x
:shell echo ":m +*Foo"
:m +*Foo
:show imports
:t x

import Prelude
:show imports
import Data.List hiding (nub)
:show imports
import qualified Data.List as Q
:show imports
:m -Data.List
:show imports