Module

Options.Applicative.Builder.Internal

#Mod

data Mod :: (Type -> Type) -> Type -> Typedata Mod f a

An option modifier.

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

The type parameter @a@ is the pure 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 'Options.Applicative.Builder').

Contraints are often used to ensure that the modifiers can be sensibly applied. For example, positional arguments can't be specified by long or short names, so the 'HasName' constraint is used to ensure we have a flag or option.

Constructors

Instances

#HasName

class HasName :: forall k. (k -> Type) -> Constraintclass HasName f  where

Members

Instances

#HasCompleter

class HasCompleter :: forall k. (k -> Type) -> Constraintclass HasCompleter f  where

Members

Instances

#HasValue

class HasValue :: forall k. (k -> Type) -> Constraintclass HasValue f  where

Members

Instances

#HasMetavar

class HasMetavar :: forall k. (k -> Type) -> Constraintclass HasMetavar f  where

Members

Instances

#OptionFields

newtype OptionFields :: forall k. k -> Typenewtype OptionFields a

Constructors

Instances

#FlagFields

newtype FlagFields a

Constructors

Instances

#CommandFields

newtype CommandFields a

Constructors

Instances

#ArgumentFields

#DefaultProp

data DefaultProp a

Constructors

Instances

#optionMod

optionMod :: forall f a. (OptProperties -> OptProperties) -> Mod f a

#fieldMod

fieldMod :: forall f a. (f a -> f a) -> Mod f a

#baseProps

baseProps :: OptProperties

Base default properties.

#mkCommand

#mkParser

#mkOption

#internal

internal :: forall f a. Mod f a

Hide this option from the help text

Modules