Stable_witness
SourceStable witnesses for primitive types exported by Core.Core_stable
. Code using ppx_stable_witness
is expected to start with open Stable_witness.Export
.
This is useful to provide a stable witness on a type that uses another type for serialization.
This is an escape hatch. Don't use it unless you have to.
There are two use cases for this:
1. It allows you to assert that a type that you're writing has stable serialization functions, even if the type itself depends on unstable types.
2. It allows you to assert that a type from some other module is stable (and generate a stable witness for it) even if the type doesn't provide one for itself. It is almost always better to get the upstream code to provide a stability guarantee. At the very least, consult with the upstream maintainer to make sure their serializations are stable over time, and document the discussion.