Functional PHP
collection
Functional PHP | collection | |
---|---|---|
6 | 20 | |
1,964 | 705 | |
- | 0.3% | |
0.0 | 8.2 | |
3 months ago | 14 days ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Functional PHP
-
I asked GPT-4 what top 5 improvements it would make to the PHP language to make it more competitive
A lot of this can be handled in userland. For examples libraries such as https://github.com/lstrojny/functional-php/blob/main/docs/functional-php.md handle a lot of this.
-
How do I become a better dev?
I’m also trying to use all of these at least once or twice to have these tools under my belt should I want them https://github.com/lstrojny/functional-php
- How to Lose Functional Programming at Work
-
PHP 8.2 Released
https://github.com/lstrojny/functional-php
The no-brainers to me are the missing array_some()/array_any() array_every()/array_all() and an array_search() that takes a predicate an iterable. I do these now in userland but an optimized native version would be nice.
-
PHP Map - PHP arrays and collections made easy
Functional PHP, which provides a lot of similar functionality, also uses pluck and has for many years https://github.com/lstrojny/functional-php
-
Simple Composition with Array.Reduce
While looking at functional-php, I saw a pretty neat way of doing composition with an array_reduce method, and wanted to recreate it in JavaScript. There are plenty of libraries that implement this (and do so more effectively), but it's pretty fun knowing that you can get this functionality with a couple lines of plain JavaScript.
collection
- Experimenting around FP in PHP
-
How to functionally invert a set of relations
It's a transposition, did it in PHP here: https://github.com/loophp/collection/blob/master/src/Operation/Transpose.php
-
Do you have a kind of Flip/Flop operator in PHP?
I didn't know that one, but I might definitely implement it in https://github.com/loophp/collection tomorrow!
-
PHP Map 3.3 released - Collections made easy!
I'm working on it, I hope I can release it before the end of the year. There is a last pull-request which is preventing me from moving forward: https://github.com/loophp/collection/pull/270
-
Do generators really reduce the memory usage?
Thanks for your super article. I might add a link to it in https://github.com/loophp/collection
-
What new array_* functions would you like to see on next PHP versions?
I personally would like to see them removed and replaced with their equivalent that would work with iterables. This is the reason why I wrote this : https://github.com/loophp/collection
-
PHP Map v3.0 - Collections made easy
Or https://github.com/loophp/collection completely lazy.
- PHP Map v2.6 - Collections made easy
-
public static function __invoke - closing gap between functions and classes
I'm using that all over the place in here : https://github.com/loophp/collection/tree/master/src/Operation
- PHP Map - PHP arrays and collections made easy
What are some alternatives?
Design Patterns PHP - sample code for several design patterns in PHP 8
dflydev-dot-access-data - Given a deep data structure representing a configuration, access configuration by dot notation.
PHP Option - Option Type for PHP
php-caching-generator - A rewindable PHP Generator class that caches its generated values.
Pipeline - League\Pipeline
JSON Machine - Efficient, easy-to-use, and fast PHP JSON stream parser
Iter - Iteration primitives using generators
Fregata - Fregata - a PHP database migrator
Monad PHP - A simple Monad library for PHP
map - PHP arrays and collections made easy
Ruler - A simple stateless production rules engine for modern PHP
contracts - Smart contracts comprising the business logic of the Matic Network