Documentation

Hale.OptParse.Options.Applicative.Builder

Set the long option name (e.g., "output" for --output). $$\text{long} : \text{String} \to \text{Mod}$$

Equations
Instances For

    Set the short option character (e.g., 'o' for -o). $$\text{short} : \text{Char} \to \text{Mod}$$

    Equations
    Instances For

      Set the help text for an option. $$\text{help} : \text{String} \to \text{Mod}$$

      Equations
      Instances For

        Set the metavar for an option (displayed in usage, e.g., FILE). $$\text{metavar} : \text{String} \to \text{Mod}$$

        Equations
        Instances For

          Mark an option as hidden from help output. $$\text{hidden} : \text{Mod}$$

          Equations
          Instances For

            Mark that the default value should be shown in help. $$\text{showDefault} : \text{Mod}$$

            Equations
            Instances For

              Identity reader that returns the string as-is. $$\text{str} : \text{ReadM String}$$

              Equations
              Instances For

                Construct a reader from an Except-returning function. $$\text{eitherReader} : (\text{String} \to \text{Except String}\ \alpha) \to \text{ReadM}\ \alpha$$

                Equations
                Instances For

                  A class for types that can be parsed from a string representation. Used by the auto reader.

                  • fromString? : StringOption α

                    Parse a string into a value, or return none on failure.

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

                    Automatic reader using FromString and ToString instances. $$\text{auto} : [\text{ToString}\ \alpha] \to [\text{FromString}\ \alpha] \to \text{ReadM}\ \alpha$$

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Options.Applicative.option {α : Type} (reader : ReadM α) (mods : Mod) :

                      Build a typed option using the given reader. The option can appear anywhere in the argument list (scanned). $$\text{option} : \text{ReadM}\ \alpha \to \text{Mod} \to \text{Parser}\ \alpha$$

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

                        Build a string-valued option. $$\text{strOption} : \text{Mod} \to \text{Parser String}$$

                        Equations
                        Instances For

                          Build a boolean switch (defaults to false, active when present). $$\text{switch} : \text{Mod} \to \text{Parser Bool}$$

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Options.Applicative.flag {α : Type} (inactive active : α) (mods : Mod) :

                            Build a flag with explicit inactive/active values. $$\text{flag} : \alpha \to \alpha \to \text{Mod} \to \text{Parser}\ \alpha$$

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Options.Applicative.flag' {α : Type} (active : α) (mods : Mod) :

                              Build a flag with no default (must be explicitly provided or combined with alternative). $$\text{flag'} : \alpha \to \text{Mod} \to \text{Parser}\ \alpha$$

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Options.Applicative.argument {α : Type} (reader : ReadM α) (mods : Mod) :

                                Build a positional argument parser. Consumes the first non-flag argument. $$\text{argument} : \text{ReadM}\ \alpha \to \text{Mod} \to \text{Parser}\ \alpha$$

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Options.Applicative.argument.findArg {α : Type} (reader : ReadM α) (mods : Mod) (before : List String) :
                                  Equations
                                  Instances For

                                    Build a subcommand parser. The first positional argument selects the command. $$\text{subparser} : \text{List (String} \times \text{ParserInfo}\ \alpha\text{)} \to \text{Parser}\ \alpha$$

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

                                      Applicative pure: a parser that always succeeds with the given value, consuming no arguments. $$\text{pure} : \alpha \to \text{Parser}\ \alpha$$

                                      Equations
                                      @[implicit_reducible]

                                      Functor map for Parser. $$\text{map} : (\alpha \to \beta) \to \text{Parser}\ \alpha \to \text{Parser}\ \beta$$

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

                                      Applicative sequencing for Parser. $$\text{seq} : \text{Parser}\ (\alpha \to \beta) \to (\text{Unit} \to \text{Parser}\ \alpha) \to \text{Parser}\ \beta$$

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

                                      SeqLeft for Parser.

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

                                      SeqRight for Parser.

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

                                      Applicative instance for Parser.

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

                                      Alternative: try left parser, fall back to right on failure. $$\text{orElse} : \text{Parser}\ \alpha \to (\text{Unit} \to \text{Parser}\ \alpha) \to \text{Parser}\ \alpha$$

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      def Options.Applicative.withDefault {α : Type} (dflt : α) (p : Parser α) :

                                      Set a default value for a parser: if it fails, return the default. $$\text{value} : \alpha \to \text{Parser}\ \alpha \to \text{Parser}\ \alpha$$

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        def Options.Applicative.optionWithDefault {α : Type} (reader : ReadM α) (mods : Mod) (dflt : α) :

                                        Build a typed option with a default value. $$\text{optionWithDefault} : \text{ReadM}\ \alpha \to \text{Mod} \to \alpha \to \text{Parser}\ \alpha$$

                                        Equations
                                        Instances For

                                          Build a string-valued option with a default value. $$\text{strOptionWithDefault} : \text{Mod} \to \text{String} \to \text{Parser String}$$

                                          Equations
                                          Instances For

                                            Create a command entry for use with subparser. $$\text{command} : \text{String} \to \text{ParserInfo}\ \alpha \to (\text{String} \times \text{ParserInfo}\ \alpha)$$

                                            Equations
                                            Instances For