Copyright | (c) 2011 MailRank Inc. |
---|---|
License | BSD3 |
Maintainer | Bryan O'Sullivan <bos@serpentine.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Data.Configurator.Types
Description
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
- convert :: Configured a => Value -> Maybe a
- 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
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 convert
ed to an Int
.
Minimal complete definition
Instances
Configured a => Configured [a] # | |
convert :: Configured a => Value -> Maybe a #
Exceptions
data ConfigError #
An error occurred while processing a configuration file.
Constructors
ParseError FilePath String |
Instances
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
.