+1 for this

On Wednesday, August 28, 2013 at 5:49:33 PM UTC+1, Steve Downey wrote:
>
> This is probably my Ruby experience/bias exposing itself but:
>
> - removing nil elements from a collection is a common pattern
> - Enum.compact(list) is more intention-revealing than Enum.reject(list, 
> &(nil?(&1)))
>
>
> On Monday, August 26, 2013 3:40:33 PM UTC-7, Patrick Van Stee wrote:
>>
>> Would implementing an `Enum.compact/1` be useful to anyone? It would 
>> basically just be the same as calling `Enum.reject` with `&nil?/1`.
>>
>> Here's an example:
>>
>> iex> Enum.compact([1, nil, 3, nil, 5])  
>> [1, 3, 5]
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/05c77c88-8b5b-4496-aa18-50fdd0601776%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to