Copyright | (c) Dominik Schrempf 2021 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Feb 14 13:30:37 2019.
Tools involving input, output, and parsing.
Synopsis
- data ExecutionMode
- openFileWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle
- readGZFile :: FilePath -> IO ByteString
- writeGZFile :: ExecutionMode -> FilePath -> ByteString -> IO ()
- runParserOnFile :: Parser a -> FilePath -> IO (Either String a)
- parseFileWith :: Parser a -> FilePath -> IO a
- parseIOWith :: Parser a -> IO a
- parseFileOrIOWith :: Parser a -> Maybe FilePath -> IO a
- parseStringWith :: Parser a -> String -> a
- parseByteStringWith :: Parser a -> ByteString -> a
Execution Mode
data ExecutionMode Source #
Overwrite existing output files or fail if output files exist.
Instances
Eq ExecutionMode Source # | |
Defined in ELynx.Tools.InputOutput (==) :: ExecutionMode -> ExecutionMode -> Bool # (/=) :: ExecutionMode -> ExecutionMode -> Bool # | |
Show ExecutionMode Source # | |
Defined in ELynx.Tools.InputOutput showsPrec :: Int -> ExecutionMode -> ShowS # show :: ExecutionMode -> String # showList :: [ExecutionMode] -> ShowS # | |
Generic ExecutionMode Source # | |
Defined in ELynx.Tools.InputOutput type Rep ExecutionMode :: Type -> Type # from :: ExecutionMode -> Rep ExecutionMode x # to :: Rep ExecutionMode x -> ExecutionMode # | |
ToJSON ExecutionMode Source # | |
Defined in ELynx.Tools.InputOutput toJSON :: ExecutionMode -> Value # toEncoding :: ExecutionMode -> Encoding # toJSONList :: [ExecutionMode] -> Value # toEncodingList :: [ExecutionMode] -> Encoding # | |
FromJSON ExecutionMode Source # | |
Defined in ELynx.Tools.InputOutput parseJSON :: Value -> Parser ExecutionMode # parseJSONList :: Value -> Parser [ExecutionMode] # | |
type Rep ExecutionMode Source # | |
openFileWithExecutionMode :: ExecutionMode -> FilePath -> IO Handle Source #
Open existing files only if ExecutionMode
is Overwrite
.
Input, output
readGZFile :: FilePath -> IO ByteString Source #
Read file. If file path ends with ".gz", assume gzipped file and decompress before read.
writeGZFile :: ExecutionMode -> FilePath -> ByteString -> IO () Source #
Write file. If file path ends with ".gz", assume gzipped file and compress before write.
Parsing
runParserOnFile :: Parser a -> FilePath -> IO (Either String a) Source #
Parse a possibly gzipped file.
parseFileWith :: Parser a -> FilePath -> IO a Source #
Parse a possibly gzipped file and extract the result.
parseIOWith :: Parser a -> IO a Source #
Parse standard input.
parseFileOrIOWith :: Parser a -> Maybe FilePath -> IO a Source #
Parse a possibly gzipped file, or standard input, and extract the result.
parseByteStringWith :: Parser a -> ByteString -> a Source #
Parse a ByteString
and extract the result.