package timed

  1. Overview
  2. Docs
Timed references for imperative state

Install

Dune Dependency

Authors

Maintainers

Sources

1.1.tar.gz
md5=06106626006450f41f0c4d4fcbcf95d0
sha512=b136d79e6ad1a50c811acadc0ae0be049f2dc0d6fc87d233400d602cdf8c6dab3af87557e8f8d740f6eba4b87b9d5b2fcc7e550d24e4ba8c03237573da5623d5

doc/timed.compat/Timed_compat/Time/index.html

Module Timed_compat.TimeSource

The Time module provides an abstract representation of time, used to set a point from which (monitored) updates to references are recorded to allow undoing/redoing the corresponding changes.

Sourcetype t

Point in the “timeline” of the program's execution.

Sourceval save : unit -> t

save () registers the position of the program in its “timeline”. The returned value can then be used to “time-travel” toward this point, by calling restore. The saving operation runs in constant time. In the process one block of memory of three words is allocated. Note that two consecutive calls to save (i.e., with no interleaved (:=) or restore) return the same value, and the second one does not allocate any memory.

Sourceval restore : t -> unit

restore t has the effect of “traveling in time” towards a previously recorded point t. After calling this function, (monitored) reference updates made between t and the “current time” are undone. Note that the time and memory complexity of this function is proportional to the number of (monitored) updates between t and the current time.

OCaml

Innovation. Community. Security.