Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Reactive Programming
Search
Jason Orendorff
March 30, 2013
Programming
10
940
Functional Reactive Programming
Slides for a talk by Wilkes Joiner at Nashville Code Co-op Talk Day.
Jason Orendorff
March 30, 2013
Tweet
Share
More Decks by Jason Orendorff
See All by Jason Orendorff
Aristotle's Topics
jorendorff
0
96
Meltdown & Spectre
jorendorff
0
33
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
37
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
36
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
91
Teaching Programming
jorendorff
2
94
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
52
How To Fix Bugs
jorendorff
0
84
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
740
Other Decks in Programming
See All in Programming
CSC307 Lecture 05
javiergs
PRO
0
210
Rust.Nagoya #1
codemountains
0
170
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
日付と正規化
megmogmog1965
0
140
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
Android開発者のための Kotlin Multiplatform入門
ntaro
0
190
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
英語
s_shimotori
1
220
Ruby メモリ管理 プログラミング
megmogmog1965
0
130
初心者がおさえておきたいAWS CDKのベストプラクティス 2024
konokenj
15
7.3k
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Practical Orchestrator
shlominoach
185
10k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
How to Ace a Technical Interview
jacobian
274
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
13
430
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Scaling GitHub
holman
458
140k
Making Projects Easy
brettharned
111
5.7k
The Mythical Team-Month
searls
217
43k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
44
4.7k
Ruby is Unlike a Banana
tanoku
96
10k
How STYLIGHT went responsive
nonsquared
93
5k
Transcript
Functional Reactive Programming
“Everything flows, nothing stands still.” Heraclitus
Streams of Events
Streams of Events • Fire and forget events are relatively
easy to create.
Streams of Events • Fire and forget events are relatively
easy to create. • UIs
Streams of Events • Fire and forget events are relatively
easy to create. • UIs • Ajax posts
Streams of Events • Fire and forget events are relatively
easy to create. • UIs • Ajax posts • Messaging queues
Processing Events
Processing Events • A little trickier
Processing Events • A little trickier • difficult to compose
Processing Events • A little trickier • difficult to compose
• lots of plumbing
Processing Events • A little trickier • difficult to compose
• lots of plumbing • Callback Hell
“We’re going to need a bigger boat.”
FRP • A model for values that vary over time
• Originates from Haskell Community • Several different implementation styles • We are focusing on Microsoft’s ReactiveExtenions style
Observable
Observable • A marriage of Iterables and the Observer Pattern
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events • Composable - SelectMany/FlatMap
Marble Diagrams
A Marble Diagrams
A Marble Diagrams
A B Marble Diagrams
A B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
Autocomplete • On Keyup • Get the value of the
field • Only values of length 3 or more • Make remote call • Filter out bad response • Display results
Autocomplete in reality • On Keyup • Get the value
of the field • Throttle to 500ms • Only values of length 3 or more • Skip duplicates • Make remote call • Filter out bad response • Display results
Demo Source code: https://github.com/Cicayda/yolk-examples