Created
November 22, 2019 08:28
-
-
Save novia713/83b7ba607eca091b2bee5356e0569f09 to your computer and use it in GitHub Desktop.
λx.z + λy.z = λxy.z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to_one = function($name){ | |
echo "Hola $name \n\r"; | |
}; | |
$to_many = function($arr) use ($to_one) { | |
return array_map($to_one, $arr); | |
}; | |
$to_one('Primero'); | |
$to_many(['Segundo','Tercero']); | |
$double_one = function($n){ | |
echo $n * 2 ."\n\r"; | |
}; | |
$double_many = function($arr) use ($double_one) { | |
return array_map( $double_one, $arr ); | |
}; | |
$double_many([3,9]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment