From 688b72d518746dc0ba614c3e182372e9975f3cb1 Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 30 May 2026 01:09:44 +0000 Subject: Equality for materialized attributes --- lib/attribute.ml | 2 ++ lib/conventions.ml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/attribute.ml b/lib/attribute.ml index b828d64..8448bee 100644 --- a/lib/attribute.ml +++ b/lib/attribute.ml @@ -9,3 +9,5 @@ let make_referenced ~value = Referenced { value_hash } let make_materialized ~value = Materialized { value } + +let materialized_equal a b = Conventions.AbstractValue.equal a.value b.value diff --git a/lib/conventions.ml b/lib/conventions.ml index a031014..9e18762 100644 --- a/lib/conventions.ml +++ b/lib/conventions.ml @@ -49,7 +49,7 @@ module AbstractValue = struct else Atom (string_of_float f) | Opaque -> Atom "" - let equals a b = + let equal a b = match (type_of a, type_of b) with | (Int, Int) -> (Obj.obj a : int) = (Obj.obj b : int) | (String, String) -> (Obj.obj a : string) = (Obj.obj b : string) -- cgit v1.2.3