yam-config-0.3.3: Yam Configuation

Safe HaskellNone
LanguageHaskell2010

Yam.Config

Documentation

class Config c where Source #

Minimal complete definition

fetch, merge, from, fromFile

Methods

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

merge :: [c] -> c Source #

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

merge' :: [IO c] -> IO c Source #

fromFile :: FilePath -> Required -> IO 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 #

Monad m => HasValue m (Box v) v Source # 

Methods

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

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

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

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