Module
Data.Hashable
- Package
- purescript-unordered-collections
- Repository
- fehrenbach/purescript-unordered-collections
#Hashable Source
class (Eq a) <= Hashable a where
The Hashable
type class represents types with decidable
equality and a hash function for use in hash-based algorithms and
data structures, not cryptography.
Instances of Hashable
must satisfy the following law:
(a == b) `implies` (hash a == hash b)
Note that while hash = const 0
is a law-abiding implementation,
one would usually prefer more discrimination. Hash-based data
structures and algorithms tend to perform badly in the presence
of excessive numbers of collisions.
Hash values produced by hash
should not be relied upon to be
stable accross multiple executions of a program and should not be
stored externally. While we currently do not do this, we might
want to use a fresh salt for every execution in the future.
Members
Instances
Hashable Boolean
Hashable Int
Hashable Number
Hashable Char
Hashable String
(Hashable a) => Hashable (Array a)
(Hashable a) => Hashable (List a)
(Hashable a, Hashable b) => Hashable (Tuple a b)
(Hashable a) => Hashable (Maybe a)
(Hashable a, Hashable b) => Hashable (Either a b)
Hashable Unit
Hashable Void
(RowToList r l, HashableRecord l r, EqRecord l r) => Hashable (Record r)
#HashableRecord Source
class (EqRecord l r) <= HashableRecord l r | l -> r where
Members
hashRecord :: RLProxy l -> Record r -> Int
Instances
HashableRecord Nil r
(Hashable vt, HashableRecord tl r, IsSymbol l, Cons l vt whatev r) => HashableRecord (Cons l vt tl) r
- Modules
- Data.
HashMap - Data.
HashSet - Data.
Hashable