Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Implementing Functional Reactive Programming in...
Search
oetzi
February 21, 2012
Programming
1
230
Implementing Functional Reactive Programming in Scala - Progress Presentation
A presentation showing the capabilities of my current FRP framework
oetzi
February 21, 2012
Tweet
Share
More Decks by oetzi
See All by oetzi
Implementing Functional Reactive Programming in Scala - Final Presentation
oetzi
1
96
Implementing Functional Reactive Programming in Scala - Project Proposal
oetzi
1
180
Other Decks in Programming
See All in Programming
sbt 2
xuwei_k
0
300
FluorTracer / RayTracingCamp11
kugimasa
0
230
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
690
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
400
React Native New Architecture 移行実践報告
taminif
1
150
JETLS.jl ─ A New Language Server for Julia
abap34
1
400
connect-python: convenient protobuf RPC for Python
anuraaga
0
410
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
130
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Writing Fast Ruby
sferik
630
62k
Scaling GitHub
holman
464
140k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Navigating Team Friction
lara
191
16k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Into the Great Unknown - MozCon
thekraken
40
2.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
Making Projects Easy
brettharned
120
6.5k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
KATA
mclloyd
PRO
32
15k
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!