aboutsummaryrefslogtreecommitdiffstats
path: root/lib/concepts/Value.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/concepts/Value.ml3
-rw-r--r--lib/concepts/Value.mli3
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/concepts/Value.ml b/lib/concepts/Value.ml
index 65a0439..75b0e88 100644
--- a/lib/concepts/Value.ml
+++ b/lib/concepts/Value.ml
@@ -1,3 +1,6 @@
type value = String of string | Integer of int
let to_string = function String s -> s | Integer n -> Int.to_string n
+
+let equal x y =
+ match x, y with String x, String y -> x = y | Integer x, Integer y -> x = y | _, _ -> false
diff --git a/lib/concepts/Value.mli b/lib/concepts/Value.mli
index 9644443..c1a9f18 100644
--- a/lib/concepts/Value.mli
+++ b/lib/concepts/Value.mli
@@ -3,3 +3,6 @@ type value = String of string | Integer of int
(** given a value, return a string representation of it *)
val to_string : value -> string
+
+(** given two values, are they the same? *)
+val equal : value -> value -> bool