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
curry.php
Search
Kazunori Otani
March 29, 2014
Technology
720
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
curry.php
A functional programming using php.
Kazunori Otani
March 29, 2014
More Decks by Kazunori Otani
See All by Kazunori Otani
実践OpenTelemetry - Jagu'e'r オブザービリティ分科会 Meetup#2
katzchang
0
930
Kubernetes環境のオブザーバビリティの次の一歩をOpenTelemetryで実現すると何がどうなるの? - CloudNative Days Winter 2024
katzchang
0
310
SLI, SLOとカオスエンジニアリング、そしてオブザーバビリティ SRE Lounge #12
katzchang
4
3k
オビザーバビリティ成熟モデル
katzchang
1
4.6k
広告配信におけるパフォーマンス対策、やるかやらないか
katzchang
3
8.6k
高スループット・低レイテンシーなWEBサービスにおけるパフォーマンス対策の現実
katzchang
5
1.3k
モニタリングだいじというはなし
katzchang
1
270
プロビジョニングツールはMakeで決まりだろ
katzchang
12
10k
頑張らないScala
katzchang
2
2.9k
Other Decks in Technology
See All in Technology
AIがAPIを書く時代に、私たちは何を設計すべきか
nagix
0
200
Amazon Bedrock Managed Knowledge BaseDive Deep
ren8k
0
320
reFACToring
moznion
1
1.1k
初めてのGitHub Actions / GitHub Actions at First
tooppoo
0
120
AIQAのナレッジ構築について
qatonchan
1
140
AI エージェント時代のデジタルアイデンティティ
fujie
2
1.3k
AIエージェントに財布を渡す日 ― 承認付き"買い物エージェント"を作って実演
yama3133
1
110
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
750
システム監視入門
grimoh
5
790
なぜ、あなたのエージェントは言うことを聞かないのか
segavvy
1
610
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
830
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
330
Featured
See All Featured
From π to Pie charts
rasagy
0
240
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Building the Perfect Custom Keyboard
takai
2
830
Discover your Explorer Soul
emna__ayadi
2
1.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
880
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
The Pragmatic Product Professional
lauravandoore
37
7.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Statistics for Hackers
jakevdp
799
230k
Transcript
DVSSZQIQ LZPO@LBP@XFEEJOH !LBU[DIBOH
21)1͖Ͱ͔͢ʁ
!LBU[DIBOH
21)1͖Ͱ͔͢ʁ
ʊਓਓਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹಥવ4USJOH͕*OUʹมΘΔɹʻ ʉ:?:?:?:?:?:?:?:?:?:ʉ
ʮྫ͑ɺ1)1Λආ͚Δʯ
IUUQKBXJLJQFEJBPSHXJLJ&&"&"&"#3BTNVT@-FSEPSG@DSPQQFEKQH
1)1JTBCPVUBTFYDJUJOHBTZPVSUPPUICSVTI :PVVTFJUFWFSZEBZ JUEPFTUIFKPC JUJTBTJNQMFUPPM TPXIBU IUUQFOXJLJRVPUFPSHXJLJ3BTNVT@-FSEPSG
「PHPは、歯ブラシみたいなものですね。 毎日使うものですけど、だから何でしょう?」 IUUQBOPOEIBUFMBCPKQ
None
+BWBͱൺֱ
ແ໊͕ؔ͋Δ ˞+BWBҎલͱͷൺֱ
<?PHP $f = function($a, $b) { return $a + $b;
}; echo $f(2,3); // => 5
<?PHP $f = (function($a, $b) { return $a * $b;
})(2,3); // FAIL!!!
<?PHP $fib = function($x) { return $x < 2 ?
$x : $fib($x-1) + $fib($x-2); })); echo $fib(6); // FAIL!!
ΧϦʔԽ
IUUQTHJTUHJUIVCDPNLBU[DIBOH ˞༵ۚޕޙͰ͢
<?PHP $f = F::curry( function($_) { return $_[0] + $_[1];
}); echo $f->_(2)->_(3)->_();
IUUQTHJTUHJUIVCDPNBKJZPTIJWH CBECEF ˞༵ۚޕޙͰ͢
<?PHP $c = curry( function($a, $b){ return $a + $b;
}); echo $c->_(2)->_(3);
<?PHP function YComb($f) { $yc = curry( function($y, $x) use
($f) { return $f($y($y), $x); }); return $yc($yc); }
<?PHP echo (YComb(curry( function($f, $x){ return $x < 2 ?
$x : $f($x-1) + $f($x-2); })))->_(6);
ʮ͜Εɺࣃϒϥγͱ͍ͯ͠ʹͳΔϨϕϧʯ
-PWFZPVS1)1
None