Module "WUI.curry"

A library to support the type-oriented construction of Web User Interfaces (WUIs).
The ideas behind the application and implementation of WUIs are described in a paper that is available via this web page.

Author: Michael Hanus

Version: February 2007


 Exported names:

Datatypes:
Rendering | WTree | WuiHandler | WuiSpec

Constructors:
WLeaf | WNode

Functions:
adaptWSpec | mainWUI | renderList | renderTaggedTuple | renderTuple | transformWSpec | w10Tuple | w11Tuple | w4Tuple | w5Tuple | w6Tuple | w7Tuple | w8Tuple | w9Tuple | wCheckBool | wCheckMaybe | wCons10 | wCons11 | wCons2 | wCons3 | wCons4 | wCons5 | wCons6 | wCons7 | wCons8 | wCons9 | wConstant | wEither | wHidden | wHList | withCondition | withError | withRendering | wInt | wList | wListWithHeadings | wMatrix | wMaybe | wMultiCheckSelect | wPair | wRadioBool | wRadioMaybe | wRadioSelect | wRequiredString | wRequiredStringSize | wSelect | wSelectBool | wSelectInt | wString | wStringSize | wTextArea | wTree | wTriple | wui2html | wuiHandler2button | wuiInForm | wuiWithErrorForm


 Summary of exported functions:

wuiHandler2button  :: String -> WuiHandler -> HtmlExp  deterministic flexible
          Transform a WUI handler into a submit button with a given label string.
withRendering  :: WuiSpec a -> ([HtmlExp] -> HtmlExp) -> WuiSpec a  deterministic flexible
          Puts a new rendering function into a WUI specification.
withError  :: WuiSpec a -> String -> WuiSpec a  deterministic flexible
          Puts a new error message into a WUI specification.
withCondition  :: WuiSpec a -> (a -> Bool) -> WuiSpec a  deterministic flexible
          Puts a new condition into a WUI specification.
transformWSpec  :: (a -> b,b -> a) -> WuiSpec a -> WuiSpec b  deterministic flexible
          Transforms a WUI specification from one type to another.
adaptWSpec  :: (a -> b) -> WuiSpec a -> WuiSpec b  deterministic 
          Adapt a WUI specification to a new type.
wHidden  :: WuiSpec a  deterministic 
          A hidden widget for a value that is not shown in the WUI.
wConstant  :: (a -> HtmlExp) -> WuiSpec a  deterministic 
          A widget for values that are shown but cannot be modified.
wInt  :: WuiSpec Int  deterministic 
          A widget for editing integer values.
wString  :: WuiSpec String  deterministic 
          A widget for editing string values.
wStringSize  :: Int -> WuiSpec String  deterministic 
          A widget for editing string values with a size attribute.
wRequiredString  :: WuiSpec String  deterministic 
          A widget for editing string values that are required to be non-empty.
wRequiredStringSize  :: Int -> WuiSpec String  deterministic 
          A widget with a size attribute for editing string values that are required to be non-empty.
wTextArea  :: (Int,Int) -> WuiSpec String  deterministic 
          A widget for editing string values in a text area.
wSelect  :: (a -> String) -> [a] -> WuiSpec a  deterministic 
          A widget to select a value from a given list of values.
wSelectInt  :: [Int] -> WuiSpec Int  deterministic 
          A widget to select a value from a given list of integers (provided as the argument).
wSelectBool  :: String -> String -> WuiSpec Bool  deterministic 
          A widget to select a Boolean value via a selection box.
wCheckBool  :: [HtmlExp] -> WuiSpec Bool  deterministic 
          A widget to select a Boolean value via a check box.
wMultiCheckSelect  :: (a -> [HtmlExp]) -> [a] -> WuiSpec [a]  deterministic 
          A widget to select a list of values from a given list of values via check boxes.
wRadioSelect  :: (a -> [HtmlExp]) -> [a] -> WuiSpec a  deterministic 
          A widget to select a value from a given list of values via a radio button.
wRadioBool  :: [HtmlExp] -> [HtmlExp] -> WuiSpec Bool  deterministic 
          A widget to select a Boolean value via a radio button.
wPair  :: WuiSpec a -> WuiSpec b -> WuiSpec (a,b)  deterministic 
          WUI combinator for pairs.
