Personally, I don't like having both `every?` and `all?`, I think it would be ambiguous. And I think the use-case does not justify this ambiguity.
On Thu, Jan 21, 2021, 09:47 Randson <orand...@gmail.com> wrote: > Xavier > > Yes. I got a case where the Enum.all?/2 doesn't work so I need to do what > Anil told. > > I put a name every because I want to ask if every member on the list > satisfy such a condition. That is false if there is at least one member > which does not satisfy the condition, otherwise it is false. An empty list > in this case should be false. > > On Thursday, January 21, 2021 at 4:10:52 AM UTC-3 Xavier Noria wrote: > >> These functions return what they should. It's standard mathematical logic. >> >> Enum.all? is a universal quantifier, asking if all members of a >> collection satisfy such condition. That is false if there is at least one >> member which does not satisfy the condition, otherwise it is true. In >> particular, it is true on an empty collection. "All elements of an empty >> set are prime" is a true statement in mathematics. >> >> Enum.every? should be an alias to all?, they are similar concepts, should >> behave the same as a predicate. >> >> You really need your own function "collection is not empty and all?". >> > -- > 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 elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/2eda6173-b59b-46fc-baf2-829b4284445fn%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/2eda6173-b59b-46fc-baf2-829b4284445fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2BztWQVoRPTgwyKaRrav1s%2BFAM0JH2DJeP2XmioHFZftEQ%40mail.gmail.com.