Yeah, I agree with you guys. The words are synonyms and I think we can add an option to all?/2, where default for breaking changes is false and if you really need that empty lists should return false. If specify it on an third argument.
I could prepare a PR this week implementing that. What do you guys think? > On 21 Jan 2021, at 09:57, Jon Rowe <[email protected]> wrote: > > I think this is too confusing compared to `all?`, the words are synonyms but > I agree that having `all?` return `true` for an empty list can create extra > cruft unless you create your own wrapper functions, personally I wouldn’t > mind an option to configure it with a default to true, such as > `Enum.all?(enum, fnx, on_empty: false)` > > Regards > Jon > ---------------- > [email protected] > https://jonrowe.co.uk > > On 21 January 2021 at 12:51, Felipe Stival wrote: >> 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. > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/dejalu-217-153a6b1d-c305-4299-9e78-4e70469e4b0f%40jonrowe.co.uk > > <https://groups.google.com/d/msgid/elixir-lang-core/dejalu-217-153a6b1d-c305-4299-9e78-4e70469e4b0f%40jonrowe.co.uk?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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/BC4ED8BF-B651-4035-8726-7FDDA5580368%40gmail.com.
