Bend/tests/golden_tests/run_file/fold_with_state.bend

8 lines
158 B
Plaintext

def main:
y = 1
fold x = [0, 0, 0] with y:
case List/Cons:
return List/Cons(x.head + y, x.tail(y + 1))
case List/Nil:
return List/Nil