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
カリー化入門 / currying
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nishimura Yuki
July 26, 2019
Programming
58
0
Share
カリー化入門 / currying
あくあたん工房2019年7月部会のLTです
Nishimura Yuki
July 26, 2019
More Decks by Nishimura Yuki
See All by Nishimura Yuki
特に作りたいものがない人のためのプログラミング入門
ni5h1
0
110
モンスターマシンを起こすBotを作った話 / wake up bot
ni5h1
0
33
Other Decks in Programming
See All in Programming
AIエージェントで業務改善してみた
taku271
0
540
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.5k
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
150
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
220
Angular Signal Forms
debug_mode
0
110
NakouPAY説明用
annouim0
0
250
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
24
14k
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
AI-DLC Deep Dive
yuukiyo
9
4.7k
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
450
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7k
Practical Orchestrator
shlominoach
191
11k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
270
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
How to Ace a Technical Interview
jacobian
281
24k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Transcript
カリー化入門 2019年あくあたん工房7月部会
そもそも カリー化って何?
カリー化 (currying, カリー化された =curried) とは、複数の引数をとる関数 を、引数が「もとの関数の最初の引 数」で戻り値が「もとの関数の残りの 引数を取り結果を返す関数」であるよ うな関数にすること(あるいはその関 数のこと)である。
出典:ウィキペディア
つまり、
N個の引数をとる関数 一引数を取る関数のチェイン
具体例
𝑓: 𝑥 → 𝑦 関数が引数を一つのみとる つまり、 すでにカリー化されている 引数を1個とる関数の場合
𝑓: 𝑥, 𝑦 → 𝑧 ↓ 𝑔: 𝑥 → (ℎ:
𝑦 → 𝑧) 引数を2個とる関数の場合
𝑓: 𝑥, 𝑦, 𝑧 → 𝑢 ↓ 𝑔: 𝑥 →
(ℎ: 𝑦 → (𝑖: 𝑧 → 𝑢)) 引数を3個とる関数の場合
何が うれしいの?
具体例として, 2つの引数の合計を返す関数f(x, y) をmap関数に渡す場合を考える
カリー化 されていないとき
func f(x,y) int { return x + y } func
g(x) int { return f(1, x) } list2 = map(g, list1)
カリー化 されているとき
func f(x,y) int { return x + y } list2
= map(g(1), list1)
部分適用で よくね
できることは同じ
func f(x,y) int { return x + y } g
= partial(f, 1) list2 = map(g, list1)
おまけ Pythonでカリー化
>>> currying.f("a")("b")("c") 'abc' カリー化されてる関数
>>> currying.f("a")("b")("c") 'abc' 関数をカリー化する関数
ご清聴ありがとう ございました