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
Using Future
Search
DAloG
November 01, 2015
Programming
0
90
Using Future
I will try to explore concept of Async state and Future monad
DAloG
November 01, 2015
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
190
Redux + MQTT
dalog
1
770
От задач к проблемам
dalog
1
250
Unlimited power of Data-Driven UI
dalog
4
630
Data-Driven View Controllers. Tips and Tricks
dalog
5
1.9k
2 years of Redux in iOS. Lessons learned
dalog
0
370
Why unidirectional architecture matter for iOS.
dalog
1
290
Mobile backend without REST
dalog
2
100
Self managed teams 101
dalog
0
150
Other Decks in Programming
See All in Programming
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
120
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
320
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
270
エラーって何種類あるの?
kajitack
5
270
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
Gleamという選択肢
comamoca
6
740
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
760
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
1.9k
Using AI Tools Around Software Development
inouehi
0
1.2k
CursorはMCPを使った方が良いぞ
taigakono
0
140
AIネイティブなプロダクトをGolangで挑む取り組み
nmatsumoto4
0
120
Create a website using Spatial Web
akkeylab
0
290
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1031
460k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Practical Orchestrator
shlominoach
188
11k
Unsuck your backbone
ammeep
671
58k
Producing Creativity
orderedlist
PRO
346
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Music & Morning Musume
bryan
46
6.6k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
USING FUTURES @daloog
ABOUT skype: nobidon
[email protected]
https://speakerdeck.com/dalog
ASYNC VS PARALLEL
ASYNC DO THINGS AT DEFERENT TIME
PARALLEL DO THINGS AT THE SAME TIME
GCD
GCD
NSOPERATION
NSOPERATION
[ _ TARGET: ACTION: ]
DELEGATE
STRATEGY AND CALLBACK
BLOCK
CALLBACK!!!
SIGNATURE DANCE
None
None
None
None
None
None
None
None
None
None
SEPARATE WORK FROM RESULT DELIVERY
SETTER
T -> ()
GETTER
() -> T
T -> U IS (GET, SET) -> ()
T -> U (() -> T, U -> ()) ->
()
None
ASYNC?
ASYNC GETTER
() -> T (T -> ()) -> () SET ->
()
SET<T> -> () FUTURE<T>
ASYNC SETTER
T -> () () -> (T -> ()) () ->
SET
() -> SET<T> PROMISE<T>
GETTER + SETTER = STATE
PROMISE + FUTURE = ASYNC STATE
ASYNC STATE >>> STATE
WHY THIS IS SO HARD???
ACTUALLY NOT
THINK ABOUT FUTURE AS A BOX
BOX WILL BE OPENED. SOMEDAY. MAYBE.
A = B C = A
CHAIN?
T -> U U -> K T -> K
T -> F<U> U -> F<K> T -> F<K>
(F<U> , U -> F<K>) -> F<K>
AND THEN
FLAT MAP
ERROR?
TRY<T, E>
FUTURE<T, E> = FUTURE<TRY<T, E>>
WHAT CAN BE FUTURE?
ANYTHING
UI
USING FUTURES FOR REVERSING UI FLOW. HTTPS://MEDIUM.COM/P/D3F5B7CA32D9/ EDIT
VM -> F<ACTION>
NETWORK BLUETOOTH …
EXPOSE F<> AS PUBLIC API
ALWAYS
USE ANY LIB • https://github.com/BoltsFramework/Bolts-iOS • https://github.com/mxcl/PromiseKit • https://github.com/Thomvis/BrightFutures •
https://realm.io/news/swift-summit-javier-soto-futures/ • https://realm.io/news/swift-tasks-nevyn-bengtsson/
ALL LIBS EQUAL ITS JUST ASYNC STATE
FUTURE / PROMISE ASYNC GET/SET