The optparse-text package

[ Tags: bsd3, development, library ] [ Propose Tags ]

Please see

[Skip to Readme]


Dependencies base (>=4.6 && <5), optparse-applicative, text [details]
License BSD3
Author Pascal Hartig
Maintainer Pascal Hartig <>
Category Development
Home page
Bug tracker
Source repository head: git clone
Uploaded Sun Jun 26 10:48:27 UTC 2016 by passy
Distributions LTSHaskell:, NixOS:, Stackage:, Tumbleweed:
Downloads 1488 total (72 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-06-26 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

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.