Proof of list bounds was made to be not present at runtime when indexing

This commit is contained in:
Denis Buzdalov 2020-12-03 17:26:05 +03:00 committed by G. Allais
parent 57a8ef4609
commit f2596318e5

View File

@ -58,7 +58,7 @@ inBounds (S k) (x :: xs) with (inBounds k xs)
|||
||| @ ok a proof that the index is within bounds
public export
index : (n : Nat) -> (xs : List a) -> {auto ok : InBounds n xs} -> a
index : (n : Nat) -> (xs : List a) -> {auto 0 ok : InBounds n xs} -> a
index Z (x :: xs) {ok = InFirst} = x
index (S k) (_ :: xs) {ok = InLater _} = index k xs