Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
camille-hdl committed Jul 7, 2020
1 parent 5169533 commit 141e391
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ composer require camille-hdl/lazy-lists
You can use the functions directly on arrays or `Traversable`s

```php
use LazyLists\map;
use LazyLists\filter;
use LazyLists\reduce;
use LazyLists\flatten;
use LazyLists\take;
use function LazyLists\map;
use function LazyLists\filter;
use function LazyLists\reduce;
use function LazyLists\flatten;
use function LazyLists\take;

$result = map($fn, $input);
$result = filter($fn, $input);
Expand All @@ -68,15 +68,15 @@ but the most interesting way of using LazyLists is to use the composition functi
Steps in the pipeline are executed sequentially *for each element* in the collection *in a single iteration*, unlike `array_map`, `array_filter` or other similar libraries.

```php
use LazyLists\pipe;
use LazyLists\iterate;
use LazyLists\map;
use LazyLists\filter;
use LazyLists\reduce;
use LazyLists\each;
use LazyLists\flatten;
use LazyLists\take;
use LazyLists\until;
use function LazyLists\pipe;
use function LazyLists\iterate;
use function LazyLists\map;
use function LazyLists\filter;
use function LazyLists\reduce;
use function LazyLists\each;
use function LazyLists\flatten;
use function LazyLists\take;
use function LazyLists\until;

/**
* Compose steps together into a single function
Expand Down

0 comments on commit 141e391

Please sign in to comment.