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
Implementing Functional Reactive Programming in...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
oetzi
February 21, 2012
Programming
230
1
Share
Implementing Functional Reactive Programming in Scala - Progress Presentation
A presentation showing the capabilities of my current FRP framework
oetzi
February 21, 2012
More Decks by oetzi
See All by oetzi
Implementing Functional Reactive Programming in Scala - Final Presentation
oetzi
1
99
Implementing Functional Reactive Programming in Scala - Project Proposal
oetzi
1
180
Other Decks in Programming
See All in Programming
Explore CoroutineScope
tomoeng11
0
110
PHPer、Cloudflare に引っ越す
suguruooki
1
110
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
230
10 Tips of AWS ~Gen AI on AWS~
licux
5
480
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
990
AIと共に生きる技術選定 2026
sgash708
0
110
Kingdom of the Machine
yui_knk
2
1.1k
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
370
GitHubCopilotCLIをはじめよう.pdf
htkym
0
290
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.3k
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
280
Featured
See All Featured
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
150
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.2k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
330
The browser strikes back
jonoalderson
0
990
What's in a price? How to price your products and services
michaelherold
247
13k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
120
How to Think Like a Performance Engineer
csswizardry
28
2.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
820
How GitHub (no longer) Works
holman
316
150k
Designing for humans not robots
tammielis
254
26k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Transcript
Implementing Functional Reactive Programming in
Remember this?
Behaviour[T] = Time => T
Event[T] = Stream[(Time, T)]
Lets use them...
val beh = new Behaviour(time => Color.red)
beh.at(now)
beh.at(now) def now = System.currentTimeMillis
beh.map(val => val.toString)
val event = new Event[Boolean]
beh.until(event, beh1)
“Hi!”.toggle(event, “Bye!”)
“Hi!”.toggle(event, “Bye!”) ?
implicit def lift[T](value : T) = { new Behaviour(time =>
value) }
implicit def lift[T](value : T) = { new Behaviour(time =>
value) }
So Far:
So Far: - Core FRP: Behaviour/Event
So Far: - Core FRP: Behaviour/Event - UI Framework
So Far: - Core FRP: Behaviour/Event - UI Framework -
I/O Framework
Everything: http://github.com/oetzi/echo
An example...
None
val playButton = Button(button => "Play".toggle(button.click, "Pause"))
val slider = Slider()
val playing = false.toggle(playButton.click, true) val song = new Song(file,
playing, slider.value)
val anim = song.volume.map1(width) { (v, w) => math.min(v *
(w / 50F), w) } val bouncer = Block(anim, height - 70, Color.green)
val frame = Frame(width, height, List( bouncer, slider, playButton ))
What if something goes wrong?
class Dangerous extends Breakable { dangerous { () => break_everything()
} }
class Dangerous extends Breakable { dangerous { () => break_everything()
} } val danger = new Dangerous() val err : Event[Exception] = danger.errors
DOING IT LIVE
Thank You!