Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Catamorphism/Erlang/catamorphism.erl
Normal file
16
Task/Catamorphism/Erlang/catamorphism.erl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-module(catamorphism).
|
||||
|
||||
-export([test/0]).
|
||||
|
||||
test() ->
|
||||
Nums = lists:seq(1,10),
|
||||
Summation =
|
||||
lists:foldl(fun(X, Acc) -> X + Acc end, 0, Nums),
|
||||
Product =
|
||||
lists:foldl(fun(X, Acc) -> X * Acc end, 1, Nums),
|
||||
Concatenation =
|
||||
lists:foldr(
|
||||
fun(X, Acc) -> integer_to_list(X) ++ Acc end,
|
||||
"",
|
||||
Nums),
|
||||
{Summation, Product, Concatenation}.
|
||||
Loading…
Add table
Add a link
Reference in a new issue