package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

Dune Dependency

Authors

Maintainers

Sources

core_kernel-v0.14.0.tar.gz
sha256=93dc40648c5e4564cb72b72ab031474372f7b169e7ba7090b28e38e1b72282f1
md5=61420bfc94dbed1667be5e2ebd7c8240

doc/core_kernel.bus/Bus/Callback_arity/index.html

Module Bus.Callback_arity

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 =
  1. | Arity1 : ('a -> unit) t
  2. | Arity2 : ('a -> 'b -> unit) t
  3. | Arity3 : ('a -> 'b -> 'c -> unit) t
  4. | Arity4 : ('a -> 'b -> 'c -> 'd -> unit) t
  5. | Arity5 : ('a -> 'b -> 'c -> 'd -> 'e -> unit) t
val sexp_of_t : ('a__001_ -> Ppx_sexp_conv_lib.Sexp.t) -> 'a__001_ t -> Ppx_sexp_conv_lib.Sexp.t
OCaml

Innovation. Community. Security.