aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-04-15 23:30:38 +0200
committerTom Smeding <tom@tomsmeding.com>2024-04-15 23:30:38 +0200
commit0711a3981b56bbe063aa73d5ac8da61b6901c9b2 (patch)
treea868dffaf150def9f4ea90fdf4853ce00b123b8c /src/Data/Array/Nested/Internal.hs
parenta95ae379851158f48f90a0274ad74caa44f582e0 (diff)
Commented-out stub for mfromList
Diffstat (limited to 'src/Data/Array/Nested/Internal.hs')
-rw-r--r--src/Data/Array/Nested/Internal.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs
index 376651f..bfcb760 100644
--- a/src/Data/Array/Nested/Internal.hs
+++ b/src/Data/Array/Nested/Internal.hs
@@ -430,6 +430,23 @@ mconstant sh x
| otherwise =
coerce (M_Primitive (X.constant sh x))
+-- | All arrays in the list must have the same shape; if they do not, a runtime
+-- error will be thrown. See the documentation of 'mgenerate' for more
+-- information. Furthermore, the length of the list must correspond with @n@:
+-- if @n@ is @Just m@ and @m@ does not equal the length of the list, a runtime
+-- error is thrown.
+-- mfromList :: forall n sh a. (KnownShapeX (n : sh), Elt a) => [Mixed sh a] -> Mixed (n : sh) a
+-- mfromList l =
+-- case knownShapeX @(n : sh) of
+-- m@GHC_SNat :$@ _
+-- | length l /= fromIntegral (natVal m) ->
+-- error $ "mfromList: length of list (" ++ show (length l) ++ ")" ++
+-- "does not match the type (" ++ show (natVal m) ++ ")"
+-- | natVal m == 0 -> memptyArray _
+-- -- | let shapetree = mshapeTree
+-- | otherwise -> _
+-- () :$? _ -> _
+
mliftPrim :: (KnownShapeX sh, Storable a)
=> (a -> a)
-> Mixed sh (Primitive a) -> Mixed sh (Primitive a)