| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Common.Utils.Bytecode.File
Synopsis
- getFileContent :: String -> IO ByteString
- tryReadFile :: String -> IO (Either SomeException ByteString)
Documentation
getFileContent :: String -> IO ByteString Source #
Retrieves the file content or exits the program on error.
@args - path: Path to the file.
@details
Handles the IO exception immediately: prints the error and calls exitFailure.
This prevents executeFile from handling nested cases.
@return The file content as ByteString.
tryReadFile :: String -> IO (Either SomeException ByteString) Source #
Helper to attempt reading a file with explicit typing.
@details Moves the type casting out of the main logic.