N-dimensional arrays in Idris 2, featuring:
- Nat-indexable n-dimensional array type synonyms
- Matrices and matrix algebra helper functions
At a very basic level, the API for an N-dimensional array in Dinwiddy is the following:
Array : (dimension : Nat) -> (sizes : Vect dimension Nat) -> (type : Type)
For example, the following type declaration x
:
x : Array 2 [2, 3] Bool
Will create an array that looks like this:
### ###
Full of booleans. It’s value could be, for example:
x = [[ True, True, True ],
[ False, False, True ]]
Check out `examples` and `tests` for more information.