optparse-text: Data.Text helpers for optparse-applicative

[ bsd3, development, library ] [ Propose Tags ]

Please see README.md

[Skip to Readme]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],
Dependencies base (>=4.6 && <5), optparse-applicative, text [details]
License BSD-3-Clause
Author Pascal Hartig
Maintainer Pascal Hartig <i@passy.me>
Category Development
Home page https://github.com/passy/optparse-text#readme
Bug tracker https://github.com/passy/optparse-text/issues
Source repo head: git clone https://github.com/passy/optparse-text
Uploaded by passy at 2016-06-26T10:48:27Z
Distributions LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 3510 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-06-26 [all 1 reports]

Readme for optparse-text-

[back to package description]


Build Status

Helpers for optparse-applicative to deal with Data.Text.


import qualified Data.Text                 as T
import qualified Options.Applicative       as Opt
import qualified Options.Applicative.Text  as OptT

data Options = Options { text    :: T.Text
                       , textArg :: T.Text
                       , textOpt :: T.Text }
  deriving (Eq, Show)

optParser :: Opt.Parser Options
optParser = Options <$> Opt.argument OptT.text ( Opt.metavar "TEXT" )
                 <*> OptT.textArgument ( Opt.metavar "TEXT2" )
                 <*> OptT.textOption ( Opt.long "textopt" )


About to be published.


You may want to consider using optparse-generic which has built-in support for Text and provides a very convient generic interface to optparse avoiding a lot of boilerplate.