@@ -72,9 +72,9 @@ index' _ [] = Nothing
73||| Get the first element of a non-empty list
73||| Get the first element of a non-empty list
74||| @ ok proof that the list is non-empty
74||| @ ok proof that the list is non-empty
75−head : (l : List a) -> (ok : isCons l = True) -> a
75+head : (l : List a) -> {auto ok : isCons l = True} -> a
76−head [] refl impossible
76+head [] {ok=refl} impossible
77−head (x::xs) p = x
77+head (x::xs) {ok=p} = x
79||| Attempt to get the first element of a list. If the list is empty, return
79||| Attempt to get the first element of a list. If the list is empty, return
80||| `Nothing`.
80||| `Nothing`.
@@ -84,9 +84,9 @@ head' (x::xs) = Just x
85||| Get the tail of a non-empty list.
85||| Get the tail of a non-empty list.
86||| @ ok proof that the list is non-empty
86||| @ ok proof that the list is non-empty
87−tail : (l : List a) -> (ok : isCons l = True) -> List a
87+tail : (l : List a) -> {auto ok : isCons l = True} -> List a
88−tail [] refl impossible
88+tail [] {ok=refl} impossible
89−tail (x::xs) p = xs
89+tail (x::xs) {ok=p} = xs
91||| Attempt to get the tail of a list.
91||| Attempt to get the tail of a list.
@@ -97,10 +97,10 @@ tail' (x::xs) = Just xs
98||| Retrieve the last element of a non-empty list.
98||| Retrieve the last element of a non-empty list.
99||| @ ok proof that the list is non-empty
99||| @ ok proof that the list is non-empty
100−last : (l : List a) -> (ok : isCons l = True) -> a
100+last : (l : List a) -> {auto ok : isCons l = True} -> a
101−last [] refl impossible
101+last [] {ok=refl} impossible
102−last [x] p = x
102+last [x] {ok=p} = x
103−last (x::y::ys) p = last (y::ys) refl
103+last (x::y::ys) {ok=p} = last (y::ys) {ok=refl}
105||| Attempt to retrieve the last element of a non-empty list.
105||| Attempt to retrieve the last element of a non-empty list.
@@ -114,10 +114,10 @@ last' (x::xs) =
115||| Return all but the last element of a non-empty list.
115||| Return all but the last element of a non-empty list.
116||| @ ok proof that the list is non-empty
116||| @ ok proof that the list is non-empty
117−init : (l : List a) -> (ok : isCons l = True) -> List a
117+init : (l : List a) -> {auto ok : isCons l = True} -> List a
118−init [] refl impossible
118+init [] {ok=refl} impossible
119−init [x] p = []
119+init [x] {ok=p} = []
120−init (x::y::ys) p = x :: init (y::ys) refl
120+init (x::y::ys) {ok=p} = x :: init (y::ys) {ok=refl}
122||| Attempt to Return all but the last element of a list.
122||| Attempt to Return all but the last element of a list.