Skip to content

Commit 25389a7

Browse files
committed
fixup! foldl-cong: don't take d ≡ e
1 parent 2a959aa commit 25389a7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Additions to existing modules
323323
mapMaybe-cong : f ≗ g → mapMaybe f ≗ mapMaybe g
324324
zipWith-cong : (∀ a b → f a b ≡ g a b) → ∀ as → zipWith f as ≗ zipWith g as
325325
unzipWith-cong : f ≗ g → unzipWith f ≗ unzipWith g
326-
foldl-cong : (∀ x y → f x y ≡ g x y) → d ≡ e → foldl f d ≗ foldl g e
326+
foldl-cong : (∀ x y → f x y ≡ g x y) → ∀ x → foldl f x ≗ foldl g x
327327
alignWith-flip : alignWith f xs ys ≡ alignWith (f ∘ swap) ys xs
328328
alignWith-comm : f ∘ swap ≗ f → alignWith f xs ys ≡ alignWith f ys xs
329329
align-flip : align xs ys ≡ map swap (align ys xs)

src/Data/List/Properties.agda

+4-5
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,10 @@ module _ {P : Pred A p} {f : A → A → A} where
696696
------------------------------------------------------------------------
697697
-- foldl
698698

699-
foldl-cong : {f g : B A B} {d e : B}
700-
( x y f x y ≡ g x y) d ≡ e
701-
foldl f d ≗ foldl g e
702-
foldl-cong f≗g refl [] = refl
703-
foldl-cong f≗g d≡e (x ∷ xs) rewrite d≡e = foldl-cong f≗g (f≗g _ x) xs
699+
foldl-cong : {f g : B A B} ( x y f x y ≡ g x y)
700+
x foldl f x ≗ foldl g x
701+
foldl-cong f≗g x [] = refl
702+
foldl-cong f≗g x (y ∷ xs) rewrite f≗g x y = foldl-cong f≗g _ xs
704703

705704
foldl-++ : (f : A B A) x ys zs
706705
foldl f x (ys ++ zs) ≡ foldl f (foldl f x ys) zs

0 commit comments

Comments
 (0)