File: extentlistSet.mli

package info (click to toggle)
xen-api-libs 0.5.2-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,940 kB
  • sloc: ml: 13,925; sh: 2,930; ansic: 1,699; makefile: 1,240; python: 83
file content (27 lines) | stat: -rw-r--r-- 553 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
27
(** A module to represent sets of elements as (start, length) pairs. *)

(** Elements must be 'Numbers': *)
module type Number = sig 
	type t 
	val zero: t
	val add : t -> t -> t 
	val sub : t -> t -> t 

end

(** Representation of a Set *)
module ExtentlistSet: functor (A : Number) -> sig
	type extent = A.t * A.t
	type t

	val empty : t

	val union : t -> t -> t
	val intersection : t -> t -> t
	val difference : t -> t -> t

	val of_list : extent list -> t
	val to_list : t -> extent list
	val fold_left : ('a -> extent -> 'a) -> 'a -> t -> 'a
end