Comments (3)
Yes, this probably would make sense (if nothing comparable is there).
from agda-stdlib.
So, I suggest for Standard library (if nothing comparable is there):
foldr-ys++y-eq : ∀ {α β} {A : Set α} {B : Set β} →
(f : A → B → B) → (x : B) → (y : A) → (ys : List A) →
foldr f x (ys ∷ʳ y) ≡ foldr f (f y x) ys
foldr-ys++y-eq _ _ _ [] = PE.refl
foldr-ys++y-eq f x y (z ∷ ys) = PE.cong (f z) $ foldr-ys++y-eq f x y ys
---
foldl≗foldr∘reverse : ∀ {α β} {A : Set α} {B : Set β} →
(f : A → B → B) → (x : B) → (ys : List A) →
foldl (flip f) x ys ≡ foldr f x (reverse ys)
foldl≗foldr∘reverse _ _ [] = PE.refl
foldl≗foldr∘reverse f xs (y ∷ ys) =
PE.sym $
≡begin
foldr f xs (reverse (y ∷ ys)) ≡[ PE.cong (foldr f xs)
rev-yys≡rev-ys++y ]
foldr f xs ((reverse ys) ∷ʳ y) ≡[ foldr-ys++y-eq f xs y
(reverse ys) ]
foldr f (f y xs) (reverse ys) ≡[ PE.sym $ foldl≗foldr∘reverse
f (f y xs) ys ]
foldl ff (f y xs) ys
≡end
where rev-yys≡rev-ys++y = unfold-reverse y ys
ff = flip f
(the implementation can be changed to something appropriate).
from agda-stdlib.
Added in 45c59f4 (named foldr-reverse
)
from agda-stdlib.
Related Issues (20)
- Tidying up `Data.Digit`
- Define `LocalRing` HOT 1
- Additions to `Data.Rational.*` HOT 3
- Redefining `Data.Nat.DivMod.DivMod` HOT 10
- Tag 1.7.3 warns the use of the name `toℕ-injective` instead of deprecated `toNat-injective` HOT 1
- Equality of functions in the new function hierarchy
- Missing reexports in function bundles HOT 2
- Define square root for `Data.Nat` (and `Data.Nat.Binary`, `Data.Word` etc.)
- Post-release version bump in `standard-library.agda-lib`? HOT 1
- updating `README.md` HOT 4
- suggestion for divisibility `_∣ʳ_ ` in `lib-2.0` HOT 3
- CI needs updating to more recent GHC version HOT 1
- Some recent additions to `Data.Nat.Divisibility` use vertical bar rather than dvisibility operator in their names HOT 3
- lib-2.0: factors-∣ rather than ∣-factors in divisibility in CommutativeMagma HOT 1
- Names and definitions in the `+-IsAbelianGroup` instance of `IsRing` HOT 5
- Streamlining the `make test`/CI infrastructure? HOT 3
- pattern synonym in `Nat.Base` in the way when working with products HOT 3
- [DRY] Reconciling the indices of `IsX` with those of the corresponding `RawX` HOT 11
- Redundant `zero` field in `Algebra.Structures.Biased.IsRing*`? HOT 7
- [DRY] defining concrete instances of `RawX` bundles HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agda-stdlib.