ยค Customiser, standard

Types

type Customiser a = a -> a

standard :: Customiser a

Description

These are the types used for customisable fudgets.

In order to make fudgets easy to use in the common case and still flexible, they come in two versions: a standard version, e.g., buttonF, and a customisable version, e.g., buttonF'. The name of the customisable version is obtained by appending a ' to the name of the standard version.

Customisable fudgets have a number of parameters which allows you to specify things like fonts, colors, border width, etc. These parameters all have default values which are used in the standard version of the fudget.

Rather than having one extra argument for each such parameter, customisable versions of fudgets (or other functions) have one extra argument which is a customiser. The customiser is always the first argument. A customiser is a function that modifies a data structure containing the values of all parameters. The type of the data structure is abstract. Its name is usually the name of the fudget, with the first letter change to upper case, e.g., ButtonF in the case of buttonF'.

This method has a number of advantages:

So, customisers are obtained by composing a number of modifying functions using ordinary function composition.

standard is the customiser that doesn't change any parameters, i.e. the identity function.

See Also

For an example of customisation, see labelF'.

Some customisable fudgets: buttonF', displayF'.

Type classes for customisers: HasFontSpec, HasBgColorSpec et al.

Bugs

Documentation incomplete.