Module Incremental__.Node
module Packed : sig ... endFor performance reasons, we do not use an OCaml existential type for
Node.Packed.t:
include module type of sig ... end with module Packed := Incremental__.Types.Node.Packed
type 'a t= 'a Incremental__Types.Node.t={id : Incremental__.Node_id.t;mutable recomputed_at : Incremental__.Stabilization_num.t;mutable value_opt : 'a Incremental__.Import.Uopt.t;mutable kind : 'a Incremental__Types.Kind.t;mutable cutoff : 'a Incremental__.Cutoff.t;mutable changed_at : Incremental__.Stabilization_num.t;mutable num_on_update_handlers : int;mutable num_parents : int;mutable parent1_and_beyond : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t array;mutable parent0 : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t;mutable created_in : Incremental__Types.Scope.t;mutable next_node_in_same_scope : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t;mutable height : int;mutable height_in_recompute_heap : int;mutable prev_in_recompute_heap : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t;mutable next_in_recompute_heap : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t;mutable height_in_adjust_heights_heap : int;mutable next_in_adjust_heights_heap : Incremental__Types.Node.Packed.t Incremental__.Import.Uopt.t;mutable old_value_opt : 'a Incremental__.Import.Uopt.t;mutable observers : 'a Incremental__Types.Internal_observer.t Incremental__.Import.Uopt.t;mutable is_in_handle_after_stabilization : bool;mutable on_update_handlers : 'a Incremental__.On_update_handler.t list;mutable my_parent_index_in_child_at_index : int array;mutable my_child_index_in_parent_at_index : int array;mutable force_necessary : bool;mutable user_info : Core_kernel.Info.t option;creation_backtrace : Core_kernel.Backtrace.t option;}
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
module Packed = Incremental__Types.Node.Packedval is_valid : 'a t -> boolval is_necessary : 'a t -> boolval type_equal_if_phys_same : 'a t -> 'b t -> ('a, 'b) Core_kernel.Type_equal.t option
include Core_kernel.Invariant.S1 with type 'a t := 'a t
val invariant : 'a Base__.Invariant_intf.inv -> 'a t Base__.Invariant_intf.inv
val create : Incremental__.Scope.t -> 'a Incremental__.Kind.t -> 'a tval set_kind : 'a t -> 'a Incremental__.Kind.t -> unitOne should only set the kind of a node using
set_kind-- usingt.kind <-will violate invariants.
val same : _ t -> _ t -> boolval iteri_children : _ t -> f:(int -> Packed.t -> unit) -> unititeri_children t ~fappliesfto all children oft.
val get_parent : _ t -> index:int -> Packed.tget_parent t ~indexraises unless0 <= index < t.num_parents.
val add_parent : child:'a t -> parent:'b t -> child_index:int -> unitval remove_parent : child:'a t -> parent:'b t -> child_index:int -> unitval swap_children_except_in_kind : _ t -> child1:_ t -> child_index1:int -> child2:_ t -> child_index2:int -> unitval is_const : _ t -> boolval is_in_recompute_heap : _ t -> boolval is_necessary : _ t -> boolis_necessary tifftis a descendant of an observer ortis aFreezenode.
val is_valid : _ t -> boolis_valid treturnstrueiff the left-hand-side oft's defining bind hasn't changed sincetwas created.
val should_be_invalidated : _ t -> boolshould_be_invalidated treturnstrueiffthas an invalid child that implies thattshould be invalid. It doesn't take into accountt.created_in.
val edge_is_stale : child:_ t -> parent:_ t -> booledge_is_stalereturnstrueiffchildhas changed sinceparentwas computed, and impliesis_stale parent.edge_is_staleis constant-time.
val is_stale : _ t -> boolis_stale tis true ifthas never been computed or if some child changed sincetwas last computed.is_staledoesn't take into accountt.created_in.
val needs_to_be_computed : _ t -> boolneeds_to_be_computedisis_necessary t && is_stale t
val value_exn : 'a t -> 'aGetting the value of a node.
value_exn traises iffUopt.is_none t.value_opt.unsafe_value tis safe iffUopt.is_some t.value_opt.
val unsafe_value : 'a t -> 'aval get_cutoff : 'a t -> 'a Incremental__.Cutoff.tval set_cutoff : 'a t -> 'a Incremental__.Cutoff.t -> unitval on_update : 'a t -> 'a Incremental__.On_update_handler.t -> uniton_update t on_update_handleradds an on-update handler tot.
val run_on_update_handlers : 'a t -> 'a Incremental__.On_update_handler.Node_update.t -> now:Incremental__.Stabilization_num.t -> unitrun_on_update_handlers t node_update ~nowrunst's on-update handlers, except those created at the stabilizationnow.
val keep_node_creation_backtrace : bool Core_kernel.refval user_info : _ t -> Core_kernel.Info.t optionval set_user_info : _ t -> Core_kernel.Info.t option -> unitval has_child : _ t -> child:_ t -> boolThese functions are meant for debug, as they are not very efficient.