elynx-tools-0.7.0.1: Tools for ELynx
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Tools.InputOutput

Description

Creation date: Thu Feb 14 13:30:37 2019.

Tools involving input, output, and parsing.

Synopsis

Execution Mode

data ExecutionMode Source #

Overwrite existing output files or fail if output files exist.

Constructors

Overwrite 
Fail 

Instances

Instances details
Eq ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

Show ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

Generic ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

Associated Types

type Rep ExecutionMode :: Type -> Type #

ToJSON ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

FromJSON ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

type Rep ExecutionMode Source # 
Instance details

Defined in ELynx.Tools.InputOutput

type Rep ExecutionMode = D1 ('MetaData "ExecutionMode" "ELynx.Tools.InputOutput" "elynx-tools-0.7.0.1-Hoz215Pz5EYHmwnWsWSkLV" 'False) (C1 ('MetaCons "Overwrite" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Fail" 'PrefixI 'False) (U1 :: Type -> Type))

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.

parseStringWith :: Parser a -> String -> a Source #

Parse a String and extract the result.

parseByteStringWith :: Parser a -> ByteString -> a Source #

Parse a ByteString and extract the result.