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
oetzi
February 21, 2012
Programming
1
220
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
94
Implementing Functional Reactive Programming in Scala - Project Proposal
oetzi
1
180
Other Decks in Programming
See All in Programming
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
500
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
590
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
200
Laravel Boost 超入門
fire_arlo
3
210
rage against annotate_predecessor
junk0612
0
170
為你自己學 Python - 冷知識篇
eddie
1
350
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
210
Rancher と Terraform
fufuhu
2
240
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
140
Testing Trophyは叫ばない
toms74209200
0
860
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
480
Featured
See All Featured
Side Projects
sachag
455
43k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Done Done
chrislema
185
16k
Statistics for Hackers
jakevdp
799
220k
Site-Speed That Sticks
csswizardry
10
810
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
A Tale of Four Properties
chriscoyier
160
23k
Balancing Empowerment & Direction
lara
3
620
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
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!