ini: Configuration files in the INI format.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Quick and easy configuration files in the INI format.


[Skip to Readme]

Properties

Versions 0.0.0, 0.0.1, 0.1.0, 0.1.1, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.4.0, 0.4.1, 0.4.2, 0.4.2
Change log CHANGELOG.md
Dependencies attoparsec, base (>=4 && <5), semigroups (>=0.10 && <0.21), text, unordered-containers [details]
License BSD-3-Clause
Copyright 2013 Chris Done
Author Chris Done
Maintainer Andreas Abel
Category Data, Configuration
Home page https://github.com/andreasabel/ini
Bug tracker https://github.com/andreasabel/ini/issues
Source repo head: git clone https://github.com/andreasabel/ini.git
Uploaded by AndreasAbel at 2022-07-25T22:37:31Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for ini-0.4.2

[back to package description]

Hackage ini on Stackage Nightly Stackage LTS version Haskell CI

ini

Quick and easy configuration files in the INI format for Haskell.

Format rules and recommendations:

An example configuration file:

# Some comment.
[SERVER]
port=6667
hostname=localhost
[AUTH]
user=hello
pass=world
# Salt can be an empty string.
salt=

Parsing example:

> parseIni "[SERVER]\nport: 6667\nhostname: localhost"
Right (Ini {unIni = fromList [("SERVER",fromList [("hostname","localhost")
                                                 ,("port","6667")])]})

Extracting values:

> parseIni "[SERVER]\nport: 6667\nhostname: localhost" >>=
  lookupValue "SERVER" "hostname"
Right "localhost"

Parsing:

> parseIni "[SERVER]\nport: 6667\nhostname: localhost" >>=
  readValue "SERVER" "port" decimal
Right 6667

Import Data.Text.Read to use decimal.

ini-qq provides a quasiquoter for INI.