Module Belt.Id
Belt.Id
Provide utilities to create identified comparators or hashes for data structures used below.
It create a unique identifier per module of functions so that different data structures with slightly different comparison functions won't mix
type ('a, 'id) hash = 'a -> inttype ('a, 'id) eq = 'a -> 'a -> booltype ('a, 'id) cmp = 'a -> 'a -> intval getHashInternal : ('a, 'id) hash -> 'a -> intval getEqInternal : ('a, 'id) eq -> 'a -> 'a -> boolval getCmpInternal : ('a, 'id) cmp -> 'a -> 'a -> intval comparableU :
cmp:('key -> 'key -> int) ->
(module Comparable
with type t = 'key)val comparable :
cmp:('key -> 'key -> int) ->
(module Comparable
with type t = 'key)type ('key, 'id) hashable =
(module Hashable
with type identity = 'id
and type t = 'key)val hashableU :
hash:('key -> int) ->
eq:('key -> 'key -> bool) ->
(module Hashable
with type t = 'key)val hashable :
hash:('key -> int) ->
eq:('key -> 'key -> bool) ->
(module Hashable
with type t = 'key)