Dimensional
tabulate
(Fn [(Ref (Fn [(Index (a (Size b) Opaque) Int)] c) d)] (a (Size b) c))
(tabulate f)
Tabulate maps a lookup
function (any function that takes an Index
as an
argument) over the positions of a sized functor.
(tabulate (lookup f))= (id f)
To make this function useful, one often needs to use an overarching context to ensure the resulting functor is sized appropriately.
transpose
(Fn [(Ref (a (Size b) (c (Size d) e)) StaticLifetime)] (c (Size d) (a (Size b) e)))
(transpose f)
Transpose takes a sized functor whose inhabitants are sized functors and effectively swaps their sizes; it is equivalent to matrix transposition.
For example, given a Vector of Size 3 of Vectors of Size 2
(Vector [(Vector [1 2]) (Vector [3 4]) (Vector [5 6])])
transpose will return a Vector of size 2 of Vectors of size 3:
(Vector [(Vector [1 3 5]) (Vector [2 4 6])])