Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
leostera committed Jul 3, 2024
1 parent 57ba698 commit 8fab82d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions serde/serde.ml
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ module rec De_base : sig
visit_string : 'state De_base.ctx -> string -> ('value, error) result;
}

val deserializer :
('state De_base.ctx -> ('value, error) result) -> ('value, 'state) t
type 'value de = De : ('value, 'state) t -> 'value de

val deserializer : (('value, 'state) t) -> 'value de

module type Deserializer = sig
type state
Expand Down Expand Up @@ -499,7 +500,9 @@ end = struct
visit_string : 'state De_base.ctx -> string -> ('value, error) result;
}

let deserializer fn = fn
type 'value de = De : ('value, 'state) t -> 'value de

let deserializer fn = De fn

module type Deserializer = sig
type state
Expand Down Expand Up @@ -758,8 +761,5 @@ let serialize :

let deserialize :
type value state output.
state Deserializer.t ->
state ->
(value, state) De.t ->
(value, error) result =
fun fmt ctx de -> de (fmt, ctx)
state Deserializer.t -> state -> value De.de -> (value, error) result =
fun fmt ctx (De de) -> de (Obj.magic fmt, Obj.magic ctx)
2 changes: 1 addition & 1 deletion serde/serde_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ let _serde_bin_roundtrip_tests =
in
deserializer @@ fun ctx ->
record ctx "nested" 1 @@ fun _ctx ->
let* nested = field ctx "nested" (d nested_deserializer) in
let* nested = field ctx "nested" nested_deserializer in
Ok { nested })
{ nested = { nested_flag = false } }
{|({nested={nested_flag=false}})|};
Expand Down

0 comments on commit 8fab82d

Please sign in to comment.