tconfig-0.5: Simple text configuration file parser library.

Data.TConfig

Description

A small and simple text file configuration library written in Haskell. It is similar to the INI file format, but lacks a few of it's features, such as sections. It is suitable for simple games that need to keep track of certain information between plays.

Synopsis

Documentation

getValue :: Key -> Conf -> Maybe ValueSource

Utility function. Searches a configuration for a key, and returns it's value.

repConfig :: Key -> Value -> Conf -> ConfSource

Utility function. Replaces the value associated with a key in a configuration.

readConfig :: FilePath -> IO ConfSource

Reads a file and parses to a Map String String.

writeConfig :: FilePath -> Conf -> IO ()Source

Parses a parsed configuration back to a file.

remKey :: Key -> Conf -> ConfSource

Utility function. Removes a key and it's value from the configuration.

addKey :: Key -> Value -> Conf -> ConfSource

Adds a key and value to the end of the configuration.