ini: Configuration files in the INI format.

[ bsd3, configuration, data, library ] [ Propose Tags ]

Quick and easy configuration files in the INI format.

[Skip to Readme]


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 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
Change log
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
Bug tracker
Source repo head: git clone
Uploaded by AndreasAbel at 2022-07-25T22:55:04Z
Distributions Arch:0.4.2, Debian:0.4.1, LTSHaskell:0.4.2, NixOS:0.4.2, Stackage:0.4.2
Reverse Dependencies 13 direct, 53 indirect [details]
Downloads 27683 total (131 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-07-25 [all 1 reports]

Readme for ini-0.4.2

[back to package description]

Hackage ini on Stackage Nightly Stackage LTS version Haskell CI


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

Format rules and recommendations:

  • foo: bar or foo=bar are allowed.
  • The : syntax is space-sensitive.
  • Keys are case-sensitive.
  • Lower-case is recommended.
  • Values can be empty.
  • Keys cannot contain :, =, [, or ].
  • Comments must start at the beginning of the line with ; or #.

An example configuration file:

# Some comment.
# Salt can be an empty string.

Parsing example:

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

Extracting values:

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


> 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.