Questions tagged [agda-stdlib]
17 questions
0
votes
1 answer
Agda: std-lib: List: pattern matching with snoc
I wrote a function to get everything but the last element of a List from std-lib:
open import Data.List
allButLast : ∀ {a} {A : Set a} → List A → List A
allButLast [] = []
allButLast (x ∷ []) = []
allButLast (x ∷ xs) = x ∷ allButLast xs
For…

fsuna064
- 195
- 1
- 7
-1
votes
1 answer
Agda: std-lib: List: all but last element with snoc
I defined allButLast this way:
allButLast : ∀ {a} {A : Set a} → List A → List A
allButLast l.[] = l.[]
allButLast list = l.reverse (tail' (l.reverse list))
and would like to prove the following statement:
allButLast-∷ʳ :
∀ {a} {A : Set a} →
…

fsuna064
- 195
- 1
- 7