Created
October 2, 2009 19:07
-
-
Save anonymous/200009 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module(elementcount). | |
export([elementcount/2]). | |
elementcount(Key, List) -> | |
lists:foldl(fun(X, Acc) -> | |
case X =:= Key of | |
true -> | |
Acc + 1; | |
false -> | |
Acc | |
end | |
end, | |
0, List). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment