-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Update Window
operation in point free style.
#179
Conversation
Window
operation in point free style.
// Unsupported - but tested. | ||
$this::fromIterable(range('a', 'e')) | ||
->window(-2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the window(-1)
case? That one is mentioned now in the docs so sounds like it's supported -> we should have a test for it
@drupol I think you merged the wrong one? 😅 |
Oh. Sorry :( Indeed I messed up... too many tabs open here. |
I'll add a new test in the master branch directly in a few minutes. |
This PR:
Window
in point free style.$size
is zero, which is more in sync with what the Window operation does and avoid mixing types (T|list<T>
=>list<T>
)Before:
Collection::fromIterable(['a', 'b', 'c'])->window(0); // ['a', 'b', 'c']
After:
Collection::fromIterable(['a', 'b', 'c'])->window(0); // [['a'], ['b'], ['c']]