package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=c78c4476ee6b856846e2d0941e5965009d5e1b853e564b2b1bee61202f0b1ebb

doc/bonsai/Bonsai/Cont/index.html

Module Bonsai.ContSource

include module type of Cont with module For_proc2 := Cont.For_proc2 and module Conv := Cont.Conv
Sourcemodule type Enum = sig ... end
Sourcemodule type Comparator = sig ... end
Sourcetype ('k, 'cmp) comparator = (module Bonsai__.Module_types.Comparator with type comparator_witness = 'cmp and type t = 'k)
Sourcetype 'a t
Sourcetype graph
include Core.Applicative.S with type 'a t := 'a t
Sourceval (<*>) : ('a -> 'b) t -> 'a t -> 'b t

same as apply

Sourceval (<*) : 'a t -> unit t -> 'a t
Sourceval (*>) : unit t -> 'a t -> 'a t
Sourceval (>>|) : 'a t -> ('a -> 'b) -> 'b t
Sourceval apply : ('a -> 'b) t -> 'a t -> 'b t
Sourceval all : 'a t list -> 'a list t
Sourceval all_unit : unit t list -> unit t
Sourcemodule Applicative_infix : sig ... end
Sourceval map3 : 'a1 t -> 'a2 t -> 'a3 t -> f:('a1 -> 'a2 -> 'a3 -> 'b) -> 'b t
Sourceval map4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> 'b t
Sourceval map5 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) -> 'b t
Sourceval map6 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'b) -> 'b t
Sourceval 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
Sourceval return : 'a -> 'a t
Sourceval map : 'a t -> f:('a -> 'b) -> 'b t
Sourceval map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
Sourceval both : 'a t -> 'b t -> ('a * 'b) t
Sourceval cutoff : 'a t -> equal:('a -> 'a -> bool) -> 'a t
Sourceval all_map : ('k, graph -> 'v t, 'cmp) Core.Map.t -> graph -> ('k, 'v, 'cmp) Core.Map.t t
Sourceval transpose_opt : 'a t option -> 'a option t

Useful for optional args that take Bonsai.ts. Note: the inverse operation is not possible.

