Page
Library
Module
Module type
Parameter
Class
Class type
Source
Ocolor_printfSourceThese 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.
Just like printf but perform automatic reset after printing if Ocolor_config.auto_reset is set
include module type of struct include StylingPrettyPrinters endval pp_bool_generic :
?false_style:Ocolor_types.style list ->
?true_style:Ocolor_types.style list ->
bool ppval pp_option_more_generic :
?none:string ->
?none_style:Ocolor_types.style list ->
?some_style:Ocolor_types.style list ->
?some_format:
(Ocolor_types.style list pp ->
Ocolor_types.style list ->
'a pp ->
'a ->
unit pp ->
unit ->
unit,
out_channel,
unit,
unit,
unit,
unit)
format6 ->
?none_format:
(Ocolor_types.style list pp ->
Ocolor_types.style list ->
string ->
unit pp ->
unit ->
unit,
out_channel,
unit,
unit,
unit,
unit)
format6 ->
'a pp ->
'a option ppval pp_option_generic :
?none:string ->
?none_style:Ocolor_types.style list ->
?some_style:Ocolor_types.style list ->
'a pp ->
'a option ppval pp_result_more_generic :
?ok_style:Ocolor_types.style list ->
?error_style:Ocolor_types.style list ->
?ok_format:
(Ocolor_types.style list pp ->
Ocolor_types.style list ->
'a pp ->
'a ->
unit pp ->
unit ->
unit,
out_channel,
unit,
unit,
unit,
unit)
format6 ->
?error_format:
(Ocolor_types.style list pp ->
Ocolor_types.style list ->
'b pp ->
'b ->
unit pp ->
unit ->
unit,
out_channel,
unit,
unit,
unit,
unit)
format6 ->
'a pp ->
'b pp ->
('a, 'b) result ppval pp_result_generic :
?ok_style:Ocolor_types.style list ->
?error_style:Ocolor_types.style list ->
'a pp ->
'b pp ->
('a, 'b) result ppval pp_pair_generic :
?left:string ->
?sep:string ->
?right:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
'a pp ->
'b pp ->
('a * 'b) ppval pp_3_tuple_generic :
?left:string ->
?sep:string ->
?right:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
'a pp ->
'b pp ->
'c pp ->
('a * 'b * 'c) ppval pp_4_tuple_generic :
?left:string ->
?sep:string ->
?right:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
'a pp ->
'b pp ->
'c pp ->
'd pp ->
('a * 'b * 'c * 'd) ppval pp_5_tuple_generic :
?left:string ->
?sep:string ->
?right:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
'a pp ->
'b pp ->
'c pp ->
'd pp ->
'e pp ->
('a * 'b * 'c * 'd * 'e) ppval pp_iterable_generic :
?left:string ->
?sep:string ->
?right:string ->
?empty:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
?empty_style:Ocolor_types.style list ->
(('a -> unit) -> 'b -> unit) ->
'a pp ->
'b ppval pp_list_generic :
?left:string ->
?sep:string ->
?right:string ->
?empty:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
?empty_style:Ocolor_types.style list ->
'a pp ->
'a list ppval pp_array_generic :
?left:string ->
?sep:string ->
?right:string ->
?empty:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?elem_style:Ocolor_types.style list ->
?empty_style:Ocolor_types.style list ->
'a pp ->
'a array ppval pp_iterable_mapping_more_generic :
?left:string ->
?sep:string ->
?right:string ->
?empty:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?empty_style:Ocolor_types.style list ->
(('a -> 'b -> unit) -> 'c -> unit) ->
('a * 'b) pp ->
'c ppval pp_iterable_mapping_generic :
?left:string ->
?sep:string ->
?right:string ->
?mapsto:string ->
?empty:string ->
?delim_style:Ocolor_types.style list ->
?sep_style:Ocolor_types.style list ->
?mapsto_style:Ocolor_types.style list ->
?key_style:Ocolor_types.style list ->
?value_style:Ocolor_types.style list ->
?empty_style:Ocolor_types.style list ->
(('a -> 'b -> unit) -> 'c -> unit) ->
'a pp ->
'b pp ->
'c pp