Options.Applicative.Builder.Internal
- Package
- purescript-optparse
- Repository
- f-o-a-m/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
Mod (f a -> f a) (DefaultProp a) (OptProperties -> OptProperties)
Instances
#HasName Source
#HasCompleter Source
class HasCompleter :: forall k. (k -> Type) -> Constraintclass HasCompleter f where
Members
modCompleter :: forall a. (Completer -> Completer) -> f a -> f a
Instances
#HasValue Source
class HasValue :: forall k. (k -> Type) -> Constraintclass HasValue f where
Members
hasValueDummy :: forall a. f a -> Unit
Instances
#HasMetavar Source
class HasMetavar :: forall k. (k -> Type) -> Constraintclass HasMetavar f where
Members
hasMetavarDummy :: forall a. f a -> Unit
Instances
#OptionFields Source
newtype OptionFields :: forall k. k -> Typenewtype OptionFields a
Constructors
OptionFields { optCompleter :: Completer, optNames :: Array OptName, optNoArgError :: String -> ParseError }
Instances
#FlagFields Source
#CommandFields Source
newtype CommandFields aConstructors
CommandFields { cmdCommands :: Array (Tuple String (ParserInfo a)), cmdGroup :: Maybe String }
Instances
#ArgumentFields Source
newtype ArgumentFields :: forall k. k -> Typenewtype ArgumentFields a
Constructors
ArgumentFields { argCompleter :: Completer }
Instances
#DefaultProp Source
data DefaultProp aConstructors
DefaultProp (Maybe a) (Maybe (a -> String))
Instances
Monoid (DefaultProp a)Semigroup (DefaultProp a)
#optionMod Source
optionMod :: forall f a. (OptProperties -> OptProperties) -> Mod f a#baseProps Source
baseProps :: OptPropertiesBase default properties.
#mkParser Source
mkParser :: forall a. DefaultProp a -> (OptProperties -> OptProperties) -> OptReader a -> Parser a#mkOption Source
mkOption :: forall a. DefaultProp a -> (OptProperties -> OptProperties) -> OptReader a -> Option a#mkProps Source
mkProps :: forall a. DefaultProp a -> (OptProperties -> OptProperties) -> OptProperties- Modules
- Options.
Applicative - Options.
Applicative. BashCompletion - Options.
Applicative. Builder - Options.
Applicative. Builder. Completer - Options.
Applicative. Builder. Internal - Options.
Applicative. Common - Options.
Applicative. Extra - Options.
Applicative. Help - Options.
Applicative. Help. Chunk - Options.
Applicative. Help. Core - Options.
Applicative. Help. Levenshtein - Options.
Applicative. Help. Pretty - Options.
Applicative. Help. Types - Options.
Applicative. Internal - Options.
Applicative. Internal. Utils - Options.
Applicative. Types - Text.
PrettyPrint. Leijen
@since 0.13.0.0