forked from purescript/purescript-effect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEffect.lua
More file actions
49 lines (49 loc) · 805 Bytes
/
Effect.lua
File metadata and controls
49 lines (49 loc) · 805 Bytes
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
return {
pureE = (function(a)
return function()
return a
end
end),
bindE = (function(a)
return function(f)
return function()
return f(a())()
end
end
end),
untilE = (function(f)
return function()
while not f() do
end
end
end),
whileE = (function(f)
return function(a)
return function()
while f() do
a()
end
end
end
end),
forE = (function(lo)
return function(hi)
return function(f)
return function()
for i = lo, hi do
f(i)()
end
end
end
end
end),
foreachE = (function(as)
return function(f)
return function()
for i, v in ipairs(as) do
f(v)()
end
end
end
end)
}