yaml-config-0.0.1: Configuration management

Safe HaskellNone

Data.Yaml.Config

Synopsis

Documentation

data Config Source

(Sub)Config type

type Key = TextSource

Subconfig or field name

load :: FilePath -> IO ConfigSource

Find file in filesystem and try to load it as YAML config May fail with KeyError

keys :: Config -> [Key]Source

Show all (sub)config first level filed's name

lookupSubconfigSource

Arguments

:: Config

(Sub)Config for find

-> Key

Field name

-> Maybe Config

Maybe Subconfig

Subconfig wrapped into Maybe

subconfigSource

Arguments

:: Config

(Sub)Config for find

-> Key

Subconfig name

-> IO Config

Subconfig

Find subconfig May fail with KeyError

lookupSource

Arguments

:: FromJSON a 
=> Config

(Sub)Config for find

-> Key

Field name

-> Maybe a

Field value

Field value wrapped into Maybe (sub)config

lookupDefaultSource

Arguments

:: FromJSON a 
=> Config

(Sub)Config for find

-> Key

Field name

-> a

Default value

-> a

Return value

Find value in (sub)config and return it or default value

require :: FromJSON a => Config -> Key -> IO aSource

Same as lookup buf fail with KeyError if there is no field with target name