My first implementation of some in elixir
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