package core_kernel
Industrial strength alternative to OCaml's standard library
Install
Dune Dependency
Authors
Maintainers
Sources
core_kernel-v0.16.0.tar.gz
sha256=e37370bad978cfb71fdaf2b1a25ab1506b98ef0b91e0dbd189ffd9d853245ce2
doc/core_kernel.bus/Bus/Callback_arity/index.html
Module Bus.Callback_arity
Source
Callback_arity
states the type of callbacks stored in a bus. Using Callback_arity
is an implementation technique that allows callbacks to be defined as ordinary n-ary curried functions (e.g., a1 -> a2 -> a3 -> r
), instead of forcing n-ary-variadic callbacks to use tuples (e.g., a1 * a2 * a3 -> r
). This also avoids extra allocation.
When reading the bus interface, keep in mind that each 'callback
is limited, through create
, to the types exposed by the variants in Callback_arity
.
Currently, only a 1-arity callback is provided with @local
annotations in order to avoid an explosion due to the permutations of @local
args. It is also relatively cheap to make the one local arg a record with multiple fields.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>