Module OpamPackage
module Version : sig
Versions
type t
ABSTRACT type
val of_string : string -> t
Create an abstract value from a string
val to_string : t -> string
Convert an abstract value to a string
module Set : sig
type elt = t
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val map : elt -> elt -> t -> t
auto-map
val choose_one : t -> elt
Return one element. Fail if the set is not a singleton.
val of_list : elt list -> t
Make a set from a list
val to_string : t -> string
Pretty-print a set
val find : elt -> bool -> t -> elt
Find an element in the list
module Op : sig
val (++) : t -> t -> t
Infix set union
val (--) : t -> t -> t
Infix set difference
val (%%) : t -> t -> t
Infix set intersection
end
end
module Map : sig
type key = t
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : key -> 'a option -> 'b option -> 'c option -> 'a t -> 'b t -> 'c t
val compare : 'a -> 'a -> int -> 'a t -> 'a t -> int
val equal : 'a -> 'a -> bool -> 'a t -> 'a t -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val for_all : key -> 'a -> bool -> 'a t -> bool
val exists : key -> 'a -> bool -> 'a t -> bool
val filter : key -> 'a -> bool -> 'a t -> 'a t
val partition : key -> 'a -> bool -> 'a t -> ('a t * 'a t)
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> (key * 'a)
val max_binding : 'a t -> (key * 'a)
val choose : 'a t -> (key * 'a)
val split : key -> 'a t -> ('a t * 'a option * 'a t)
val find : key -> 'a t -> 'a
val map : 'a -> 'b -> 'a t -> 'b t
val mapi : key -> 'a -> 'b -> 'a t -> 'b t
val to_string : 'a -> string -> 'a t -> string
Pretty-printing
val values : 'a t -> 'a list
Return the values in the map.
val keys : 'a t -> key list
Return the keys in the map.
val union : 'a -> 'a -> 'a -> 'a t -> 'a t -> 'a t
A key will be in the union of
m1
and m2
if it is appears
either m1
or m2
, with the corresponding value. If a key
appears in both m1
and m2
, then the resulting value is built
using the function given as argument.
val of_list : (key * 'a) list -> 'a t
Convert an assoc list to a map
end
val compare : t -> t -> int
Compare two versions using the Debian version scheme
end
module Name : sig
Names
type t
ABSTRACT type
val of_string : string -> t
Create an abstract value from a string
val to_string : t -> string
Convert an abstract value to a string
module Set : sig
type elt = t
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val map : elt -> elt -> t -> t
auto-map
val choose_one : t -> elt
Return one element. Fail if the set is not a singleton.
val of_list : elt list -> t
Make a set from a list
val to_string : t -> string
Pretty-print a set
val find : elt -> bool -> t -> elt
Find an element in the list
module Op : sig
val (++) : t -> t -> t
Infix set union
val (--) : t -> t -> t
Infix set difference
val (%%) : t -> t -> t
Infix set intersection
end
end
module Map : sig
type key = t
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : key -> 'a option -> 'b option -> 'c option -> 'a t -> 'b t -> 'c t
val compare : 'a -> 'a -> int -> 'a t -> 'a t -> int
val equal : 'a -> 'a -> bool -> 'a t -> 'a t -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val for_all : key -> 'a -> bool -> 'a t -> bool
val exists : key -> 'a -> bool -> 'a t -> bool
val filter : key -> 'a -> bool -> 'a t -> 'a t
val partition : key -> 'a -> bool -> 'a t -> ('a t * 'a t)
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> (key * 'a)
val max_binding : 'a t -> (key * 'a)
val choose : 'a t -> (key * 'a)
val split : key -> 'a t -> ('a t * 'a option * 'a t)
val find : key -> 'a t -> 'a
val map : 'a -> 'b -> 'a t -> 'b t
val mapi : key -> 'a -> 'b -> 'a t -> 'b t
val to_string : 'a -> string -> 'a t -> string
Pretty-printing
val values : 'a t -> 'a list
Return the values in the map.
val keys : 'a t -> key list
Return the keys in the map.
val union : 'a -> 'a -> 'a -> 'a t -> 'a t -> 'a t
A key will be in the union of
m1
and m2
if it is appears
either m1
or m2
, with the corresponding value. If a key
appears in both m1
and m2
, then the resulting value is built
using the function given as argument.
val of_list : (key * 'a) list -> 'a t
Convert an assoc list to a map
end
val compare : t -> t -> int
Compare two package names
val global_config : t
global configuration package
end
type t
ABSTRACT type
val of_string : string -> t
Create an abstract value from a string
val to_string : t -> string
Convert an abstract value to a string
module Set : sig
type elt = t
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : elt -> unit -> t -> unit
val fold : elt -> 'a -> 'a -> t -> 'a -> 'a
val for_all : elt -> bool -> t -> bool
val exists : elt -> bool -> t -> bool
val filter : elt -> bool -> t -> t
val partition : elt -> bool -> t -> (t * t)
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> (t * bool * t)
val map : elt -> elt -> t -> t
auto-map
val choose_one : t -> elt
Return one element. Fail if the set is not a singleton.
val of_list : elt list -> t
Make a set from a list
val to_string : t -> string
Pretty-print a set
val find : elt -> bool -> t -> elt
Find an element in the list
module Op : sig
val (++) : t -> t -> t
Infix set union
val (--) : t -> t -> t
Infix set difference
val (%%) : t -> t -> t
Infix set intersection
end
end
module Map : sig
type key = t
type 'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge : key -> 'a option -> 'b option -> 'c option -> 'a t -> 'b t -> 'c t
val compare : 'a -> 'a -> int -> 'a t -> 'a t -> int
val equal : 'a -> 'a -> bool -> 'a t -> 'a t -> bool
val iter : key -> 'a -> unit -> 'a t -> unit
val fold : key -> 'a -> 'b -> 'b -> 'a t -> 'b -> 'b
val for_all : key -> 'a -> bool -> 'a t -> bool
val exists : key -> 'a -> bool -> 'a t -> bool
val filter : key -> 'a -> bool -> 'a t -> 'a t
val partition : key -> 'a -> bool -> 'a t -> ('a t * 'a t)
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> (key * 'a)
val max_binding : 'a t -> (key * 'a)
val choose : 'a t -> (key * 'a)
val split : key -> 'a t -> ('a t * 'a option * 'a t)
val find : key -> 'a t -> 'a
val map : 'a -> 'b -> 'a t -> 'b t
val mapi : key -> 'a -> 'b -> 'a t -> 'b t
val to_string : 'a -> string -> 'a t -> string
Pretty-printing
val values : 'a t -> 'a list
Return the values in the map.
val keys : 'a t -> key list
Return the keys in the map.
val union : 'a -> 'a -> 'a -> 'a t -> 'a t -> 'a t
A key will be in the union of
m1
and m2
if it is appears
either m1
or m2
, with the corresponding value. If a key
appears in both m1
and m2
, then the resulting value is built
using the function given as argument.
val of_list : (key * 'a) list -> 'a t
Convert an assoc list to a map
end
val name : t -> Name.t
Return the package name
val of_string_opt : string -> t option
Return None if
nv
is not a valid package name
val version : t -> Version.t
Return the version name
val create : Name.t -> Version.t -> t
Create a new pair (name x version)
val name_to_string : t -> string
To fit in the GenericPackage type, for generic display functions
val version_to_string : t -> string
val of_filename : OpamFilename.t -> t option
Guess the package name from a filename. This function extracts
name
and version
from /path/to/$name.$version/opam
val of_dirname : OpamFilename.Dir.t -> t option
Guess the package name from a directory name. This function extracts $name and $version from /path/to/$name.$version/
val of_archive : OpamFilename.t -> t option
Guess the package name from an archive file. This function extract
$name and $version from /path/to/$name.$version+opam.tar.gz
val to_map : Set.t -> Version.Set.t Name.Map.t
Convert a set of pairs to a map
name -> versions
val keys : 'a Map.t -> Set.t
Returns the keys in a package map as a package set
val versions_of_packages : Set.t -> Version.Set.t
Extract the versions from a collection of packages
val versions_of_name : Set.t -> Name.t -> Version.Set.t
Return the list of versions for a given package
val names_of_packages : Set.t -> Name.Set.t
Extract the naes from a collection of packages
val has_name : Set.t -> Name.t -> bool
Returns true if the set contains a package with the given name
val packages_of_name : Set.t -> Name.t -> Set.t
Return all the packages with the given name
val packages_of_names : Set.t -> Name.Set.t -> Set.t
Return all the packages with one of the given names
val max_version : Set.t -> Name.t -> t
Return the maximal available version of a package name from a set.
Raises
Not_found
if no such package available.
val compare : t -> t -> int
Compare two packages
val equal : t -> t -> bool
Are two packages equal ?
val hash : t -> int
Hash a package
val prefixes : OpamFilename.Dir.t -> string option Map.t
Return all the package descriptions in the current directory (and
their eventual prefixes).
val unknown : Name.t -> Version.t option -> 'a
Unknown package: either the name is unknown, or the version does
not exist.
module Parallel : sig
Parallel executions.
module G : sig
type t
Abstract type of graphs
module V : sig
Vertices have type
V.t
and are labeled with type V.label
(note that an implementation may identify the vertex with its
label)
type t = t
val compare : t -> t -> int
val hash : t -> int
val equal : t -> t -> bool
type label
val create : label -> t
val label : t -> label
end
type vertex = V.t
module E : sig
Edges have type
E.t
and are labeled with type E.label
.
src
(resp. dst
) returns the origin (resp. the destination) of a
given edge.
type t
val compare : t -> t -> int
type vertex = vertex
val src : t -> vertex
Edge origin.
val dst : t -> vertex
Edge destination.
type label
val create : vertex -> label -> vertex -> t
create v1 l v2
creates an edge from v1
to v2
with label l
val label : t -> label
Get the label of an edge.
end
type edge = E.t
val is_directed : bool
Is this an implementation of directed graphs?
val is_empty : t -> bool
val nb_vertex : t -> int
val nb_edges : t -> int
val out_degree : t -> vertex -> int
out_degree g v
returns the out-degree of v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val in_degree : t -> vertex -> int
in_degree g v
returns the in-degree of v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val mem_vertex : t -> vertex -> bool
val mem_edge : t -> vertex -> vertex -> bool
val mem_edge_e : t -> edge -> bool
val find_edge : t -> vertex -> vertex -> edge
find_edge g v1 v2
returns the edge from v1
to v2
if it exists.
Unspecified behaviour if g
has several edges from v1
to v2
.
Raises
Not_found
if no such edge exists.
val find_all_edges : t -> vertex -> vertex -> edge list
val succ : t -> vertex -> vertex list
succ g v
returns the successors of v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val pred : t -> vertex -> vertex list
pred g v
returns the predecessors of v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val succ_e : t -> vertex -> edge list
succ_e g v
returns the edges going from v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val pred_e : t -> vertex -> edge list
pred_e g v
returns the edges going to v
in g
.
Raises
Invalid_argument
if v
is not in g
.
val fold_vertex : vertex -> 'a -> 'a -> t -> 'a -> 'a
Fold on all vertices of a graph.
val iter_edges : vertex -> vertex -> unit -> t -> unit
Iter on all edges of a graph. Edge label is ignored.
val fold_edges : vertex -> vertex -> 'a -> 'a -> t -> 'a -> 'a
Fold on all edges of a graph. Edge label is ignored.
val iter_edges_e : edge -> unit -> t -> unit
Iter on all edges of a graph.
val fold_edges_e : edge -> 'a -> 'a -> t -> 'a -> 'a
Fold on all edges of a graph.
val map_vertex : vertex -> vertex -> t -> t
Map on all vertices of a graph.
val iter_pred : vertex -> unit -> t -> vertex -> unit
val fold_succ : vertex -> 'a -> 'a -> t -> vertex -> 'a -> 'a
val fold_pred : vertex -> 'a -> 'a -> t -> vertex -> 'a -> 'a
val iter_succ_e : edge -> unit -> t -> vertex -> unit
val fold_succ_e : edge -> 'a -> 'a -> t -> vertex -> 'a -> 'a
val iter_pred_e : edge -> unit -> t -> vertex -> unit
val fold_pred_e : edge -> 'a -> 'a -> t -> vertex -> 'a -> 'a
val create : ?size:int -> unit -> t
create ()
returns an empty graph. Optionally, a size can be
given, which should be on the order of the expected number of
vertices that will be in the graph (for hash tables-based
implementations). The graph grows as needed, so size
is
just an initial guess.
val clear : t -> unit
val copy : t -> t
copy g
returns a copy of g
. Vertices and edges (and eventually
marks, see module Mark
) are duplicated.
val add_vertex : t -> vertex -> unit
add_vertex g v
adds the vertex v
to the graph g
.
Do nothing if v
is already in g
.
val remove_vertex : t -> vertex -> unit
Time complexity for ocamlgraph implementations: O(|V|*ln(D)) for unlabeled graphs and O(|V|*D) for labeled graphs. D is the maximal degree of the graph.
remove g v
removes the vertex v
from the graph g
(and all the edges going from v
in g
).
Do nothing if v
is not in g
.Time complexity for ocamlgraph implementations: O(|V|*ln(D)) for unlabeled graphs and O(|V|*D) for labeled graphs. D is the maximal degree of the graph.
val add_edge : t -> vertex -> vertex -> unit
add_edge g v1 v2
adds an edge from the vertex v1
to the vertex v2
in the graph g
.
Add also v1
(resp. v2
) in g
if v1
(resp. v2
) is not in g
.
Do nothing if this edge is already in g
.
val add_edge_e : t -> edge -> unit
add_edge_e g e
adds the edge e
in the graph g
.
Add also E.src e
(resp. E.dst e
) in g
if E.src e
(resp. E.dst
e
) is not in g
.
Do nothing if e
is already in g
.
val remove_edge : t -> vertex -> vertex -> unit
remove_edge g v1 v2
removes the edge going from v1
to v2
from the
graph g
. If the graph is labelled, all the edges going from v1
to
v2
are removed from g
.
Do nothing if this edge is not in g
.
Raises
Invalid_argument
if v1
or v2
are not in g
.
val remove_edge_e : t -> edge -> unit
remove_edge_e g e
removes the edge e
from the graph g
.
Do nothing if e
is not in g
.
Raises
Invalid_argument
if E.src e
or E.dst e
are not in g
.
val iter_vertex : V.t -> unit -> t -> unit
val iter_succ : V.t -> unit -> t -> V.t -> unit
val has_cycle : t -> bool
val scc_list : t -> V.t list list
val string_of_vertex : V.t -> string
end
val iter : int -> G.t -> pre:G.V.t -> unit -> child:G.V.t -> unit -> post:G.V.t -> unit -> unit
val iter_l : int -> G.vertex list -> pre:G.V.t -> unit -> child:G.V.t -> unit -> post:G.V.t -> unit -> unit
val map_reduce : int -> G.t -> map:G.V.t -> 'a -> merge:'a -> 'a -> 'a -> init:'a -> 'a
val map_reduce_l : int -> G.vertex list -> map:G.V.t -> 'a -> merge:'a -> 'a -> 'a -> init:'a -> 'a
val create : G.V.t list -> G.t
exception Cyclic of G.V.t list list
end