Nicer syntax for taking subarrays
|Reported by:||benl||Owned by:|
A few people have asked how to take sub-matrices. This is an index transformation that's easy to specify, but there should be a nice wrapper for it. We could make a shape polymorphic version using addIndex to add the starting offset.
let arr = fromList (Z :. (5 :: Int)) [1, 2, 3, 4, 5 :: Int] in fromFunction (Z :. 3) (\(Z :. ix) -> arr ! (Z :. ix + 1))