The API docs for Core_kernel.Sequence
say:
This module extends Base.Sequence with bin_io.
I’m trying to figure out how to use bin_prot
to serialise Sequence
sequences. So far nothing I’ve tried has had success. Is it possible to do this at this point without writing a chunk of bin_prot
support code for Sequence
? Here are some of the things I’ve tried:
# module C = Core_kernel;;
...
# #require "ppx_bin_prot";;
# open Bin_prot.Std;;
# open Bin_prot.Common;;
# type t = int C.Sequence.t;;
...
# C.Sequence.bin_size_t;;
Error: Unbound value C.Sequence.bin_size_t
# type t = int C.Sequence.t [@@deriving bin_io];;
Error: Unbound value C.Sequence.bin_shape_t
The only reference I can see to bin_io
in the source files sequence.ml
and sequence.mli
in the core_kernel
repo is for the submodule Core_kernel.Sequence.Merge_with_duplicates_element
, which has [@@deriving bin_io]
after its type definition. bin_prot
functions do indeed get defined for this module, but I don’t understand how this module would help me serialize sequences, and none of the experiments I’ve tried with it have provided insight.
I don’t think that Merge_with_duplicates_element
is by itself supposed to let me use Sequence
with bin_prot
. None of my experiments with it got anywhere.