summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/T10508.script
blob: 968c4c4d27829d083a48d088db17f6de5feabe06 (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" :: IO String
: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