aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Internal/Mixed.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-06-14 10:08:03 +0200
committerTom Smeding <tom@tomsmeding.com>2024-06-14 10:08:03 +0200
commit22f8f053f9ea2a3273d25f49ecd88a30ad506972 (patch)
treeda1b7879fbb87479874490d5a2d2680a7979f593 /src/Data/Array/Nested/Internal/Mixed.hs
parentc6b912051ddac25c9d7efe2f8162eac9068a335c (diff)
Export full [mrs]{shape,rank,size} set
Diffstat (limited to 'src/Data/Array/Nested/Internal/Mixed.hs')
-rw-r--r--src/Data/Array/Nested/Internal/Mixed.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal/Mixed.hs b/src/Data/Array/Nested/Internal/Mixed.hs
index e5d53e8..8421372 100644
--- a/src/Data/Array/Nested/Internal/Mixed.hs
+++ b/src/Data/Array/Nested/Internal/Mixed.hs
@@ -636,6 +636,13 @@ instance (KnownShX sh', KnownElt a) => KnownElt (Mixed sh' a) where
mvecsNewEmpty _ = MV_Nest (shxCompleteZeros (knownShX @sh')) <$> mvecsNewEmpty (Proxy @a)
+mrank :: Elt a => Mixed sh a -> SNat (Rank sh)
+mrank = shxRank . mshape
+
+-- | The total number of elements in the array.
+msize :: Elt a => Mixed sh a -> Int
+msize = shxSize . mshape
+
-- | Create an array given a size and a function that computes the element at a
-- given index.
--