Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This module contains functions to create option descriptions, together with their argument types.
Option descriptions
A value of type Option a
describes an option, that delivers a value
to the program of type a
.
:: [Char] | List of short option characters. |
-> [String] | List of long option strings. |
-> Type a | Type of option argument. |
-> a | Default value when the option is not specified by the user. |
-> String | Description. |
-> Option a | The resulting option description. |
Create an option description.
Options can have arguments, as in myprogram --foo=bar
, where bar
is the argument to foo
. These arguments have types, dictated by the
particular option; this type is the third parameter to option
.
A Type a
represents the type of an option or argument.
Further below you can find some common types of option arguments.
Type | |
|
Argument types
A boolean. Argument can be "1","0","true","false","on","off","yes","no".