File: dagutils.mli

package info (click to toggle)
ocaml-obuild 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,456 kB
  • sloc: ml: 14,491; sh: 211; ansic: 34; makefile: 11
file content (26 lines) | stat: -rw-r--r-- 776 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(** DAG Utility Functions

    This module provides iteration and linearization utilities for DAGs (Directed Acyclic Graphs).
    It uses the Taskdep module to traverse DAGs in topological order.
 *)

(** Iterate over DAG nodes in topological order

    @param f Function to apply to each node
    @param dag The DAG to iterate over
 *)
val iter : ('a -> unit) -> 'a Dag.t -> unit

(** Iterate over DAG nodes with indices in topological order

    @param f Function to apply to each node with its index
    @param dag The DAG to iterate over
 *)
val iteri : (int -> 'a -> unit) -> 'a Dag.t -> unit

(** Linearize a DAG into a topologically sorted list

    @param dag The DAG to linearize
    @return List of nodes in topological order
 *)
val linearize : 'a Dag.t -> 'a list