RosettaCodeData/Task/Catamorphism/Rye/catamorphism.rye
2026-04-30 12:34:36 -04:00

8 lines
211 B
Text

; use first element as seed
print reduce { 10 5 7 2 } 'acc { + acc }
; provide a seed
print fold\do { } 'acc 1 { * acc }
; use a function instead of word + block
print fold { 1 2 3 } 20 fn { x acc } { + acc }