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
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
1
660
Kotlinの開発でも AIをいい感じに使いたい / Making the Most of AI in Kotlin Development
kohii00
5
2k
Duke on CRaC with Jakarta EE
ivargrimstad
0
240
Boost Your Web Performance with Hyperdrive
chimame
1
130
Jasprが凄い話
hyshu
0
190
良いコードレビューとは
danimal141
10
8.9k
コードを読んで理解するko build
bells17
1
120
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
370
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
3
860
クックパッド検索システム統合/Cookpad Search System Consolidation
giga811
0
180
はじめての Go * WASM * OCR
sgash708
1
120
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Why Our Code Smells
bkeepers
PRO
336
57k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Producing Creativity
orderedlist
PRO
344
40k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
550
Building Your Own Lightsaber
phodgson
104
6.2k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Typedesign – Prime Four
hannesfritz
41
2.5k
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!