console-program-0.2.0.1: Interprets the command line and a config file as commands and options

System.Console.Options

Description

This module defines a class for dealing with configurations and settings. It also exports a Template Haskell function to easily create datatypes to deal with the configuration of your program.

For an example using this module, see the file "Examples/Options.hs" in the package tarball.

Synopsis

Documentation

class Configuration c whereSource

An instance c of Configuration has as values complete configurations, as the program peruses. Setting s is the associated type of a single setting, or option assignments, as given by the user in a configuration file or command line options.

Associated Types

type Setting c Source

Methods

set :: Setting c -> c -> cSource

Instances

apply :: forall c. Configuration c => [Setting c] -> c -> cSource

create :: String -> String -> [(String, Type)] -> Q [Dec]Source

create is a template haskell computation. Given names for the "configuration" type and the "settings" type, and a list of settings (pairs of their names and types), it creates those datatypes, and an instance of the Configuration class.

data Type

Constructors

ConT Name
T