package containers

  1. Overview
  2. Docs
On This Page
  1. References
A modular, clean and powerful extension of the OCaml standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v2.8.1.tar.gz
md5=d84e09c5d0abc501aa17cd502e31a038
sha512=8b832f4ada6035e80d81be0cfb7bdffb695ec67d465ed6097a144019e2b8a8f909095e78019c3da2d8181cc3cd730cd48f7519e87d3162442562103b7f36aabb

doc/containers/CCRef/index.html

Module CCRefSource

References

  • since 0.9
Sourcetype 'a printer = Format.formatter -> 'a -> unit
Sourcetype 'a ord = 'a -> 'a -> int
Sourcetype 'a eq = 'a -> 'a -> bool
Sourcetype 'a sequence = ('a -> unit) -> unit
Sourcetype 'a t = 'a ref
Sourceval map : ('a -> 'b) -> 'a t -> 'b t

Transform the value.

Sourceval create : 'a -> 'a t

Alias to ref.

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

Call the function on the content of the reference.

Sourceval update : ('a -> 'a) -> 'a t -> unit

Update the reference's content with the given function.

Sourceval incr_then_get : int t -> int

incr_then_get r increments r and returns its new value, think ++r.

  • since 0.17
Sourceval get_then_incr : int t -> int

get_then_incr r increments r and returns its old value, think r++.

  • since 0.17
Sourceval swap : 'a t -> 'a t -> unit

swap t1 t2 puts !t2 in t1 and !t1 in t2.

  • since 1.4
Sourceval compare : 'a ord -> 'a t ord
Sourceval equal : 'a eq -> 'a t eq
Sourceval to_list : 'a t -> 'a list
Sourceval to_seq : 'a t -> 'a sequence
Sourceval pp : 'a printer -> 'a t printer