Skip to content

Commit 8669bad

Browse files
committed
[add]: length-⁺++⁺-comm
1 parent 0a9db06 commit 8669bad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Data/List/NonEmpty/Properties.agda

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ open import Data.Maybe.Properties using (just-injective)
1616
open import Data.Bool.Base using (Bool; true; false)
1717
open import Data.List.Base as List using (List; []; _∷_; _++_)
1818
open import Data.List.Effectful using () renaming (monad to listMonad)
19-
open import Data.List.Properties using (length-++; length-++-≤ˡ; length-++-≤ʳ; ++-assoc; map-++)
19+
open import Data.List.Properties using (length-++; length-++-comm; length-++-≤ˡ; length-++-≤ʳ; ++-assoc; map-++)
2020
open import Data.List.NonEmpty.Effectful using () renaming (monad to list⁺Monad)
2121
open import Data.List.NonEmpty as List⁺
2222
using (List⁺; _∷_; tail; head; toList; _⁺++_; _⁺++⁺_; _++⁺_; length; fromList;
@@ -91,6 +91,10 @@ length-⁺++⁺ : (xs ys : List⁺ A) →
9191
length (xs ⁺++⁺ ys) ≡ length xs + length ys
9292
length-⁺++⁺ (x ∷ xs) (y ∷ ys) = length-++ (x ∷ xs)
9393

94+
length-⁺++⁺-comm : (xs ys : List⁺ A)
95+
length (xs ⁺++⁺ ys) ≡ length (ys ⁺++⁺ xs)
96+
length-⁺++⁺-comm (x ∷ xs) (y ∷ ys) = length-++-comm (x ∷ xs) (y ∷ ys)
97+
9498
length-⁺++⁺-≤ˡ : (xs ys : List⁺ A)
9599
length xs ≤ length (xs ⁺++⁺ ys)
96100
length-⁺++⁺-≤ˡ (x ∷ xs) (y ∷ ys) = s≤s (length-++-≤ˡ xs)

0 commit comments

Comments
 (0)