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
93
Implementing Functional Reactive Programming in Scala - Project Proposal
oetzi
1
170
Other Decks in Programming
See All in Programming
人には人それぞれのサービス層がある
shimabox
3
500
テスト分析入門/Test Analysis Tutorial
goyoki
12
2.7k
複数アプリケーションを育てていくための共通化戦略
irof
7
2.6k
tsconfigのオプションで変わる型世界
keisukeikeda
1
130
JVM の仕組みを理解して PHP で実装してみよう
m3m0r7
PRO
1
250
REST API設計の実践 – ベストプラクティスとその落とし穴
kentaroutakeda
2
320
Practical Domain-Driven Design - Workshop at NDC 2025
mufrid
0
130
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
13
3.7k
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
600
Perlで痩せる
yuukis
1
660
External SecretsのさくらProvider初期実装を担当しています
logica0419
0
250
Blueskyのプラグインを作ってみた
hakkadaikon
1
300
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.1k
Fireside Chat
paigeccino
37
3.5k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
Visualization
eitanlees
146
16k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
4 Signs Your Business is Dying
shpigford
183
22k
Building Applications with DynamoDB
mza
95
6.4k
Bash Introduction
62gerente
614
210k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
15
890
The Language of Interfaces
destraynor
158
25k
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!