package eventually

All checked builds pass
  1. Overview
  2. Docs
Time-bounded computations and stream iteration

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.2.0.tar.gz
md5=2ff603e740d1267316d1dcf3ce4e0c39
sha512=48cf12103dd2f67ffdaf9ab4d061432ccbaf1e36c454f9928c76abde58abb02076fecdb23538a16480c8485e449ad424d2205913483392b99619b3ed1503db38

doc/eventually/Timer/index.html

Module TimerSource

Sourcetype timer

A value of type timer is one of

  • a natural number incr n zero, in which case the timer is called finite,
  • or the value forever, in which case the timer is called infinite.

The interface exposes methods for constructing timers and observing their behavior over finite intervals. By design, it is not possible to observe that a timer is infinite.

Sourceval zero : timer

A finished timer.

Sourceval incr : int -> timer -> timer

Increment the number of ticks left by n, and return the result.

Raises Invalid_argument if n is negative.

Sourceval decr : int -> timer -> (timer, int) result

Decrement the number of ticks left by n. Returns

  • Error m if the timer has m ticks left and m < n,
  • and otherwise Ok t where t is the new timer.

Raises Invalid_argument if n is negative.

Sourceval min : timer -> timer -> timer

Returns the timer with the fewest ticks left.

Sourceval max : timer -> timer -> timer

Returns the timer with the most ticks left.

Sourceval forever : timer

The timer that never finishes.