You are right, there will an error if I just type:
#require "ppx_jane";;
# type person = {name: string}[@@deriving bin_io];;
Error: Unbound value bin_shape_string
In order to make it works ,I have to search bin_prot’s github repo, and find some hints there:
##require "bin_prot";;
# open Bin_prot.Std;;
# type person = {name: string}[@@deriving bin_io];;
Characters 0-47:
Warning 3: deprecated: module Base.Pervasives
[2016-09] this element comes from the stdlib distributed with OCaml.
Refering to the stdlib directly is discouraged by Base. You should either
use the equivalent functionality offered by Base, or if you really want to
refer to the stdlib, use Caml.Pervasives instead
type person = { name : string; }
val bin_shape_person : Bin_prot.Shape.t = <abstr>
val bin_size_person : person -> int = <fun>
val bin_write_person : Bin_prot.Common.buf -> pos:int -> person -> int = <fun>
val bin_writer_person : person Bin_prot.Type_class.writer0 =
{Bin_prot.Type_class.size = <fun>; write = <fun>}
val bin_read_person :
Bin_prot.Common.buf -> pos_ref:Bin_prot.Common.pos_ref -> person = <fun>
val bin_reader_person : person Bin_prot.Type_class.reader0 =
{Bin_prot.Type_class.read = <fun>; vtag_read = <fun>}
val bin_person : person Bin_prot.Type_class.t0 =
{Bin_prot.Type_class.shape = <abstr>;
writer = {Bin_prot.Type_class.size = <fun>; write = <fun>};
reader = {Bin_prot.Type_class.read = <fun>; vtag_read = <fun>}}