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
960
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
110
Meltdown & Spectre
jorendorff
0
72
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
50
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
46
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
110
Teaching Programming
jorendorff
2
100
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
61
How To Fix Bugs
jorendorff
0
93
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
760
Other Decks in Programming
See All in Programming
エンジニアが挑む、限界までの越境
nealle
1
210
趣味全開のAITuber開発
kokushin
0
200
海外のアプリで見かけたかっこいいTransitionを真似てみる
shogotakasaki
1
170
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
340
VitestのIn-Source Testingが便利
taro28
6
1.8k
Contribute to Comunities | React Tokyo Meetup #4 LT
sasagar
0
200
ComposeでWebアプリを作る技術
tbsten
0
110
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
400
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
0
700
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
670
状態と共に暮らす:ステートフルへの挑戦
ypresto
1
560
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
160
Featured
See All Featured
Become a Pro
speakerdeck
PRO
27
5.3k
[RailsConf 2023] Rails as a piece of cake
palkan
54
5.4k
Practical Orchestrator
shlominoach
186
11k
GraphQLとの向き合い方2022年版
quramy
46
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Product Roadmaps are Hard
iamctodd
PRO
52
11k
Gamification - CAS2011
davidbonilla
81
5.2k
Designing Experiences People Love
moore
141
24k
Unsuck your backbone
ammeep
670
57k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
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