I have assumed that I could use ppx_bin_prot
to generate functions for serializing, into bin_prot
formats, structures containing bin_prot
-defined types. If this is correct, I haven’t been able to figure out what I have to load or open to get it to work:
# #require "ppx_bin_prot";;
# open Bin_prot.Std;;
# type foo = {dims : int array; buf : Bin_prot.Common.buf} [@@deriving bin_io];;
Error: Unbound value Bin_prot.Common.bin_shape_buf
I can get [@@deriving bin_io]
to work for basic OCaml types. int array
doesn’t cause a problem, for example. I’ve tried opening various Bin_prot
submodules before the type definition, but they haven’t helped.
Do I need to define some functions myself in order for deriving
to generate functions for a record type containing Bin_prot.Common.buf
? (Or can I use a different type as the target/source for bin_prot
serialization functions?)