Use Format for pretty-printing instead of Fmt#140
Use Format for pretty-printing instead of Fmt#140keleshev wants to merge 1 commit intoandreas:masterfrom keleshev:rm-fmt
Conversation
|
Looks good, thanks! 👍 I'm happy to merge this when 0.9.0 is merged in OPAM -- just in case there are any last minute changes required before then. |
|
what is the advantage hereof? I honestly find the Fmt combinators much easier to read than Format (also, the diff +100 -84 shows that there is actually more code involved). |
|
@hannesm the advantage is dubious, honestly. Readability is subjective. I find the The +100 -84 diff is mostly due to more liberal line breaks: (* Before *)
Fmt.fmt "%a %s%a%a %a" fmt pp_optype op.optype name variables op.variable_definitions directives op.directives selection_set op.selection_set
(* After *)
fprintf ppf "%s %s%a%a %a"
(optype_to_string op.optype)
name
pp_variables op.variable_definitions
pp_directives op.directives
pp_selection_set op.selection_setI find that let list = Format.pp_print_list |
|
I don't mind much either way. I hope this can be motivating for further contributions though, so I'm happy to indulge 😄 |
This is probably a bit random, but I replaced
Fmtwith the standardFormatmodule. One less dependency, plus if you likeprintfyou might find this more readable.I hope to get onto something more useful (like block strings) soon