   ## find_index
 
   defp do_find_index([h|t], counter, fun) do
-    case fun.(h) do
-      x in [false, nil] -> do_find_index(t, counter + 1, fun)
-      _ -> counter
+    if fun.(h) do
+      counter
+    else
+      do_find_index(t, counter + 1, fun)
     end
   end
 

  end

  defp do_partition({ h, next }, iterator, fun, acc1, acc2) do
    case fun.(h) do
      x in [false, nil] ->
        do_partition(iterator.(next), iterator, fun, acc1, [h|acc2])
      _ ->
        do_partition(iterator.(next), iterator, fun, [h|acc1], acc2)
    end
  end


  end

  defp do_all?({ h, next }, iterator, fun) do
    if fun.(h) do
      do_all?(iterator.(next), iterator, fun)
    else
      false
    end
  end

