mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-01 09:49:24 +03:00
Proof of list bounds was made to be not present at runtime when indexing
This commit is contained in:
parent
57a8ef4609
commit
f2596318e5
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user