wCons2  :: (a -> b -> c) -> WuiSpec a -> WuiSpec b -> WuiSpec c  deterministic flexible
          WUI combinator for constructors of arity 2.
wTriple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec (a,b,c)  deterministic 
          WUI combinator for triples.
wCons3  :: (a -> b -> c -> d) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d  deterministic flexible
          WUI combinator for constructors of arity 3.
w4Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec (a,b,c,d)  deterministic 
          WUI combinator for tuples of arity 4.
wCons4  :: (a -> b -> c -> d -> e) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e  deterministic flexible
          WUI combinator for constructors of arity 4.
w5Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec (a,b,c,d,e)  deterministic 
          WUI combinator for tuples of arity 5.
wCons5  :: (a -> b -> c -> d -> e -> f) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f  deterministic flexible
          WUI combinator for constructors of arity 5.
w6Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec (a,b,c,d,e,f)  deterministic 
          WUI combinator for tuples of arity 6.
wCons6  :: (a -> b -> c -> d -> e -> f -> g) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g  deterministic flexible
          WUI combinator for constructors of arity 6.
w7Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec (a,b,c,d,e,f,g)  deterministic 
          WUI combinator for tuples of arity 7.
wCons7  :: (a -> b -> c -> d -> e -> f -> g -> h) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h  deterministic flexible
          WUI combinator for constructors of arity 7.
w8Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec (a,b,c,d,e,f,g,h)  deterministic 
          WUI combinator for tuples of arity 8.
wCons8  :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i  deterministic flexible
          WUI combinator for constructors of arity 8.
w9Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec (a,b,c,d,e,f,g,h,i)  deterministic 
          WUI combinator for tuples of arity 9.
wCons9  :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j  deterministic flexible
          WUI combinator for constructors of arity 9.
w10Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec (a,b,c,d,e,f,g,h,i,j)  deterministic 
          WUI combinator for tuples of arity 10.
wCons10  :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k  deterministic flexible
          WUI combinator for constructors of arity 10.
w11Tuple  :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k -> WuiSpec (a,b,c,d,e,f,g,h,i,j,k)  deterministic 
          WUI combinator for tuples of arity 11.
wCons11  :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k -> WuiSpec l  deterministic flexible
          WUI combinator for constructors of arity 11.
wList  :: WuiSpec a -> WuiSpec [a]  deterministic flexible
          WUI combinator for list structures where the list elements are vertically aligned in a table.
wListWithHeadings  :: [String] -> WuiSpec a -> WuiSpec [a]  deterministic 
          Add headings to a standard WUI for list structures:
wHList  :: WuiSpec a -> WuiSpec [a]  deterministic 
          WUI combinator for list structures where the list elements are horizontally aligned in a table.
wMatrix  :: WuiSpec a -> WuiSpec [[a]]  deterministic 
          WUI for matrices, i.e., list of list of elements visualized as a matrix.
wMaybe  :: WuiSpec Bool -> WuiSpec a -> a -> WuiSpec (Maybe a)  deterministic flexible
          WUI for Maybe values.
wCheckMaybe  :: WuiSpec a -> [HtmlExp] -> a -> WuiSpec (Maybe a)  deterministic 
          A WUI for Maybe values where a check box is used to select Just.
wRadioMaybe  :: WuiSpec a -> [HtmlExp] -> [HtmlExp] -> a -> WuiSpec (Maybe a)  deterministic 
          A WUI for Maybe values where radio buttons are used to switch between Nothing and Just.
wEither  :: WuiSpec a -> WuiSpec b -> WuiSpec (Either a b)  deterministic flexible
          WUI for union types.
wTree  :: WuiSpec a -> WuiSpec (WTree a)  deterministic flexible
          WUI for tree types.
renderTuple  :: [HtmlExp] -> HtmlExp  deterministic 
          Standard rendering of tuples as a table with a single row.
renderTaggedTuple  :: [String] -> [HtmlExp] -> HtmlExp  deterministic 
          Standard rendering of tuples with a tag for each element.
renderList  :: [HtmlExp] -> HtmlExp  deterministic 
          Standard rendering of lists as a table with a row for each item: Thus, the elements are vertically aligned.
mainWUI  :: WuiSpec a -> a -> (a -> IO HtmlForm) -> IO HtmlForm  deterministic 
          Generates an HTML form from a WUI data specification, an initial value and an update form.
