New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Format.{pp_print_opt, pp_print_list, pp_print_text} #6009
Comments
Comment author: @gasche That's mildly unrelated, but have you considered using Pprint ( http://gallium.inria.fr/~fpottier/pprint/ ) instead of the Format module? You may appreciate the simplicity and smaller codebase. |
Comment author: @dbuenzli Thanks for the pointer but the problem is that I'm writing OCaml libraries. I always provide pretty printers for values of the type they define so that users can quickly perform printf debugging or use in the toplevel. There would be no point in having a dependency on the library you mention however good it may be. |
Comment author: @gasche Good point. |
Comment author: meyer I support having need of such an extended interface. I needed to write again and again given functions. Eventually I turned this into mini module and copied across the project. At least pp_print_list is useful, and pp_print_text is something I didn't think of, but it looks also very useful. |
Comment author: @gasche I just uploaded an equivalent patch that applies as-is against the current trunk. I'm wary of optional parameters in the API (especially since Format does not use any so far), but didn't find a better way to express pp_print_list -- and omitted pp_print_opt for now because I'm not satisfied with the interface. |
These functions have all been merged into the stdlib. |
Original bug ID: 6009
Reporter: @dbuenzli
Status: acknowledged (set by @gasche on 2013-05-07T14:45:15Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.00.1
Category: standard library
Tags: patch
Monitored by: meyer @hcarty
Bug description
Ok, this time I got too tired of copy pasting that code.
First an option pretty printer.
Then a list pretty printer.
Then a string printer that hints newlines and spaces with Format's functions.
File attachments
The text was updated successfully, but these errors were encountered: