Commits

bergsoe committed 7202941

API doc.

Comments (0)

Files changed (3)

src/PaplDLTree.mli

 *)
 
 val fold_node : ('acc -> 'a node -> 'acc) -> 'acc -> 'a node -> 'acc
+(** Fold over the nodes of a tree.
+
+    [fold_node f acc node] returns [(f ... (f (f acc node0) node1) ... nodeN)]
+    where [node0, ..., nodeN] are the nodes of the tree [node]. The order of the
+    nodes is unspecified.
+*)
 
 val to_single_linked : 'a node -> 'a PaplTree.node list
 (** [to_single_linked node] returns the nodes of a single listed tree with the
     same shape and contents as [node].
 
-    The order of the nodes is unspecified.
+    While the tree has the same shape, the order of the nodes in the list is
+    unspecified.
 *)
 
 val map_node : ('a node -> 'b) -> 'a node -> 'b node
   'acc ->
   'a node ->
   'acc
+(** Fold over the path to the root.
+
+    [fold_nodes_to_root f acc node] returns [(f ... (f (f acc node0) node1) ...
+    nodeN)] where [node0 = node, node1, ..., nodeN] is the path from [node] up
+    to and including the root of the tree.
+*)
 
 val node_path_to_root : 'a node -> 'a node list
 (** [node_path_to_root node] is the list of nodes from [node] up to and

src/PaplIncrEdgeConstraint.ml

 let constrain_path create path =
   match path with
       [] -> invalid_arg "constrain_path: empty path."
-      | [_] -> invalid_arg "constrain_path: one-element path."
-      | _ ->
-          let rec build xs =
-            match xs with
-                x0 :: x1 :: rest ->
-                  create (x0, x1) :: build (x1 :: rest)
-              | _ -> []
-          in
-            PaplIncrConstraint.prioritized (BatList.enum (build path))
+    | [_] -> invalid_arg "constrain_path: one-element path."
+    | _ ->
+        let rec build xs =
+          match xs with
+              x0 :: x1 :: rest ->
+                create (x0, x1) :: build (x1 :: rest)
+            | _ -> []
+        in
+          PaplIncrConstraint.prioritized (BatList.enum (build path))

src/PaplIncrEdgeConstraint.mli

 (** {2 Utilities} *)
 
 val constrain_path : 'a create_t -> 'a list -> PaplIncrConstraint.t
-(**
-   Prioritized checking of a path.
+(** Prioritized checking of a path.
 
-   The path must be at least 2 elements long.
+    [constrain_path create path] constructs an incremental constraint by
+    [create] for each segment of [path]. These incremental constraints are
+    verified in prioritized order. See {! PaplIncrConstraint.prioritized}.
+
+    The path must be at least 2 elements long.
 *)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.