summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci023.script
blob: a21fcb6ccc61acb356852f98e29ffa07b0e09982 (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
putStrLn "-- testing ghci multiline commands :{ .. :}"
putStrLn "-- via stdin"
:{
  let
  { f 0 = 1
  ; f 1 = w
    where { w = 2 }
  ; y = 3
  }
:}
print (f 0,f 1,y)

putStrLn "-- layout rule instead of explicit braces and semicolons works too"
:{
  let
   g 0 = 1
   g 1 = w
    where w = 2
   z = 3
:}
print (g 0,g 1,z)

:{
:browse
  Data.Maybe
:}
putStrLn "-- via readFile"
:cmd readFile "ghci023.ghci"