Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- fetchFromConfigByRead :: Read a => Key -> Config -> IO (Either Text a)
- fromValueWith :: (Text -> Maybe a) -> Key -> Text -> Either Text a
- fetchFromConfigWith :: (Text -> Maybe a) -> Key -> Config -> IO (Either Text a)
- findKeyAndApplyConfig :: FetchFromConfig newvalue => Config -> Key -> Key -> (newvalue -> config -> config) -> Either Text config -> IO (Either Text config)
Documentation
findKeyAndApplyConfig Source #
:: FetchFromConfig 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) |
-> (newvalue -> config -> config) | Function that knows how to use the value to update the config |
-> Either Text config | Result of the last config updating |
-> IO (Either Text config) | Updated config |
Concatenate many transformations to the config based on keys and functions