HashFunction[A: A]
A pluggable hash function.
interface val HashFunction[A: A]
Constructors
create
Data structures create instances internally. Use a primitive if possible.
new val create() : HashFunction[A] val^
Returns
- HashFunction[A] val^
Public Functions
hash
Calculate the hash of some type. This is an alias of the type parameter to allow data structures to hash things without consuming them.
fun box hash( x: box->A!) : USize val
Parameters
- x: box->A!
Returns
- USize val
eq
Determine equality between two keys with the same hash. This is done with viewpoint adapted aliases to allow data structures to determine equality in a box fun without consuming keys.
fun box eq( x: box->A!, y: box->A!) : Bool val
Parameters
- x: box->A!
- y: box->A!
Returns
- Bool val
© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/collections-HashFunction