diff gui.ur @ 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.ur	Fri Sep 23 13:30:01 2011 +0200
+++ b/gui.ur	Sat Sep 24 15:47:00 2011 -0400
@@ -1,16 +1,8 @@
-class gui = fn t :: Type => fn xcomponent :: Type => t -> xcomponent
+class gui = fn (t :: Type) (ctx :: {Unit}) => [body ~ ctx] => t -> xml (body ++ ctx) [] []
 
-fun gui_xbody (x:xbody) : xbody = x
-fun gui_xtable (x:xtable) : xtable = x
+fun gui_xbody [body ~ []] x = x
+fun gui_xtable [body ~ _] x = x
 
-fun mkGui [t ::: Type] [xcomponent:::Type] (toXml : t -> xcomponent) = toXml 
+fun mkGui [t ::: Type] [ctx ::: {Unit}] (toXml : [body ~ ctx] => t -> xml (body ++ ctx) [] []) = @toXml
 
-fun toXml [t:::Type] [xcomponent ::: Type] (xmlize: gui t xcomponent) = xmlize 
-
-(* class gui t = t -> xbody *)
-
-(* fun toXml [t ::: Type] (xmlize : gui t) = xmlize *)
-
-(* fun gui_xbody x = x *)
-
-(* fun mkGui [t ::: Type] (toXml : t -> xbody) = toXml *)
+fun toXml [t ::: Type] [ctx ::: {Unit}] [body ~ ctx] (toXml : gui t ctx) = toXml