yam-config-0.3.0: Yam Configuation

Safe HaskellNone
LanguageHaskell2010

Yam.Config

Documentation

class Config c where Source #

Minimal complete definition

fetch, merge, from

Methods

fetch :: Text -> c -> Either String c Source #

merge :: [c] -> c Source #

from :: (String, String) -> c Source #

fromEnv :: [(String, String)] -> c Source #

fromCommandLine :: [String] -> c Source #

class (Monad m, Config c) => HasValue m c v where Source #

Minimal complete definition

parse

Methods

parse :: c -> m (Either String v) Source #

getValue :: Text -> c -> m (Either String v) Source #

getValueOrDef :: v -> Text -> c -> m v Source #

requireValue :: Text -> c -> m v Source #

Instances

(Monad m, FromJSON v) => HasValue m Value v Source # 

Methods

parse :: Value -> m (Either String v) Source #

getValue :: Text -> Value -> m (Either String v) Source #

getValueOrDef :: v -> Text -> Value -> m v Source #

requireValue :: Text -> Value -> m v Source #