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
20241128 カリー化
Search
saka
December 23, 2025
2
0
Share
20241128 カリー化
saka
December 23, 2025
More Decks by saka
See All by saka
20250304 関数型DDD 6
sakatttttta
0
17
20241219 Github Actionsの面倒いところ
sakatttttta
0
3
20250109 関数型
sakatttttta
0
3
20250116 関数型DDD 2
sakatttttta
0
4
20250123 関数型DDD 3
sakatttttta
0
2
20250206 関数型DDD 4
sakatttttta
0
1
20250213 関数型DDD 4
sakatttttta
0
2
20250220 Hono カスタムfetch
sakatttttta
0
1
20250225 関数型DDD 5
sakatttttta
0
1
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
93
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Code Reviewing Like a Champion
maltzj
528
40k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
500
Raft: Consensus for Rubyists
vanstee
141
7.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
470
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Ethics towards AI in product and experience design
skipperchong
2
250
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
260
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
700
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Transcript
ΧϦʔԽͬͯͬͯ·͢ʁ
ॳ
ͳͥΦϒδΣΫτࢦͰ ࡞Δͷ͔
ͷؔܕݴޠͷ ίʔφʔ
ୈҰڃؔ ෦ద༻
ୈҰڃؔ ᵓᴷᴷ ΧϦʔԽ │ └── ҾΛ1ͭͣͭड͚औΔؔʹม └── ෦ద༻ └── Ұ෦ͷҾΛݻఆͯ͠৽͍ؔ͠Λ࡞
ୈҰڃؔ
ؔΛมͱಉ͡Α͏ʹ ͑Δ
// ੜ let calc = (x: number, y: number): number
=> x + y; console.log(calc(3, 4)); // ݁Ռ: 7
ߴ֊ؔ
ҾฦΓʹؔ
// ೖ calc = (x: number, y: number): number =>
x - y; // ड͚͠ const diffLength = (a: string, b: string, fn: (x: number, y: number) => number): number => { return fn(a.length, b.length); }; console.log(diffLength('aaa', 'a', calc)); // 2
෦ద༻
const add = (a: number, b: number) => a +
b; // ෦ద༻Ͱʮa = 2ʯΛݻఆ const add2 = (b: number) => add(2, b); console.log(add2(3)); // 5
ΧϦʔԽ
// ௨ৗͷؔ function add(a: number, b: number): number { return
a + b; } // ΧϦʔԽ͞Εͨؔ const curriedAdd = (a: number) => (b: number) => a + b; console.log(curriedAdd(2)(3)); // 5 const curriedAdd2 = curryAdd(2); const result = curryAdd2(3); // 5