metaxy/php-functional

PHP的功能性原语

dev-master / 1.0.x-dev 2018-01-31 11:38 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:18:38 UTC


README

示例

映射

在 Haskell 中的映射看起来像什么

mult2 = map((*) 2)
f = mult2 5

以及使用 php-functional 在 PHP 中看起来像什么

$mult2 = map(function($x){return $x*2});
$f = $mult2(5);