conferer-0.3.0.0: Configuration management library

Safe HaskellSafe
LanguageHaskell2010

Conferer.FromConfig.Basics

Contents

Synopsis

Documentation

updateAllAtOnceUsingFetch :: forall a. (FromConfig a, Typeable a) => Key -> Config -> a -> IO a Source #

fetchFromConfigWith :: forall a. Typeable a => (Text -> Maybe a) -> Key -> Config -> IO (Maybe a) Source #

updateFromConfigWith :: forall a. Typeable a => (Text -> Maybe a) -> Key -> Config -> a -> IO a Source #

findKeyAndApplyConfig Source #

Arguments

:: FromConfig newvalue 
=> Config

Complete config

-> Key

Key that indicates the part of the config that we care about

-> Key

Key that we use to find the config (usually concatenating with the other key)

-> (config -> newvalue)

Function that knows how to use the value to update the config

-> (newvalue -> config -> config)

Function that knows how to use the value to update the config

-> config

Result of the last config updating

-> IO config

Updated config

Concatenate many transformations to the config based on keys and functions

class FromConfigWithConNameG f where Source #

Instances
(FromConfigWithConNameG left, FromConfigWithConNameG right) => FromConfigWithConNameG (left :*: right) Source # 
Instance details

Defined in Conferer.FromConfig.Basics

Methods

updateFromConfigWithConNameG :: String -> Key -> Config -> (left :*: right) a -> IO ((left :*: right) a) Source #

fetchFromConfigWithConNameG :: String -> Key -> Config -> IO (Maybe ((left :*: right) a)) Source #

(FromConfigG inner, Selector selector) => FromConfigWithConNameG (S1 selector inner) Source # 
Instance details

Defined in Conferer.FromConfig.Basics

Methods

updateFromConfigWithConNameG :: String -> Key -> Config -> S1 selector inner a -> IO (S1 selector inner a) Source #

fetchFromConfigWithConNameG :: String -> Key -> Config -> IO (Maybe (S1 selector inner a)) Source #

Orphan instances

FromConfig Bool Source # 
Instance details

FromConfig Float Source # 
Instance details

FromConfig Int Source # 
Instance details

FromConfig Integer Source # 
Instance details

FromConfig String Source # 
Instance details

FromConfig ByteString Source # 
Instance details

FromConfig Text Source # 
Instance details

FromConfig a => FromConfig (Maybe a) Source # 
Instance details

DefaultConfig (Maybe a) Source # 
Instance details

Methods

configDef :: Maybe a Source #

FromConfig inner => FromConfigG (Rec0 inner) Source #

Purely Generics machinery, ignore...

Instance details

Methods

updateFromConfigG :: Key -> Config -> Rec0 inner a -> IO (Rec0 inner a) Source #

fetchFromConfigG :: Key -> Config -> IO (Maybe (Rec0 inner a)) Source #

FromConfigG inner => FromConfigG (D1 metadata inner) Source # 
Instance details

Methods

updateFromConfigG :: Key -> Config -> D1 metadata inner a -> IO (D1 metadata inner a) Source #

fetchFromConfigG :: Key -> Config -> IO (Maybe (D1 metadata inner a)) Source #

(FromConfigWithConNameG inner, Constructor constructor) => FromConfigG (C1 constructor inner) Source # 
Instance details

Methods

updateFromConfigG :: Key -> Config -> C1 constructor inner a -> IO (C1 constructor inner a) Source #

fetchFromConfigG :: Key -> Config -> IO (Maybe (C1 constructor inner a)) Source #