wui2html  :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp,WuiHandler)  deterministic 
          Generates HTML editors and a handler from a WUI data specification, an initial value and an update form.
wuiInForm  :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp -> WuiHandler -> HtmlForm) -> IO HtmlForm  deterministic 
          Puts a WUI into a HTML form containing "holes" for the WUI and the handler.
wuiWithErrorForm  :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp -> WuiHandler -> HtmlForm) -> (HtmlExp,WuiHandler)  deterministic 
          Generates HTML editors and a handler from a WUI data specification, an initial value and an update form.

 Imported modules:

Char
HTML
List
Maybe
Prelude
Read
ReadShowTerm

 Exported datatypes:

Rendering

A rendering is a function that combines the visualization of components of a data structure into some HTML expression.

Type synonym: Rendering = [HtmlExp] -> HtmlExp


WuiHandler

A handler for a WUI is an event handler for HTML forms possibly with some specific code attached (for future extensions).

Constructors:


WuiSpec

The type of WUI specifications. The first component are parameters specifying the behavior of this WUI type (rendering, error message, and constraints on inputs). The second component is a "show" function returning an HTML expression for the edit fields and a WUI state containing the CgiRefs to extract the values from the edit fields. The third component is "read" function to extract the values from the edit fields for a given cgi environment (returned as (Just v)). If the value is not legal, Nothing is returned. The second component of the result contains an HTML edit expression together with a WUI state to edit the value again.

Constructors:


WTree

A simple tree structure to demonstrate the construction of WUIs for tree types.

Constructors:

WLeaf :: a -> WTree a
WNode :: [WTree a] -> WTree a



 Exported functions:

wuiHandler2button :: String -> WuiHandler -> HtmlExp  deterministic flexible

Transform a WUI handler into a submit button with a given label string.


withRendering :: WuiSpec a -> ([HtmlExp] -> HtmlExp) -> WuiSpec a  deterministic flexible

Puts a new rendering function into a WUI specification.

Further infos:
  • defined as left-associative infix operator with precedence 0
  • solution complete, i.e., able to compute all solutions

withError :: WuiSpec a -> String -> WuiSpec a  deterministic flexible

Puts a new error message into a WUI specification.

Further infos:
  • defined as left-associative infix operator with precedence 0
  • solution complete, i.e., able to compute all solutions

withCondition :: WuiSpec a -> (a -> Bool) -> WuiSpec a  deterministic flexible

Puts a new condition into a WUI specification.

Further infos:
  • defined as left-associative infix operator with precedence 0
  • solution complete, i.e., able to compute all solutions

transformWSpec :: (a -> b,b -> a) -> WuiSpec a -> WuiSpec b  deterministic flexible

Transforms a WUI specification from one type to another.


adaptWSpec :: (a -> b) -> WuiSpec a -> WuiSpec b  deterministic 

Adapt a WUI specification to a new type. For this purpose, the first argument must be a transformation mapping values from the old type to the new type. This function must be bijective and operationally invertible (i.e., the inverse must be computable by narrowing). Otherwise, use transformWSpec!


wHidden :: WuiSpec a  deterministic 

A hidden widget for a value that is not shown in the WUI. Usually, this is used in components of larger structures, e.g., internal identifiers, data base keys.


wConstant :: (a -> HtmlExp) -> WuiSpec a  deterministic 

A widget for values that are shown but cannot be modified. The first argument is a mapping of the value into a HTML expression to show this value.


wInt :: WuiSpec Int  deterministic 

A widget for editing integer values.


wString :: WuiSpec String  deterministic 

A widget for editing string values.


wStringSize :: Int -> WuiSpec String  deterministic 

A widget for editing string values with a size attribute.


wRequiredString :: WuiSpec String  deterministic 

A widget for editing string values that are required to be non-empty.


wRequiredStringSize :: Int -> WuiSpec String  deterministic 

A widget with a size attribute for editing string values that are required to be non-empty.


wTextArea :: (Int,Int) -> WuiSpec String  deterministic 

A widget for editing string values in a text area. The argument specifies the height and width of the text area.


wSelect :: (a -> String) -> [a] -> WuiSpec a  deterministic 

A widget to select a value from a given list of values. The current value should be contained in the value list and is preselected. The first argument is a mapping from values into strings to be shown in the selection widget.


