Sorry for being unclear.  Your point that it should be unnecessary to name
unimportant things is a valid one.  Can you share the specifics of
scenarios where you have 3-tuples and larger where it doesn't make sense to
give names to each part?  Elm's design is based on finding clean solutions
to real-world problems, so more examples of that are valuable to inform
Elm's future development.

You also mentioned that you ran into this when using 3rd-party packages.
Can you point out some of the packages where you've needed to use functions
that returned 3-tuples and larger where you only cared about one of the
values in the tuple?



On Tue, Dec 27, 2016 at 10:55 AM, Mike MacDonald <[email protected]>
wrote:

> I can't think of a use case where defining an intermediary type wouldn't
> solve the immediate issue; philosophically I dislike naming things which
> are unimportant.
>
> On Tuesday, December 27, 2016 at 1:08:03 PM UTC-5, Aaron VonderHaar wrote:
>>
>> One reason `first` and `second` are only defined for 2-tuples is that
>> it's usually a better choice to use records if you have more than a couple
>> fields.
>>
>> If defining a record type alias and giving names to you're fields doesn't
>> work for your situation, can you give more details about why?
>>
>> On Dec 27, 2016 7:09 AM, "Mike MacDonald" <[email protected]> wrote:
>>
>>> On a somewhat regular basis, I end up needing to extract a single field
>>> from a tuple provided from a third-party function. At the moment, I have to
>>> write a boilerplate function just to pattern match it out. If I need the
>>> second field of tuple of a different size, I need to write more boilerplate.
>>>
>>> Seeing as record filed names cannot start with digits, and the language
>>> only allows up to Tuple9, it would be nice to have `.0` through `.8` as
>>> accessors to the tuple. This is symmetric with record field access
>>> "methods", and seems like a moderate ergonomic gain.
>>>
>>> Thoughts?
>>>
>>> --
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to