Go to the first, previous, next, last section, table of contents.

Component abstraction

Functions that create user interface components take an explicit environment DisplayContext that amongst other things contain an customisation environment. To reduce clutter in type signatures and invocation, Component defines a monad (environment+IO) and some basic combinators:

The monadic operators for the monad Component is an instance of, See section Environment + IO monad.


type Component = DC -> IO a

 {- add name and aliases to the Style environment -}
nameComponent  :: String -> Component a -> Component a
aliasComponent :: String -> Component a -> Component a

transformStyle :: (StyleEnv -> StyleEnv) -> Component a -> Component a
 {-
   append a style environment to the chain of style environments
   passed in. Style lookups will try to resolve to this new style
   environment last.

   Also append name to the style name chain.
 -}
withStyle    :: String -> [StyleValue] -> Component a -> Component a

 {- prepend a style environment to the front of the style env. chain. -} 
withDefaults :: String -> [StyleValue] -> Component a -> Component a


Go to the first, previous, next, last section, table of contents.