package mnet

  1. Overview
  2. Docs
An implementation of TCP (Transmission Control Protocol) in OCaml for Miou & Solo5

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mnet-0.0.9.tbz
sha256=f406db87adc00e711817f83ce3c89b8dee14edac36aa3e90446800f37173efdc
sha512=446650dad4ecc587b3b1c76a035f9aebb4884494352cf704a6660f87e3073931034547f7d30709c63a9d2930ced3d10ac1a12b4745abb06c1164d7c749d3b513

doc/mnet.fragments/Fragments/Make/argument-1-Key/index.html

Parameter Make.Key

type t

The type of the hashtable keys.

val equal : t -> t -> bool

The equality predicate used to compare keys.

val hash : t -> int

A hashing function on keys. It must be such that if two keys are equal according to equal, then they have identical hash values as computed by hash.

The hash value of a key should remain constant as long as the key is in the table. In particular, if the hash function depends on mutable key data, then that data must not be mutated while the key is in the table. Similarly, as the hash function may be called while the table itself is being modified, it should avoid accessing the table as part of its computation.

Examples: suitable (equal, hash) pairs for arbitrary key types include

  • ((=), hash) for comparing objects by structure (provided objects do not contain floats)
  • ((fun x y -> compare x y = 0), hash) for comparing objects by structure and handling Stdlib.nan correctly
  • ((==), hash) for comparing objects by physical equality (e.g. for mutable or cyclic objects).