Skip to content

Instantly share code, notes, and snippets.

@camlspotter
Last active October 2, 2015 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camlspotter/a8952a5fdf7298c59b9b to your computer and use it in GitHub Desktop.
Save camlspotter/a8952a5fdf7298c59b9b to your computer and use it in GitHub Desktop.
hov_box vs box
open Format
let rec hovb ppf = function
| 0 -> ()
| n ->
fprintf ppf "(@[<hov>-----------------------------------%03d@," n;
hovb ppf (n-1);
fprintf ppf "@])"
let rec b ppf = function
| 0 -> ()
| n ->
fprintf ppf "(@[<>-----------------------------------%03d@," n;
b ppf (n-1);
fprintf ppf "@]@,)"
let rec hovb' ppf = function
| 0 -> ()
| n ->
fprintf ppf "(@[<hov>-----------------------------------%03d@," n;
hovb' ppf (n-1);
fprintf ppf "@]@,)"
let () =
eprintf "@[%a@]@." hovb 3;
eprintf "@[%a@]@." b 3;
eprintf "@[%a@]@." hovb' 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment