package tablecloth-base

  1. Overview
  2. Docs

Construct a Map which can be keyed by any data type using the polymorphic compare function.

type identity
type nonrec ('key, 'value) t = ('key, 'value, identity) t
val empty : unit -> ('key, 'value) t

A map with nothing in it.

val singleton : key:'key -> value:'value -> ('key, 'value) t

Create a map from a key and value.

Examples

Map.Poly.singleton ~key:false ~value:1 |> Map.to_list = [(false, 1)]
val from_array : ('key * 'value) array -> ('key, 'value) t

Create a map from an Array of key-value tuples.

val from_list : ('key * 'value) list -> ('key, 'value) t

Create a map from a List of key-value tuples.

OCaml

Innovation. Community. Security.