coalpit-0.1.1.1: Command-line options and DSV parsing and printing

Maintainerdefanor <defanor@uberspace.net>
Stabilityunstable
Portabilitynon-portable (uses GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Coalpit.Core

Contents

Description

The Coalpit class with instances, a few functions to work with it, and Options are defined here.

Synopsis

Documentation

class Coalpit a where Source #

Coalpit class: parsing, printing, usage strings.

Minimal complete definition

Nothing

Methods

argParser :: Options -> Parser a Source #

argParser :: (Generic a, GCoalpit (Rep a)) => Options -> Parser a Source #

toArgs :: Options -> a -> [String] Source #

toArgs :: (Generic a, GCoalpit (Rep a)) => Options -> a -> [String] Source #

argHelper :: Options -> [String] -> Proxy a -> Usage Source #

argHelper :: GCoalpit (Rep a) => Options -> [String] -> Proxy a -> Usage Source #

Instances
Coalpit Bool Source # 
Instance details

Defined in Coalpit.Core

Coalpit Char Source # 
Instance details

Defined in Coalpit.Core

Coalpit Double Source # 
Instance details

Defined in Coalpit.Core

Coalpit Float Source # 
Instance details

Defined in Coalpit.Core

Coalpit Int Source # 
Instance details

Defined in Coalpit.Core

Coalpit Int8 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Int16 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Int32 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Int64 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Integer Source # 
Instance details

Defined in Coalpit.Core

Coalpit Natural Source # 
Instance details

Defined in Coalpit.Core

Coalpit Ordering Source # 
Instance details

Defined in Coalpit.Core

Coalpit Rational Source # 
Instance details

Defined in Coalpit.Core

Coalpit Word8 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Word16 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Word32 Source # 
Instance details

Defined in Coalpit.Core

Coalpit Word64 Source # 
Instance details

Defined in Coalpit.Core

Coalpit () Source # 
Instance details

Defined in Coalpit.Core

Coalpit Version Source # 
Instance details

Defined in Coalpit.Core

Coalpit ExitCode Source # 
Instance details

Defined in Coalpit.Core

Coalpit String Source # 
Instance details

Defined in Coalpit.Core

Coalpit Scientific Source # 
Instance details

Defined in Coalpit.Core

Coalpit URI Source #

An URI reference (absolute or relative).

Instance details

Defined in Coalpit.Core

Coalpit ZonedTime Source #

Uses dateTimeFormat.

Instance details

Defined in Coalpit.Core

Coalpit LocalTime Source #

Uses dateTimeFormat.

Instance details

Defined in Coalpit.Core

Coalpit TimeOfDay Source #

Uses timeFormat.

Instance details

Defined in Coalpit.Core

Coalpit UniversalTime Source #

Uses dateTimeFormat.

Instance details

Defined in Coalpit.Core

Coalpit UTCTime Source #

Uses dateTimeFormat.

Instance details

Defined in Coalpit.Core

Coalpit NominalDiffTime Source #

Converts to/from Scientific.

Instance details

Defined in Coalpit.Core

Coalpit DiffTime Source #

Converts to/from Scientific.

Instance details

Defined in Coalpit.Core

Coalpit Day Source #

Uses dateFormat.

Instance details

Defined in Coalpit.Core

Coalpit a => Coalpit [a] Source # 
Instance details

Defined in Coalpit.Core

Methods

argParser :: Options -> Parser [a] Source #

toArgs :: Options -> [a] -> [String] Source #

argHelper :: Options -> [String] -> Proxy [a] -> Usage Source #

Coalpit a => Coalpit (Maybe a) Source # 
Instance details

Defined in Coalpit.Core

Coalpit a => Coalpit (Complex a) Source # 
Instance details

Defined in Coalpit.Core

Coalpit a => Coalpit (NonEmpty a) Source # 
Instance details

Defined in Coalpit.Core

(Coalpit a, Coalpit b) => Coalpit (Either a b) Source # 
Instance details

Defined in Coalpit.Core

(Coalpit a, Coalpit b) => Coalpit (a, b) Source # 
Instance details

Defined in Coalpit.Core

Methods

argParser :: Options -> Parser (a, b) Source #

toArgs :: Options -> (a, b) -> [String] Source #

argHelper :: Options -> [String] -> Proxy (a, b) -> Usage Source #

(Coalpit a, Coalpit b, Coalpit c) => Coalpit (a, b, c) Source # 
Instance details

Defined in Coalpit.Core

Methods

argParser :: Options -> Parser (a, b, c) Source #

toArgs :: Options -> (a, b, c) -> [String] Source #

argHelper :: Options -> [String] -> Proxy (a, b, c) -> Usage Source #

(Coalpit a, Coalpit b, Coalpit c, Coalpit d) => Coalpit (a, b, c, d) Source # 
Instance details

Defined in Coalpit.Core

Methods

argParser :: Options -> Parser (a, b, c, d) Source #

toArgs :: Options -> (a, b, c, d) -> [String] Source #

argHelper :: Options -> [String] -> Proxy (a, b, c, d) -> Usage Source #

fromArgs :: Coalpit a => Options -> [String] -> Either String a Source #

Parses arguments.

Usage

data Usage Source #

Usage description: can be translated into help messages or documentation formats.

Constructors

UConstructor String

Data constructor.

URecursive String

Constructor of a recursive data structure (its second appearance in the tree).

USelector String Usage

Record selector.

UOptional Usage

Optional element.

USum Usage Usage

Sum.

UProduct Usage Usage

Product.

UUnit

Unit.

UType String

Type name, e.g. "INT".

Instances
Show Usage Source # 
Instance details

Defined in Coalpit.Core

Methods

showsPrec :: Int -> Usage -> ShowS #

show :: Usage -> String #

showList :: [Usage] -> ShowS #

usage :: Coalpit a => Options -> Proxy a -> Usage Source #

Composes Usage description.

usageString :: Coalpit a => Options -> Proxy a -> String Source #

Composes a usage string.

Options

data Options Source #

Printing and parsing options.

Constructors

Options 

Fields

defOpt :: Options Source #

Default options.