extensible-0.4.6: 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 OptDescr' a Source #

OptDescr with a default

Constructors

OptDescr' a (OptDescr (a -> a)) 

Instances

Wrapper * OptDescr' Source # 

Associated Types

type Repr OptDescr' (h :: OptDescr' -> *) (v :: OptDescr') :: * Source #

Methods

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

type Repr * OptDescr' a Source # 

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

getOptRecord Source #

Arguments

:: RecordOf OptDescr' xs

a record of option descriptors

-> [String]

arguments

-> (Record xs, [String], [String], String -> String)

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

withGetOpt :: MonadIO m => RecordOf OptDescr' xs -> (Record 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.