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
0
650
curry.php
A functional programming using php.
Kazunori Otani
March 29, 2014
Tweet
Share
More Decks by Kazunori Otani
See All by Kazunori Otani
Kubernetes環境のオブザーバビリティの次の一歩をOpenTelemetryで実現すると何がどうなるの? - CloudNative Days Winter 2024
katzchang
0
190
SLI, SLOとカオスエンジニアリング、そしてオブザーバビリティ SRE Lounge #12
katzchang
4
2.6k
オビザーバビリティ成熟モデル
katzchang
1
4.1k
広告配信におけるパフォーマンス対策、やるかやらないか
katzchang
3
7.7k
高スループット・低レイテンシーなWEBサービスにおけるパフォーマンス対策の現実
katzchang
4
1.2k
モニタリングだいじというはなし
katzchang
1
220
プロビジョニングツールはMakeで決まりだろ
katzchang
12
9.7k
頑張らないScala
katzchang
2
2.8k
Immutable Infrastructure #1
katzchang
1
5.3k
Other Decks in Technology
See All in Technology
チームの性質によって変わる ADR との向き合い方と、生成 AI 時代のこれから / How to deal with ADR depends on the characteristics of the team
mh4gf
4
350
IAMのマニアックな話 2025 ~40分バージョン ~
nrinetcom
PRO
8
970
Enterprise AI in 2025?
pamelafox
0
110
初めてのPostgreSQLメジャーバージョンアップ
kkato1
0
480
17年のQA経験が導いたスクラムマスターへの道 / 17 Years in QA to Scrum Master
toma_sm
0
450
AI・LLM事業部のSREとタスクの自動運転
shinyorke
PRO
0
310
AIエージェントキャッチアップと論文リサーチ
os1ma
6
1.3k
大規模サービスにおける カスケード障害
takumiogawa
3
710
モンテカルロ木探索のパフォーマンスを予測する Kaggleコンペ解説 〜生成AIによる未知のゲーム生成〜
rist
4
1.2k
Amazon GuardDuty Malware Protection for Amazon S3を使おう
ryder472
2
110
Cloud Native PG 使ってみて気づいたことと最新機能の紹介 - 第52回PostgreSQLアンカンファレンス
seinoyu
2
240
問題解決に役立つ数理工学
recruitengineers
PRO
8
2.3k
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
480
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
We Have a Design System, Now What?
morganepeng
51
7.5k
Gamification - CAS2011
davidbonilla
81
5.2k
RailsConf 2023
tenderlove
29
1k
Speed Design
sergeychernyshev
28
870
The Pragmatic Product Professional
lauravandoore
33
6.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Optimising Largest Contentful Paint
csswizardry
35
3.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
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