Comments (5)
reduce 实现模式
from ideas.
- http://elbenshira.com/blog/understanding-transducers/
- https://kukuruku.co/post/clojure-transducers-reducers-and-other-stuff/
- http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
(defn mapping
[f]
(fn [reducing]
(fn [result input]
(reducing result (f input)))))
(defn filtering
[predicate]
(fn [reducing]
(fn [result input]
(if (predicate input)
(reducing result input)
result))))
(reduce
((filtering even?) conj)
[]
(reduce
((mapping inc) conj)
[]
(range 10)))
; ⇒ [2 4 6 8 10]
from ideas.
其他语言的实现
from ideas.
reduce VS. fold
- https://www.cs.cornell.edu/courses/cs3110/2009sp/lectures/lec05.html
- http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html
from ideas.
https://homes.cs.washington.edu/~billhowe/mapreduce_a_major_step_backwards.html
from ideas.
Related Issues (20)
- bash manual
- Socket SO_REUSEADDR HOT 5
- leetcode 开刷,每周两道
- TCO in Python, Javascript, Ruby
- jvm gc, memory stat
- Clojure cheatsheet HOT 10
- JVM gc 算法 HOT 7
- latency & bindwidth tcp http HOT 7
- Java Thread-safety misc
- CAP HOT 2
- chrome devtools
- 开源公司的经验教训
- 名人访谈
- 让子弹飞一会儿-- **科技监管的意图和临界点 HOT 1
- **、半导体以及寻求独立的原动力 HOT 1
- 有网友发现关于芯片的一个历史内幕了
- An Interview with Mickey Petersen, author of Mastering Emacs HOT 1
- An Interview with Bozhidar Batsov, Creator of CIDER, Projectile, Prelude, and RuboCop HOT 1
- Emacs 29 is nigh! What can we expect? HOT 1
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 ideas.