Remove rank-index on Order type

This commit is contained in:
Kiana Sheibani 2022-05-16 08:56:45 -04:00
parent a499d14e87
commit 76e16574f1
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
4 changed files with 30 additions and 63 deletions

View file

@ -46,8 +46,12 @@ index [] x = x
index (i::is) v = index is $ index i v
export
getLocation' : (sts : Vect rk Nat) -> (is : Vect rk Nat) -> Nat
getLocation' = sum .: zipWith (*)
||| Compute the memory location of an array element
||| given its coordinate and the strides of the array.
export
getLocation : Vect rk Nat -> Coords {rk} s -> Nat
getLocation sts is = sum $ zipWith (*) sts (toNats is)
getLocation sts is = getLocation' sts (toNats is)