Skip to content

v6.1.0

Choose a tag to compare

@brunoga brunoga released this 05 Sep 13:01
· 76 commits to main since this release
f673a12

Added

  • Type families: custom behaviour for every type matching a predicate,
    where RegisterCustomEqual and friends are custom behaviour for one
    concrete type. deep.RegisterTypeFamily takes a Match predicate and a
    family of handlers — Equal, Clone, Diff, Apply, and a value codec — and any
    type the predicate accepts is handled by them, however many such types
    exist.

    The distinction matters for types produced by another runtime. A protobuf
    application holds hundreds of generated message types; registering each one
    is not a usable interface, and every one needs the same treatment. A family
    is also all-or-nothing about its boundary: once a value is matched, nothing
    generic looks inside it — an operation whose path crosses into a matched
    value is handed to the family's own applier with the remainder of the path,
    and the family's codec carries its values on the wire in their own form.

    This is the extension point the deep/proto companion module builds on; it
    is proto-agnostic and serves any foreign type family with its own runtime.