| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (*** This module implements an "untyped store", in this particular case we |
| 12 | see it as an extensible record whose fields are left unspecified. ***) |
| 13 | |
| 14 | module type S = |
| 15 | sig |
| 16 | type t |
| 17 | (** Type of stores *) |
| 18 | |
| 19 | type 'a field |
| 20 | (** Type of field of such stores *) |
| 21 | |
| 22 | val field : string -> 'a field |
| 23 | (** Create a new field. See also [Dyn.create]. *) |
| 24 | |
| 25 | val empty : t |
| 26 | (** Empty store *) |
| 27 | |
| 28 | val set : t -> 'a field -> 'a -> t |
| 29 | (** Set a field *) |
| 30 | |
| 31 | val get : t -> 'a field -> 'a option |
| 32 | (** Get the value of a field, if any *) |
| 33 | |
| 34 | val remove : t -> 'a field -> t |
| 35 | (** Unset the value of the field *) |
| 36 | |
| 37 | val merge : t -> t -> t |
| 38 | (** [merge s1 s2] adds all the fields of [s1] into [s2]. *) |
| 39 | end |
| 40 | |
| 41 | module Make() : S |
| 42 | (** Create a new store type. *) |