ConfigFile-1.0.3: Configuration file reading & writingContentsIndex
Data.ConfigFile.Types
Portabilityportable
Stabilityprovisional
MaintainerJohn Goerzen <jgoerzen@complete.org>
Description

Internal types for Data.ConfigFile. This module is not intended to be used directly by your programs.

Copyright (c) 2004 John Goerzen, jgoerzen@complete.org

Synopsis
type CPOptions = Map OptionSpec String
type CPData = Map SectionSpec CPOptions
data CPErrorData
= ParseError String
| SectionAlreadyExists SectionSpec
| NoSection SectionSpec
| NoOption OptionSpec
| OtherProblem String
| InterpolationError String
type CPError = (CPErrorData, String)
data ConfigParser = ConfigParser {
content :: CPData
optionxform :: (OptionSpec -> OptionSpec)
defaulthandler :: (ConfigParser -> SectionSpec -> OptionSpec -> Either CPError String)
usedefault :: Bool
accessfunc :: (ConfigParser -> SectionSpec -> OptionSpec -> Either CPError String)
}
type SectionSpec = String
type OptionSpec = String
type ParseOutput = [(String, [(String, String)])]
Documentation
type CPOptions = Map OptionSpec String
Storage of options.
type CPData = Map SectionSpec CPOptions

The main data storage type (storage of sections).

PLEASE NOTE: This type is exported only for use by other modules under Data.ConfigFile. You should NEVER access the FiniteMap in a ConfigParser directly. This type may change in future releases of MissingH, which could break your programs. Please retrict yourself to the interface in ConfigFile.

data CPErrorData
Possible ConfigParser errors.
Constructors
ParseError StringParse error
SectionAlreadyExists SectionSpecAttempt to create an already-existing ection
NoSection SectionSpecThe section does not exist
NoOption OptionSpecThe option does not exist
OtherProblem StringMiscellaneous error
InterpolationError StringRaised by interpolatingAccess if a request was made for a non-existant option
show/hide Instances
type CPError = (CPErrorData, String)
Indicates an error occurred. The String is an explanation of the location of the error.
data ConfigParser
This is the main record that is used by ConfigFile.
Constructors
ConfigParser
content :: CPDataThe data itself
optionxform :: (OptionSpec -> OptionSpec)How to transform an option into a standard representation
defaulthandler :: (ConfigParser -> SectionSpec -> OptionSpec -> Either CPError String)Function to look up an option, considering a default value if usedefault is True; or ignoring a default value otherwise. The option specification is assumed to be already transformed.
usedefault :: BoolWhether or not to seek out a default action when no match is found.
accessfunc :: (ConfigParser -> SectionSpec -> OptionSpec -> Either CPError String)Function that is used to perform lookups, do optional interpolation, etc. It is assumed that accessfunc will internally call defaulthandler to do the underlying lookup. The option value is not assumed to be transformed.
type SectionSpec = String
Names of sections
type OptionSpec = String
Names of options
type ParseOutput = [(String, [(String, String)])]
Internal output from parser
Produced by Haddock version 0.8