wSelectInt :: [Int] -> WuiSpec Int  deterministic 

A widget to select a value from a given list of integers (provided as the argument). The current value should be contained in the value list and is preselected.


wSelectBool :: String -> String -> WuiSpec Bool  deterministic 

A widget to select a Boolean value via a selection box. The arguments are the strings that are shown for the values True and False in the selection box, respectively.

Example call:  (wSelectBool true false)

Parameters:
true - string for selection of True
false - string for selection of False
Returns:
a WUI specification for a Boolean selection widget

wCheckBool :: [HtmlExp] -> WuiSpec Bool  deterministic 

A widget to select a Boolean value via a check box. The first argument are HTML expressions that are shown after the check box. The result is True if the box is checked.


wMultiCheckSelect :: (a -> [HtmlExp]) -> [a] -> WuiSpec [a]  deterministic 

A widget to select a list of values from a given list of values via check boxes. The current values should be contained in the value list and are preselected. The first argument is a mapping from values into HTML expressions that are shown for each item after the check box.


wRadioSelect :: (a -> [HtmlExp]) -> [a] -> WuiSpec a  deterministic 

A widget to select a value from a given list of values via a radio button. The current value should be contained in the value list and is preselected. The first argument is a mapping from values into HTML expressions that are shown for each item after the radio button.


wRadioBool :: [HtmlExp] -> [HtmlExp] -> WuiSpec Bool  deterministic 

A widget to select a Boolean value via a radio button. The arguments are the lists of HTML expressions that are shown after the True and False radio buttons, respectively.

Example call:  (wRadioBool true false)

Parameters:
true - HTML expressions for True radio button
false - HTML expressions for False radio button
Returns:
a WUI specification for a Boolean selection widget

wPair :: WuiSpec a -> WuiSpec b -> WuiSpec (a,b)  deterministic 

WUI combinator for pairs.


wCons2 :: (a -> b -> c) -> WuiSpec a -> WuiSpec b -> WuiSpec c  deterministic flexible

WUI combinator for constructors of arity 2. The first argument is the binary constructor. The second and third arguments are the WUI specifications for the argument types.


wTriple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec (a,b,c)  deterministic 

WUI combinator for triples.


wCons3 :: (a -> b -> c -> d) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d  deterministic flexible

WUI combinator for constructors of arity 3. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w4Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec (a,b,c,d)  deterministic 

WUI combinator for tuples of arity 4.


wCons4 :: (a -> b -> c -> d -> e) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e  deterministic flexible

WUI combinator for constructors of arity 4. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w5Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec (a,b,c,d,e)  deterministic 

WUI combinator for tuples of arity 5.


wCons5 :: (a -> b -> c -> d -> e -> f) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f  deterministic flexible

WUI combinator for constructors of arity 5. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w6Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec (a,b,c,d,e,f)  deterministic 

WUI combinator for tuples of arity 6.


wCons6 :: (a -> b -> c -> d -> e -> f -> g) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g  deterministic flexible

WUI combinator for constructors of arity 6. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w7Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec (a,b,c,d,e,f,g)  deterministic 

WUI combinator for tuples of arity 7.


wCons7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h  deterministic flexible

WUI combinator for constructors of arity 7. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w8Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec (a,b,c,d,e,f,g,h)  deterministic 

WUI combinator for tuples of arity 8.


wCons8 :: (a -> b -> c -> d -> e -> f -> g -> h -> i) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i  deterministic flexible

WUI combinator for constructors of arity 8. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w9Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec (a,b,c,d,e,f,g,h,i)  deterministic 

WUI combinator for tuples of arity 9.


wCons9 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j  deterministic flexible

WUI combinator for constructors of arity 9. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w10Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec (a,b,c,d,e,f,g,h,i,j)  deterministic 

WUI combinator for tuples of arity 10.


wCons10 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k  deterministic flexible

WUI combinator for constructors of arity 10. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


w11Tuple :: WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k -> WuiSpec (a,b,c,d,e,f,g,h,i,j,k)  deterministic 

WUI combinator for tuples of arity 11.


wCons11 :: (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l) -> WuiSpec a -> WuiSpec b -> WuiSpec c -> WuiSpec d -> WuiSpec e -> WuiSpec f -> WuiSpec g -> WuiSpec h -> WuiSpec i -> WuiSpec j -> WuiSpec k -> WuiSpec l  deterministic flexible

