Module

Options.Applicative.Builder.Internal

Package
purescript-optparse
Repository
f-o-a-m/purescript-optparse

#Mod Source

data 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 Source

class HasName f  where

Members

Instances

#HasCompleter Source

class HasCompleter f  where

Members

Instances

#HasValue Source

class HasValue f  where

Members

Instances

#FlagFields Source

newtype FlagFields a

Constructors

Instances

#CommandFields Source

newtype CommandFields a

Constructors

Instances

#DefaultProp Source

data DefaultProp a

Constructors

Instances

#optionMod Source

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

#fieldMod Source

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

#baseProps Source

baseProps :: OptProperties

Base default properties.

#mkParser Source

#mkOption Source

#internal Source

internal :: forall a f. Mod f a

Hide this option from the help text