Bloom filter for probabilistic membership testing
0
fork

Configure Feed

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

fix(lint): resolve E410 doc style and E415 missing pp across packages

Fix 64 documentation style issues: add trailing periods, fix [name] format
mismatches, and correct arg count mismatches in doc comments. Add pp
pretty-printers to 7 modules (block_map, standard_site_api, tangled_api,
xrpc_auth_client, xrpc_client, xrpc_cred, block).

+22 -2
+20 -2
src/bloom.mli
··· 41 41 Bloom filter created from scratch using the union of the two sets. 42 42 43 43 Raises [Invalid_argument] if the two bloom filters were created with 44 - different parameters *) 44 + different parameters. *) 45 45 46 46 val inter : 'a t -> 'a t -> 'a t 47 47 (** [inter t1 t2] computes the intersection of the two inputs. The false ··· 51 51 from scratch using the intersection of the two sets. 52 52 53 53 Raises [Invalid_argument] if the two bloom filters were created with 54 - different parameters *) 54 + different parameters. *) 55 55 56 56 val size_estimate : 'a t -> int 57 57 (** [size_estimate t] is an approximation of the number of elements stored in ··· 61 61 (** {2 Serializers/Deserializers} *) 62 62 63 63 val to_bytes : 'a t -> bytes 64 + 64 65 val of_bytes : bytes -> ('a t, [ `Msg of string ]) result 66 + (** [of_bytes b] deserializes a Bloom filter from bytes. *) 65 67 66 68 (** {1 Functorial interface} *) 67 69 ··· 81 83 (** The output interface for [Bloom.Make]. *) 82 84 module Make (H : Hashable) : sig 83 85 type t 86 + (** The type of the Bloom filter. *) 84 87 85 88 val create : ?error_rate:float -> int -> t 89 + (** [create ~error_rate size] creates a fresh Bloom filter. *) 90 + 86 91 val copy : t -> t 92 + (** [copy t] returns a deep copy of the Bloom filter. *) 93 + 87 94 val add : t -> H.t -> unit 95 + (** [add t e] adds element [e] to the filter. *) 96 + 88 97 val mem : t -> H.t -> bool 98 + (** [mem t e] is [true] if [e] is in the filter. *) 99 + 89 100 val clear : t -> unit 101 + (** [clear t] removes all elements from the filter. *) 102 + 90 103 val size_estimate : t -> int 104 + (** [size_estimate t] approximates the number of stored elements. *) 105 + 91 106 val to_bytes : t -> bytes 107 + (** [to_bytes t] serializes the Bloom filter to bytes. *) 108 + 92 109 val of_bytes : bytes -> (t, [ `Msg of string ]) result 110 + (** [of_bytes b] deserializes a Bloom filter from bytes. *) 93 111 end
+2
test/main.mli
··· 1 + (** Test suite for the Bloom filter library. *) 2 + 1 3 (* Left empty on purpose *)