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
35
Authorization to implement with Extensible Effect
machuz
PRO
0
380
アルプの 認証/認可分離戦略と手法
machuz
PRO
3
710
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
310
Other Decks in Technology
See All in Technology
iPadOS18でフローティングタブバーを解除してみた
sansantech
PRO
1
140
0→1事業こそPMは営業すべし / pmconf #落選お披露目 / PM should do sales in zero to one
roki_n_
PRO
1
1.5k
コロプラのオンボーディングを採用から語りたい
colopl
5
1.3k
2025年のARグラスの潮流
kotauchisunsun
0
790
#TRG24 / David Cuartielles / Post Open Source
tarugoconf
0
580
RubyでKubernetesプログラミング
sat
PRO
4
160
タイミーのデータ活用を支えるdbt Cloud導入とこれから
ttccddtoki
1
150
今年一年で頑張ること / What I will do my best this year
pauli
1
220
Bring Your Own Container: When Containers Turn the Key to EDR Bypass/byoc-avtokyo2024
tkmru
0
860
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!事例のご紹介+座学②
siyuanzh09
0
110
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Bash Introduction
62gerente
610
210k
Typedesign – Prime Four
hannesfritz
40
2.5k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building Your Own Lightsaber
phodgson
104
6.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Navigating Team Friction
lara
183
15k
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ͰΔͷͰ͏ͪΐ͍͓ͪΛ