aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2026-01-06 11:30:56 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2026-01-31 13:40:10 +0100
commit92b83a159fd1806446ac2d8217ea342d7b83fd3e (patch)
treefbc2e177fa59ebecfe589f00f1f9d84946055c48 /src
parentd4352fdcecacd204b52e1c1a3646633e963e5490 (diff)
Document that mshapeTree is partialmild-tweaks-repackaged
Diffstat (limited to 'src')
-rw-r--r--src/Data/Array/Nested/Mixed.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Mixed.hs b/src/Data/Array/Nested/Mixed.hs
index eb05eaa..f9d9aa8 100644
--- a/src/Data/Array/Nested/Mixed.hs
+++ b/src/Data/Array/Nested/Mixed.hs
@@ -355,6 +355,9 @@ class Elt a where
-- | Tree giving the shape of every array component.
type ShapeTree a
+ -- | Produces an internal representation of a tree of shapes of (potentially)
+ -- nested arrays. If the argument is an array, it requires that the array
+ -- is not empty (it's guaranteed to crash early otherwise).
mshapeTree :: a -> ShapeTree a
mshapeTreeEq :: Proxy a -> ShapeTree a -> ShapeTree a -> Bool
@@ -676,6 +679,7 @@ instance Elt a => Elt (Mixed sh' a) where
type ShapeTree (Mixed sh' a) = (IShX sh', ShapeTree a)
+ -- This requires that @arr@ is not empty.
mshapeTree :: Mixed sh' a -> ShapeTree (Mixed sh' a)
mshapeTree arr = (mshape arr, mshapeTree (mindex arr (ixxZero (ssxFromShX (mshape arr)))))