Module Ocolor_printf Source Printf-friendly functionsThese functions are useful when trying to print with styles with Printf. However, they are a very bad choice. They perform a context-free formatting. For instance, there is no way to end the current style and restore the previous, like stack-base functions of Ocolor_format do. They just print the desired style and keep no track of the current state.
Thus, it's better to use Ocolor_format as much as possible. Moreover, Format provide a nice way of composing printers with %a and Format.asprintf . Even if you don't like boxes, Format.asprintf and semantic tags are cool.
So, here are the Printf-friendly functions. Use with care, and preferably, not at all.
fprintf %a %t sprintf %a Printf-likeJust like printf but perform automatic reset after printing if Ocolor_config.auto_reset is set
include module type of struct include StylingPrettyPrinters end Source val pp_bool_generic : ?false_style :??? -> ?true_style :??? -> bool pp Source val pp_option_generic :
?none :??? ->
?none_style :??? ->
?some_style :??? ->
'a pp ->
'a option pp Source val pp_pair_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
'a pp ->
'b pp ->
('a * 'b ) pp Source val pp_3_tuple_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
'a pp ->
'b pp ->
'c pp ->
('a * 'b * 'c ) pp Source val pp_4_tuple_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
'a pp ->
'b pp ->
'c pp ->
'd pp ->
('a * 'b * 'c * 'd ) pp Source val pp_4_tuple : 'a pp -> 'b pp -> 'c pp -> 'd pp -> ('a * 'b * 'c * 'd ) pp Source val pp_5_tuple_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
'a pp ->
'b pp ->
'c pp ->
'd pp ->
'e pp ->
('a * 'b * 'c * 'd * 'e ) pp Source val pp_5_tuple :
'a pp ->
'b pp ->
'c pp ->
'd pp ->
'e pp ->
('a * 'b * 'c * 'd * 'e ) pp Source val pp_iterable_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
(('a -> unit) -> 'b -> unit) ->
'a pp ->
'b pp Source val pp_iterable : (('a -> unit) -> 'b -> unit) -> 'a pp -> 'b pp Source val pp_list_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
?elem_style :??? ->
'a pp ->
'a list pp Source val pp_iterable_mapping_more_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?delim_style :??? ->
?sep_style :??? ->
(('a -> 'b -> unit) -> 'c -> unit) ->
('a * 'b ) pp ->
'c pp Source val pp_iterable_mapping_generic :
?left :??? ->
?sep :??? ->
?right :??? ->
?mapsto :??? ->
?delim_style :??? ->
?sep_style :??? ->
?mapsto_style :??? ->
?key_style :??? ->
?value_style :??? ->
(('a -> 'b -> unit) -> 'c -> unit) ->
'a pp ->
'b pp ->
'c pp Source val pp_iterable_mapping :
(('a -> 'b -> unit) -> 'c -> unit) ->
'a pp ->
'b pp ->
'c pp