From d6c56dd83a9fc7905002aae423ab1cb40e33dabe Mon Sep 17 00:00:00 2001 From: Akinori Abe Date: Mon, 9 Aug 2021 21:46:51 +0900 Subject: [PATCH] :+1: add binary_bytes driver --- src/ppx/ppx_deriving_binary.ml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ppx/ppx_deriving_binary.ml b/src/ppx/ppx_deriving_binary.ml index b4441b4..9b2a830 100644 --- a/src/ppx/ppx_deriving_binary.ml +++ b/src/ppx/ppx_deriving_binary.ml @@ -39,3 +39,14 @@ let () = ~type_decl_str:(Encoder.type_decl_str ~deriver) ~type_decl_sig:Encoder.type_decl_sig ()) + +let () = + let deriver = "binary_bytes" in + register (create "binary_bytes" + ~type_decl_str:(fun ~options ~path type_decls -> + Encoder.type_decl_str ~deriver ~options ~path type_decls + @ Decoder.type_decl_str ~deriver ~options ~path type_decls) + ~type_decl_sig:(fun ~options ~path type_decls -> + Encoder.type_decl_sig ~options ~path type_decls + @ Decoder.type_decl_sig ~options ~path type_decls) + ())