I’m trying to print ocaml datastructures and use the Fmt module. From the test example (https://github.com/dbuenzli/fmt/blob/master/test/test.ml) I can
some examples on howto use i.e. for numbers but becaue I’m unfamiliar with ocaml I have a hard time to understand howto i.e. printing a list whould be done.
let str u = Format.asprintf "%a" Fmt.Dump.uchar u in
str Uchar.min
so I thought I can try:
let str u = Format.asprintf "%a" Fmt.Dump.list u in
str []
but I get:
Error: This expression has type 'a Fmt.t -> 'a list Fmt.t
but an expression was expected of type Format.formatter -> 'b -> unit
Type 'a Fmt.t = Format.formatter -> 'a -> unit
is not compatible with type Format.formatter
I dont really understand how th Format module and pp_xxx works so: Are there examples for the different datatypes for the Fmt module…