| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
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
- unwrapConfigResult :: forall a. Config a => Bool -> Either [ConfigError] (a, Map Key [Origin], [Warning]) -> IO a
- printConfigOrigins :: Map Key [Origin] -> IO ()
- printConfigWarnings :: [Warning] -> IO ()
- printConfigErrors :: [ConfigError] -> IO ()
- displayError :: ConfigError -> Text
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.
printConfigWarnings :: [Warning] -> IO () Source #
printConfigErrors :: [ConfigError] -> IO () Source #
displayError :: ConfigError -> Text Source #