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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jason Orendorff
March 30, 2013
Programming
1k
9
Share
Functional Reactive Programming
Slides for a talk by Wilkes Joiner at Nashville Code Co-op Talk Day.
Jason Orendorff
March 30, 2013
More Decks by Jason Orendorff
See All by Jason Orendorff
Aristotle's Topics
jorendorff
0
160
Meltdown & Spectre
jorendorff
0
120
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
94
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
89
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
130
Teaching Programming
jorendorff
2
160
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
100
How To Fix Bugs
jorendorff
0
130
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
820
Other Decks in Programming
See All in Programming
CDK Deployのための ”反響定位”
watany
4
780
第3木曜LT会 #28
tinykitten
PRO
0
110
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
970
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
140
Angular Signal Forms
debug_mode
0
110
AIエージェントで業務改善してみた
taku271
0
530
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
3
310
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
140
実践CRDT
tamadeveloper
0
570
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
270
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
790
Featured
See All Featured
Practical Orchestrator
shlominoach
191
11k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Designing Experiences People Love
moore
143
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Fireside Chat
paigeccino
42
3.9k
A Modern Web Designer's Workflow
chriscoyier
698
190k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
440
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
RailsConf 2023
tenderlove
30
1.4k
Speed Design
sergeychernyshev
33
1.6k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
410
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