|
4 | 4 | [](https://coveralls.io/github/sanmai/pipeline?branch=main)
|
5 | 5 | [](https://shepherd.dev/github/sanmai/pipeline)
|
6 | 6 |
|
7 |
| -Pipeline is a PHP library that brings the power of streaming pipelines to your code. Inspired by the pipe operator (`|>`), common in functional programming languages, Pipeline lets you chain together a series of operations on your data in a clear, concise, and readable way. This approach not only simplifies complex data transformations but also makes your code more maintainable and easier to test. |
| 7 | +Pipeline is a PHP library that brings the power of streaming pipelines to your code. Inspired by the pipe operator (`|>`), typical in functional programming languages, Pipeline lets you chain a series of operations on your data concisely, clearly, and readably. This approach simplifies complex data transformations and makes your code more maintainable and easier to test. |
8 | 8 |
|
9 |
| -Pipeline makes dealing with `iterable` types as easy as it can be, making it a perfect tool for bespoke data processing pipelines, hence the name. If you ever piped together several bash commands where one command uses output of another in succession, this library does just that but for PHP functions, generators, arrays, and iterators. |
| 9 | +The pipeline uses lazy evaluation to optimize performance, especially for large datasets. This means operations are not executed immediately but deferred until the final result is needed. The pipeline is built as a chain of generator functions, processing data iteratively without loading the entire dataset into memory. |
10 | 10 |
|
11 |
| -Pipeline comes with the most important yet basic building blocks. It boasts methods to map, filter, reduce, zip, and unpack data from arbitrary generators and from all kinds of standard iterators. |
| 11 | +This means the actual computation is deferred until the final result is needed. This approach offers the benefits of reduced memory usage, making it suitable for handling massive datasets, improved performance by avoiding unnecessary computations, and efficiency for large datasets or even infinite sequences. For example, if you have an array with a million numbers and want to find the first five even numbers multiplied by 2, thanks to the lazy evaluation, it will only process the first few necessary numbers. |
| 12 | + |
| 13 | +The pipeline makes dealing with `iterable` types as easy as possible, making it a perfect tool for bespoke data processing pipelines, hence the name. If you ever piped together several bash commands where one command uses the output of another in succession, this library does just that for PHP functions, generators, arrays, and iterators. |
| 14 | + |
| 15 | +The pipeline has the most essential yet basic building blocks. It boasts methods to map, filter, reduce, zip, and unpack data from arbitrary generators and all kinds of standard iterators. |
12 | 16 |
|
13 | 17 | This rigorously tested library just works. Pipeline neither defines nor throws any exceptions.
|
14 | 18 |
|
15 | 19 | # Install
|
16 | 20 |
|
17 |
| - composer require sanmai/pipeline |
| 21 | +``` |
| 22 | +composer require sanmai/pipeline |
| 23 | +``` |
18 | 24 |
|
19 | 25 | The latest version requires PHP 7.4 or above, including PHP 8.2 and later.
|
20 | 26 |
|
21 |
| -There are earlier versions that work under PHP 5.6 and above, but they are not as feature complete. |
| 27 | +Some earlier versions work under PHP 5.6 and above, but they are not as feature-complete. |
22 | 28 |
|
23 | 29 | # Use
|
24 | 30 |
|
|
0 commit comments