diff lib/basis.lig @ 104:b1e5398a7f30

Initial HTML attributes support
author Adam Chlipala <adamc@hcoop.net>
date Thu, 10 Jul 2008 15:04:32 -0400
parents 94afff1ff7f6
children da760c34f5ed
line wrap: on
line diff
--- a/lib/basis.lig	Thu Jul 10 14:14:23 2008 -0400
+++ b/lib/basis.lig	Thu Jul 10 15:04:32 2008 -0400
@@ -3,13 +3,15 @@
 type string
 
 
-con tag :: {Unit} -> {Unit} -> Type
+con tag :: {Type} -> {Unit} -> {Unit} -> Type
 
 
 con xml :: {Unit} -> Type
 val cdata : ctx ::: {Unit} -> string -> xml ctx
-val tag : outer ::: {Unit} -> inner ::: {Unit}
-        -> tag outer inner
+val tag : attrsGiven ::: {Type} -> attrsAbsent ::: {Type} -> attrsGiven ~ attrsAbsent
+        -> outer ::: {Unit} -> inner ::: {Unit}
+        -> $attrsGiven
+        -> tag (attrsGiven ++ attrsAbsent) outer inner
         -> xml inner
         -> xml outer
 val join : shared :: {Unit}
@@ -18,10 +20,11 @@
         -> xml (shared ++ ctx1) -> xml (shared ++ ctx2) -> xml shared
 
 
-val head : tag [Html] [Head]
-val title : tag [Head] []
+val head : tag [] [Html] [Head]
+val title : tag [] [Head] []
 
-val body : tag [Html] [Body]
-val p : tag [Body] [Body]
-val b : tag [Body] [Body]
-val i : tag [Body] [Body]
+val body : tag [] [Html] [Body]
+val p : tag [] [Body] [Body]
+val b : tag [] [Body] [Body]
+val i : tag [] [Body] [Body]
+val font : tag [Size = int, Face = string] [Body] [Body]