File tree 2 files changed +8
-1
lines changed 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2152,7 +2152,8 @@ Other minor changes
2152
2152
2153
2153
length-isMagmaHomomorphism : (A : Set a) → IsMagmaHomomorphism (++-rawMagma A) +-rawMagma length
2154
2154
length-isMonoidHomomorphism : (A : Set a) → IsMonoidHomomorphism (++-[]-rawMonoid A) +-0-rawMonoid length
2155
-
2155
+
2156
+ take-all : n ≥ length xs → take n xs ≡ xs
2156
2157
take-[] : ∀ m → take m [] ≡ []
2157
2158
drop-[] : ∀ m → drop m [] ≡ []
2158
2159
```
Original file line number Diff line number Diff line change @@ -759,6 +759,12 @@ length-take zero xs = refl
759
759
length-take (suc n) [] = refl
760
760
length-take (suc n) (x ∷ xs) = cong suc (length-take n xs)
761
761
762
+ -- If you take at least as many elements from a list as it has, you get the whole list.
763
+ take-all : (n : ℕ) (xs : List A) → n ≥ length xs → take n xs ≡ xs
764
+ take-all zero [] _ = refl
765
+ take-all (suc _) [] _ = refl
766
+ take-all (suc n) (x ∷ xs) (s≤s pf) = cong (x ∷_) (take-all n xs pf)
767
+
762
768
-- Taking from an empty list does nothing.
763
769
take-[] : ∀ m → take {A = A} m [] ≡ []
764
770
take-[] zero = refl
You can’t perform that action at this time.
0 commit comments