Re: [elixir-core:8945] Re: [Proposal] identity function

2019-07-18 Thread Louis Pilfold
Hi Alexey

In this mailing list and in the Elixir community in general we want to
create a friendly and welcoming environment. Please refrain from calling
people's opinions "insane" and try to be respectful of others.

For more information please read the Elixir code of conduct
https://github.com/elixir-lang/elixir/blob/master/CODE_OF_CONDUCT.md

Thanks,
Louis


On Thu, 18 Jul 2019, 13:26 Alexey Nikitin,  wrote:

> What's wrong with you? What planet are you from? Any functional language
> has this function. These are basic concepts of mathematics and functional
> programming. What a "slippery slope"? It's insane. This function just must
> to be here, that's all. The standard library has `fn x -> x end`
> everywhere. So if you didn't know, this thing has a name!
>
> воскресенье, 14 июля 2019 г., 18:34:36 UTC+3 пользователь Chris Keathley
> написал:
>>
>> I understand that the desire from the core team isn't to add this. I'm OK
>> with that decision despite feeling like it would be a good addition That's
>> fine.
>>
>> But I do take issue with this "slippery slope" argument that adding
>> `identity` to Elixir would somehow open the door to numerous other
>> functions being added to Elixir. Which is silly. Because we aren't talking
>> about adding some untold number of functions to Elixir. We're talking about
>> `identity`. If the core team had decided that `identity` was worth having
>> in the language would we still not add it because later someone could add
>> the `snausages` function? No. Of course not. That's a nonsensical argument.
>> Improvements to the language should be considered on their own terms.
>>
>> On Sat, Jul 13, 2019 at 12:26 AM Sven Gehring  wrote:
>>
>>> I definitely agree that it's better to import it from an additional
>>> module if need be.
>>>
>>> If we ignore the Metaprogramming parts, Elixir has a very easy Syntax
>>> and the &(&1) notation is one of the only non-intuitive things to learn.
>>> Compared to other languages, there are virtually no 'weird' syntax elements
>>> you have to 'just remember' when you start out, so I am actually in favor
>>> of teaching people this shorthand instead of hiding it from them. (It's
>>> really not THAT complicated)
>>>
>>> Also, as José said, you can always use "fn x -> x end", which is about
>>> the same length as "/1" and also obvious in what it does.
>>>
>>> I don't think expanding the Kernel just for the sake of adopting
>>> concepts of similar ecosystems is worth it.
>>>
>>> Sven
>>>
>>> On Fri, Jul 12, 2019, 23:10 Rich Morin  wrote:
>>>
 > On Jul 12, 2019, at 13:43, José Valim 
 wrote:
 >
 > Filtering nils may be considered bad practice (i.e. why do you have
 nils there?)

 I use them, on occasion, to support a "maybe" type.

 > ... it may be more readable to do with Enum.reject(_nil/1).

 Cool!  I just replaced four instances of `Enum.filter(&(&1))` with
 `Enum.reject(_nil/1)`.
 FWIW, I'd love to see an annotated collection of suggested Elixir
 idioms such as this one.

 -r

 --
 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-l...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/elixir-lang-core/C4BDFC3F-1646-4957-B814-0204D3B147A6%40gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> 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-l...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/elixir-lang-core/CAFuVuxzkdQbPZaPHRWA6w13LE1jFZm-sgoxK8ToOkTag2_9AbA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Chris
>>
> --
> 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/aa6ad3d9-abc6-4afb-b153-26491d3cc6b4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 

Re: [elixir-core:8945] Re: [Proposal] identity function

2019-07-18 Thread Alexey Nikitin
What's wrong with you? What planet are you from? Any functional language 
has this function. These are basic concepts of mathematics and functional 
programming. What a "slippery slope"? It's insane. This function just must 
to be here, that's all. The standard library has `fn x -> x end` 
everywhere. So if you didn't know, this thing has a name!

воскресенье, 14 июля 2019 г., 18:34:36 UTC+3 пользователь Chris Keathley 
написал:
>
> I understand that the desire from the core team isn't to add this. I'm OK 
> with that decision despite feeling like it would be a good addition That's 
> fine.
>
> But I do take issue with this "slippery slope" argument that adding 
> `identity` to Elixir would somehow open the door to numerous other 
> functions being added to Elixir. Which is silly. Because we aren't talking 
> about adding some untold number of functions to Elixir. We're talking about 
> `identity`. If the core team had decided that `identity` was worth having 
> in the language would we still not add it because later someone could add 
> the `snausages` function? No. Of course not. That's a nonsensical argument. 
> Improvements to the language should be considered on their own terms.
>
> On Sat, Jul 13, 2019 at 12:26 AM Sven Gehring  > wrote:
>
>> I definitely agree that it's better to import it from an additional 
>> module if need be.
>>
>> If we ignore the Metaprogramming parts, Elixir has a very easy Syntax and 
>> the &(&1) notation is one of the only non-intuitive things to learn. 
>> Compared to other languages, there are virtually no 'weird' syntax elements 
>> you have to 'just remember' when you start out, so I am actually in favor 
>> of teaching people this shorthand instead of hiding it from them. (It's 
>> really not THAT complicated)
>>
>> Also, as José said, you can always use "fn x -> x end", which is about 
>> the same length as "/1" and also obvious in what it does.
>>
>> I don't think expanding the Kernel just for the sake of adopting concepts 
>> of similar ecosystems is worth it. 
>>
>> Sven
>>
>> On Fri, Jul 12, 2019, 23:10 Rich Morin > 
>> wrote:
>>
>>> > On Jul 12, 2019, at 13:43, José Valim >> > wrote:
>>> > 
>>> > Filtering nils may be considered bad practice (i.e. why do you have 
>>> nils there?)
>>>
>>> I use them, on occasion, to support a "maybe" type.
>>>
>>> > ... it may be more readable to do with Enum.reject(_nil/1).
>>>
>>> Cool!  I just replaced four instances of `Enum.filter(&(&1))` with 
>>> `Enum.reject(_nil/1)`.
>>> FWIW, I'd love to see an annotated collection of suggested Elixir idioms 
>>> such as this one.
>>>
>>> -r
>>>
>>> -- 
>>> 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-l...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elixir-lang-core/C4BDFC3F-1646-4957-B814-0204D3B147A6%40gmail.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> 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-l...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/CAFuVuxzkdQbPZaPHRWA6w13LE1jFZm-sgoxK8ToOkTag2_9AbA%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Chris
>

-- 
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/aa6ad3d9-abc6-4afb-b153-26491d3cc6b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.