Portability | portable |
---|---|
Stability | experimental |
Maintainer | Bryan O'Sullivan <bos@serpentine.com> |
Safe Haskell | None |
Types for working with configuration files.
- data AutoConfig = AutoConfig {
- interval :: Int
- onError :: SomeException -> IO ()
- 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 Source
Directions for automatically reloading Config
data.
AutoConfig | |
|
A value in a Config
.
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 whereSource
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 convert
ed to an Int
.
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 ByteString | |
Configured Text | |
Configured CFloat | |
Configured CDouble | |
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) |
Exceptions
data ConfigError Source
An error occurred while processing a configuration file.
An error occurred while lookup up the given Name
.
Notification of configuration changes
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
.