comparison gui.urs @ 20:554e342665fe

Add a new parameter to Gui.gui
author Adam Chlipala <adam@chlipala.net>
date Sat, 24 Sep 2011 15:47:00 -0400
parents 16447dc6a68c
children 5905b56e0cd9
comparison
equal deleted inserted replaced
19:3a303df9ae92 20:554e342665fe
1 (* Gui framework elements common across individual components. *) 1 (* Gui framework elements common across individual components. *)
2 2
3 (* Types of this class describe gui components. *) 3 (* Types of this class describe gui components. *)
4 class gui :: Type -> Type -> Type 4 class gui :: Type (* The type of an object to render *)
5 5 -> {Unit} (* The HTML context to render it for (minus [body]) *)
6 6 -> Type
7 (* class gui = fn t xcomponent => t -> xcomponent *)
8 (* class gui :: Type -> Type -> Type *)
9 7
10 (* How to add components to the gui class. *) 8 (* How to add components to the gui class. *)
11 val mkGui : t ::: Type -> xcomponent:::Type -> (t -> xcomponent) -> gui t xcomponent 9 val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx
12 10
13 (* Xml itself can be a gui component. *) 11 (* XML itself can be a gui component. *)
14 val gui_xbody : gui xbody xbody 12 val gui_xbody : gui xbody []
13 val gui_xtable : gui xtable [Table]
15 14
16 (* Currently the only thing a gui component can do is be 15 (* Currently the only thing a gui component can do is be
17 * pretty printed to a piece of xml. *) 16 * pretty printed to a piece of xml. *)
18 val toXml : t ::: Type -> xcomponent ::: Type -> gui t xcomponent -> t -> xcomponent 17 val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []
19
20
21