Up

Module Make_with_config (C : Incremental_config) () : S

Parameters

Signature

include Incremental_kernel.Incremental_intf.S_abstract_times with module Time := Core.Std.Time
type 'a t
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
type 'a incremental = 'a t
val is_const : 'a t -> bool
val is_valid : 'a t -> bool
val is_necessary : 'a t -> bool
val const : 'a -> 'a t
val return : 'a -> 'a t
val map : 'a t -> f:('a -> 'b) -> 'b t
val (>>|) : 'a t -> ('a -> 'b) -> 'b t
val map2 : 'a1 t -> 'a2 t -> f:('a1 -> 'a2 -> 'b) -> 'b t
val map3 : 'a1 t -> 'a2 t -> 'a3 t -> f:('a1 -> 'a2 -> 'a3 -> 'b) -> 'b t
val map4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> 'b t
val map5 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) -> 'b t
val map6 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'b) -> 'b t
val map7 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'b) -> 'b t
val map8 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> 'a8 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'b) -> 'b t
val map9 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> 'a8 t -> 'a9 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'a8 -> 'a9 -> 'b) -> 'b t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val bind2 : 'a1 t -> 'a2 t -> ('a1 -> 'a2 -> 'b t) -> 'b t
val bind3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 -> 'a2 -> 'a3 -> 'b t) -> 'b t
val bind4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b t) -> 'b t
module Infix : sig .. end
val join : 'a t t -> 'a t
val if_ : bool t -> then_:'a t -> else_:'a t -> 'a t
val freeze : ?when_:('a -> bool) -> 'a t -> 'a t
val depend_on : 'a t -> depend_on:'b t -> 'a t
val necessary_if_alive : 'a t -> 'a t
val for_all : bool t array -> bool t
val exists : bool t array -> bool t
val all : 'a t list -> 'a list t
val array_fold : 'a t array -> init:'b -> f:('b -> 'a -> 'b) -> 'b t
val unordered_array_fold : ?full_compute_every_n_changes:int -> 'a t array -> init:'b -> f:('b -> 'a -> 'b) -> f_inverse:('b -> 'a -> 'b) -> 'b t
val opt_unordered_array_fold : ?full_compute_every_n_changes:int -> 'a option t array -> init:'b -> f:('b -> 'a -> 'b) -> f_inverse:('b -> 'a -> 'b) -> 'b option t
val sum : ?full_compute_every_n_changes:int -> 'a t array -> zero:'a -> add:('a -> 'a -> 'a) -> sub:('a -> 'a -> 'a) -> 'a t
val opt_sum : ?full_compute_every_n_changes:int -> 'a option t array -> zero:'a -> add:('a -> 'a -> 'a) -> sub:('a -> 'a -> 'a) -> 'a option t
val sum_int : int t array -> int t
val sum_float : float t array -> float t
module Time : sig .. end
val now : unit -> Time.t
val watch_now : unit -> Time.t t
val advance_clock : to_:Time.t -> unit
module Before_or_after : sig .. end
val at_intervals : Time.Span.t -> unit t
val step_function : init:'a -> (Time.t * 'a) list -> 'a t
val snapshot : 'a t -> at:Time.t -> before:'a -> 'a t Core_kernel.Std.Or_error.t
module Var : sig .. end
module Observer : sig .. end
val observe : ?should_finalize:bool -> 'a t -> 'a Observer.t
module Update : sig .. end
val on_update : 'a t -> f:('a Update.t -> unit) -> unit
val stabilize : unit -> unit
val am_stabilizing : unit -> bool
module Cutoff : sig .. end
val set_cutoff : 'a t -> 'a Cutoff.t -> unit
val get_cutoff : 'a t -> 'a Cutoff.t
module Scope : sig .. end
val lazy_from_fun : (unit -> 'a) -> 'a Core_kernel.Std.Lazy.t
val default_hash_table_initial_size : int
val memoize_fun : ?initial_size:int -> 'a Core_kernel.Std.Hashtbl.Hashable.t -> ('a -> 'b) -> ('a -> 'b) Core_kernel.Std.Staged.t
val memoize_fun_by_key : ?initial_size:int -> 'key Core_kernel.Std.Hashtbl.Hashable.t -> ('a -> 'key) -> ('a -> 'b) -> ('a -> 'b) Core_kernel.Std.Staged.t
val user_info : 'a t -> Core_kernel.Std.Info.t option
val set_user_info : 'a t -> Core_kernel.Std.Info.t option -> unit
module State : sig .. end
module Packed : sig .. end
val pack : 'a t -> Packed.t
val save_dot : string -> unit
val keep_node_creation_backtrace : bool Core_kernel.Std.ref

The weak versions of the memoization functions use a Weak_hashtbl for the memo table. This keeps a weak pointer to each result, and so the garbage collector automatically removes unused results. Furthermore, stabilize removes the table entries whose result is unused.

val weak_memoize_fun : ?initial_size:int -> 'a Core.Std.Hashtbl.Hashable.t -> ('a -> 'b Core.Std.Heap_block.t) -> ('a -> 'b Core.Std.Heap_block.t) Core.Std.Staged.t
val weak_memoize_fun_by_key : ?initial_size:int -> 'key Core.Std.Hashtbl.Hashable.t -> ('a -> 'key) -> ('a -> 'b Core.Std.Heap_block.t) -> ('a -> 'b Core.Std.Heap_block.t) Core.Std.Staged.t