Documentation

Hale.OptParse.Options.Applicative.Types

A reader that can parse a string value into a typed result. $$\text{ReadM}\ \alpha := \text{String} \to \text{Except String}\ \alpha$$

Equations
Instances For
    @[implicit_reducible]
    Equations

    Option visibility and characteristics. Combines long/short names, help text, metavar, and visibility.

    • long : Option String

      Long option name (e.g., "output" for --output).

    • short : Option Char

      Short option character (e.g., 'o' for -o).

    • help : Option String

      Help text displayed in usage.

    • metavar : Option String

      Metavar displayed in usage (e.g., FILE in --output FILE).

    • hidden : Bool

      Whether this option is hidden from help.

    • showDefault : Bool

      Whether to show the default value in help text.

    Instances For
      Equations
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[implicit_reducible]

          Combine two Mod values, with the right-hand side taking precedence for fields that are set.

          Equations
          • One or more equations did not get rendered due to their size.

          Modifier configuration for ParserInfo. $$\text{InfoMod} := \text{ParserInfo-level modifiers}$$

          • description : Option String

            Program description.

          • header : Option String

            Header text shown before usage.

          • footer : Option String

            Footer text shown after options.

          • fullDesc : Bool

            Whether to show full description in help.

          • failureCode : Nat

            Exit code on parse failure.

          Instances For
            Equations
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Description of a single option, used for generating help text. Separated from the parsing logic so that the parser can be a plain function type.

                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    A composable command-line parser. Internally a function from an argument list to either an error or a pair of (parsed value, remaining args). Option descriptions are tracked separately for help generation.

                    $$\text{Parser}\ \alpha := \{ \text{run} : \text{List String} \to \text{Except String}\ (\alpha \times \text{List String}), \text{descrs} : \text{List OptDescr} \}$$

                    Instances For

                      Parser with metadata for help text generation. $$\text{ParserInfo}\ \alpha := (\text{Parser}\ \alpha, \text{description}, \text{header}, \text{footer}, \ldots)$$

                      • parser : Parser α

                        The underlying parser.

                      • description : Option String

                        Program description.

                      • header : Option String

                        Header text shown before usage.

                      • footer : Option String

                        Footer text shown after options.

                      • fullDesc : Bool

                        Whether to show full description.

                      • failureCode : Nat

                        Exit code on parse failure.

                      Instances For