diff lib/basis.lig @ 141:63c699450281

Initial form support
author Adam Chlipala <adamc@hcoop.net>
date Sun, 20 Jul 2008 11:33:23 -0400
parents f214c535d253
children 6f9e224692ec
line wrap: on
line diff
--- a/lib/basis.lig	Sun Jul 20 10:40:25 2008 -0400
+++ b/lib/basis.lig	Sun Jul 20 11:33:23 2008 -0400
@@ -9,7 +9,7 @@
 
 
 con xml :: {Unit} -> {Type} -> {Type} -> Type
-val cdata : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> string -> xml ctx use bind
+val cdata : ctx ::: {Unit} -> use ::: {Type} -> string -> xml ctx use []
 val tag : attrsGiven ::: {Type} -> attrsAbsent ::: {Type} -> attrsGiven ~ attrsAbsent
         -> ctxOuter ::: {Unit} -> ctxInner ::: {Unit}
         -> useOuter ::: {Type} -> useInner ::: {Type} -> useOuter ~ useInner
@@ -32,7 +32,7 @@
 con html = [Html]
 con head = [Head]
 con body = [Body]
-con form = [Body, Form]
+con lform = [Body, LForm]
 
 val head : unit -> tag [] html head [] []
 val title : unit -> tag [] head [] [] []
@@ -40,6 +40,10 @@
 val body : unit -> tag [] html body [] []
 con bodyTag = fn attrs :: {Type} => ctx ::: {Unit} -> [Body] ~ ctx -> unit
         -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] []
+con bodyTagStandalone = fn attrs :: {Type} => ctx ::: {Unit} -> [Body] ~ ctx -> unit
+        -> tag attrs ([Body] ++ ctx) [] [] []
+
+val br : bodyTagStandalone []
 
 val p : bodyTag []
 val b : bodyTag []
@@ -51,4 +55,11 @@
 
 val a : bodyTag [Link = page]
 
-val form : unit -> tag [] [Body] [Form] [] []
+val lform : ctx ::: {Unit} -> [Body] ~ ctx -> bind ::: {Type}
+        -> xml lform [] bind
+        -> xml ([Body] ++ ctx) [] []
+con lformTag = fn ty :: Type => fn attrs :: {Type} =>
+        ctx ::: {Unit} -> [LForm] ~ ctx
+        -> nm :: Name -> unit
+        -> tag attrs ([LForm] ++ ctx) [] [] [nm = ty]
+val textbox : lformTag string []