Commits

Paweł Wieczorek committed 7342ad8

adder sections in a documentation

  • Participants
  • Parent commits 3d4f94b

Comments (0)

Files changed (1)

File src/Prioritized.mli

  *)
 
 
+(** {2 Painter representation} *)
 
 (** painter type *)
 type painter
 (** Returns basic painter from prioritized one. *)
 val get_painter :  painter -> Basic.painter
 
-(** Group list of painters as one painter with given priority. *)
-val psp_group_with_priority : priority -> painter list -> painter
-
-(** Group list of painters as one painter with the [psp_min_priority] priority. *)
-val psp_group: painter list -> painter
-
-val psp_indent_with_priority : priority->  painter -> painter
-
-val psp_indent : painter -> painter
-
-(** Group and indent list of painters as one painter with given priority. *)
-val psp_indent_group_with_priority : priority->  painter list -> painter
-
-(** Group and indent list of painters as one painter with the [psp_min_priority] priority. *)
-val psp_indent_group : painter list -> painter
-
-(** Return painter with different priority. *)
-val psp_reprioritize : priority -> painter -> painter
-
-(**
-    Align priority of obtained painter. 
-
-    {[ psp_correct_priority_after f_prio f t = psp_reprioritize (f_prio t) (f t) ]}
-
-    With this helper a function in similar shape to defined below
-
-    {[
-    let rec psp_expr t = match t with
-        | SomeNode(...) -> psp_group_with_priority (expr_priority t)
-            [ ...
-            ]
-
-    ]}
-
-    can be rewritten to form where priority of constructed painter is set in one place:
-
-    {[
-
-    let rec _psp_expr = function
-        | SomeNode(...) -> psp_group
-            [ ...
-            ]
-
-    and psp_expr = psp_correct_priority_after expr_priority _psp_expr
-
-    ]}
-
-
-*)
-val psp_correct_priority_after : ('a -> priority) -> ('a -> painter) -> 'a -> painter
-
-
 (** Maximal priority. *)
 val psp_max_priority : priority
 
 (** Minimal priority. *)
 val psp_min_priority : priority
 
-(** Breaks not empty line. *)
-val psp_break : painter
+(** Return painter with different priority. *)
+val psp_reprioritize : priority -> painter -> painter
 
-(** Identity on painter. *)
-val psp_id : painter -> painter
 
-(** Returns empty painter for each argument. *)
-val psp_nothing : 'a -> painter
-
-(** Breaks line. *)
-val psp_newline : painter
-
-(** Paints nothing. *)
-val psp_empty : painter
+(** {2 Fundamental painters} *)
 
 (** Paints a word. *)
 val psp_word : string -> painter
 (** Paints an boolean value.  *)
 val psp_value_bool : bool -> painter
 
+
+(** {2 Line breaking} *)
+
+
+(** Breaks not empty line. *)
+val psp_break : painter
+
+(** Breaks line. *)
+val psp_newline : painter
+
+
+(** {2 Basic operands and painters} *)
+
+
+(** Identity on painter. *)
+val psp_id : painter -> painter
+
+(** Returns empty painter for each argument. *)
+val psp_nothing : 'a -> painter
+
+(** Paints nothing. *)
+val psp_empty : painter
+
+val psp_indent_with_priority : priority->  painter -> painter
+
+val psp_indent : painter -> painter
+
+
+(** {2 Grouping} *)
+
+
+(** Group list of painters as one painter with given priority. *)
+val psp_group_with_priority : priority -> painter list -> painter
+
+(** Group list of painters as one painter with the [psp_min_priority] priority. *)
+val psp_group: painter list -> painter
+
+(** Group and indent list of painters as one painter with given priority. *)
+val psp_indent_group_with_priority : priority->  painter list -> painter
+
+(** Group and indent list of painters as one painter with the [psp_min_priority] priority. *)
+val psp_indent_group : painter list -> painter
+
+(** {2 [when_multiline] painters} *)
+
 val psp_indent_with_priority_when_multiline : priority -> painter -> painter
 
 val psp_indent_when_multiline : painter -> painter
 
 val psp_indent_group_with_priority_when_multiline : priority -> painter list -> painter
 
+(** {2 Brackets} *)
+
+
 (**
    The [ psp_bracket opening closing prio elem ] parenthesis [ elem ] with given brackets.
  *)
 
 val psp_decide_std_bracket : bool -> painter -> painter
 
+(** {2 Associative operators} *)
 
 (** associtivity *)
 type associativity
 val psp_gen_infix : ('a -> associativity) -> ('a -> priority) -> ('a -> painter)
                  -> 'a -> painter -> painter -> painter
 
+(** {2 Output} *)
+
 (**
    Prints on standard output with newline.
  *)