[swift-evolution] [Draft] Hasher & HashVisitable

David Sweeris davesweeris at mac.com
Tue Mar 14 14:01:42 CDT 2017


> On Mar 13, 2017, at 8:38 AM, Vincent Esche via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hi there,
> 
> I've written up a proposal for an overhaul/replacement of the Hashable protocol and would love to hear your feedback on it!
> 
> Rendered <https://gist.github.com/regexident/1b8e84974da2243e5199e760508d2d25> | Blog Post <https://blog.definiteloops.com/ha-r-sh-visitors-8c0c3686a46f>
Are we committed to having `hashValue` always be an `Int`, or could it be an associated type like  `(Int, Int, Int, Int)`? Seems like especially for something like a BigNum type or an Array, there might simple not be a reasonably efficient way to uniquely-ish represent 1024 bits with just 64 bits.

(This kinda feels like one of those questions where the answer starts out with a variation on “you’re missing the point”)

- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170314/91e4295e/attachment.html>


More information about the swift-evolution mailing list