Right.

I meant to return a single element, the "earliest" one. Otherwise I would 
find using a superlative for the function name confusing.

The Decimal library could be another example. It provides a 
Decimal.compare/2 and a more semantic Decimal.min/2 and Decimal.max/2.

On Friday, October 11, 2019 at 9:01:32 AM UTC+2, Tyson Buzza wrote:
>
> The earliest function as proposed by Jose above is more like the sort_by 
> function than the min function. It returns a sorted list.
>
> On Friday, October 11, 2019 at 2:40:47 PM UTC+8, Fernando Tapia Rico wrote:
>>
>> I would drop the `mapper` function, and have a similar interface to 
>> `Enum.min/2`: `DateTime.earliest(list_of_dates, empty_fallback // fn -> 
>> raise(...) end)`.
>
>

-- 
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/bce11106-9f29-457e-b63f-e6eef0633d74%40googlegroups.com.

Reply via email to