Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irmin: document heap.mli and schema.mli, add Heap.pp

Address merlint warnings about missing documentation in heap.mli
(blocks, refs, lifecycle, BACKEND signature) and schema.mli's
functor parameter. Also add a stub Heap.pp for E415.

+46
+1
lib/heap.ml
··· 43 43 let flush t = t.flush () 44 44 let close t = t.close () 45 45 let to_seq t = t.to_seq () 46 + let pp ppf _ = Format.fprintf ppf "<heap>" 46 47 47 48 module Make (B : BACKEND) = struct 48 49 let v (s : B.t) : (B.hash, B.block, _) t =
+42
lib/heap.mli
··· 26 26 (** A heap parameterized by hash type ['h], block type ['v], and backend tag 27 27 ['b]. *) 28 28 29 + val pp : Format.formatter -> _ t -> unit 30 + (** Pretty-print a heap (debug only — does not enumerate contents). *) 31 + 29 32 (** {1:blocks Blocks} *) 30 33 31 34 val find : ('h, 'v, _) t -> 'h -> 'v option 35 + (** [find heap h] returns the block at [h], if present. *) 36 + 32 37 val put : ('h, 'v, _) t -> 'h -> 'v -> unit 38 + (** [put heap h v] stores [v] under [h]. *) 39 + 33 40 val mem : ('h, _, _) t -> 'h -> bool 41 + (** [mem heap h] is [true] iff [h] is in [heap]. *) 42 + 34 43 val batch : ('h, 'v, _) t -> ('h * 'v) list -> unit 44 + (** [batch heap pairs] stores all [pairs] atomically (best effort). *) 35 45 36 46 (** {1:refs Named References} 37 47 38 48 Mutable pointers into the heap. Used for branches, HEAD, etc. *) 39 49 40 50 val find_ref : ('h, _, _) t -> string -> 'h option 51 + (** [find_ref heap name] is the hash bound to [name], if any. *) 52 + 41 53 val set_ref : ('h, _, _) t -> string -> 'h -> unit 54 + (** [set_ref heap name h] binds [name] to [h]. *) 55 + 42 56 val del_ref : ('h, _, _) t -> string -> unit 57 + (** [del_ref heap name] removes [name]. *) 58 + 43 59 val list_refs : (_, _, _) t -> string list 60 + (** [list_refs heap] lists all ref names. *) 44 61 45 62 val cas_ref : ('h, _, _) t -> string -> test:'h option -> set:'h option -> bool 46 63 (** Compare-and-set on a ref. *) ··· 48 65 (** {1:lifecycle Lifecycle} *) 49 66 50 67 val flush : (_, _, _) t -> unit 68 + (** [flush heap] flushes pending writes to the backend. *) 69 + 51 70 val close : (_, _, _) t -> unit 71 + (** [close heap] releases backend resources. *) 52 72 53 73 (** {1:backend Backend binding} *) 54 74 ··· 61 81 for JSON, etc. *) 62 82 63 83 val find : t -> hash -> block option 84 + (** Look up a block. *) 85 + 64 86 val put : t -> hash -> block -> unit 87 + (** Store a block. *) 88 + 65 89 val mem : t -> hash -> bool 90 + (** Check whether a block exists. *) 91 + 66 92 val batch : t -> (hash * block) list -> unit 93 + (** Store many blocks. *) 94 + 67 95 val find_ref : t -> string -> hash option 96 + (** Look up a named ref. *) 97 + 68 98 val set_ref : t -> string -> hash -> unit 99 + (** Set a named ref. *) 100 + 69 101 val del_ref : t -> string -> unit 102 + (** Delete a named ref. *) 103 + 70 104 val list_refs : t -> string list 105 + (** List all ref names. *) 106 + 71 107 val cas_ref : t -> string -> test:hash option -> set:hash option -> bool 108 + (** Compare-and-set on a ref. *) 109 + 72 110 val flush : t -> unit 111 + (** Flush pending writes. *) 112 + 73 113 val close : t -> unit 114 + (** Release resources. *) 74 115 end 75 116 76 117 module Make (B : BACKEND) : sig 77 118 val v : B.t -> (B.hash, B.block, _) t 119 + (** [v backend] wraps a backend instance into a typed heap. *) 78 120 end 79 121 80 122 (** {1:recording Recording and Replay}
+3
lib/schema.mli
··· 25 25 type block 26 26 27 27 val hash_equal : hash -> hash -> bool 28 + (** Hash equality. *) 29 + 28 30 val hash_block : block -> hash 31 + (** Compute the content-address of a block. *) 29 32 end) : sig 30 33 (** {1:children Children} 31 34