diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-05-30 01:09:44 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-05-30 01:09:44 +0000 |
| commit | 688b72d518746dc0ba614c3e182372e9975f3cb1 (patch) | |
| tree | 9d5eb26b82adfac6a856d1be169c1d50573a6f1d | |
| parent | 2fa028193c76e6df949d535a37727cdab220a0dc (diff) | |
| download | Sakura-688b72d518746dc0ba614c3e182372e9975f3cb1.tar.gz Sakura-688b72d518746dc0ba614c3e182372e9975f3cb1.zip | |
Equality for materialized attributes
| -rw-r--r-- | lib/attribute.ml | 2 | ||||
| -rw-r--r-- | lib/conventions.ml | 2 |
2 files changed, 3 insertions, 1 deletions
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 "<opaque>" - 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) |
