From 0711a3981b56bbe063aa73d5ac8da61b6901c9b2 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 15 Apr 2024 23:30:38 +0200 Subject: Commented-out stub for mfromList --- src/Data/Array/Nested/Internal.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Data') 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) -- cgit v1.2.3-70-g09d2