[swift-evolution] [Review] SE-0065 A New Model for Collections and Indices

Howard Lovatt howard.lovatt at gmail.com
Sat Apr 16 17:17:10 CDT 2016


+1 for Scala's path dependent types.

On Saturday, 16 April 2016, Thorsten Seitz via swift-evolution <
swift-evolution at swift.org> wrote:

>
> > Am 15.04.2016 um 23:19 schrieb Dmitri Gribenko via swift-evolution <
> swift-evolution at swift.org <javascript:;>>:
> >
> > On Fri, Apr 15, 2016 at 1:30 PM, Stephan Tolksdorf <st at quanttec.com
> <javascript:;>> wrote:
> >> On 2016-04-12 Dmitri Gribenko via swift-evolution wrote:
> >>>
> >>> Not even to mention that
> >>> indices are valid only in context of a particular collection instance,
> >>> so in this model you could validate an index against one collection
> >>> and use it with another one.
> >>
> >>
> >> The proposal requires Index values to be Comparable. Does that mean that
> >> indices from different collection instances should be comparable i.e.
> have a
> >> strict total order?
> >
> > No, comparing indices from unrelated instances produces unspecified
> > results (incl. traps).
>
> Path dependent types as used in Scala would allow making this distinction
> type safe (see http://docs.scala-lang.org/tutorials/tour/inner-classes or
> http://danielwestheide.com/blog/2013/02/13/the-neophytes-guide-to-scala-part-13-path-dependent-types.html)
> by allowing the index type to be rooted at the instance.
>
> Are there any plans to adding path dependent types to Swift?
>
> -Thorsten
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <javascript:;>
> https://lists.swift.org/mailman/listinfo/swift-evolution
>


-- 
-- Howard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160417/fff1461a/attachment.html>


More information about the swift-evolution mailing list