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
81
Meltdown & Spectre
jorendorff
0
32
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
28
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
35
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
84
Teaching Programming
jorendorff
2
92
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
51
How To Fix Bugs
jorendorff
0
77
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
730
Other Decks in Programming
See All in Programming
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
170
Rethinking UI building strategies @ SFI 2024
letelete
0
270
VS Code をプロダクトにどう取り込むか
onomax
1
330
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
470
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
320
Snowflakeで眠ったデータを起こそう!
estie
0
110
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
220
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
210
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
250
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
670
Featured
See All Featured
Producing Creativity
orderedlist
PRO
336
39k
Facilitating Awesome Meetings
lara
41
5.6k
How to name files
jennybc
64
93k
Navigating Team Friction
lara
177
13k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Reflections from 52 weeks, 52 projects
jeffersonlam
344
19k
Infographics Made Easy
chrislema
238
18k
Bootstrapping a Software Product
garrettdimon
PRO
301
110k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Making Projects Easy
brettharned
108
5.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