WUI combinator for constructors of arity 11. The first argument is the ternary constructor. The further arguments are the WUI specifications for the argument types.


wList :: WuiSpec a -> WuiSpec [a]  deterministic flexible

WUI combinator for list structures where the list elements are vertically aligned in a table.


wListWithHeadings :: [String] -> WuiSpec a -> WuiSpec [a]  deterministic 

Add headings to a standard WUI for list structures:


wHList :: WuiSpec a -> WuiSpec [a]  deterministic 

WUI combinator for list structures where the list elements are horizontally aligned in a table.


wMatrix :: WuiSpec a -> WuiSpec [[a]]  deterministic 

WUI for matrices, i.e., list of list of elements visualized as a matrix.


wMaybe :: WuiSpec Bool -> WuiSpec a -> a -> WuiSpec (Maybe a)  deterministic flexible

WUI for Maybe values. It is constructed from a WUI for Booleans and a WUI for the potential values. Nothing corresponds to a selection of False in the Boolean WUI. The value WUI is shown after the Boolean WUI.

Example call:  (wMaybe wspecb wspeca def)

Parameters:
wspecb - a WUI specification for Boolean values
wspeca - a WUI specification for the type of potential values
def - a default value that is used if the current value is Nothing

wCheckMaybe :: WuiSpec a -> [HtmlExp] -> a -> WuiSpec (Maybe a)  deterministic 

A WUI for Maybe values where a check box is used to select Just. The value WUI is shown after the check box.

Example call:  (wCheckMaybe wspec hexps def)

Parameters:
wspec - a WUI specification for the type of potential values
hexps - a list of HTML expressions shown after the check box
def - a default value if the current value is Nothing

wRadioMaybe :: WuiSpec a -> [HtmlExp] -> [HtmlExp] -> a -> WuiSpec (Maybe a)  deterministic 

A WUI for Maybe values where radio buttons are used to switch between Nothing and Just. The value WUI is shown after the radio button WUI.

Example call:  (wRadioMaybe wspec hexps hexps def)

Parameters:
wspec - a WUI specification for the type of potential values
hexps - a list of HTML expressions shown after the Nothing button
hexps - a list of HTML expressions shown after the Just button
def - a default value if the current value is Nothing

wEither :: WuiSpec a -> WuiSpec b -> WuiSpec (Either a b)  deterministic flexible

WUI for union types. Here we provide only the implementation for Either types since other types with more alternatives can be easily reduced to this case.


wTree :: WuiSpec a -> WuiSpec (WTree a)  deterministic flexible

WUI for tree types. The rendering specifies the rendering of inner nodes. Leaves are shown with their default rendering.


renderTuple :: [HtmlExp] -> HtmlExp  deterministic 

Standard rendering of tuples as a table with a single row. Thus, the elements are horizontally aligned.


renderTaggedTuple :: [String] -> [HtmlExp] -> HtmlExp  deterministic 

Standard rendering of tuples with a tag for each element. Thus, each is preceded by a tag, that is set in bold, and all elements are vertically aligned.


renderList :: [HtmlExp] -> HtmlExp  deterministic 

Standard rendering of lists as a table with a row for each item: Thus, the elements are vertically aligned.


mainWUI :: WuiSpec a -> a -> (a -> IO HtmlForm) -> IO HtmlForm  deterministic 

Generates an HTML form from a WUI data specification, an initial value and an update form.


wui2html :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp,WuiHandler)  deterministic 

Generates HTML editors and a handler from a WUI data specification, an initial value and an update form.


wuiInForm :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp -> WuiHandler -> HtmlForm) -> IO HtmlForm  deterministic 

Puts a WUI into a HTML form containing "holes" for the WUI and the handler.


wuiWithErrorForm :: WuiSpec a -> a -> (a -> IO HtmlForm) -> (HtmlExp -> WuiHandler -> HtmlForm) -> (HtmlExp,WuiHandler)  deterministic 

Generates HTML editors and a handler from a WUI data specification, an initial value and an update form. In addition to wui2html, we can provide a skeleton form used to show illegal inputs.



Generated by CurryDoc (Version 0.4.1 of June 7, 2007) at Aug 28 15:30:51 2008