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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jason Orendorff
March 30, 2013
Programming
9
990
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
150
Meltdown & Spectre
jorendorff
0
110
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
88
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
80
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
130
Teaching Programming
jorendorff
2
150
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
90
How To Fix Bugs
jorendorff
0
120
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
810
Other Decks in Programming
See All in Programming
Basic Architectures
denyspoltorak
0
660
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
組織で育むオブザーバビリティ
ryota_hnk
0
170
CSC307 Lecture 08
javiergs
PRO
0
670
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
AI巻き込み型コードレビューのススメ
nealle
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
490
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
130
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
620
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Featured
See All Featured
Building Adaptive Systems
keathley
44
2.9k
Docker and Python
trallard
47
3.7k
Navigating Weather and Climate Data
rabernat
0
100
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Unsuck your backbone
ammeep
671
58k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Building AI with AI
inesmontani
PRO
1
680
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
50
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Large-scale JavaScript Application Architecture
addyosmani
515
110k
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