functional-php
functional-php copied to clipboard
Primitives for functional programming in PHP
Expected take_left to support iterators without requiring fully iterating through it. Because sequence_linear returns an infinite iterator the take_left function is never able to provide the first $count of iteration...
In order to support pipe function, I'm contributing my proposal to get this long before reaching 2.0.
This is a feature request. Something like this: ```php create_map( ['cat', 'bear', 'aardvark'], function($element, $index, $collection) { return strlen($element); } ); /* returns [ 'cat'=>3, 'bear'=>4, 'aardvark'=>8 ]; */ ```...
Generative testing looks ideal for Functional PHP and https://github.com/steos/php-quickcheck looks like a good implementation. ### TBD - [ ] weither to use it inside of PHPUnit or not. First instinct...
This is a proposal to implement create_assoc function as is commented in #164, let me know if there is anything I can do to adjust it to this project standards.
I'm happy to introduce the amazing set of functions: `path`, `path_or`, `prop`, `prop_or`, `props`. Example: ```php
Add psalm annotations - [ ] Fix all issues found by psalm - [x] Increase type specificity - [x] Add `@psalm-pure` - [x] Add `@psalm-assert` - [ ] Add proper...
Surprised to see `InvalidArgumentException::assertCallback` was removed with no apparent substitute on sight, implemented check for callables inside Pipe functor construction, and adding some docblocks that Psalm complained about.