package ppx_stable_witness

  1. Overview
  2. Docs
Ppx extension for deriving a witness that a type is intended to be stable. In this context, stable means that the serialization format will never change. This allows programs running at different versions of the code to safely communicate.

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=052db5d52ccacaab30ead1a4192ad021ee00c235a73c09b7918acabcee4a0cda

doc/src/ppx_stable_witness.stable_witness/stable_witness.ml.html

Source file stable_witness.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
include Stable_witness_intf

(* The runtime representation of stable witnesses does not matter. *)
type _ t = unit

module Export = struct
  let stable_witness_array () = ()
  let stable_witness_bool = ()
  let stable_witness_bytes = ()
  let stable_witness_char = ()
  let stable_witness_exn = ()
  let stable_witness_float = ()
  let stable_witness_int = ()
  let stable_witness_int32 = ()
  let stable_witness_int64 = ()
  let stable_witness_lazy_t () = ()
  let stable_witness_list () = ()
  let stable_witness_nativeint = ()
  let stable_witness_option () = ()
  let stable_witness_ref () = ()
  let stable_witness_string = ()
  let stable_witness_unit = ()
end

let of_serializable () _ _ = ()

module Of_serializable1 (_ : T1) (_ : T1) = struct
  let of_serializable _ _ _ () = ()
end

module Of_serializable2 (_ : T2) (_ : T2) = struct
  let of_serializable _ _ _ () () = ()
end

module Of_serializable3 (_ : T3) (_ : T3) = struct
  let of_serializable _ _ _ _ () () = ()
end

let assert_stable = ()
OCaml

Innovation. Community. Security.