[proposal] Enum.take_and_count

50 views
Skip to first unread message

Paulo Henrique

unread,
Mar 12, 2025, 9:33:30 AMMar 12
to elixir-lang-core
On the project of the company I currently work, we have a module helper, EnumHelpers, where we wrap helper functions to work with Enum, and we try to keep it as close as possible to the kernel version implementation. And EnumHelpers.take_and_count/2 is one of this function, where we use the current loop to count how many items were taking, removing the need to call `Enum.count` with the result of a previous `Enum.take` call.
I'd like to propose this as a function from Enum module instead, as maybe some other devs also need to do the same sometimes.
Reply all
Reply to author
Forward
0 new messages