Composable, reusable, pure functions for PHP. Inspired by Ramda in the JS world. It's supposed to be a naive PHP port.
<?php
require 'Panda.php';
$xs = [1, 2 ,3, [[4]], [5], 6, 8, 9];
$flattenReverseAndIncrease = P::pipe([
P::flatten(),
P::reverse(),
P::map(P::inc())
]);
print_r($flattenReverseAndIncrease($xs));
Array
(
[0] => 10
[1] => 9
[2] => 7
[3] => 6
[4] => 5
[5] => 4
[6] => 3
[7] => 2
)
- Implement as a PSR-4 PHP package.
- Consider a better way of declaring library functions.
- Unit tests.
- Travis.
- Investigate performance.
- Create adapters for Doctrine and Laravel collections.
- Create function implementations to work with Arrays and Objects.
- [] ascend
- identity
- comparator
- concat
- contains
- curryN
- [] descend
- F
- find
- findLast
- flatten
- [] groupBy
- has
- init
- isEmpty
- join
- keys
- [] merges?
- omit
- pathEq
- pick
- pluck
- pathOr
- propOr
- reduceRight
- reduceWhile
- reject
- reverse
- [] sort
- [] sortWith
- split
- splitEvery
- splitWhen
- T
- [] uniq
- [] uniqBy
- unless
- when
- [] where
- [] whereEq