aboutsummaryrefslogtreecommitdiff
path: root/lib/basic.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-20 09:23:23 -0500
committerMarc Coquand <marc@mccd.space>2024-05-20 09:23:23 -0500
commit964d6773395b7008661b38c11acd24959f280fb1 (patch)
treed4f58518302d406e571a3eb976efbc25b560a8d7 /lib/basic.ml
parent5aec082b915416107cec9e8c811bbbedafb70b59 (diff)
downloadstitch-964d6773395b7008661b38c11acd24959f280fb1.tar.gz
stitch-964d6773395b7008661b38c11acd24959f280fb1.tar.bz2
stitch-964d6773395b7008661b38c11acd24959f280fb1.zip
Replace ugly conversion
Diffstat (limited to 'lib/basic.ml')
-rw-r--r--lib/basic.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/basic.ml b/lib/basic.ml
new file mode 100644
index 0000000..76b6863
--- /dev/null
+++ b/lib/basic.ml
@@ -0,0 +1,3 @@
+let array_drop n arr =
+ if Array.length arr < n then [||] else Array.sub arr n (max (Array.length arr - n) 0)
+