-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add AboutApplicatives koan #6
base: master
Are you sure you want to change the base?
Conversation
zip embedded values with embedded functions
Co-authored-by: Alexander Bandukwala <[email protected]>
Co-authored-by: Alexander Bandukwala <[email protected]>
Co-authored-by: Alexander Bandukwala <[email protected]>
assertThat(right("World!").zip(right(getStringLength)), equalTo(__)); | ||
assertThat(Either.<String, String>left("whoops").zip(right(getStringLength)), equalTo(left(__))); | ||
|
||
// Moving on to LambdaIterables, where "zipping" is more obvious |
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.
We might want to point out that LambdaIterable
is a specific choice in terms of how to implement Zip for iterables. It could be pairwise or cross-product. Alternatively, it might be worth putting it in a separate "test" to make that explicit.
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.
Added a comment about that possible alternative in 5d1d6da.
src/test/java/com/jnape/palatable/lambdakoans/AboutApplicatives.java
Outdated
Show resolved
Hide resolved
src/test/java/com/jnape/palatable/lambdakoans/AboutApplicatives.java
Outdated
Show resolved
Hide resolved
Thanks for the contribution! From a pedagogical standpoint, I wonder if it makes sense to introduce |
- reorder functionIsApplicative - add assertion - change type signature - add timeout for applicativeRepresentsParallelism - add comments
7cf4157
to
e681444
Compare
Here's a brief demonstration of applicatives. I'm happy to include additional patterns reviewers may suggest.
@7h3kk1d was very helpful in pulling this together.