aboutsummaryrefslogtreecommitdiffstats
path: root/lib/attribute.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-03-06 04:10:31 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-03-06 04:10:31 -0300
commit5bbbbc976d25859082014f3720b82bcd2d05a2f0 (patch)
tree91c8a230260006156ef58fcc004775d1387de94e /lib/attribute.ml
parent1f084d995444683e2885beb6e12eeee6df1241d3 (diff)
downloadSakura-5bbbbc976d25859082014f3720b82bcd2d05a2f0.tar.gz
Sakura-5bbbbc976d25859082014f3720b82bcd2d05a2f0.zip
encode relations on module base
Diffstat (limited to 'lib/attribute.ml')
-rw-r--r--lib/attribute.ml21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/attribute.ml b/lib/attribute.ml
new file mode 100644
index 0000000..05d33f4
--- /dev/null
+++ b/lib/attribute.ml
@@ -0,0 +1,21 @@
+type t = {
+ hash : Conventions.Hash.t;
+ name : Conventions.Name.t;
+ name_hash : Conventions.Hash.t;
+ value : Conventions.AbstractValue.t;
+ value_hash : Conventions.Hash.t;
+}
+
+type materialized = {
+ name: Conventions.Name.t;
+ value: Conventions.AbstractValue.t
+}
+
+let make ~name ~value =
+ let name_hash = Conventions.Hash.hash_text name in
+ let value_hash = Conventions.AbstractValue.hash_text value in
+ let hash = Conventions.Hash.hash_text (name_hash ^ value_hash) in
+ { hash; name; name_hash; value; value_hash }
+
+let make_with_hashes ~hash ~name ~name_hash ~value ~value_hash =
+ { hash; name; name_hash; value; value_hash }