optparse-applicative-0.18.0.0: Utilities and combinators for parsing command line options
Safe HaskellSafe-Inferred
LanguageHaskell98

Options.Applicative.Builder.Internal

Contents

Synopsis

Internals

data Mod f a Source #

An option modifier.

Option modifiers are values that represent a modification of the properties of an option.

The type parameter a is the return type of the option, while f is a record containing its properties (e.g. OptionFields for regular options, FlagFields for flags, etc...).

An option modifier consists of 3 elements:

  • A field modifier, of the form f a -> f a. These are essentially (compositions of) setters for some of the properties supported by f.
  • An optional default value and function to display it.
  • A property modifier, of the form OptProperties -> OptProperties. This is just like the field modifier, but for properties applicable to any option.

Modifiers are instances of Monoid, and can be composed as such.

One rarely needs to deal with modifiers directly, as most of the times it is sufficient to pass them to builders (such as strOption or flag) to create options (see Builder).

Constructors

Mod (f a -> f a) (DefaultProp a) (OptProperties -> OptProperties) 

Instances

Instances details
Monoid (Mod f a) Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

Methods

mempty :: Mod f a #

mappend :: Mod f a -> Mod f a -> Mod f a #

mconcat :: [Mod f a] -> Mod f a #

Semigroup (Mod f a) Source #

Since: 0.13.0.0

Instance details

Defined in Options.Applicative.Builder.Internal

Methods

(<>) :: Mod f a -> Mod f a -> Mod f a #

sconcat :: NonEmpty (Mod f a) -> Mod f a #

stimes :: Integral b => b -> Mod f a -> Mod f a #

class HasName f where Source #

Methods

name :: OptName -> f a -> f a Source #

Instances

Instances details
HasName FlagFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

HasName OptionFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

class HasValue f where Source #

Methods

hasValueDummy :: f a -> () Source #

Instances

Instances details
HasValue ArgumentFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

HasValue OptionFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

class HasMetavar f where Source #

Methods

hasMetavarDummy :: f a -> () Source #

data FlagFields a Source #

Constructors

FlagFields 

Fields

Instances

Instances details
HasName FlagFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

data CommandFields a Source #

Constructors

CommandFields 

Instances

Instances details
HasMetavar CommandFields Source # 
Instance details

Defined in Options.Applicative.Builder.Internal

data DefaultProp a Source #

Constructors

DefaultProp (Maybe a) (Maybe (a -> String)) 

fieldMod :: (f a -> f a) -> Mod f a Source #

baseProps :: OptProperties Source #

Base default properties.

internal :: Mod f a Source #

Hide this option completely from the help text

Use hidden if the option should remain visible in the full description.

noGlobal :: Mod f a Source #

Suppress this option from appearing in global options