DEV Community

loading...

Discussion on: Daily Challenge #40 - Counting Sheep

Collapse
oscherler profile image
Olivier “Ölbaum” Scherler

Erlang:

% erl
1> Sheep = fun(N) -> lists:flatmap(fun(X) -> lists:concat([X, " sheep..."]) end, lists:seq(1, N)) end.
#Fun<erl_eval.7.91303403>
2> Sheep(3).
"1 sheep...2 sheep...3 sheep..."