diff gui.urs @ 23:7c734edc6301

Merge from Adam.
author Karn Kallio <kkallio@eka>
date Sat, 24 Sep 2011 18:55:27 -0430
parents 554e342665fe
children 5905b56e0cd9
line wrap: on
line diff
--- a/gui.urs	Mon Aug 22 05:06:15 2011 -0430
+++ b/gui.urs	Sat Sep 24 18:55:27 2011 -0430
@@ -1,14 +1,17 @@
 (* Gui framework elements common across individual components. *)
 
-class gui
 (* Types of this class describe gui components. *)
+class gui :: Type (* The type of an object to render *)
+      -> {Unit} (* The HTML context to render it for (minus [body]) *)
+      -> Type
 
-val toXml : t ::: Type -> gui t -> t -> xbody
+(* How to add components to the gui class. *)
+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 []
+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 gui_xbody : gui xbody
-(* Xml itself can be a gui component. *)
-
-val mkGui : t ::: Type -> (t -> xbody) -> gui t
-(* How to add components to the gui class. *)
+val toXml : t ::: Type -> ctx ::: {Unit} -> [body ~ ctx] => gui t ctx -> t -> xml (body ++ ctx) [] []