Currently it is necessary to do `|> &elem(&1, 1)` or `|> &elem(&1, 2)` when 
trying to get a specific element of a tuple in a pipeline or normally.

F#[0], Haskell[1], Ocaml[2] and other functional languages have the `fst` 
and `snd` functions, which simply extract the first and second elements of 
a tuple, respectively.

I think it would make some code samples simpler, since it reads much 
better, I guess it's the same idea as using `|> hd()` rather than doing `|> 
fn [h | _] -> h end`.

Does this makes sense for Elixir? If so, I'm willing to implement it.

[0]: 
https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/tuples#obtaining-individual-values
[1]: https://hackage.haskell.org/package/base-4.18.0.0/docs/Prelude.html#g:3
[2]: https://v2.ocaml.org/api/Stdlib.html

-- 
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/8c965a60-d8a5-4384-aeb4-182a86c085bbn%40googlegroups.com.

Reply via email to