The minimal-configuration package

[ Tags: configuration, library, system ] [ Propose Tags ]

The module exported provides the ability to manage a configuration file in the users home directory (or the Windows equivalent). Where the configuration takes the form of key=value, without sections, that for example an '.ini' would have.

The library simplifies serilization/deserialization of the configuration into a structure similar in behavior to a Map, as well as an interactive way to fill in values for simple cases.

Consider the following example, where a user would run the application for the first time, it would ask him for his name; however on a followup run it would just print a greeting with his name.

import System.Config.File

main = loadLocal ".apprc" >>= \conf -> do
    let name = getV conf "name"
    case name of Just n  -> putStrLn $ "hello " ++ n
                 Nothing -> do conf' <- fillInteractively conf [("name", acceptNonBlank)]
                               saveConfiguration conf'

Properties

Versions 0.1, 0.1.1, 0.1.2, 0.1.3 (info)
Dependencies base (==4.*), containers (==0.*), directory (==1.*), filepath (==1.*), tconfig (==0.5.2) [details]
License OtherLicense
Author Marius Ghita
Maintainer mhitza@gmail.com
Category System, Configuration
Source repository head: git clone https://github.com/mhitza/minimal-configuration
Uploaded Thu May 26 02:05:43 UTC 2016 by MariusGhita
Distributions NixOS:0.1.3
Downloads 785 total (118 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-05-26 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees