package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Represents a (_, _, _, _) Computation.t

type t = {
  1. node_path : Bonsai__.Node_path.t Core.Lazy.t;
  2. kind : kind;
  3. here : Core.Source_code_position.t option;
}
and kind =
  1. | Return of {
    1. value : Value.t;
    }
  2. | Leaf01 of {
    1. input : Value.t;
    }
  3. | Leaf1 of {
    1. input : Value.t;
    }
  4. | Leaf0
  5. | Leaf_incr of {
    1. input : Value.t;
    }
  6. | Model_cutoff of {
    1. t : t;
    }
  7. | Sub of {
    1. from : t;
    2. via : Id.t;
    3. into : t;
    }
  8. | Store of {
    1. id : Id.t;
    2. value : Value.t;
    3. inner : t;
    }
  9. | Fetch of {
    1. id : Id.t;
    }
  10. | Assoc of {
    1. map : Value.t;
    2. key_id : Id.t;
    3. cmp_id : Id.t;
    4. data_id : Id.t;
    5. by : t;
    }
  11. | Assoc_on of {
    1. map : Value.t;
    2. io_key_id : int;
    3. model_key_id : int;
    4. model_cmp_id : int;
    5. data_id : int;
    6. by : t;
    }
  12. | Assoc_simpl of {
    1. map : Value.t;
    }
  13. | Switch of {
    1. match_ : Value.t;
    2. arms : t list;
    }
  14. | Lazy of {
    1. t : t option;
    }
  15. | Wrap of {
    1. model_id : Id.t;
    2. inject_id : Id.t;
    3. inner : t;
    }
  16. | With_model_resetter of {
    1. reset_id : Id.t;
    2. inner : t;
    }
  17. | Path
  18. | Lifecycle of {
    1. value : Value.t;
    }
  19. | Identity of {
    1. t : t;
    }
val sexp_of_t : t -> Sexplib0.Sexp.t
val sexp_of_kind : kind -> Sexplib0.Sexp.t
val t_of_sexp : Sexplib0.Sexp.t -> t
val kind_of_sexp : Sexplib0.Sexp.t -> kind
val of_computation : 'result Computation.t -> t
val sanitize_for_testing : t -> t

Uid.t's is different between ocaml and javascript build targets, which makes printing uids on expect tests tricky. You can use sanitize_uids_for_testing to make sure that all uids for a given computation are the same for a compilation target.

val minimal_sexp_of_t : t -> Core.Sexp.t

Computes a sexp that shows the structure of the value, it leaves any node_path's and positions that add an extra level of indentation making it hard to read in tests out.

val inputs : t -> Value.t list

Returns the input values for the computation.

val children : t -> t list

Returns any "children" bonsai computations that the given computation has.

OCaml

Innovation. Community. Security.