comparison 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
comparison
equal deleted inserted replaced
19:3a303df9ae92 20:554e342665fe
1 class gui = fn t :: Type => fn xcomponent :: Type => t -> xcomponent 1 class gui = fn (t :: Type) (ctx :: {Unit}) => [body ~ ctx] => t -> xml (body ++ ctx) [] []
2 2
3 fun gui_xbody (x:xbody) : xbody = x 3 fun gui_xbody [body ~ []] x = x
4 fun gui_xtable (x:xtable) : xtable = x 4 fun gui_xtable [body ~ _] x = x
5 5
6 fun mkGui [t ::: Type] [xcomponent:::Type] (toXml : t -> xcomponent) = toXml 6 fun mkGui [t ::: Type] [ctx ::: {Unit}] (toXml : [body ~ ctx] => t -> xml (body ++ ctx) [] []) = @toXml
7 7
8 fun toXml [t:::Type] [xcomponent ::: Type] (xmlize: gui t xcomponent) = xmlize 8 fun toXml [t ::: Type] [ctx ::: {Unit}] [body ~ ctx] (toXml : gui t ctx) = toXml
9
10 (* class gui t = t -> xbody *)
11
12 (* fun toXml [t ::: Type] (xmlize : gui t) = xmlize *)
13
14 (* fun gui_xbody x = x *)
15
16 (* fun mkGui [t ::: Type] (toXml : t -> xbody) = toXml *)