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/Expert/index.html

Module Bonsai.ExpertSource

Sourceval thunk : (unit -> 'a) -> 'a Computation.t

thunk will execute its argument exactly once per instantiation of the computation.

Sourceval assoc_on : ('io_key, 'io_cmp) comparator -> ('model_key, 'model_cmp) comparator -> ('io_key, 'data, 'io_cmp) Core.Map.t Value.t -> get_model_key:('io_key -> 'data -> 'model_key) -> f:('io_key Value.t -> 'data Value.t -> 'result Computation.t) -> ('io_key, 'result, 'io_cmp) Core.Map.t Computation.t

assoc_on is similar to assoc, but allows the model to be keyed differently than the input map. This comes with a few caveats:

  • Inputs whose keys map to the same model_key will share the same model.
  • The result of get_model_key is used in a bind, so it is expensive when it changes.

assoc should almost always be used instead. Consider whether you really need the additional power before reaching for this function.