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
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
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
670
ハーネスエンジニアリングとは?
kinopeee
13
6.8k
From Formal Specification to Property Based Test
ohbarye
0
2.4k
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
280
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
230
t *testing.T は どこからやってくるの?
otakakot
1
920
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
340
20260514_its_the_context_window_stupid.pdf
heita
0
790
AI-DLC Deep Dive
yuukiyo
9
5.6k
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
300
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Building an army of robots
kneath
306
46k
Embracing the Ebb and Flow
colly
88
5k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
370
ラッコキーワード サービス紹介資料
rakko
1
3.2M
Designing for humans not robots
tammielis
254
26k
Amusing Abliteration
ianozsvald
1
160
The Limits of Empathy - UXLibs8
cassininazir
1
320
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
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' 関数をカリー化する関数
ご清聴ありがとう ございました