config-schema-0.1.0.0: Schema definitions for the config-value package

Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Config.Schema.Load

Contents

Description

This module automates the extraction of a decoded value from a configuration value according to a specification as built using Config.Schema.Spec.

Synopsis

Documentation

loadValue Source #

Arguments

:: ValueSpecs a

specification

-> Value

value

-> Either [LoadError] a

error or decoded value

Match a Value against a ValueSpecs and return either the interpretation of that value or the list of errors encountered.

Errors

data LoadError Source #

Type for errors that can be encountered while decoding a value according to a specification. The error includes a key path indicating where in the configuration file the error occurred.

Constructors

LoadError [Text] Problem

path to problem and problem description

data Problem Source #

Problems that can be encountered when matching a Value against a ValueSpecs.

Constructors

MissingSection Text

missing section name

UnusedSections [Text]

unused section names

SpecMismatch Text

failed specification name