harg-0.2.0.0: Haskell program configuration using higher kinded data

Safe HaskellNone
LanguageHaskell2010

Options.Harg.Cmdline

Synopsis

Documentation

mkOptparseParser Source #

Arguments

:: (Applicative f, TraversableB a, ProductB a) 
=> [a (Compose Maybe f)]

Source results

-> a (Compose Opt f)

Target configuration options

-> Parser (a f) 

Create a Parser from a list of source results and an option parser. The source results are folded using <|> and then used as a single result.

mkParser Source #

Arguments

:: Compose Maybe f a

Accumulated source results

-> Compose Opt f a

Target option

-> Compose Parser f a 

Create a Parser for a single option, using the accumulated source results.

toOptionParser :: Compose Maybe f a -> Compose Opt f a -> Compose Parser f a Source #

Create a Parser for an OptionOpt, which results in an optparse-applicative option.

toFlagParser :: Compose Maybe f a -> Compose Opt f a -> f a -> Compose Parser f a Source #

Create a Parser for a FlagOpt, which results in an optparse-applicative flag.

toArgumentParser :: Compose Maybe f a -> Compose Opt f a -> Compose Parser f a Source #

Create a Parser for a ArgumentOpt, which results in an optparse-applicative argument.