extensible-0.4.7: Extensible, efficient, optics-friendly data types and effects

Copyright(c) Fumiaki Kinoshita 2017
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.GetOpt

Description

A wrapper for GetOpt

Synopsis

Documentation

data OptionDescr h a Source #

OptDescr with a default

Constructors

OptionDescr (s -> h a) !s (OptDescr (s -> s)) 

Instances

Wrapper k (OptionDescr k h) Source # 

Associated Types

type Repr (OptionDescr k h) (h :: OptionDescr k h -> *) (v :: OptionDescr k h) :: * Source #

Methods

_Wrapper :: (Functor f, Profunctor p) => Optic' * * p f (h v) (Repr (OptionDescr k h) h v) Source #

Functor h => Functor (OptionDescr * h) Source # 

Methods

fmap :: (a -> b) -> OptionDescr * h a -> OptionDescr * h b #

(<$) :: a -> OptionDescr * h b -> OptionDescr * h a #

type Repr k (OptionDescr k h) a Source # 
type Repr k (OptionDescr k h) a = OptionDescr k h a

optNoArg Source #

Arguments

:: [Char]

short option

-> [String]

long option

-> String

explanation

-> OptDescr' Int 

Option without an argument; the result is the total count of this option.

optReqArg Source #

Arguments

:: [Char]

short option

-> [String]

long option

-> String

placeholder

-> String

explanation

-> OptDescr' [String] 

Option with an argument

optionNoArg :: (Int -> h a) -> [Char] -> [String] -> String -> OptionDescr h a Source #

optionReqArg :: ([String] -> h a) -> [Char] -> [String] -> String -> String -> OptionDescr h a Source #

getOptRecord Source #

Arguments

:: RecordOf (OptionDescr h) xs

a record of option descriptors

-> [String]

arguments

-> (RecordOf h xs, [String], [String], String -> String)

(result, remaining non-options, errors, usageInfo)

withGetOpt :: MonadIO m => String -> RecordOf (OptionDescr h) xs -> (RecordOf h xs -> [String] -> m a) -> m a Source #

When there's an error, print it along with the usage info to stderr and terminate with exitFailure.