Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
8
Task/Catamorphism/Racket/catamorphism.rkt
Normal file
8
Task/Catamorphism/Racket/catamorphism.rkt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#lang racket
|
||||
(define (fold f xs init)
|
||||
(if (empty? xs)
|
||||
init
|
||||
(f (first xs)
|
||||
(fold f (rest xs) init))))
|
||||
|
||||
(fold + '(1 2 3) 0) ; the result is 6
|
||||
Loading…
Add table
Add a link
Reference in a new issue