Data.Ix.Shapable
Documentation
We need this type class to distinguish between different tuples of Ix. There are Shapable instances for homogenous Int tuples, but may Haddock doesn't see them.
Instances
Shapable Int | |
Shapable (Int, Int) | |
Shapable (Int, Int, Int) | |
Shapable (Int, Int, Int, Int) | |
Shapable (Int, Int, Int, Int, Int) | |
Shapable (Int, Int, Int, Int, Int, Int) | |
Shapable (Int, Int, Int, Int, Int, Int, Int) | |
Shapable (Int, Int, Int, Int, Int, Int, Int, Int) | |
Shapable (Int, Int, Int, Int, Int, Int, Int, Int, Int) |
shape :: (Shapable i, Ix i, IArray a e) => a i e -> [Int]Source
Canonical representation of the shape. The following properties hold: 'length . shape = rank' 'product . shape = size'
shapeToStride :: [Int] -> [Int]Source
How much the offset changes when you move one element in the given direction. Since arrays are in row-major order, 'last . shapeToStride = const 1'