summaryrefslogtreecommitdiff
path: root/src/Array.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Array.hs')
-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)