adamc@56: type int adamc@56: type float adamc@56: type string adamc@91: adamc@119: type unit = {} adamc@119: adamc@91: adamc@139: con tag :: {Type} -> {Unit} -> {Unit} -> {Type} -> {Type} -> Type adamc@91: adamc@91: adamc@139: con xml :: {Unit} -> {Type} -> {Type} -> Type adamc@139: val cdata : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> string -> xml ctx use bind adamc@104: val tag : attrsGiven ::: {Type} -> attrsAbsent ::: {Type} -> attrsGiven ~ attrsAbsent adamc@139: -> ctxOuter ::: {Unit} -> ctxInner ::: {Unit} adamc@139: -> useOuter ::: {Type} -> useInner ::: {Type} -> useOuter ~ useInner adamc@139: -> bindOuter ::: {Type} -> bindInner ::: {Type} -> bindOuter ~ bindInner adamc@104: -> $attrsGiven adamc@139: -> tag (attrsGiven ++ attrsAbsent) ctxOuter ctxInner useOuter bindOuter adamc@139: -> xml ctxInner useInner bindInner adamc@139: -> xml ctxOuter (useOuter ++ useInner) (bindOuter ++ bindInner) adamc@140: val join : ctx ::: {Unit} adamc@139: -> use1 ::: {Type} -> bind1 ::: {Type} -> bind2 ::: {Type} adamc@139: -> use1 ~ bind1 -> bind1 ~ bind2 adamc@140: -> xml ctx use1 bind1 adamc@140: -> xml ctx (use1 ++ bind1) bind2 adamc@140: -> xml ctx use1 (bind1 ++ bind2) adamc@91: adamc@91: adamc@110: con xhtml = xml [Html] adamc@139: con page = xhtml [] [] adamc@110: adamc@140: con html = [Html] adamc@140: con head = [Head] adamc@140: con body = [Body] adamc@140: con form = [Body, Form] adamc@93: adamc@140: val head : unit -> tag [] html head [] [] adamc@140: val title : unit -> tag [] head [] [] [] adamc@110: adamc@140: val body : unit -> tag [] html body [] [] adamc@140: con bodyTag = fn attrs :: {Type} => ctx ::: {Unit} -> [Body] ~ ctx -> unit adamc@140: -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] adamc@119: adamc@140: val p : bodyTag [] adamc@140: val b : bodyTag [] adamc@140: val i : bodyTag [] adamc@140: val font : bodyTag [Size = int, Face = string] adamc@140: adamc@140: val h1 : bodyTag [] adamc@140: val li : bodyTag [] adamc@140: adamc@140: val a : bodyTag [Link = page] adamc@140: adamc@140: val form : unit -> tag [] [Body] [Form] [] []