envparse: Parse environment variables

[ bsd3, library, system ] [ Propose Tags ]

Here's a simple example

module Main (main) where

import Control.Monad (unless)
import Env

data Hello = Hello { name :: String, quiet :: Bool }

hello :: IO Hello
hello = Env.parse (header "envparse example") $
  Hello <$> var (str <=< nonempty) "NAME"  (help "Target for the greeting")
        <*> switch                 "QUIET" (help "Whether to actually print the greeting")
 
main :: IO ()
main = do
  Hello { name, quiet } <- hello
  unless quiet $
    putStrLn ("Hello, " ++ name ++ "!")

[Skip to Readme]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.4, 0.4.1, 0.5.0
Dependencies base (>=4.6 && <4.11), containers [details]
License BSD-2-Clause
Copyright 2014 Matvey Aksenov
Author Matvey Aksenov
Maintainer matvey.aksenov@gmail.com
Revised Revision 1 made by Bodigrim at 2022-06-18T17:00:05Z
Category System
Home page http://example.com/
Source repo head: git clone https://github.com/supki/envparse
Uploaded by MatveyAksenov at 2014-11-12T12:20:11Z
Distributions LTSHaskell:0.5.0, NixOS:0.5.0, Stackage:0.5.0
Reverse Dependencies 13 direct, 27 indirect [details]
Downloads 8748 total (69 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for envparse-0.1.0

[back to package description]

envparse

Hackage Build Status

optparse-applicative, but for environment variables

See example/Main.hs for an executable example