Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains utility functions for working with TOML configuration files and JSON data.
Synopsis
- loadConfig :: (MonadIO r, MonadReporter r, FromJSON a) => FilePath -> r a
- saveConfig :: (MonadIO r, MonadReporter r, ToJSON a) => FilePath -> a -> r ()
Documentation
loadConfig :: (MonadIO r, MonadReporter r, FromJSON a) => FilePath -> r a Source #
Loads a .json
or .toml
file and decodes its contents using
the Aeson interface.
The configuration file type is inferred from the file extension.
saveConfig :: (MonadIO r, MonadReporter r, ToJSON a) => FilePath -> a -> r () Source #
Encodes the given value using its Aeson interface and saves
the encoded value as .json
file.