@hackage flags-applicative0.0.3.0

Applicative flag parsing

Applicative flags

Simple flags parsing, inspired by optparse-applicative:

data Options = Options
  { rootPath :: Text
  , logLevel :: Int
  , context :: Maybe Text
  } deriving Show

optionsParser :: FlagParser Options
optionsParser = Options <$> textFlag "root" "path to the root"
                        <*> (numericFlag decimal "log_level" "" <|> pure 0)
                        <*> (optional $ textFlag "context" "")

See the documentation for more information.