Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glguy/config-value
Simple, layout-based, unambiguous configuration language implemented in Haskell
https://github.com/glguy/config-value
configuration haskell
Last synced: 9 days ago
JSON representation
Simple, layout-based, unambiguous configuration language implemented in Haskell
- Host: GitHub
- URL: https://github.com/glguy/config-value
- Owner: glguy
- License: mit
- Created: 2015-03-25T06:31:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-11-21T16:48:45.000Z (12 months ago)
- Last Synced: 2024-05-08T20:13:48.332Z (6 months ago)
- Topics: configuration, haskell
- Language: Haskell
- Homepage:
- Size: 163 KB
- Stars: 17
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# config-value
[![Hackage](https://img.shields.io/hackage/v/config-value.svg)](https://hackage.haskell.org/package/config-value)
This package implements a simple, layout-based value definition language
used for supplying configuration values to various applications.Before starting to use config-value, you probably want to read the documentation for [config-schema](https://github.com/glguy/config-schema) to see the user-friendly way to wrap this library.
Live Demo
--------The config-value and config-schema packages are available in a [live demo](https://glguy.net/config-demo/).
Example
-------
```
-- Line comments until newline
layout:
based:
configuration:
{} -- empty sectioninline-maps: {key1: value1, key2: value2}
sections:
"glguy"{- Block comments
{- nested comments -}
"O'caml style {- strings in comments"
so you can comment out otherwise valid
portions of your config
-}
atoms: yesdecimal: -1234
hexadecimal: 0x1234
octal: 0o1234
binary: 0b1010floats: [1e2, 0x3p-5, 24.48]
underscores: 1_000_000lists:
* sections: in-lists
next-section: still-in-list
* [ "inline", "lists" ]
* * "nestable"
* "layout"
* "lists"
* 3unicode: "standard Haskell format strings (1 ≤ 2)x2228(2 ≤ 3)"
multiline: "haskell style\
\string gaps"
```Format
------The language supports: Strings, Atoms, 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, dashes (`-`), underscores (`_`), and periods (`.`).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`).
Atoms follow the same lexical rule as section heading.