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.

cbor: rename from cbort (partial downstream)

Drops the "t" suffix. Internal raw CBOR module moves to Value (was
Cbor in lib/cbor.ml), matching the value/codec/<pkg> layout from the
other codec packages. Low-level byte R/W moved to lib/binary.ml (was
lib/cbor_rw.ml). Library name cbor; main module Cbor via lib/cbor.ml
(was cbort.ml).

Downstream packages (ocaml-bundle, ocaml-cose, ocaml-bpsec, ocaml-scitt,
ocaml-crow, irmin) partially migrated: Cbort.Cbor -> Cbor.Value, the
internal Cbor alias shadowing in each file renamed to V to free the
top-level Cbor for the library facade. Some downstream build errors
remain because many callsites conflated raw value constructors
(Cbor.int, Cbor.int64) with schema codecs and need manual triage.

The lib/binary.ml R/W primitives are NOT re-exported through Cbor.Binary
due to OCaml's lazy module alias elision when the aliased module isn't
referenced by any type/value in the parent signature. A separate
cbor.bytesrw library (ocaml-cbor/lib/bytesrw/) is the right home for
that, matching json.bytesrw / toml.bytesrw; left as a follow-up.

+16 -16
+1 -1
dune-project
··· 33 33 (pds (>= 0.1)) 34 34 (wal (>= 0.1)) 35 35 (bloom (>= 0.1)) 36 - (cbort (>= 0.1)) 36 + (cbor (>= 0.1)) 37 37 (merge3 (>= 0.1)) 38 38 (base64 (>= 3.5)) 39 39 (alcotest :with-test)
+1 -1
irmin.opam
··· 27 27 "pds" {>= "0.1"} 28 28 "wal" {>= "0.1"} 29 29 "bloom" {>= "0.1"} 30 - "cbort" {>= "0.1"} 30 + "cbor" {>= "0.1"} 31 31 "merge3" {>= "0.1"} 32 32 "base64" {>= "3.5"} 33 33 "alcotest" {with-test}
+1 -1
lib/cbor/dune
··· 1 1 (library 2 2 (name irmin_cbor) 3 3 (public_name irmin.cbor) 4 - (libraries irmin cbort digestif)) 4 + (libraries irmin cbor digestif))
+13 -13
lib/cbor/irmin_cbor.ml
··· 1 1 (** CBOR codec for string blocks. 2 2 3 - Parses CBOR maps and arrays from [string] blocks. Uses the cbort library. 3 + Parses CBOR maps and arrays from [string] blocks. Uses the cbor library. 4 4 Maps become named children, arrays become indexed children. *) 5 5 6 6 module S = Irmin.SHA256 7 7 8 8 let parse : S.dec = 9 9 fun block -> 10 - match Cbort.decode_string Cbort.any block with 10 + match Cbor.decode_string Cbor.any block with 11 11 | Error _ -> S.Named [] 12 12 | Ok cbor -> ( 13 - match Cbort.Cbor.to_array cbor with 13 + match Cbor.Value.to_array cbor with 14 14 | Some items -> 15 15 S.Indexed 16 16 (Array.of_list 17 17 (List.map 18 18 (fun item -> 19 - let s = Cbort.encode_string Cbort.any item in 19 + let s = Cbor.encode_string Cbor.any item in 20 20 (`Inline s : S.child)) 21 21 items)) 22 22 | None -> ( 23 - match Cbort.Cbor.to_map cbor with 23 + match Cbor.Value.to_map cbor with 24 24 | Some pairs -> 25 25 S.Named 26 26 (List.filter_map 27 27 (fun (k, v) -> 28 - match Cbort.Cbor.to_text k with 28 + match Cbor.Value.to_text k with 29 29 | Some name -> 30 - let s = Cbort.encode_string Cbort.any v in 30 + let s = Cbor.encode_string Cbor.any v in 31 31 Some (name, (`Inline s : S.child)) 32 32 | None -> None) 33 33 pairs) ··· 41 41 let data = 42 42 match child with `Inline data -> data | `Link _ -> "" 43 43 in 44 - match Cbort.decode_string Cbort.any data with 45 - | Ok v -> Some (Cbort.Cbor.string name, v) 44 + match Cbor.decode_string Cbor.any data with 45 + | Ok v -> Some (Cbor.Value.string name, v) 46 46 | Error _ -> None) 47 47 children 48 48 in 49 - Cbort.encode_string Cbort.any (Cbort.Cbor.map pairs) 49 + Cbor.encode_string Cbor.any (Cbor.Value.map pairs) 50 50 | S.Indexed children -> 51 51 let items = 52 52 Array.to_list ··· 55 55 let data = 56 56 match child with `Inline data -> data | `Link _ -> "" 57 57 in 58 - match Cbort.decode_string Cbort.any data with 58 + match Cbor.decode_string Cbor.any data with 59 59 | Ok v -> v 60 - | Error _ -> Cbort.Cbor.map []) 60 + | Error _ -> Cbor.Value.map []) 61 61 children) 62 62 in 63 - Cbort.encode_string Cbort.any (Cbort.Cbor.array items) 63 + Cbor.encode_string Cbor.any (Cbor.Value.array items) 64 64 65 65 let ( => ) = S.( => ) 66 66