elynx-tools-0.0.1: Tools for ELynx.

Copyright(c) Dominik Schrempf 2019
LicenseGPL-3
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Tools.InputOutput

Contents

Description

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

Tools involving input, output, and parsing.

Synopsis

Input, output.

readGZFile :: FilePath -> IO ByteString Source #

Read file. If file path ends with ".gz", assume gzipped file and decompress before read.

writeGZFile :: FilePath -> ByteString -> IO () Source #

Write file. If file path ends with ".gz", assume gzipped file and compress before write.

io :: (MonadLogger m, MonadIO m) => String -> ByteString -> Maybe FilePath -> m () Source #

Write a result with a given name to file or standard output.

Parsing.

runParserOnFile :: Parsec e ByteString a -> FilePath -> IO (Either (ParseErrorBundle ByteString e) a) Source #

Parse a possibly gzipped file.

parseFileWith Source #

Arguments

:: ShowErrorComponent e 
=> Parsec e ByteString a

The parser.

-> FilePath 
-> IO a 

Parse a possibly gzipped file and extract the result.

parseIOWith Source #

Arguments

:: ShowErrorComponent e 
=> Parsec e ByteString a

The parser.

-> IO a 

Parse standard input.

parseFileOrIOWith Source #

Arguments

:: ShowErrorComponent e 
=> Parsec e ByteString a

The parser.

-> Maybe FilePath

If no file path is given, standard input is used.

-> IO a 

Parse a possibly gzipped file, or standard input, and extract the result.

parseStringWith Source #

Arguments

:: ShowErrorComponent e 
=> String

Name of string.

-> Parsec e ByteString a

Parser.

-> String

Input.

-> a 

Parse a String and extract the result.

parseByteStringWith Source #

Arguments

:: ShowErrorComponent e 
=> String

Name of byte string.

-> Parsec e ByteString a

Parser.

-> ByteString

Input.

-> a 

Parse a ByteString and extract the result.