[swift-evolution] [Discussion] Sortable Attribute

Xiaodi Wu xiaodi.wu at gmail.com
Tue Aug 16 19:22:21 CDT 2016


Perfect. I use the phrase "sort on" often and was thinking of suggesting
that, but I was afraid it was just jargon in my line of work.
On Tue, Aug 16, 2016 at 19:17 Silvan Mosberger <infinisil at icloud.com> wrote:

> I'd be in favor. We'd need another name, since the current closure
> predicate is already standardized to `by:`.
>
>
> Haskell uses "on" for sorting with a mapping. There are both
>
> sortOn :: Ord
> <http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ord> b
> => (a -> b) -> [a] -> [a]
>
> and
>
> sortBy :: (a -> a -> Ordering
> <http://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Ord.html#t:Ordering>)
> -> [a] -> [a]
>
> in Haskell.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160817/b56c7a73/attachment.html>


More information about the swift-evolution mailing list