withFileAsInput :: FilePathfile to open
-> (InputStream ByteString -> IO a)function to run
-> IO a
withFileAsInput name act opens the specified file in "read mode" and
passes the resulting InputStream to the computation act. The file will
be closed on exit from withFileAsInput, whether by normal termination or
by raising an exception.
If closing the file raises an exception, then that exception will be
raised by withFileAsInput rather than any exception raised by act.