package reason-standard

  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.toList = [(false, 1)]
val ofArray : ('key * 'value) array -> ('key, 'value) t

Create a map from an Array of key-value tuples

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

Create a map from a List of key-value tuples

OCaml

Innovation. Community. Security.