(* Error: The implementation builder.ml
does not match the interface builder.cmi:
Values do not match:
val enum :
Buffer.t ->
int ->
'a ->
('a -> (int, 'b) Core.Std.Result.Monad_infix.t) ->
(unit, 'b) Core.Std.Result.Monad_infix.t
is not included in
val enum :
t ->
tag ->
'a ->
('a -> (int, error) Core.Std.Result.t) ->
(unit, [> error ]) Core.Std.Result.t
*)
(* val enum : t -> tag -> 'a -> ('a -> (int, error) Result.t) -> (unit, [> error ]) Result.t *)
let enum t tag v conv =
let open Result.Monad_infix in
conv v >>= fun v ->
let f
= to_field tag
(Value
.Varint
(Int64.of_int v
)) in add_field t f
KCogRXJyb3I6IFRoZSBpbXBsZW1lbnRhdGlvbiBidWlsZGVyLm1sCiAgICAgICBkb2VzIG5vdCBtYXRjaCB0aGUgaW50ZXJmYWNlIGJ1aWxkZXIuY21pOgogICAgICAgVmFsdWVzIGRvIG5vdCBtYXRjaDoKICAgICAgICAgdmFsIGVudW0gOgogICAgICAgICAgIEJ1ZmZlci50IC0+CiAgICAgICAgICAgaW50IC0+CiAgICAgICAgICAgJ2EgLT4KICAgICAgICAgICAoJ2EgLT4gKGludCwgJ2IpIENvcmUuU3RkLlJlc3VsdC5Nb25hZF9pbmZpeC50KSAtPgogICAgICAgICAgICh1bml0LCAnYikgQ29yZS5TdGQuUmVzdWx0Lk1vbmFkX2luZml4LnQKICAgICAgIGlzIG5vdCBpbmNsdWRlZCBpbgogICAgICAgICB2YWwgZW51bSA6CiAgICAgICAgICAgdCAtPgogICAgICAgICAgIHRhZyAtPgogICAgICAgICAgICdhIC0+CiAgICAgICAgICAgKCdhIC0+IChpbnQsIGVycm9yKSBDb3JlLlN0ZC5SZXN1bHQudCkgLT4KICAgICAgICAgICAodW5pdCwgWz4gZXJyb3IgXSkgQ29yZS5TdGQuUmVzdWx0LnQKKikKCigqIHZhbCBlbnVtICAgICA6IHQgLT4gdGFnIC0+ICdhIC0+ICgnYSAtPiAoaW50LCBlcnJvcikgUmVzdWx0LnQpIC0+ICh1bml0LCBbPiBlcnJvciBdKSBSZXN1bHQudCAqKQpsZXQgZW51bSB0IHRhZyB2IGNvbnYgPQogIGxldCBvcGVuIFJlc3VsdC5Nb25hZF9pbmZpeCBpbgogIGNvbnYgdiA+Pj0gZnVuIHYgLT4KICBsZXQgZiA9IHRvX2ZpZWxkIHRhZyAoVmFsdWUuVmFyaW50IChJbnQ2NC5vZl9pbnQgdikpIGluCiAgYWRkX2ZpZWxkIHQgZg==