Skip to content

Commit 7fe7f05

Browse files
authored
feat: map/reduce (#1010)
Signed-off-by: Louis Mandel <[email protected]>
1 parent 1fbfde6 commit 7fe7f05

File tree

17 files changed

+2270
-580
lines changed

17 files changed

+2270
-580
lines changed

examples/map-reduce/python-reduce.pdl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
defs:
2+
plus:
3+
lang: python
4+
code: |
5+
import operator
6+
result = operator.add
7+
for:
8+
i: [1,2,3,4]
9+
map:
10+
${i}
11+
join:
12+
as: reduce
13+
reduce: ${ plus }

examples/map-reduce/reduce.pdl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
defs:
2+
plus:
3+
function:
4+
x: number
5+
y: number
6+
return:
7+
${ x + y }
8+
for:
9+
i: [1,2,3,4]
10+
map:
11+
${i}
12+
join:
13+
reduce: ${ plus }

0 commit comments

Comments
 (0)