[PYTHON] Curry cheat sheet [Description example list version]

As for my article "Cheat Sheet", as the number of supported languages and supplementary notes increased, it became a commentary article rather than a cheat sheet. Created a list of description examples. After a while, the original article title may be changed to "Currying Description Summary" and this may be changed to "Currying Cheat Sheet".

List of description examples

For languages that can use multiple notations, only the shortest writing method is posted when the latest version and currying method are not used. For other differences due to notation and version, see Original article.

language (λxy.(true, if x>y;and fake, if x≦y)) 10 20
Haskell (\x y -> x > y) 10 20
Scheme (((lambda (x) (lambda (y) (> x y))) 10) 20)
Python (lambda x: lambda y: x > y)(10)(20)
Ruby -> x { -> y { x > y } }[10][20]
JavaScript (x => y => x > y)(10)(20)
Scala ((x: Int) => (y: Int) => x > y)(10)(20)
Perl sub { my $x = shift; return sub { my $y = shift; return $x > $y }; }->(10)->(20)
Go language func(x int) func(int) bool { return func(y int) bool { return (x > y) } }(10)(20)
PHP (fn($x) => fn($y) => $x > $y)(10)(20)
Julia (x -> y -> x > y)(10)(20)
Emacs Lisp, Common Lisp (funcall (funcall (lambda (x) (lambda (y) (> x y))) 10) 20)
R language (function(x) { function(y) { x > y } })(10)(20)

Change log

Recommended Posts

Curry cheat sheet [Description example list version]
Curry cheat sheet
A brief description of pandas (Cheat Sheet)
SQLite3 cheat sheet
pyenv cheat sheet
conda command cheat sheet
PIL / Pillow cheat sheet
Linux command cheat sheet
ps command cheat sheet
Spark API cheat sheet
Python3 cheat sheet (basic)
PySpark Cheat Sheet [Python]
Python sort cheat sheet
Go language cheat sheet