Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created January 6, 2021 20:15
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 cemerick/cf945721a7cf00054148ee036225b902 to your computer and use it in GitHub Desktop.
Save cemerick/cf945721a7cf00054148ee036225b902 to your computer and use it in GitHub Desktop.
let asprintf_nm x =
let open Format in
let fns = get_formatter_out_functions () in
try
set_formatter_out_functions {fns with out_newline = Fun.const () ; out_indent = Fun.const ()};
asprintf x
with exn ->
set_formatter_out_functions fns;
raise exn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment