Skip to content

[RFC] TODOs for version 2.0ย #141

@lstrojny

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions