ogma-extra-1.15.0: Ogma: Helper tool to interoperate between Copilot and other languages.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.ByteString.Extra

Contents

- Safe I/O
  - Error messages

Description

Auxiliary functions for working with values of type `ByteString`.

Synopsis

- safeReadFile :: FilePath -> IO (Either String ByteString)
- strByteStringFileNotFound :: FilePath -> String
- strByteStringCannotOpenFile :: FilePath -> String

# Safe I/O

safeReadFile :: FilePath -> IO (Either String ByteString) Source #

Safely read a file into a lazy `ByteString`, returning a `Left` error message if the file cannot be opened.

## Error messages

strByteStringFileNotFound :: FilePath -> String Source #

File-not-found message.

strByteStringCannotOpenFile :: FilePath -> String Source #

Cannot-open-file message.