summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/T10508.script
blob: 5ac770060beb587995a480379a821d22449d1ac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- :cmd accepts an expr of type 'IO String'
let cmd = return "0"
:cmd cmd

-- works with multiline mode, handles indention correctly
:{
:cmd return $ unlines
  [ "1"
  , "2"
  ]
:}

-- it should work even 'IO' or 'String' is not in scope
import Prelude ()
:cmd cmd

-- or even when a different 'String' is in scope
import Prelude
type String = ShowS
:def macro \_ -> return id
:macro