| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | Bryan O'Sullivan <bos@serpentine.com> |
Data.Configurator.Types
Description
Types for working with configuration files.
- data AutoConfig = AutoConfig {}
- data Config
- type Name = Text
- data Value
- class Configured a where
- data Worth a
- data ConfigError = ParseError FilePath String
- data KeyError = KeyError Name
- data Pattern
- type ChangeHandler = Name -> Maybe Value -> IO ()
Documentation
data AutoConfig
Directions for automatically reloading Config data.
Constructors
| AutoConfig | |
Fields
| |
Instances
data Config
Configuration data.
data Value
A value in a Config.
Constructors
| Bool Bool | A Boolean. Represented in a configuration file as |
| String Text | A Unicode string. Represented in a configuration file as text surrounded by double quotes. Escape sequences:
|
| Number Rational | Integer. |
| List [Value] | Heterogeneous list. Represented in a configuration
file as an opening square bracket " |
class Configured a where
This class represents types that can be automatically and safely
converted from a Value to a destination type. If conversion
fails because the types are not compatible, Nothing is returned.
For an example of compatibility, a Value of Bool True cannot
be converted to an Int.
Instances
| Configured Bool | |
| Configured Double | |
| Configured Float | |
| Configured Int | |
| Configured Int8 | |
| Configured Int16 | |
| Configured Int32 | |
| Configured Int64 | |
| Configured Integer | |
| Configured Word | |
| Configured Word8 | |
| Configured Word16 | |
| Configured Word32 | |
| Configured Word64 | |
| Configured ByteString | |
| Configured CFloat | |
| Configured CDouble | |
| Configured ByteString | |
| Configured Text | |
| Configured Text | |
| Configured Value | |
| Configured [Char] | |
| Integral a => Configured (Ratio a) | |
| HasResolution a => Configured (Fixed a) | |
| RealFloat a => Configured (Complex a) | |
| (Configured a, Configured b) => Configured (a, b) | |
| (Configured a, Configured b, Configured c) => Configured (a, b, c) | |
| (Configured a, Configured b, Configured c, Configured d) => Configured (a, b, c, d) |
data Worth a
Exceptions
data ConfigError
An error occurred while processing a configuration file.
Constructors
| ParseError FilePath String |
Instances
Notification of configuration changes
data Pattern
A pattern specifying the name of a property that has changed.
This type is an instance of the IsString class. If you use the
OverloadedStrings language extension and want to write a
prefix-matching pattern as a literal string, do so by suffixing
it with ".*", for example as follows:
"foo.*"
If a pattern written as a literal string does not end with
".*", it is assumed to be exact.