Thanks for the reply!

Let me comment on your list of merits and then some last remarks:


> 1. Guarantees of linear-time index access
>

Already provided by Enum.


> 2. Enforcing explicit handling of countable collections
>

Yes, that would be great.


> 3. Consistent failure modes around negative index access of interminable
> sequences
>

This would be great as well.


> 4. Slimming down Enum and Enumerable a little
>

Could be a positive or negative change. Having another module to lookup for
functions, beyond Enum and List, can actually cause more confusion than
help.


> 5. Adding a possible avenue to introducing an Access-style formalism for
> non-atom (ie integer index) values
>

As mentioned in my previous e-mail, this one is provided with accessors
functions. Remember this functionality needs to be polymorphic on the
function instead of the data type, if we want to support things such as
strings and binaries on the same data type.

In order for us to do such a large change, we need to have very clear
benefits across the board. That's why I would rather extend the Enumerable
protocol, without changing the Enum API, then do things like segregating
the API which is a risky change. We could debate for weeks if splitting
Enum apart is beneficial - and that's exactly the point - at this point, if
we are unclear on such a large change, it is probably not the way to go.

It also worth expressing the sentiments of the Elixir team in that v2.0
will not have breaking changes besides the removal of what has been
previously deprecated on 1.x. I don't think this affect this proposal but
it is worth making it explicit.

Generally speaking, enumerable gives very few guarantees:

1. no guarantees of termination
2. no guarantees of ordering
3. no guarantees of constant-access

I think we could improve the termination one in many cases though. If you
feel it is worth discussing, maybe we could start a topic around that -
first by identifying the functions that need to terminate - such as the
access and aggregation ones - and then coming up with a possible extension
of Enumerable.

-- 
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/CAGnRm4%2B_-7wdfi8UgCGM%3D6%2BCuH3XtE47Zd3zyRiB_-NGHRP5zQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to