RosettaCodeData/Task/Catamorphism/Rye/catamorphism.rye

9 lines
211 B
Text
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
; 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 }