summaryrefslogtreecommitdiff
path: root/src/util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.ml')
-rw-r--r--src/util.ml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.ml b/src/util.ml
index 0ae3fcf7..a2bd7cc0 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -80,6 +80,11 @@ let remove_dups compare eq l =
in
aux [] l'
+let rec power i tothe =
+ if tothe <= 0
+ then 1
+ else i * power i (tothe - 1)
+
let rec assoc_maybe eq l k =
match l with
| [] -> None