The lambda-options package

[ Tags: library, text ] [ Propose Tags ]

A modern command-line parser for Haskell.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.5.0.0, 0.5.1.0, 0.6.0.0, 0.7.0.0, 0.8.0.0, 0.9.0.0, 0.9.0.1
Dependencies base (==4.7.*), containers (==0.5.*), monad-loops (==0.4.*), mtl (==2.2.*) [details]
License OtherLicense
Author Thomas Eding
Maintainer thomasedingcode@gmail.com
Category Text
Home page https://github.com/thomaseding/lambda-options
Uploaded Thu May 14 05:41:51 UTC 2015 by ThomasEding
Distributions NixOS:0.9.0.1
Downloads 1370 total (8 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 2015-05-14 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for lambda-options-0.1.0.0

[back to package description]

lambda-options-haskell

A modern command-line parser for Haskell.

  • Easy to use. The API is expressive.
  • Easy to learn. The API is tiny and simple.
  • BSD 1-Clause License -------------- Basic example:
import System.Environment
import System.ExitCode
import Text.LambdaOptions

options :: LambdaOptions IO ()
options = do
  addOption "--help" $ do
    putStrLn "--user NAME [AGE]"
  addOption "--user" $ \name -> do
    putStrLn $ "Name:" ++ name
  addOption "--user" $ \name age -> do
    putStrLn $ "Name:" ++ name ++ " Age:" ++ show (age :: Int)

main :: IO ()
main = do
  args <- getArgs
  mError <- runOptions options args
  case mError of
    Just OptionsError -> exitFailure
    Nothing -> exitSuccess