package earley

  1. Overview
  2. Docs

This modules implements a computation of a fixpoints for valus that depends upon other values. Cycles are handled through update of references. If the fixpoint is not reached, this might loop.

This modules ressemble a little the Lazy module.

type 'a t
val from_val : 'a -> 'a t

Standard way to construct a value of type 'a t

val from_fun : 'a t -> ('a -> 'b) -> 'b t
val from_fun2 : 'a t -> 'b t -> ('a -> 'b -> 'c) -> 'c t
val from_funl : 'a t list -> 'b -> ('b -> 'a -> 'b) -> 'b t
val from_ref : 'b -> ('b -> 'a t) -> 'a t

value obtained by reading 'b which is mutable

val update : 'a t -> unit

Must be called when updating a mutable field used in from_ref

val force : 'a t -> 'a

Reading the value

OCaml

Innovation. Community. Security.