Created
October 14, 2018 17:39
-
-
Save toranb/f620aae9796dfb7a6c3f75b32f5975c5 to your computer and use it in GitHub Desktop.
My first implementation of some in elixir
This file contains 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 MyEnum do | |
def some([], _func), do: [] | |
def some([head | tail], func) do | |
case func.(head) do | |
true -> | |
true | |
false -> | |
case some(tail, func) do | |
true -> | |
true | |
_ -> | |
false | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment