Module

Options.Applicative.Builder.Internal

Package
purescript-optparse
Repository
purescript-contrib/purescript-optparse

#Mod Source

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 Source

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

Members

Instances

#HasCompleter Source

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

Members

Instances

#HasValue Source

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

Members

Instances

#HasMetavar Source

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

Members

Instances

#OptionFields Source

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

Constructors

Instances

#FlagFields Source

newtype FlagFields a

Constructors

Instances

#CommandFields Source

newtype CommandFields a

Constructors

Instances

#ArgumentFields Source

#DefaultProp Source

data DefaultProp a

Constructors

Instances

#optionMod Source

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

#fieldMod Source

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

#baseProps Source

baseProps :: OptProperties

Base default properties.

#mkParser Source

#mkOption Source

#internal Source

internal :: forall f a. Mod f a

Hide this option from the help text