package fix

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Glue.PersistentMapsToImperativeMapsSource

An implementation of persistent maps can be made to satisfy the interface of imperative maps. An imperative map is represented as a persistent map, wrapped within a reference cell.

Parameters

module M : sig ... end

Signature

Sourcetype key = M.key

The type of keys.

Sourcetype 'data t = 'data M.t ref

The type of association maps.

Sourceval create : unit -> 'data t

create() creates a fresh empty map.

Sourceval add : key -> 'data -> 'data t -> unit

add inserts a new entry or replaces an existing entry. The map is updated in place.

Sourceval find : key -> 'data t -> 'data

find raises Not_found if the key is not in the domain of the map.

Sourceval clear : 'data t -> unit

clear empties a map.

Sourceval iter : (key -> 'data -> unit) -> 'data t -> unit

iter iterates over all entries.