diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-20 11:33:23 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-20 11:33:23 -0400 |
commit | 035e55c6c3d7d79a73f98e7d4c6a0e5e760c8cc8 (patch) | |
tree | 2e137813291731c3f2f934f012268b810cb8f766 /lib | |
parent | 0fe71710d474e4c93392ec9d2069ef36464fbfa0 (diff) |
Initial form support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/basis.lig | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/basis.lig b/lib/basis.lig index bdac9ba0..264427a0 100644 --- a/lib/basis.lig +++ b/lib/basis.lig @@ -9,7 +9,7 @@ con tag :: {Type} -> {Unit} -> {Unit} -> {Type} -> {Type} -> Type 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 page = xhtml [] [] 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 title : unit -> tag [] head [] [] [] 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 li : bodyTag [] 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 [] |