-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjavascript.law
53 lines (43 loc) · 1.07 KB
/
javascript.law
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
47
48
49
50
51
52
53
category JavaScript = {
ob = ObBase
ar = { src: ObBase, tgt: ObBase, fun: String }
src = .src
tgt = .tgt
identity = "identity",
comp = "comp({.f}, {.g})"
}
jsArrows =
{ left: "{",
right: "}",
sep: ","
items: list("{.label labelName}: {.arrow}") }
wrapIntercalate
category JavaScript sums = {
sumInj = labelName show "inj({})"
sumUni = jsArrows "cocone({})"
}
category JavsScript products = {
projProj = labelName show "proj({})"
prodUni = jsArrows "cone({})"
}
category JavaScript closed = {
app = "app",
curry = labelName show "curry({})",
uncurry = labelName show "uncurry({})"
}
category Javascript distributive = labelName show "distr({})"
category Javascript scalars = {
integers = show "mkConst({})",
floats = show "mkConst({})",
strings = show "mkConst({})",
primFns = primFnName show "prim({})"
}
category JavaScript definitional = {
def = "tops[{.name show}] = {.def};"
ref = show "top({})"
}
ar Cat browser : Base --> JavaScript = initital
ar foo : Int --> Int =
incr incr
ar JavaScript : Int --> Int =
brower(foo)