package record_builder

  1. Overview
  2. Docs

A set of right-nested tuples and associated types used to represent the fields of a record while rebuilding it.

type 'elements t = 'elements
type nil = unit
type ('head, 'tail) cons = 'head * 'tail
type 'elements nonempty = 'elements constraint 'elements = ('x, 'xs) cons
val empty : nil t
val cons : 'a -> 'tail t -> ('a, 'tail) cons t
val head : ('a, _) cons t -> 'a
val tail : (_, 'tail) cons t -> 'tail
module Suffix_index : sig ... end
val drop : 'elements_before t -> ('elements_before, 'elements_after) Suffix_index.t -> 'elements_after t

Drop some prefix of an Hlist to get a suffix of it.

O(n) allocation and work.

module Element_index : sig ... end
val nth : 'elements t -> ('elements, 'element) Element_index.t -> 'element

Get the element at some index of an hlist.

O(n) work, no allocation.