flags-applicative: Applicative flag parsing

[ bsd3, library, web ] [ Propose Tags ]


[Skip to Readme]
Versions [RSS] [faq],,,,,,,,,,,,,,
Dependencies base (>=4.7 && <5), containers (==0.6.*), flags-applicative, mtl (==2.2.*), text (==1.2.*) [details]
License BSD-3-Clause
Copyright 2019 Matthieu Monsch
Author Matthieu Monsch
Maintainer matthieu.monsch@gmail.com
Category Web
Home page https://github.com/mtth/flags-applicative
Source repo head: git clone https://github.com/mtth/flags-applicative
Uploaded by mtth at 2019-05-26T02:47:18Z
Distributions LTSHaskell:, NixOS:, Stackage:
Executables simple-example
Downloads 5171 total (45 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-05-26 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees


Readme for flags-applicative-

[back to package description]

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.