Skip to content

Instantly share code, notes, and snippets.

@cowlike
Last active September 29, 2015 02:17
Show Gist options
  • Save cowlike/1531998 to your computer and use it in GitHub Desktop.
Save cowlike/1531998 to your computer and use it in GitHub Desktop.
foldl with predefined function
-module(fold_test).
-export([do_fold/0]).
do_fold() -> lists:foldl(fun(T,Acc) -> foo(T,Acc) end, [], [1,2,3]).
foo(T, Acc) -> [T | Acc].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment