From 2e2d7f6a9b116dac2fa20be657c916cb498c1508 Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 19 Sep 2026 01:08:28 +0000 Subject: Do not assume that the hash of an object is its storage address --- lib/Utilities.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/Utilities.ml') diff --git a/lib/Utilities.ml b/lib/Utilities.ml index 9bff69b..404d8aa 100644 --- a/lib/Utilities.ml +++ b/lib/Utilities.ml @@ -4,6 +4,14 @@ module Ordering = struct let of_int x = if x < 0 then Smaller else if x > 0 then Greater else Equal end +module Option = struct + let ( let* ) = Option.bind + let fmap f m = Option.bind m f + let sequence = function + | None -> Ok None + | Some x -> Result.map Option.some x +end + module Result = struct let ( let* ) = Result.bind let fmap f m = Result.bind m f @@ -80,11 +88,6 @@ module FingerTree = struct |> Fun.flip BatIO.to_string ss end -module Option = struct - let ( let* ) = Option.bind - let fmap f m = Option.bind m f -end - module Atomic = struct let rec swap atom f = let v = Atomic.get atom in -- cgit v1.2.3