Sourceval state : ?reset:('model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> 'model -> graph -> 'model t * ('model -> unit Ui_effect.t) t
Sourceval state_opt : ?reset:('model option -> 'model option) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> ?default_model:'model -> graph -> 'model option t * ('model option -> unit Ui_effect.t) t
Sourcemodule Apply_action_context : sig ... end
Sourcemodule Computation_status : sig ... end
Sourcemodule Toggle : sig ... end
Sourceval toggle : default_model:bool -> graph -> bool t * unit Ui_effect.t t
Sourceval toggle' : default_model:bool -> graph -> Toggle.t
Sourceval state_machine0 : ?reset:('action Apply_action_context.t -> 'model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?sexp_of_action:('action -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> default_model:'model -> apply_action:('action Apply_action_context.t -> 'model -> 'action -> 'model) -> graph -> 'model t * ('action -> unit Ui_effect.t) t
Sourceval state_machine1 : ?reset:('action Apply_action_context.t -> 'model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?sexp_of_action:('action -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> default_model:'model -> apply_action: ('action Apply_action_context.t -> 'input Computation_status.t -> 'model -> 'action -> 'model) -> 'input t -> graph -> 'model t * ('action -> unit Ui_effect.t) t
Sourceval actor0 : ?reset: (inject:('action -> 'return Ui_effect.t) -> schedule_event:(unit Ui_effect.t -> unit) -> 'model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?sexp_of_action:('action -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> default_model:'model -> recv: (inject:('action -> 'return Ui_effect.t) -> schedule_event:(unit Ui_effect.t -> unit) -> 'model -> 'action -> 'model * 'return) -> graph -> 'model t * ('action -> 'return Ui_effect.t) t
Sourceval actor1 : ?sexp_of_action:('action -> Core.Sexp.t) -> ?reset: (inject:('action -> 'return Ui_effect.t) -> schedule_event:(unit Ui_effect.t -> unit) -> 'model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> default_model:'model -> recv: (inject:('action -> 'return Ui_effect.t) -> schedule_event:(unit Ui_effect.t -> unit) -> 'input Computation_status.t -> 'model -> 'action -> 'model * 'return) -> 'input t -> graph -> 'model t * ('action -> 'return Ui_effect.t) t
Sourceval freeze : ?sexp_of_model:('a -> Core.Sexp.t) -> ?equal:('a -> 'a -> bool) -> 'a t -> graph -> 'a t
Sourceval fix : 'input t -> f: (recurse:('input t -> graph -> 'result t) -> 'input t -> graph -> 'result t) -> graph -> 'result t
Sourceval fix2 : 'a t -> 'b t -> f: (recurse:('a t -> 'b t -> graph -> 'result t) -> 'a t -> 'b t -> graph -> 'result t) -> graph -> 'result t
Sourceval scope_model : ('a, _) comparator -> on:'a t -> for_:(graph -> 'b t) -> graph -> 'b t
Sourceval most_recent_some : ?sexp_of_model:('b -> Core.Sexp.t) -> equal:('b -> 'b -> bool) -> 'a t -> f:('a -> 'b option) -> graph -> 'b option t
Sourceval most_recent_value_satisfying : ?sexp_of_model:('a -> Core.Sexp.t) -> equal:('a -> 'a -> bool) -> 'a t -> condition:('a -> bool) -> graph -> 'a option t
Sourceval previous_value : ?sexp_of_model:('a -> Core.Sexp.t) -> equal:('a -> 'a -> bool) -> 'a t -> graph -> 'a option t
Sourceval wrap : ?reset:('action Apply_action_context.t -> 'model -> 'model) -> ?sexp_of_model:('model -> Core.Sexp.t) -> ?equal:('model -> 'model -> bool) -> default_model:'model -> apply_action: ('action Apply_action_context.t -> 'result -> 'model -> 'action -> 'model) -> f:('model t -> ('action -> unit Ui_effect.t) t -> graph -> 'result t) -> graph -> 'result t
Sourceval enum : (module Enum with type t = 'k) -> match_:'k t -> with_:('k -> graph -> 'a t) -> graph -> 'a t
Sourceval with_model_resetter : f:(graph -> 'a t) -> graph -> 'a t * unit Ui_effect.t t
Sourceval with_model_resetter' : f:(reset:unit Ui_effect.t t -> graph -> 'a t) -> graph -> 'a t

peek maps a Bonsai.t to an Effect.t with the same underlying value. This allows you to inspect the 'a value from inside of a let%bind.Effect chain which might have been changed by previous effects. It is analogous to peek on other abstract data types, including Deferred.ts and Mvar.ts, but more constrained in that you still can only read from within an effect bind.

The 'a Computation_state.t returned by the effect means that if the value was inactive at the time it is peeked, then the effect will be unable to retrieve it.

Sourcemodule Clock : sig ... end
Sourcemodule Edge : sig ... end
Sourcemodule Memo : sig ... end
Sourcemodule Effect_throttling : sig ... end
Sourcemodule Dynamic_scope : sig ... end
Sourcemodule Incr : sig ... end
Sourceval assoc : ('k, 'cmp) comparator -> ('k, 'v, 'cmp) Core.Map.t t -> f:('k t -> 'v t -> graph -> 'a t) -> graph -> ('k, 'a, 'cmp) Core.Map.t t
Sourceval assoc_set : ('key, 'cmp) comparator -> ('key, 'cmp) Core.Set.t t -> f:('key t -> graph -> 'result t) -> graph -> ('key, 'result, 'cmp) Core.Map.t t
Sourceval assoc_list : ('key, _) comparator -> 'a list t -> get_key:('a -> 'key) -> f:('key t -> 'a t -> graph -> 'b t) -> graph -> [ `Duplicate_key of 'key | `Ok of 'b list ] t
Sourcemodule Time_source = Ui_time_source
Sourcemodule Debug : sig ... end
Sourcemodule Path : sig ... end
Sourceval path_id : graph -> string t
Sourceval path : graph -> Path.t t
Sourceval arr1 : graph -> 'a t -> f:('a -> 'b) -> 'b t
Sourceval arr2 : graph -> 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
Sourcemodule Effect = Ui_effect
Sourcemodule Let_syntax : sig ... end
Sourcemodule Map : sig ... end
Sourcemodule Expert : sig ... end