summaryrefslogtreecommitdiff
path: root/lib/basis.lig
blob: 86b01992cea83693f3ab66263a83f0435a035b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
type int
type float
type string

type unit = {}


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 tag : attrsGiven ::: {Type} -> attrsAbsent ::: {Type} -> attrsGiven ~ attrsAbsent
        -> ctxOuter ::: {Unit} -> ctxInner ::: {Unit}
        -> useOuter ::: {Type} -> useInner ::: {Type} -> useOuter ~ useInner
        -> bindOuter ::: {Type} -> bindInner ::: {Type} -> bindOuter ~ bindInner
        -> $attrsGiven
        -> tag (attrsGiven ++ attrsAbsent) ctxOuter ctxInner useOuter bindOuter
        -> xml ctxInner useInner bindInner
        -> xml ctxOuter (useOuter ++ useInner) (bindOuter ++ bindInner)
val join : sharedCtx :: {Unit}
        -> ctx1 ::: {Unit} -> ctx1 ~ sharedCtx
        -> ctx2 ::: {Unit} -> ctx2 ~ sharedCtx
        -> use1 ::: {Type} -> bind1 ::: {Type} -> bind2 ::: {Type}
        -> use1 ~ bind1 -> bind1 ~ bind2
        -> xml (sharedCtx ++ ctx1) use1 bind1
        -> xml (sharedCtx ++ ctx2) (use1 ++ bind1) bind2
        -> xml sharedCtx use1 (bind1 ++ bind2)


con xhtml = xml [Html]
con page = xhtml [] []

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 font : tag [Size = int, Face = string] [Body] [Body] [] []

val h1 : tag [] [Body] [Body] [] []
val li : tag [] [Body] [Body] [] []

val a : tag [Link = page] [Body] [Body] [] []