comparison gui.urs @ 18:16447dc6a68c

Introduction of multi-parameter type class for gui components
author Ron de Bruijn <rmbruijn@gmail.com>
date Thu, 22 Sep 2011 19:24:01 +0200
parents 90be8b8917d5
children 554e342665fe
comparison
equal deleted inserted replaced
17:2947170fcfd6 18:16447dc6a68c
1 (* Gui framework elements common across individual components. *) 1 (* Gui framework elements common across individual components. *)
2 2
3 class gui
4 (* Types of this class describe gui components. *) 3 (* Types of this class describe gui components. *)
4 class gui :: Type -> Type -> Type
5
5 6
6 val toXml : t ::: Type -> gui t -> t -> xbody 7 (* class gui = fn t xcomponent => t -> xcomponent *)
8 (* class gui :: Type -> Type -> Type *)
9
10 (* How to add components to the gui class. *)
11 val mkGui : t ::: Type -> xcomponent:::Type -> (t -> xcomponent) -> gui t xcomponent
12
13 (* Xml itself can be a gui component. *)
14 val gui_xbody : gui xbody xbody
15
7 (* Currently the only thing a gui component can do is be 16 (* Currently the only thing a gui component can do is be
8 * pretty printed to a piece of xml. *) 17 * pretty printed to a piece of xml. *)
18 val toXml : t ::: Type -> xcomponent ::: Type -> gui t xcomponent -> t -> xcomponent
9 19
10 val gui_xbody : gui xbody
11 (* Xml itself can be a gui component. *)
12 20
13 val mkGui : t ::: Type -> (t -> xbody) -> gui t 21
14 (* How to add components to the gui class. *)