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
mahjong-kun.pdf
Search
YuyaHorita
March 04, 2022
0
87
mahjong-kun.pdf
YuyaHorita
March 04, 2022
Tweet
Share
More Decks by YuyaHorita
See All by YuyaHorita
Apollo_Code_Generation [jp]
horitayuya
0
2.3k
Apollo_Code_Generation [en]
horitayuya
0
220
Difference Algorithm
horitayuya
11
5.6k
iOS11でのHEVC動画のHLS配信
horitayuya
2
1.6k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
YesSQL, Process and Tooling at Scale
rocio
170
14k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Facilitating Awesome Meetings
lara
51
6.2k
Code Review Best Practice
trishagee
65
17k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Making Projects Easy
brettharned
116
6k
For a Future-Friendly Web
brad_frost
176
9.5k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Transcript
ຑͷܕ͔ΒֶͿ 5ZQF4DSJQU
໊લງా༗࠸ ݄.ೖࣾ ۙͷϓϩδΣΫτ.1BZɺ৺ଁ܅ UZQFDIBMMFOHFTΛগ͍ͣͭͬͯ͠Δ NFEJVNͷޙ͘Β͍·ͰEPOF લ৬αΠόʔΤʔδΣϯτ ຑ෦͕͋Γॴଐͯͨ͠ ్த͔Β༓ྶ෦һʹ IUUQTHJUIVCDPNUZQFDIBMMFOHFTUZQFDIBMMFOHFT
खṛͷຕͷṛͰΛ࡞Ε0,ɺ͕͑Δ👍 ͔ͳΓͬ͘͟ΓɺҰݴͰຑϧʔϧͷհ ͭͷṛͷΈΛηοτ ࣈ֊ஈλΠϓ ຕಉ͡λΠϓ ຕಉ͡λΠϓ ͭͷṛͷΈΛηοτ
ࠓ͢͜ͱ ຑͷखṛΛೖྗͯ͠ɺͦͷखṛͷͷϦςϥϧܕΛฦ͢ܕΛ ࡞ͬͨɻ ௨শຑ܅BMQIB൛ ຑ܅࡞ͷաఔͱ5ZQF4DSJQUͷػೳɾݟΛհ͍ͨ͠ IUUQTHJUIVCDPNIPSJUBZVZBNBIKPOHLVO ࠓɺ͜ͷลΓͷύϥϝʔλͷׂѪ
ṛͷܕఆٛ खṛͷܕఆٛ ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ ·ͱΊ ࣍
ṛͷఆٛ w -JUFSBM5ZQF w 5FNQMBUF-JUFSBM5ZQF
ṛͷܕఆٛ -JUFSBMܕɺͦͷ͔ࣗ͠ड͚͚ͳ͍ܕ lPzͱ͍͏-JUFSBMܕʹzPz͔͠ೖͰ͖ͳ͍ ܗؙ͕͍ͷͰʮPʯ -JUFSBM5ZQF
ṛͷܕఆٛ શ෦खಈͰఆٛʁ 5FNQMBUF-JUFSBM5ZQF ܕΛ5FNQMBUF-JUFSBMͷೖྗʹ͑Δɻ ࣈͷṛ̍ʙ·Ͱͷ͋Δɻ
ṛͷܕఆٛ w 5FNQMBUF-JUFSBM5ZQFʹ6OJPOܕΛ͢ͱͯ͠ධՁ͞Εͨ݁Ռͷ6OJPOʹͳΔ 6OJPOͷશ௨ΓͷΈ߹Θ͕ͤఆٛ͞ΕΔ 5FNQMBUF-JUFSBM5ZQF w ṛछྨ͋ΔͷͰɺ࣮ࡍb.BSL`ܕ6OJPOʹͳΔ͕ɺׂѪ
खṛͷܕఆٛ w "SSBZ5ZQF w 5VQMF5ZQF w (FOFSJDT w *OEFYFE"DDFTT5ZQFT
खṛͷܕఆٛ ྻܕ w ྻܕԿݸͷཁૉ͕͋Δ͔ɺίϯύΠϧ࣌ʹܾఆ͠ͳ͍ w λϓϧܕԿݸͷཁૉ͕͋Δ͔ɾԿ൪ͷΠϯσοΫεʹԿ ܕ͕͋Δ͔ɺίϯύΠϧ࣌ʹܾఆ͞ΕΔ λϓϧܕ IUUQTXXXUZQFTDSJQUMBOHPSHEPDTIBOECPPLPCKFDUTIUNMUVQMFUZQFT
λϓϧܕͰखࡳΛఆٛ͢ΔͱɺຕҎ֎ͷέʔε ͰίϯύΠϧΤϥʔʹͯ͘͠ΕΔͷͰྑ͍ खṛͷܕఆٛ
ͭͷṛͷΈͱͭͷṛͷΈʹղͰ͖Δ ͱɺ͞Βʹྑ͍ खṛͷܕఆٛ
(FOFSJDT ܕύϥϝʔλΛड͚औͬͯɺ৽͍͠ܕΛੜͰ͖Δ bFYUFOET`ΩʔϫʔυΛ͚Δ͜ͱͰೖྗύϥϝʔλʹ੍Λ͚ΒΕΔ खṛͷܕఆٛ
(FOFSJDT*OEFYFE"DDFTT5ZQFT AFYUFOET)BOEA੍ͷ͔͔͍ͬͯΔA5Aλϓϧܕ λϓϧܕΠϯσοΫεΞΫηεʹΑͬͯɺͦͷҐஔͰͷܕΛऔಘͰ͖Δ ྻܕͰ<> <>ͷΑ͏ʹΞΫηεग़དྷΔ͕ɺ5<> 5<>ͳͲΤϥʔʹͳΒͣʹ௨ͬͯ͠·͏ खṛͷܕఆٛ
ฒͼॱͷ੍͖͕ͩɺ खṛͷຕYηοτɺຕYηοτΛܕͰදݱͰ͖ͨ ޙɺͦΕͧΕͷ·ͱ·Γ͕݅Λຬ͔ͨ֬͢ೝ͢Ε0,
(FOFSJDT*OEFYFE"DDFTT5ZQFT खṛͷܕఆٛ
ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ w $POEJUJPOBM5ZQFT w 5ZQF&RVJWBMFODF
ܕͷ߲ԋࢉࢠ ͷΑ͏ͳͷ ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ $POEJUJPOBM5ZQFT 5ΛzPzʹೖग़དྷΔͳΒUSVFܕΛɺग़དྷͳ͍ͳΒGBMTFܕΛฦ͢ CPPMFBOܕͰͳ͘ɺUSVFͱGBMTFͷϦςϥϧܕ
ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ $POEJUJPOBM5ZQFT ͱ͜ΖͰɺʮܕ͕ಉ͡ʯͷఆʹFYUFOETΛͬͯྑ͍ͷ͔ʁ
5ZQF&RVJWBMFODF Ұൠతʹ🙅 AAܕɺOVNCFSܕʹೖͰ͖ΔͷͰUSVFʹͳΔ AAܕɺAcAܕʹೖͰ͖ΔͷͰUSVFʹͳΔ ͨͩ͠ɺϦςϥϧܕ͕ͦΕ୯ମͰൺֱ͞ΕΔ߹ʹڐ༰ग़དྷΔ ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ
ଞͷํ๏ແ͍ͷ͔ʁ
5ZQF&RVJWBMFODF UZQFDIBMMFOHFTͷਖ਼ղఆʹΘΕ͍ͯΔ&RVBMTܕ ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ શͰແ͍͕ɺଟ͘ͷέʔεͰࠔΒͳͦ͏ͳϫʔΫΞϥϯυ IUUQTHJUIVCDPNNJDSPTPGU5ZQF4DSJQUJTTVFTJTTVFDPNNFOU
5ZQF&RVJWBMFODF IUUQTHJUIVCEFWNJDSPTPGU5ZQF4DSJQUCMPCNBJOTSDDPNQJMFSDIFDLFSUT- // 'T1 extends U1 ? X1 : Y1’
// 'T2 extends U2 ? X2 : Y2' are related if // one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2, // and Y1 is related to Y2. ͭͷ$POEJUJPOBM5ZQFͷൺֱʹ࣋ͪࠐΉ͜ͱͰɺ`JEFOUJDBM`͔Ͳ͏͔֬ೝग़དྷΔ ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ
5ZQF&RVJWBMFODF ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ `4`͕͞Ε͍ͯͳ͍ͷͰɺ`4FYUFOET5`ΛධՁग़དྷͳ͍ɻ `$IFDL`b4 4FYUFOET `ܕͱͯ͠ѻΘΕΔ ٻΊ͍ͯͨɺ$POEJUJPOBM5ZQFܕ 3FGFSFODFIUUQTXXXUZQFTDSJQUMBOHPSHEPDTIBOECPPLBEWBODFEUZQFTIUNMDPOEJUJPOBMUZQFT ʮDPOEJUJPOBMUZQFTBSFEFGFSSFEʯͰݕࡧ ެࣜυΩϡϝϯτ͕ͩɺEFQSFDBUFEɻ࠷৽ͷϖʔδͰࣅͨΑ͏ͳจষΛݟ͚ͭΒΕͳ͔ͬͨɻ
5ZQF&RVJWBMFODF ͭͷṛ͕ಉ͡ṛ͔νΣοΫ͢Δ `4`͕ύϥϝʔλͱͯ͠͞Εͨ݁Ռɺ`4FYUFOET5`͕ධՁ͞Εɺ ͨͩͷb `ܕʹͳΔͷͰɺ❌
ṛͷܕఆٛɺखṛͷܕఆٛɺṛͷܕಉ࢜ͷൺֱͳͲجૅ෦Λհͨ͠ ޙɺηοτɺηοτͷ݅ʹͳ͍ͬͯΔ͔ʁཱͯ͠ ͍Δ͔ʁϝϯθϯʁͲͷͪͰ্͕ͬͨʁϩϯ͔πϞ͔ʁූ͍͔ͭ͘ʁ Λఆ͢Δ͚ͩ ·ͱΊ IUUQTHJUIVCDPNNJDSPTPGU5ZQF4DSJQUJTTVFT IUUQTTQFBLFSEFDLDPNTBJZB@NPFCJVTUZQFTZTUFNPGUIFUZQFTDSJQU IUUQTXXXUZQFTDSJQUMBOHPSHEPDTIBOECPPLUZQFTGSPNUZQFTIUNM ਆࢿྉ ެࣜυΩϡϝϯτɺ๛Ͱ͔Γ͍͢
࡚͞Μͷ54ɻಛʹɺհ͞Ε͍ͯΔOFWFSͷ͍ํɺຊ൪ίʔυͰͱͯʹཱͭ 5ZQF&RVJWBMFODFͷɻ54ͷίʔυ DIFDLFSUT ΛಡΉ͖͔͚ͬʹͳͬͨ ͠ྑ͔ͬͨΒຑ܅ͷ࣮ݟͯΈ͍ͯͩ͘͞🤲