diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-04-15 23:30:38 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-04-15 23:30:38 +0200 |
commit | 0711a3981b56bbe063aa73d5ac8da61b6901c9b2 (patch) | |
tree | a868dffaf150def9f4ea90fdf4853ce00b123b8c /src/Data | |
parent | a95ae379851158f48f90a0274ad74caa44f582e0 (diff) |
Commented-out stub for mfromList
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Array/Nested/Internal.hs | 17 |
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) |