package yocaml

  1. Overview
  2. Docs

The cache is an artifact of the previous build that tracks information about build targets, including dynamic dependencies, and maintains a hashed version of the targets.

Types

type t

A representation of the cache (a map indexed by Path.t).

type entry

An entry of the cache.

Building

val entry : ?last_build_date:int -> string -> Deps.t -> entry

entry ?last_build_date hashed_content deps creates an entry.

val empty : t

empty returns an empty cache.

val from_list : (Path.t * entry) list -> t

from_list l creates a cache from a list.

Cache interaction

val update : t -> Path.t -> ?deps:Deps.t -> now:int -> string -> t

update cache path ?deps ~now content updates the cache for the path entry. If an entry already existed at the given key, it will be deleted.

val get : t -> Path.t -> (string * Deps.t * int option) option

get cache path returns the associated hash content, deps set and the last build date for a given path.

Serialization/Deserialization

Supports serialization and deserialization of cache.

val to_sexp : t -> Sexp.t

to_sexp cache Converts a cache into a Sexp.

val from_sexp : Sexp.t -> (t, Sexp.invalid) Stdlib.result

from_sexp sexp try to converts a Sexp into a cache.

Utils

val pp : Stdlib.Format.formatter -> t -> unit

Pretty printer for caches.

val equal : t -> t -> bool

Equality between caches.

OCaml

Innovation. Community. Security.