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
620
curry.php
A functional programming using php.
Kazunori Otani
March 29, 2014
Tweet
Share
More Decks by Kazunori Otani
See All by Kazunori Otani
SLI, SLOとカオスエンジニアリング、そしてオブザーバビリティ SRE Lounge #12
katzchang
4
2.4k
オビザーバビリティ成熟モデル
katzchang
1
3.8k
広告配信におけるパフォーマンス対策、やるかやらないか
katzchang
2
7.3k
高スループット・低レイテンシーなWEBサービスにおけるパフォーマンス対策の現実
katzchang
4
1.1k
モニタリングだいじというはなし
katzchang
1
200
プロビジョニングツールはMakeで決まりだろ
katzchang
12
9.5k
頑張らないScala
katzchang
2
2.7k
Immutable Infrastructure #1
katzchang
1
5.1k
zgok-sunrise
katzchang
1
340
Other Decks in Technology
See All in Technology
可視化により内部品質をあげるAIドキュメントリバース/20240910 Hiromitsu Akiba
shift_evolve
0
230
AIで変わるテスト自動化:最新ツールの多様なアプローチ/ 20240910 Takahiro Kaneyama
shift_evolve
0
250
DroidKaigi 2024 たすけて!ViewModel
mhidaka
5
1.1k
「認証認可」という体験をデザインする ~Nekko Cloud認証認可基盤計画
logica0419
2
460
やってやろうじゃないかメカアジャイル! / Let's do it, mechanical agile!
psj59129
1
740
とあるOSSを継続可能にするための取り組みについて / OSS Refactoring Process
bun913
1
220
OCI で始める!! Red Hat OpenShift / Get Started OpenShift on OCI
oracle4engineer
PRO
1
200
サプライチェーン攻撃に備える
ryunen344
0
410
不動産売買取引におけるAIの可能性とプロダクトでのAI活用
zabio3
0
280
テスト”ケース”駆動開発 で手戻りをなくそう
ryohma0510
0
340
フロントエンド開発事例③ Yahoo! JAPAN トップページ
lycorptech_jp
PRO
0
110
2ヶ月かかるDBアップグレード検証を最大2週間に短縮した自作Go製CLIツール「Platinum」を紹介する / Introducing Go CLI tool "Platinum" for shortened DB upgrade validation
vtryo
2
130
Featured
See All Featured
Six Lessons from altMBA
skipperchong
26
3.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
502
140k
Documentation Writing (for coders)
carmenintech
65
4.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Designing the Hi-DPI Web
ddemaree
278
34k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
In The Pink: A Labor of Love
frogandcode
139
22k
Gamification - CAS2011
davidbonilla
79
5k
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