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
86
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
Building Applications with DynamoDB
mza
91
6.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
4 Signs Your Business is Dying
shpigford
181
21k
Building an army of robots
kneath
302
44k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Being A Developer After 40
akosma
87
590k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
KATA
mclloyd
29
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Making Projects Easy
brettharned
116
5.9k
How to train your dragon (web standard)
notwaldorf
88
5.7k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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 ΛಡΉ͖͔͚ͬʹͳͬͨ ͠ྑ͔ͬͨΒຑ܅ͷ࣮ݟͯΈ͍ͯͩ͘͞🤲