module Lifetime:Datastructure for life timelines.sig
..end
Provides a datastructure for representing sets of days as a list of intervals, suitable for
rLepresenting the lifetime of a package in an archive.
exception Empty
typeday =
int
type
lifetime
val io_lifetime : lifetime Io.literate
val io_day : day Io.literate
val day_of_ymd : int * int * int -> day
(year,month,day)
format to a calendar day.val ymd_of_day : day -> int * int * int
day_of_date
.val empty : lifetime
val load : string -> lifetime
Io
.val save : string -> lifetime -> unit
Io
.val output : Pervasives.out_channel -> lifetime -> unit
Io
.val singleton : day -> lifetime
val add_day : lifetime -> day -> lifetime
val is_empty : lifetime -> bool
true
if the lifetime contains no days.val range : lifetime -> day * day
range lf
returns a pair (a,b)
where a
is the first day and b
is the last day in the lifetime. Raises Empty
if lf
is empty.val iterate_over_intervals : (day * day -> unit) -> lifetime -> unit
(d,d)
.val iterate_over_days : (day -> unit) -> lifetime -> unit