• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MinaProtocol / mina / 85

16 Apr 2025 12:15PM UTC coverage: 60.776% (-0.003%) from 60.779%
85

push

buildkite

web-flow
Merge pull request #16963 from MinaProtocol/dkijania/merge/compatible_to_develop_250417

merge compatible to develop 250416

548 of 819 new or added lines in 94 files covered. (66.91%)

57 existing lines in 33 files now uncovered.

49968 of 82216 relevant lines covered (60.78%)

473971.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/lib/mina_stdlib/map_set.ml
1
(** Utilities for dealing with "multimaps" or mapsets. *)
2

120✔
3
open Core_kernel
4

5
(* TODO consider using a lighter interface than Comparable.S *)
6
module Make (Key : Comparable.S) (Set : Generic_set.S0) = struct
NEW
7
  type t = Set.t Key.Map.t [@@deriving equal]
×
8

9
  (** Remove an element from a mapset. *)
10
  let remove_exn : t -> Key.t -> Set.el -> t =
11
   fun map k v ->
12
    let newset = Map.find_exn map k |> Fn.flip Set.remove v in
195,666✔
13
    if Set.is_empty newset then Map.remove map k
162,934✔
14
    else Map.set map ~key:k ~data:newset
32,732✔
15

16
  (* Add an element to a mapset. *)
17
  let insert : t -> Key.t -> Set.el -> t =
18
   fun map k v ->
19
    Map.change map k ~f:(fun set_opt ->
583,479✔
20
        match set_opt with
583,479✔
21
        | None ->
537,964✔
22
            Some (Set.singleton v)
537,964✔
23
        | Some set ->
45,515✔
24
            Some (Set.add set v) )
45,515✔
25
end
26

27
module Make_with_sexp_of
28
    (Key : Comparable.S) (Set : sig
29
      include Generic_set.S0
30

31
      val sexp_of_t : t -> Sexp.t
32
    end) =
33
struct
34
  include Make (Key) (Set)
35

36
  let sexp_of_t = [%sexp_of: Set.t Key.Map.t]
37
end
240✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc