Module Yocaml.Deps

Deps is an attempt to represent (without much effort) a set of dependencies to build a file.

Types

type t

Describes a collection of dependencies (where each dependency is a value of type kind. For the moment, a dependency collection is described as a Set on Kinds.

type kind =
  1. | File of Filepath.t

A Deps can take many forms. For the moment, I only handle the case where the dependency is a file.

Helpers

val file : Filepath.t -> kind

file path turns a Filepath.t into a kind.

val to_list : t -> kind list

to_list deps turns a t into a List of kind.

val to_filepath : kind -> Filepath.t

Translate kind to Filepath.t.

Effects Helpers

As working with a list of dependencies usually involves running effects, helpers for this are not a luxury!

val kind_exists : kind -> bool Effect.t

Perfrom the effect File_exists on a kind.

val get_modification_time : kind -> int Try.t Effect.t

Perfrom the effect Get_modification_time on a kind.

val get_max_modification_time : t -> int option Try.t Effect.t

Perform the effect Get_modification_time to find the largest change date included in the dependencies..

val need_update : t -> Filepath.t -> [ `Need_creation | `Need_update | `Up_to_date ] Try.t Effect.t

Defines whether a Aliases.Filepath.t should be updated according to a t using the effects management logic.

Implementations

module Monoid : Preface.Specs.MONOID with type t = t

A Deps.t is a Monoid.

module Writer : Preface.Specs.WRITER with type tape = t

A Writer monad over deps.

Included Set operations

include Stdlib.Set.S with type t := t and type elt = kind
type elt = kind
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 disjoint : t -> t -> bool
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 map : (elt -> elt) -> t -> t
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 filter_map : (elt -> elt option) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val min_elt_opt : t -> elt option
val max_elt : t -> elt
val max_elt_opt : t -> elt option
val choose : t -> elt
val choose_opt : t -> elt option
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val find_opt : elt -> t -> elt option
val find_first : (elt -> bool) -> t -> elt
val find_first_opt : (elt -> bool) -> t -> elt option
val find_last : (elt -> bool) -> t -> elt
val find_last_opt : (elt -> bool) -> t -> elt option
val of_list : elt list -> t
val to_seq_from : elt -> t -> elt Stdlib.Seq.t
val to_seq : t -> elt Stdlib.Seq.t
val to_rev_seq : t -> elt Stdlib.Seq.t
val add_seq : elt Stdlib.Seq.t -> t -> t
val of_seq : elt Stdlib.Seq.t -> t