Mercurial > gui
diff 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 |
line wrap: on
line diff
--- a/gui.urs Fri Sep 23 13:30:01 2011 +0200 +++ b/gui.urs Sat Sep 24 15:47:00 2011 -0400 @@ -1,21 +1,17 @@ (* Gui framework elements common across individual components. *) (* Types of this class describe gui components. *) -class gui :: Type -> Type -> Type - - -(* class gui = fn t xcomponent => t -> xcomponent *) -(* class gui :: Type -> Type -> Type *) +class gui :: Type (* The type of an object to render *) + -> {Unit} (* The HTML context to render it for (minus [body]) *) + -> Type (* How to add components to the gui class. *) -val mkGui : t ::: Type -> xcomponent:::Type -> (t -> xcomponent) -> gui t xcomponent +val mkGui : t ::: Type -> ctx ::: {Unit} -> ([body ~ ctx] => t -> xml (body ++ ctx) [] []) -> gui t ctx -(* Xml itself can be a gui component. *) -val gui_xbody : gui xbody xbody +(* XML itself can be a gui component. *) +val gui_xbody : gui xbody [] +val gui_xtable : gui xtable [Table] (* Currently the only thing a gui component can do is be * pretty printed to a piece of xml. *) -val toXml : t ::: Type -> xcomponent ::: Type -> gui t xcomponent -> t -> xcomponent - - - +val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []