Skip to content

Commit

Permalink
pretty printer for ezEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Aug 28, 2024
1 parent 4e6dc91 commit 37113e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/encoding/ezEncoding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,5 @@ let ignore_enc encoding =

let enc_constant enc v =
conv (fun () -> v) (fun v2 -> if v2 = v then () else assert false) enc

let pp ?compact enc fmt x = Format.fprintf fmt "%s" (construct ?compact enc x)
2 changes: 2 additions & 0 deletions src/encoding/ezEncoding.mli
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,5 @@ val result : 'a Json_encoding.encoding -> 'b Json_encoding.encoding ->
val ignore_enc : 'a Json_encoding.encoding -> 'a Json_encoding.encoding

val enc_constant : 'a Json_encoding.encoding -> 'a -> unit Json_encoding.encoding

val pp : ?compact:bool -> 'a Json_encoding.encoding -> Format.formatter -> 'a -> unit

0 comments on commit 37113e8

Please sign in to comment.