Files
agdaproofs/Lists/Length.agda
2020-01-05 15:06:35 +00:00

20 lines
574 B
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Semiring -- for length
open import Lists.Definition
open import Lists.Fold.Fold
module Lists.Length where
length : {a : _} {A : Set a} (l : List A)
length [] = zero
length (x :: l) = succ (length l)
length' : {a : _} {A : Set a} (l : List A)
length' = fold (λ _ succ) 0
length=length' : {a : _} {A : Set a} (l : List A) length l length' l
length=length' [] = refl
length=length' (x :: l) = applyEquality succ (length=length' l)