glados-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Common.Utils.Bytecode.File

Synopsis

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.