annotate gui.ur @ 18:16447dc6a68c

Introduction of multi-parameter type class for gui components
author Ron de Bruijn <rmbruijn@gmail.com>
date Thu, 22 Sep 2011 19:24:01 +0200
parents 90be8b8917d5
children 554e342665fe
rev   line source
rmbruijn@18 1 class gui = fn t :: Type => fn xcomponent :: Type => t -> xcomponent
kkallio@8 2
rmbruijn@18 3 fun gui_xbody (x:xbody) : xbody = x
rmbruijn@18 4 fun gui_xtable (x:xtable) : xtable = x
kkallio@8 5
rmbruijn@18 6 fun mkGui [t ::: Type] [xcomponent:::Type] (toXml : t -> xcomponent) = toXml
kkallio@8 7
rmbruijn@18 8 fun toXml [t:::Type] [xcomponent ::: Type] (xmlize: gui t xcomponent) = xmlize
rmbruijn@18 9
rmbruijn@18 10 (* class gui t = t -> xbody *)
rmbruijn@18 11
rmbruijn@18 12 (* fun toXml [t ::: Type] (xmlize : gui t) = xmlize *)
rmbruijn@18 13
rmbruijn@18 14 (* fun gui_xbody x = x *)
rmbruijn@18 15
rmbruijn@18 16 (* fun mkGui [t ::: Type] (toXml : t -> xbody) = toXml *)