hgiesel
hgiesel

Reputation: 5648

Defining multiline functions in .ghci file

Can you define a multi-line function in the .ghci file?

I've tried

 what :: Show a => a -> a
 what = Db.traceShowId

But this didn't work. Is there some way to do this?

Upvotes: 4

Views: 224

Answers (1)

chi
chi

Reputation: 116139

The .ghci file is not the proper place for such definitions.

Still, if you really must, you can use

:{
line1
line2
...
:}

otherwise, you can try to put the whole definition in one line

line1 ; line2 ; ...

Upvotes: 3

Related Questions