tconfig-0.2: 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 which will be added eventually. It is suitable for simple games that need to keep track of certain information between plays.

Synopsis

Documentation

data Configuration Source

The Configuration type takes a key and a value, and returns a Configuration type.

getValue :: Key -> [Configuration] -> Maybe ValueSource

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

repConfig :: Key -> Value -> [Configuration] -> [Configuration]Source

Utility function. Replaces the value for a key in a Configuration.

readConfig :: FilePath -> IO [Configuration]Source

Reads and parses a string from a file into a Configuration.

writeConfig :: FilePath -> [Configuration] -> IO ()Source

Parses a parsed Configuration back to a file.

remKey :: Key -> [Configuration] -> [Configuration]Source

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

addKey :: Key -> Value -> [Configuration] -> [Configuration]Source

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