Mission
Fix all the things that I got wrong in 1.x
Avoid accidental breakage as much as possible
❗ Dangerous
👍 Easy
Topics
❗ Fix order of compose arguments ([IHNFIWIWD] The compose function is executed left to right #117 )
In 1.x
Introduce compose_2 that fixes the argument order
Deprecate composeand ask people to migrate to compose_2
Introduce pipe that does what compose does in 1.x
In 2.0
Rename compose to compose
Deprecate compose_2 and ask users to use compose instead
Fully fledged PHP 7.1 support
👍 Use type hints everywhere
Should we return iterable or array for container return values?
❗ Should we use generators for lazy evaluation?
❗ Do we want to continue passing value, index, collection?
E.g. map suffers from the same problems JavaScript’s map suffers from
> [ "0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , "10" ] . map ( parseInt )
[ 0 , NaN , NaN , NaN , NaN , NaN , NaN , NaN , NaN , NaN , 10 ]
❗ Switch argument order from collection, function to function, collection
Is the more common signature in the functional world
Reads better as "map F over L"
Mission
❗ Dangerous
👍 Easy
Topics
❗ Fix order of
composearguments ([IHNFIWIWD] The compose function is executed left to right #117)compose_2that fixes the argument ordercomposeand ask people to migrate tocompose_2pipethat does whatcomposedoes in 1.xcomposetocomposecompose_2and ask users to usecomposeinsteadFully fledged PHP 7.1 support
iterableorarrayfor container return values?❗ Do we want to continue passing
value, index, collection?mapsuffers from the same problems JavaScript’smapsuffers fromcollection, functiontofunction, collection