diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-06-14 10:08:03 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-06-14 10:08:03 +0200 |
commit | 22f8f053f9ea2a3273d25f49ecd88a30ad506972 (patch) | |
tree | da1b7879fbb87479874490d5a2d2680a7979f593 /src/Data/Array/Nested/Internal/Mixed.hs | |
parent | c6b912051ddac25c9d7efe2f8162eac9068a335c (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.hs | 7 |
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. -- |