Ultra light weight ini file parser, written in Haskell
Consider a simple ini-like file config.ini
like this:
[something]
foo = bar
[something else]
answer = 42
name = Boaty McBoatface
There are two sections (inbetween [
and ]
) defined, something
and something else
. These sections contain a dictionary of Strings each, the keys being some string followed by =
, and anything else until end of the line as values. The leading and trailing spaces in section headers, keys and values are trimmed.
trivialini simply parses a map of maps of strings from this data:
$ cat config.ini
[foo]
bar = 42
λ> ini <- readIniFileStrings "config.ini"
λ> ini ! "foo" ! "bar"
"42"
Copyright (c) 2021-2024 Mirko Westermeier
Released under the MIT license. See LICENSE for details.