option package:opt-env-conf

Try to parse an argument. You'll also need to add a reader, at least one long or short, and a metavar. Multiple options are redundant.
One or none. It is useful for modelling any computation that is allowed to fail.

Examples

Using the Alternative instance of Control.Monad.Except, the following functions:
>>> import Control.Monad.Except
>>> canFail = throwError "it failed" :: Except String Int

>>> final = return 42                :: Except String Int
Can be combined by allowing the first function to fail:
>>> runExcept $ canFail *> final
Left "it failed"

>>> runExcept $ optional canFail *> final
Right 42
A setting with option, a reader set to str, and the metavar set to STR. Note that you can override the metavar with another metavar in the given list of builders. This function may help with easier migration from optparse-applicative.
Consume an option. This supports:
  • ["-f", "foo"]
  • ["--foo", "foo"]
  • ["-df", "foo"]
  • ["--foo=foo"]
  • ["-ffoo"]
Whether the dasheds should be tried together with the readers as options.