package dolmen

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

Module Expr.SubstSource

Module to handle substitutions

Sourcetype ('a, 'b) t

The type of substitutions from values of type 'a to values of type 'b.

Sourceval empty : ('a, 'b) t

The empty substitution

Sourceval is_empty : ('a, 'b) t -> bool

Test wether a substitution is empty

Sourceval iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit

Iterates over the bindings of the substitution.

Sourceval map : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t

Maps the given function over bound values

Sourceval fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c

Fold over the elements

Sourceval merge : ('a -> 'b option -> 'c option -> 'd option) -> ('a, 'b) t -> ('a, 'c) t -> ('a, 'd) t

Merge two substitutions

Sourceval filter : ('a -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t

Filter bindings base on a predicate.

Sourceval bindings : ('a, 'b) t -> ('a * 'b) list

Returns the list of bindings ofa substitution.

Sourceval exists : ('a -> 'b -> bool) -> ('a, 'b) t -> bool

Tests wether the predicate holds for at least one binding.

Sourceval for_all : ('a -> 'b -> bool) -> ('a, 'b) t -> bool

Tests wether the predicate holds for all bindings.

Sourceval hash : ('b -> int) -> ('a, 'b) t -> int
Sourceval compare : ('b -> 'b -> int) -> ('a, 'b) t -> ('a, 'b) t -> int
Sourceval equal : ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool

Comparison and hash functions, with a comparison/hash function on values as parameter

Sourceval print : (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) t -> unit

Prints the substitution, using the given functions to print keys and values.

Sourceval debug : (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) t -> unit

Prints the substitution, using the given functions to print keys and values, includign some debug info.

Sourceval choose : ('a, 'b) t -> 'a * 'b

Return one binding of the given substitution, or raise Not_found if the substitution is empty.

Sourcemodule type S = sig ... end
Sourcemodule Var : S with type 'a key = 'a id
OCaml

Innovation. Community. Security.