Skip to content

Instantly share code, notes, and snippets.

@toranb
Created October 14, 2018 17:39
Show Gist options
  • Save toranb/f620aae9796dfb7a6c3f75b32f5975c5 to your computer and use it in GitHub Desktop.
Save toranb/f620aae9796dfb7a6c3f75b32f5975c5 to your computer and use it in GitHub Desktop.
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