Skip to content

[RFC] TODOs for version 2.0 #141

Description

@lstrojny

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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions