Copyright | (c) 2011 MailRank Inc. |
---|---|
License | BSD3 |
Maintainer | Bryan O'Sullivan <bos@serpentine.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Data.Configurator.Types
Description
Types for working with configuration files.
Synopsis
- data AutoConfig = AutoConfig {
- interval :: Int
- onError :: SomeException -> IO ()
- data Config
- type Name = Text
- data Value
- class Configured a
- 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 Source #
Directions for automatically reloading Config
data.
Constructors
AutoConfig | |
Fields
|
Instances
Show AutoConfig Source # | |
Defined in Data.Configurator.Types.Internal |
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 " |
Instances
Data Value Source # | |
Defined in Data.Configurator.Types.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Value -> c Value Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Value Source # toConstr :: Value -> Constr Source # dataTypeOf :: Value -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Value) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Value) Source # gmapT :: (forall b. Data b => b -> b) -> Value -> Value Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Value -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Value -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Value -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Value -> m Value Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Value -> m Value Source # | |
Show Value Source # | |
Configured Value Source # | |
Eq Value Source # | |
class Configured a Source #
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 Value
True
cannot
be convert
ed to an Int
.
Minimal complete definition
Instances
Exceptions
data ConfigError Source #
An error occurred while processing a configuration file.
Constructors
ParseError FilePath String |
Instances
Exception ConfigError Source # | |
Defined in Data.Configurator.Types.Internal Methods toException :: ConfigError -> SomeException Source # fromException :: SomeException -> Maybe ConfigError Source # displayException :: ConfigError -> String Source # | |
Show ConfigError Source # | |
Defined in Data.Configurator.Types.Internal |
An error occurred while lookup up the given Name
.
Instances
Exception KeyError Source # | |
Defined in Data.Configurator.Types.Internal Methods toException :: KeyError -> SomeException Source # fromException :: SomeException -> Maybe KeyError Source # displayException :: KeyError -> String Source # | |
Show KeyError Source # | |
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
.
Instances
Data Pattern Source # | |
Defined in Data.Configurator.Types.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pattern -> c Pattern Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pattern Source # toConstr :: Pattern -> Constr Source # dataTypeOf :: Pattern -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pattern) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern) Source # gmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pattern -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pattern -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Pattern -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pattern -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pattern -> m Pattern Source # | |
IsString Pattern Source # | |
Defined in Data.Configurator.Types.Internal Methods fromString :: String -> Pattern Source # | |
Show Pattern Source # | |
Eq Pattern Source # | |
Hashable Pattern Source # | |