To me, this is like adding an option to any? Let's imagine: any?(enum,
on_empty: true).

You'd say, man, how can you special-case the enum like that, the predicate
is about finding some element! If there is no element, then, the result
should be false. If you need contextual logic about the emptiness of the
collection, write it next to the predicate.

Same for all?(enum, on_empty: false). How can all? return false for an
empty collection? It does not make sense! If there are no elements, all?
should be true! It is the same argument argued above for any? It's equally
off for me.

In my view, if you need logic about the emptiness, you write it apart, do
not mix it.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAM%3DYcdi_Hb2%2BwDWgLuC_Dqe7XwgaiuBVzC%2BSXC07wkuGJwy9ZQ%40mail.gmail.com.

Reply via email to