Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Catamorphism/Nim/catamorphism.nim
Normal file
19
Task/Catamorphism/Nim/catamorphism.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import sequtils
|
||||
|
||||
block:
|
||||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldl(numbers, a + b)
|
||||
substraction = foldl(numbers, a - b)
|
||||
multiplication = foldl(numbers, a * b)
|
||||
words = @["nim", "is", "cool"]
|
||||
concatenation = foldl(words, a & b)
|
||||
|
||||
block:
|
||||
let
|
||||
numbers = @[5, 9, 11]
|
||||
addition = foldr(numbers, a + b)
|
||||
substraction = foldr(numbers, a - b)
|
||||
multiplication = foldr(numbers, a * b)
|
||||
words = @["nim", "is", "cool"]
|
||||
concatenation = foldr(words, a & b)
|
||||
Loading…
Add table
Add a link
Reference in a new issue