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
let_s_use_Eff.pdf
Search
machu
PRO
November 08, 2018
Technology
1
58
let_s_use_Eff.pdf
machu
PRO
November 08, 2018
Tweet
Share
More Decks by machu
See All by machu
NBAチームから学ぶ強いチームの作り方
machuz
PRO
0
31
Authorization to implement with Extensible Effect
machuz
PRO
0
370
アルプの 認証/認可分離戦略と手法
machuz
PRO
3
700
AuthzCtx - Alp社内共有会
machuz
PRO
0
66
アルプのEff独自エフェクト集 / Alp-original ’Eff’ pearls
machuz
PRO
1
1.8k
Scalebaseバックエンド構成について/the backend design of Scalebase
machuz
PRO
0
6.2k
SQL Meisterへの道 ~更新編~ / sql-meister-CUD
machuz
PRO
0
2.2k
SQL Meisterへの道 ~基礎〜参照編~ / sql-meister-R
machuz
PRO
0
2.5k
Authz
machuz
PRO
0
300
Other Decks in Technology
See All in Technology
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
16
4.1k
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
Storage Browser for Amazon S3
miu_crescent
1
180
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
330
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
MLOps の現場から
asei
6
640
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
250
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
KATA
mclloyd
29
14k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
We Have a Design System, Now What?
morganepeng
51
7.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
The Cost Of JavaScript in 2023
addyosmani
45
7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Transcript
let's use Eff ~first step~
ࠓ ΄Μͷ͞ΘΓ͚ͩͰ͢
༻ޠͷઆ໌ • Monad Transformer • Extensible effect (use FreeMonad) •
˒Freer effects (use FreerMonad, Efficient Freer) • ࠓճಋೖ͢ΔͷFreer effectsɻ͜·͍ผͰࢿྉ࡞ͬͯ෦ձͰͰ͠·͢ɻ
effͰͳʹ͕͍ͨ͠ͷ͔ • DSLΛ࡞ͬͯͦΕΛ߹͍ͨ͠ɻ • DSLӳޠαϓϦDSLతͳ୯ҐͰ࡞ΔͱυϝΠϯ͕Ͱ͔͗ͯ͋͢·Γҙຯ͕ͳ͍ • ࡉ͔͍୯ҐͰDSLΛ࡞ΓɺͦΕΛUseCaseͰ߹͢ΕυϝΠϯ͕Β·ͳ͍ • DSLΛ࡞Δ·Ͱͳ͍ࡉ͔ͳEffect߹͍ͨ͠ •
zipkinͰͷτϨʔεॲཧͷϕϯνϚʔΫɺΞϓϦέʔγϣϯίʔυͷมߋ͕ඞཁͳٕज़Ҋ݅Λ͢ ҆͘શʹߦ͏͜ͱ͕Ͱ͖Δɻ • ※͜͜Ͱ͍͏DSLશͯEDSLͰ͢ɻ
Ͳ͏มΘΔͷ͔ SecondaryAdapter UseCase Domain Application ※ґଘੑٯసޙͷਤͰ͢ ·ͣ͜͜ʹDSL,InterpreterΛ ಋೖ͢Δɻ Lib ͍·Θ͠Մೳͳ෦͜͜
ίʔυͷΠϝʔδ
DSL • ͜Μͳײ͡ͷܕ(ADT)͕Ͱ͖·͢ɻ • store,find,delete,exists,clearMonad Stackૢ࡞ΛੵΉεϚʔτίϯετϥΫλͰ͢ɻҰݟͦ͠͏Ͱ͕͏ͱ͖؆୯ͳͷͰ҆͝৺Λ(ޙड़)
Interpreter • ఆٛͨ͠ADTΛύλʔϯϚονͯ͠ॲཧΛ͢Δɻ • ͜͜Ͱ৭ΜͳEffectΛ߹͢Δ͜ͱ͕Ͱ͖Δɻ
࣮ߦ • InterpreterͷςετΛషͬͯΈΔ • ͜ͷςετ௨Γ·͢ɻ • CacheIOͷதͰwriter,reader,either,taskΛ߹͍ͯ͠Δͷ ʹɺprogramͰ΄ͱΜͲҙࣝ͠ͳ͍ͰOK • ࣮ߦ࣌ʹͲͷEffectΛ͍ࠞͥͯΔ͔͚ͩڭ͑ͯ͋͛ͳ͍ͱ͍
͚ͳ͍͕ɺࡉ͔͘ҙࣝ͠ͳ͍ͰॅΉΑ͏ʹ͢Δ༧ఆ (CacheIO,TwilioIOͷελοΫΛ͕ͬͪΌΜͯ͜͠Θͨͩ͢ ͚ɺ͘Β͍ͷཻɻ
͏গ͠༡ΜͰΈΑ͏ • ಠࣗఆٛͷDSLͱผͰtaskܕͱUnitܕࠞͥͯΈΔɻ • ͜Εී௨ʹ௨Δɻ • ܕ߹ΘͤήʔϜ͕ͷ͘͢͝γϯϓϧʹͳ͍ͬͯΔͷ͕͓Θ͔Γ͍͚ͨͩΔͩΖ͏͔ɾɾɾɾɾ • sequenceEff.SequenceAͰ༻ҙ͞Ε͍ͯΔɻࠓͬͯΔͷΧόʔ͍ͯ͠Δɻ
Γ࡞ۀήʔ͜ͳͤ PRͰΔͷͰ͏ͪΐ͍͓ͪΛ