Created
July 4, 2013 23:24
-
-
Save guipdutra/5930803 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
defmodule Mylist do | |
def filter([], func, f_array), do: f_array | |
def filter([head|tail], func, f_array // []) do | |
if func.(head) do | |
filter(tail, func, List.concat(f_array , [head])) | |
else | |
filter(tail, func, List.concat(f_array , [])) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment