conftrack-0.0.1: Tracable multi-source config management
Safe HaskellSafe-Inferred
LanguageGHC2021

Conftrack.Pretty

Description

This module contains convenience functions to print the values returned by runFetchConfig.

These functions can be used as-is in programs using this library, or serve as examples for people who wish to display the results some another way.

Synopsis

Documentation

unwrapConfigResult :: forall a. Config a => Bool -> Either [ConfigError] (a, Map Key [Origin], [Warning]) -> IO a Source #

A convenience function, to be >>='d with runFetchConfig.

It prints any errors in case of failure and then aborts the program, and prints any warnings (and, if the first argument is True, also each value's origin) and returns the config in case of success.