MrD
MrD

Reputation: 5086

GHCI to external file

I have a Haskell function which returns quite a large output. (In fact, beyond the console's buffer size.) Is there any way GHCI output can be automatically saved to an external txt file rather than simply displayed?

Upvotes: 0

Views: 90

Answers (1)

vivian
vivian

Reputation: 1434

The result of the last command is bound to the variable it.

You can

writeFile "filename.txt" $ show it

or

writefile "filename.txt" $ show $ <statement>

Upvotes: 1

Related Questions