summaryrefslogtreecommitdiff
path: root/src/Collections.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Collections.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Collections.ml b/src/Collections.ml
index ee088a9d..80345e14 100644
--- a/src/Collections.ml
+++ b/src/Collections.ml
@@ -35,6 +35,9 @@ module List = struct
| x :: ls ->
let ls, last = pop_last ls in
(x :: ls, last)
+
+ (** Return the n first elements of the list *)
+ let prefix (n : int) (ls : 'a list) : 'a list = fst (split_at ls n)
end
module type OrderedType = sig