I see. I am not questioning usage of sortBy, my point was to provide an
alternative solution to what the post's author suggested because I thought
that direct implementation with List.map and then sort may be not suitable
in some cases.

Great that there is a better way but @Rudolf was asking for an example of
using sortWith as well.

суббота, 10 сентября 2016 г. пользователь Joey Eremondi написал:

> @Sergey Right, but the List.sortBy examples just sort based on the
> toUppercased version, but don't put the toUppercase results in the final
> list.
>
> sortBy is different than using List.map
>
> On Sat, Sep 10, 2016 at 1:00 PM, Sergey Zubtsovskiy <
> sergey.zubtsovs...@gmail.com> wrote:
>
>> Well, I meant that elements from original list will stay intact. If you
>> are first applying List.map toUppercase and then sort, resulting list will
>> contain uppercased letters which may be undesirable.
>>
>> In my solution resulting list will contain same elements as the original
>> one sorted in case-insensitive manner.
>>
>> I see this difference as significant and necessary.
>>
>> суббота, 10 сентября 2016 г. пользователь Max Goldstein написал:
>>
>>> not changing original list
>>>
>>>
>>> An an immutable language such as Elm, nothing can change the original
>>> list! I think you've more-or-less implemented List.sortBy explicitly, which
>>> is instructive, but not really necessary.
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Elm Discuss" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/elm-discuss/IwSIlRUoNFw/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> elm-discuss+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Sergey Zubtsovskiy
>> sergey.zubtsovs...@gmail.com
>> Skype: szubtsovskiy
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elm-discuss+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Elm Discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/elm-discuss/IwSIlRUoNFw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sergey Zubtsovskiy
sergey.zubtsovs...@gmail.com
Skype: szubtsovskiy

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to