@hackage / ConfigFileTH

Template haskell for reading ConfigFiles.

Latest0.2

About

Metadata

  • Last updated , by VilleTirronen
  • License LicenseRef-LGPL
  • Categories Template Haskell, Parsers
  • Maintained by: Ville Tirronen <ville.e.t.tirronen@jyu.fi>

  • Lottery factor: 0

Links

Installation

Readme

This module provides syntax for concise definitions of config files from Data.ConfigFile through template haskell. For example, the following splice, $(genConf Example [$conf| elbow/center -> ec :: Double elbow/min -> emi :: Double elbow/max -> ema :: Double |]) resolves into declaration of the following datatype data Example = Example {ec :: Double ,emi :: Double ,ema :: Double} and a function loadExample :: (MonadIO m) => FilePath -> m (Either CPError Example) , which uses Data.ConfigFile to read a values for the above struct from a file.