Add operator form for unsafe indexing
This commit is contained in:
parent
1ebf0dcbe9
commit
7916e10aef
3 changed files with 5 additions and 2 deletions
|
|
@ -243,6 +243,7 @@ array v = MkArray COrder (calcStrides COrder s) s (fromList $ collapse v)
|
|||
|
||||
infixl 10 !!
|
||||
infixl 10 !?
|
||||
infixl 10 !#
|
||||
infixl 11 !!..
|
||||
infixl 11 !?..
|
||||
|
||||
|
|
@ -395,6 +396,7 @@ export
|
|||
elements : Array {rk} s a -> Vect (product s) a
|
||||
elements (MkArray _ sts sh p) =
|
||||
let elems = map (flip index p . getLocation' sts) (getAllCoords' sh)
|
||||
-- TODO: prove that the number of elements is `product s`
|
||||
in assert_total $ case toVect (product sh) elems of Just v => v
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue