writeFile package:streaming-bytestring

Write a ByteStream to a file. Use runResourceT to ensure that the handle is closed.
>>> :set -XOverloadedStrings

>>> runResourceT $ Q.writeFile "hello.txt" "Hello world.\nGoodbye world.\n"

>>> :! cat "hello.txt"
Hello world.
Goodbye world.

>>> runResourceT $ Q.writeFile "hello2.txt" $ Q.readFile "hello.txt"

>>> :! cat hello2.txt
Hello world.
Goodbye world.