Skip to content

Commit

Permalink
Merge pull request #72 from mattjbray/dave/remove-lazy
Browse files Browse the repository at this point in the history
Remove lazy
  • Loading branch information
actionshrimp authored Mar 20, 2024
2 parents 562a5bd + 3dc661d commit e2b8cb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/decoder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ module Infix = struct
end

let fix (f : ('i, 'a) t -> ('i, 'a) t) : ('i, 'a) t =
let rec p = lazy (f r)
and r = { dec = (fun value -> (Lazy.force p).dec value) } in
let rec p () = f r
and r = { dec = (fun value -> (p ()).dec value) } in
r


Expand Down
4 changes: 1 addition & 3 deletions src/encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ module Make (E : Encodeable) : S with type value = E.value = struct

let key_value_pairs' : 'k encoder -> 'v encoder -> ('k * 'v) list encoder =
fun key_encoder value_encoder xs ->
xs
|> List.map (fun (k, v) -> (key_encoder k, value_encoder v))
|> obj'
xs |> List.map (fun (k, v) -> (key_encoder k, value_encoder v)) |> obj'


let obj xs = key_value_pairs' string (fun x -> x) xs
Expand Down

0 comments on commit e2b8cb8

Please sign in to comment.