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
.
type _ t
=
| Arity1 : ('a ‑> Core_kernel__.Import.unit) t |
| Arity2 : ('a ‑> 'b ‑> Core_kernel__.Import.unit) t |
| Arity3 : ('a ‑> 'b ‑> 'c ‑> Core_kernel__.Import.unit) t |
| Arity4 : ('a ‑> 'b ‑> 'c ‑> 'd ‑> Core_kernel__.Import.unit) t |
include sig ... end
val sexp_of_t : ('v_x__001_ ‑> Sexplib.Sexp.t) ‑> 'v_x__001_ t ‑> Sexplib.Sexp.t