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
関数の話
Search
yuroyoro
July 13, 2016
Programming
20
17k
関数の話
Supershipの社内勉強会で使ったやつ
yuroyoro
July 13, 2016
Tweet
Share
More Decks by yuroyoro
See All by yuroyoro
Goに無名関数の糖衣構文いれたらどうなるの? / Considering the introduction of the anonymous function syntax sugar into Go
yuroyoro
4
3.1k
Scala で 作る奇妙なプログラミング言語??
yuroyoro
4
16k
Other Decks in Programming
See All in Programming
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
160
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
780
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
170
Ethereum_.pdf
nekomatu
0
370
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
190
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
110
Click-free releases & the making of a CLI app
oheyadam
2
100
Realtime API 入門
riofujimon
0
140
僕がつくった48個のWebサービス達
yusukebe
20
17k
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
440
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
190
Featured
See All Featured
Become a Pro
speakerdeck
PRO
25
5k
Typedesign – Prime Four
hannesfritz
40
2.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
560
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Building Applications with DynamoDB
mza
90
6.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
820
A Tale of Four Properties
chriscoyier
156
23k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Optimizing for Happiness
mojombo
376
69k
Transcript
ؔͷ !ZVSPZPSP
ؔͱ
Z G Y ೖྗYʹରͯ͠ɺग़ྗZͷΛܾఆ͢Δنଇ
" # $ % *OU 4USJOH
ࣸ૾ͭͷू߹ͷରԠؔ
JOU TUS JOH ू߹ܕͱߟ͑ΔͱɺܕͱܕͷରԠنଇ
͕ؔ ϑΝʔετΫϥε
MFUGaY TIPX Y มʹʮؔʯΛೖ ଋറ Ͱ͖Δ )BTLFMM
G Y \YUP@T ^ มʹʮؔʯΛೖ ଋറ Ͱ͖Δ 3VCZ
DPOTUG Y \SFUVSOYUP4USJOH ^ มʹʮؔʯΛೖ ଋറ Ͱ͖Δ +BWB4DSJQU
ؔద༻
ධՁʮؔʯʹҾΛ༩͑ͯ݁ՌΛಘΔ͜ͱ SFUVSOYUP4USJOH GJOUTUSJOH SFUVSO ʠʡ ҾY
G H I 2Ͳͷ͔ؔΒʮධՁʯ͢Δ
G H I ਖ਼֨ධՁଆ͔Βɻී௨ͷݴޠ $+43VCZ+BWBʜ
G H I ඇਖ਼֨ධՁ֎ଆ͔ΒɻԆධՁ )BTLFMM*0ʜ
ߴ֊ؔ
MFUH *OU4USJOH TUSJOH HBʠIFMMPʠ B ʮؔʯΛड͚औΔؔ )BTLFMM
H GO \ʠIFMMPʠ GO ^ ʮؔʯΛड͚औΔؔ 3VCZ
DPOTUH GO \SFUVSOʠIFMMPʠ GO ^ ʮؔʯΛड͚औΔؔ +BWB4DSJQU
ʮؔHʯͷҾGOʹʮؔGʯΛ༩͑Δ SFUVSOYUP4USJOH SFUVSOʠIFMMPʠ GO GJOUTUSJOH H JOUTUSJOH TUSJOH lIFMMPz
SFUVSO ҾGO
ड͚औͬͨʮؔʯGOΛͬͯTUSJOHΛฦ͢ H JOUTUSJOH TUSJOH SFUVSOʠIFMMPʠ SFUVSOYUP4USJOH GOJOUTUSJOH lIFMMPz SFUVSO
ҾY SFUVSOYUP4USJOH GOJOUTUSJOH
Ϋϩʔδϟ
MFUB MFUIaYY B पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ )BTLFMM
B I Y \Y B^ पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ 3VCZ
DPOTUB DPOTUI Y \SFUVSOY B^ पғͷʮڥʯΛऔΓࠐΜͩʮؔʯ +BWB4DSJQU
ʮؔIʯʮBʯͱ͍͏ڥΛ͍֮͑ͯΔ SFUVSOY IJOUJOU B B ڥΛऔΓࠐΉ
ʮؔʯ͕ʮঢ়ଶʯΛ͍࣋ͬͯΔͱݴ͑Δ SFUVSOY IJOUJOU B SFUVSO
Ϋϩʔδϟͱ ߴ֊ؔ
MFUJ*OU *OU4USJOH JYaZTIPX Y Z ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ )BTLFMM Ϋϩʔδϟ
J Y \ Z \ Y Z UP@T^ ^
ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ 3VCZ Ϋϩʔδϟ
DPOTUJ Y \ SFUVSO Z \ SFUVSO Y Z UP4USJOH
^ ^ ҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛ࡞ͬͯฦ͢ʮؔʯ +BWB4DSJQU Ϋϩʔδϟ
ड͚औͬͨҾΛऔΓࠐΜͩʮΫϩʔδϟʯΛฦ͢ JJOUJOUTUSJOH SFUVSO JOUTUSJOH SFUVSO Y ڥΛऔΓࠐΉ SFUVSO Z UP4USJOH
Y Y SFUVSO Z UP4USJOH ҾY JOUTUSJOH
ؔ߹
GɾH Y G H Y ̎ͭͷؔG HΛॱ൪ʹద༻͢Δ߹ؔGɾHΛੜ͢Δ͜ͱ
MFUGaYY MFUHaYTIPXY MFUHGaYHGY ؔHGҾYΛGʹ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UJPOʹDPNQPTFΛఆٛ͢Δํ͕ࣗવ +BWB4DSJQU
ؔ W T ΦϒδΣΫτ
Φ ϒδΣ Ϋ τ ؔ ม
ʹ ೖͰ͖ Δ ม ʹ ೖͰ͖ Δ
Φ ϒδΣ Ϋ τ ؔ ؔ
ͷҾ ʹ ͤ Δ ؔ ͷҾ ʹ ͤ Δ
Φ ϒδΣ Ϋ τ ؔ ঢ় ଶ
Λ࣋ ͭ ϝϯό ʔ ม ঢ় ଶ Λ࣋ ͭ Ϋϩʔ δ ϟ
Φ ϒδΣ Ϋ τ ؔ ؔ
Ͱੜ ͯ͠ Γ ʹ Ͱ͖Δ ؔ Ͱੜ ͯ͠ Γ ʹ Ͱ͖Δ
Φ ϒδΣ Ϋ τ ؔ Έ
߹Θ ͤΔ͜ ͱ ͕Ͱ͖ Δ EF M FH BU F D PN Q PTJ UJP O Έ ߹Θ ͤΔ͜ ͱ ͕Ͱ͖ Δ ؔ ߹
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
͔͜͜Β ͕࣌ؒ༨ͬͨΒ
ؔ߹ͷ ॱং
I H G Y YΛGʹͨ݁͠ՌΛɺHʹͯ͠ಘͨ݁ՌΛɺIʹ͢
I H G Y ӈ͔Βࠨॲཧ͕ྲྀΕ͍ͯ͘
IɾHɾG Y ߹ؔIɾHɾGӈ͔Βద༻͞Ε͍ͯ͘
GH Y H G Y ߹ͷॱংΛٯʹͯ͠߹͢Δ Λߟ͑Δ GɾH Y
G H Y
Ͱ߹͢Δͱɺॲཧ͕ࠨ͔ΒӈʹྲྀΕΔ I H G Y GHI Y
JNQPSU$POUSPM$BUFHPSZ $BUFHPSZDBUDBUBCDBUCDDBUBD )BTLFMMͰ$POUSPM$BUFHPSZʹ ͕͋Δ )BTLFMM
DMBTT1SPD EFG H Y \H TFMG Y ^
FOE FOE 3VCZͰ1SPDͷԋࢉࢠ Λॻ͖͑Δ 3VCZ
'VODUJPOQSPUPUZQFBOE5IFO GVODUJPO G \ SFUVSO Y \SFUVSOG UIJT Y ^
^ 'VODUJPOʹBOE5IFOͳͲ࡞ΕͲ͏ʹ͔ +BWB4DSJQU
ؔ߹ͷॱংΛม͑Δͱ ࠨ͔ΒӈॲཧͷྲྀΕΛ දݱ͢Δ͜ͱ͕Ͱ͖Δ ຊਓͳͷͰࠨ͔ΒಡΈ͍ͨ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ؔద༻͢Δ ؔ
ؔద༻ࠨ͔Βӈʹྲྀ͍ͨ͠ GHI Y
] ؔద༻͢Δʮؔʯ Y]GG Y
Y͕ࠨ͔ΒӈʹG H IΛ௨ͬͯྲྀΕ͍ͯ͘ Y] GHI
] B BC C B]GGB தஔԋࢉࢠ ] ӈลͷؔʹࠨลͷΛ͢ )BTLFMM
DMBTT0CKFDU EFGʛʼ G G TFMG FOE FOE 3VCZͰશ֯
ʛʼ ͰͲ͏ʹ͔ʜ 3VCZ
0CKFDUQSPUPUZQFSFWBQQMZ GVODUJPO G \SFUVSOG UIJT ^ 0CKFDUQSPUPUZQFԚછ +BWB4DSJQU
ؔద༻͢ΔؔͰ Ҿ͕ࠨ͔ΒӈྲྀΕΔ༷Λ දݱ͢Δ͜ͱ͕Ͱ͖Δ ຊਓͳͷͰࠨ͔ΒಡΈ͍ͨ
6OJYͷQJQF &MJYJSͷ]ͳͲ Ͱ͋Μ·Γ͜͏͍͏ॻ͖ํ͠ͳ͍͚Ͳʜ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ؔ߹ͷ จ຺
EFGDPNQPTF G Y \TFMG G Y ^ FOE
ؔ߹ͷ࣮Ͱʜ 3VCZ
EFG G Y \TFMG G Y
^ FOE G Y ͷ݁ՌΛഒʹͯ͠ΈΔ 3VCZ
G Y \Y ^ H Y \Y ^ I Y
\YUP@T^ IHG ʠʡ ߹͞ΕͨؔͷؒͰҾ͕ഒʹ 3VCZ
߹͞ΕͨؔͷؒͰҾ͕ഒʹ Y GJOUJOU Y HJOUJOU YUP@T IJOUTUSJOH
ʠʡ
EFG G Y \ SFTG Y SFTOJM
OJMTFMG SFT ^ FOE G Y ͕OJMͳΒɺ߹͞ΕͨؔΛݺͣʹऴྃ͢Δ 3VCZ
G Y \<OJM Y >TBNQMF^ H Y \<OJM Y >TBNQMF^
I Y \YUP@T^ IHG OJMPSʠʡ G HͷͲͪΒ͔͕OJMΛฦ͢ͱશମͷ݁Ռ͕OJMʹͳΔ 3VCZ
߹͞ΕͨؔͷؒͰOJMνΣοΫ <OJM Y >TBNQMF GJOUJOU <OJM Y >TBNQMF HJOUJOU YUP@T
IJOUTUSJOH OJM OJM ʠʡ ऴྃ ऴྃ
ʮ݁Ռ͕ഒʹͳΔʯจ຺ ʮOJMͩͱதࢭ͢Δʯจ຺ ؔ߹ʹ༷ʑͳʮจ຺ʯΛ༩͑Δ͜ͱ͕Ͱ͖Δ
ʮঢ়ଶ͕มԽ͢Δʯจ຺ ʮೖग़ྗ͕ൃੜ͢Δʯจ຺ ʮඇಉظͰܭࢉ͢Δʯจ຺ ଞʹ͍Ζ͍Ζͳʮจ຺ʯ͕͋Δ
ؔ߹ΛநԽ͢Δͱ ੜ͞ΕΔؔʹ༷ʑͳ ੑ࣭Λ༩͑Δ͜ͱ͕Ͱ͖Δ ͔ͯ͠͠Ϟφʜʜ ҧ͍·͢
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍
ྫ ؔ߹Ͱ 'J[[#V[[
DMBTT1SPD EFGPS G Y \ SFTTFMG Y
SFTOJM G Y SFT ^ FOE FOE ࣗʹYΛద༻ͨ݁͠Ռ͕OJMͳΒɺ߹͞ΕͨؔΛݺͿ 3VCZ
GJ[[ Y \Y GJ[[OJM^ CV[[ Y \Y CV[[OJM^ GJ[[CV[[ Y
\ YY GJ[[CV[[OJM^ JE Y \YUP@T^ GJ[[ CV[[ GJ[[CV[[ͱࣈΛग़ྗ͢ΔؔΛ༻ҙ 3VCZ
NBQ GJ[[CV[[PSGJ[[PSCV[[PSJE ֤ؔΛPSͰ߹ͯ͠NBQ͢ΕGJ[[CV[[Ͱ͖Δ 3VCZ
ͦͷଞͷ τϐοΫ
wŋࢀরಁա wŋΧϦʔԽ wŋ෦ద༻ wŋ࠶ؼ wŋΈࠐΈؔ wŋσʔλߏ ϞϊΠυͱ͔ ͜ͷ͋ͨΓͷػձ͕͋ͬͨΒ
ؔ͜Θ͘ͳ͍ ͜Θ͘ͳ͍