Join Nostr
2025-02-22 19:09:33 UTC

๐–‹๐–‘๐–”๐–—๐–Ž๐–“ ๐Ÿ‡จ๐Ÿ‡ฆ on Nostr: No. I completely understand, and you should choose whichever approach makes the most ...

No. I completely understand, and you should choose whichever approach makes the most sense to you. Personally, I prefer composing and passing functions rather than โ€œrenamingโ€ built-in onesโ€”especially when working in a team or on a shared codebase. If I ever have trouble remembering what a specific Enum.filter does, Iโ€™ll simply define a function like this:

def reject(item), do: โ€ฆ
Enum.filter(items, &reject/1)

And Iโ€™d use the same strategy for functions like select and others.

(Of course there is Enum.reject/2, but used a โ€œrejectโ€ fun here, for brevity)