config-value: Simple, layout-based value language similar to YAML or JSON

[ language, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

This package implments a language similar to YAML or JSON but with fewer special cases and fewer dependencies. It emphasizes layout structure for sections and lists, and requires quotes around strings.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1, 0.2, 0.3, 0.4, 0.4.0.1, 0.4.0.2, 0.5, 0.5.1, 0.6, 0.6.1, 0.6.2, 0.6.2.1, 0.6.3, 0.6.3.1, 0.7.0.0, 0.7.0.1, 0.8, 0.8.1, 0.8.2, 0.8.2.1, 0.8.3 (info)
Change log CHANGELOG.md
Dependencies array (>=0.5 && <0.6), base (>=4.7 && <4.9), bytestring (>=0.10.4 && <0.11), pretty (>=1.1.1.1 && <1.2), text (>=1.2.0.4 && <1.3) [details]
License MIT
Copyright 2015 Eric Mertens
Author Eric Mertens
Maintainer emertens@gmail.com
Category Language
Home page https://github.com/glguy/config-value
Bug tracker https://github.com/glguy/config-value/issues
Source repo head: git clone git://github.com/glguy/config-value.git
Uploaded by EricMertens at 2015-03-28T02:03:01Z
Distributions Arch:0.8.3, Debian:0.7.0.1, LTSHaskell:0.8.3, NixOS:0.8.3, Stackage:0.8.3
Reverse Dependencies 6 direct, 14 indirect [details]
Downloads 18419 total (143 in the last 30 days)
Rating 2.5 (votes: 3) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for config-value-0.1.1

[back to package description]

config-value

Build Status

This package implements a simple, layout-based value definition language which I intend to be used for supplying configuration values to various applications.

Example

-- Line comments until newline
layout:
  based:
    configuration:
      {} -- empty section

    sections:
     "glguy"

    {- Block comments
       {- nested comments -}
       "O'caml style {- strings in comments"
       so you can comment out otherwise valid
       portions of your config
    -}
    booleans   : yes
    complicated: no

    decimal    : -1234
    hexadecimal: 0x1234
    octal      : 0o1234
    binary     : 0b1010

lists:
   * 1
   * [ "inline", "lists" ]
   * * "nestable"
     * "layout"
     * "lists"
   * 3

unicode : "standard Haskell format strings (1 ≤ 2)\x2228(2 ≤ 3)"

Format

The language supports: Strings, Bools, Integers, Lists, Nested Sections.

Sections are layout based. The contents of a section must be indented further than the section heading. The whitespace between a section heading and its colon is not significant. Section names must start with a letter and may contain letters, numbers, and dashes (-).

Lists are either layout based with * prefixes or inline surrounded by [ and ] delimited by ,

Strings are surrounded by " and use Haskell-style escapes.

Numbers support decimal, hexadecimal (0x), octal (0o), and binary (0b).

Booleans are given by yes and no (and are case-insensitive)