make a distinction between Hash.state and Hash.t (and private type is bad here)

This commit is contained in:
Simon Cruanes 2014-06-23 23:44:53 +02:00
parent b56cdfa17a
commit 6872591708
2 changed files with 11 additions and 6 deletions

View file

@ -25,8 +25,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(** {1 Hash combinators} *)
type t = int64
type 'a hash_fun = 'a -> t -> t
type t = int
type state = int64
type 'a hash_fun = 'a -> state -> state
let _r = 47
let _m = 0xc6a4a7935bd1e995L

View file

@ -31,16 +31,20 @@ Combination of hashes based on the Murmur Hash (64 bits). See
(** {2 Definitions} *)
type t = private int64
type t = int
(** A hash value is a positive integer *)
type 'a hash_fun = 'a -> t -> t
type state = int64
(** State required by the hash function *)
type 'a hash_fun = 'a -> state -> state
(** Hash function for values of type ['a], merging a fingerprint of the
value into the state of type [t] *)
val init : t
val init : state
(** Initial value *)
val finish : t -> int
val finish : state -> int
(** Extract a usable hash value *)
val apply : 'a hash_fun -> 'a -> int