functional-php

所属分类:collect
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2023-03-23 15:58:16
上 传 者sh-1993
说明:  PHP中函数编程的原语,
(Primitives for functional programming in PHP,)

文件列表:
.editorconfig (242, 2021-11-29)
.php_cs.dist (199, 2021-11-29)
.phpstorm.meta.php (771, 2021-11-29)
.scrutinizer.yml (136, 2021-11-29)
LICENSE (1074, 2021-11-29)
composer.json (5167, 2021-11-29)
docs/ (0, 2021-11-29)
docs/functional-php.md (33469, 2021-11-29)
phpcs.xml.dist (712, 2021-11-29)
phpunit.xml.dist (2139, 2021-11-29)
src/ (0, 2021-11-29)
src/Functional/ (0, 2021-11-29)
src/Functional/Ary.php (830, 2021-11-29)
src/Functional/Average.php (906, 2021-11-29)
src/Functional/ButLast.php (754, 2021-11-29)
src/Functional/Capture.php (669, 2021-11-29)
src/Functional/CompareObjectHashOn.php (843, 2021-11-29)
src/Functional/CompareOn.php (980, 2021-11-29)
src/Functional/Compose.php (854, 2021-11-29)
src/Functional/Concat.php (457, 2021-11-29)
src/Functional/ConstFunction.php (525, 2021-11-29)
src/Functional/Contains.php (910, 2021-11-29)
src/Functional/Converge.php (1121, 2021-11-29)
src/Functional/Curry.php (1605, 2021-11-29)
src/Functional/CurryN.php (1337, 2021-11-29)
src/Functional/Difference.php (824, 2021-11-29)
src/Functional/DropFirst.php (966, 2021-11-29)
src/Functional/DropLast.php (947, 2021-11-29)
src/Functional/Each.php (869, 2021-11-29)
src/Functional/Entries.php (880, 2021-11-29)
src/Functional/Equal.php (524, 2021-11-29)
src/Functional/ErrorToException.php (990, 2021-11-29)
src/Functional/Every.php (1006, 2021-11-29)
src/Functional/Exceptions/ (0, 2021-11-29)
... ...

# Functional PHP: Functional primitives for PHP [![Test](https://github.com/lstrojny/functional-php/actions/workflows/test.yaml/badge.svg)](https://github.com/lstrojny/functional-php/actions/workflows/test.yaml) *NOTE:* functional-php used to come with a C extension that implemented most of the functions natively. As the performance differences weren’t that huge compared to the maintenance cost it has been removed. A set of functional primitives for PHP, heavily inspired by [Scala’s traversable collection](http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/scala/collection/Traversable.html), [Dojo’s array functions](http://dojotoolkit.org/reference-guide/quickstart/arrays.html) and [Underscore.js](http://underscorejs.org/) - Works with arrays and everything implementing interface `Traversable` - Consistent interface: for functions taking collections and callbacks, first parameter is always the collection, then the callback. Callbacks are always passed `$value`, `$index`, `$collection`. Strict comparison is the default but can be changed - Calls 5.3 closures as well as usual callbacks - All functions reside in namespace `Functional` to not raise conflicts with any other extension or library [![Functional Comic](http://imgs.xkcd.com/comics/functional.png)](http://xkcd.com/1270/) ## Installation Run the following command in your project root: composer require lstrojny/functional-php ## Docs [Read the docs](docs/functional-php.md) ## Contributing 1. Fork and `git clone` the project 2. Install dependencies via `composer install` 3. Run the tests via `composer run tests` 4. Write code and create a PR ## Mailing lists - General help and development list: http://groups.google.com/group/functional-php - Commit list: http://groups.google.com/group/functional-php-commits ## Thank you - [Richard Quadling](https://github.com/RQuadling) and [Pierre Joye](https://github.com/pierrejoye) for Windows build help - [David Soria Parra](https://github.com/dsp) for various ideas and the userland version of `Functional\flatten()` - [Max Beutel](https://github.com/maxbeutel) for `Functional\unique()`, `Functional\invoke_first()`, `Functional\invoke_last()` and all the discussions - [An Phan](https://github.com/phanan) for [many](https://github.com/lstrojny/functional-php/pulls?q=author%3Aphanan) great contributions

近期下载者

相关文件


收藏者