The latest version of conf is 0.1.1.0-0.

conf

Version 0.1.0.0 revision 0 uploaded by carymrobbins.

Package meta

Synopsis
Parser for Haskell-based configuration files.
Description

This package is designed to allow you to create configuration files with declarative Haskell and parse the values back into Haskell code. The benefit here is to have a configuration file in Haskell that does not have to be recompiled - it is interpreted/parsed at runtime in a type-safe manner.

Example usage:

-- /path/to/my-config.hs
foo = ["bar", "baz"]
spam = Eggs

-- Application source
import Data.Conf
import Data.Maybe

data Spam = Eggs | Parrot | SomethingEntirelyDifferent
    deriving (Show, Read)

getSpam :: Conf -> Spam
getSpam = fromMaybe SomethingEntirelyDifferent . getConf "spam"

getFoo :: Conf -> Maybe Foo
getFoo = getConf "foo"

main = do
    conf <- readConf "my-config.hs"
    let spam = getSpam conf
    print spam
    let foo = getFoo conf
    print foo
Author
Cary M. Robbins
Bug reports
n/a
Category
Configuration, Parsing
Copyright
Copyright (C) 2014 Cary M. Robbins
Homepage
n/a
Maintainer
carymrobbins@gmail.com
Package URL
n/a
Stability
n/a

Components