-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Template haskell for reading ConfigFiles. -- -- 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. @package ConfigFileTH @version 0.2 -- | 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. -- -- Known bugs: Does not support comments in the quotes. module Data.ConfigFile.TH -- | TH macro for generating a data type and corresponding code to load it -- from a config file. genConf :: Monad m => String -> [(String, String, String, String)] -> m [Dec] conf :: QuasiQuoter