Sha256: 09cfc586e90141670a81cd315a5e98204c87e2f28be51ada0f9ae13b79cdcc69
Contents?: true
Size: 416 Bytes
Versions: 310
Compression:
Stored size: 416 Bytes
Contents
-module(example). -export([accumulate/2, test_version/0]). %% %% given a fun and a list, apply fun to each list item replacing list item with fun's return value. %% -spec accumulate(fun((A) -> B), list(A)) -> list(B). accumulate(Fn, List) -> accumulate(List, Fn, []). accumulate([H|T], Fn, Out) -> accumulate(T, Fn, [Fn(H) | Out]); accumulate([], _Fn, Out) -> lists:reverse(Out). test_version() -> 1.
Version data entries
310 entries across 310 versions & 1 rubygems