summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-03-26 23:47:59 +0100
committerTom Smeding <tom@tomsmeding.com>2025-03-26 23:47:59 +0100
commit6e85d5b2aee0cf2c089538e74261f1d88d6b1b71 (patch)
tree1ae5699e3b420e7a61203dfb697ad17eba38f683 /src
parent16a836d078caefc3526031c084e2527cba0da3a8 (diff)
test: Start of a list of compile tests
Diffstat (limited to 'src')
-rw-r--r--src/Array.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Array.hs b/src/Array.hs
index 059600f..707dce2 100644
--- a/src/Array.hs
+++ b/src/Array.hs
@@ -88,6 +88,9 @@ emptyArray n = Array (emptyShape n) V.empty
arrayFromList :: Shape n -> [t] -> Array n t
arrayFromList sh l = Array sh (V.fromListN (shapeSize sh) l)
+arrayToList :: Array n t -> [t]
+arrayToList (Array _ v) = V.toList v
+
arrayUnit :: t -> Array Z t
arrayUnit x = Array ShNil (V.singleton x)