tce-conf: Very simple config file reading

[ bsd3, configuration, library, program ] [ Propose Tags ] [ Report a vulnerability ]

This package contains modules for runtime reading of very simple config files of the `key=value` style or as a Haskell data structure to be deserialized with Read. The modules support files with blank lines and simple single-line comments, but nothing else.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.1, 1.2, 1.3
Change log changelog.md
Dependencies base (>=3 && <5), containers, tce-conf [details]
Tested with ghc >=8.0.1
License BSD-3-Clause
Copyright 2015-2016 Dino Morelli
Author Dino Morelli
Maintainer Dino Morelli <dino@ui3.info>
Category Configuration
Home page http://hub.darcs.net/dino/tce-conf
Source repo head: darcs get http://hub.darcs.net/dino/tce-conf
Uploaded by DinoMorelli at 2016-10-10T14:36:42Z
Distributions LTSHaskell:1.3, NixOS:1.3, Stackage:1.3
Reverse Dependencies 1 direct, 0 indirect [details]
Executables ReadConf-example, KVConf-example
Downloads 2517 total (12 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-11-15 [all 1 reports]

Readme for tce-conf-1.3

[back to package description]

tce-conf

Synopsis

Very simple config file reading (Haskell)

Description

This package contains modules for runtime reading of very simple config files of the key=value style or as a Haskell data structure to be deserialized with Read. The modules support files with blank lines and simple single-line comments, but nothing else.

KVConf

Pros

  • Well-known key=value config file syntax
  • Adding new entries doesn't necessarily mean code changes as they are stored in a Map

Cons

  • All values are String and so may as well be untyped. Conversion to other types will be required by users of the library.
  • Simulating hierarchies requires hacky key syntax with dots or what-have-you
  • Only single-line comments supported at this time, with #
  • No support for INI sections or variable substitution

ReadConf

Pros

  • Config files are strongly typed Haskell source code. Read instancing takes care of everything!
  • Can easily support hierarchical data because Haskell data types do so

Cons

  • Config files must adhere to Haskell source syntax (may not be a con for some)
  • Changing the config file at all requires code changes to keep the types synced with each other.
  • Only single-line comments supported at this time, with --
  • No support for variable substitution

Getting source

  • Get the source with darcs: $ darcs get http://hub.darcs.net/dino/tce-conf
  • If you're just looking, browse the source

And once you have it, building the usual way:

$ stack build
$ stack test

Contact

Dino Morelli <dino@ui3.info>