Skip to content
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

Expose Cats/Scalaz Foldable instances for mutable Java structures #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mr-calvert
Copy link
Owner

@mr-calvert mr-calvert commented Jan 7, 2018

Addresses issue #17

@mr-calvert
Copy link
Owner Author

::sigh::

I suppose if I'm enforcing issue/branch/PR discipline on myself I ought to include appropriate tests with each PR.

@mr-calvert
Copy link
Owner Author

mr-calvert commented Jan 7, 2018

Note to self
Those Foldable instances need to be complete and tested before pushing this.

Complete means we need the Scalaz version too. Tested means figuring out how to run the laws provided by Cats and Scalaz against instances coming from solid implementations of the hidden traits.

THEN we need to figure out laws (or at least reusable tests) for classes that implement the hidden traits.

@mr-calvert mr-calvert mentioned this pull request Jan 7, 2018
Using cats.laws.discipline.FoldableTests (Cats' Foldable laws) and a
check that the resulting foldable has the same elements as are passed
into it.
@mr-calvert
Copy link
Owner Author

Got some tests in place for JListFoldable as cats.Foldable. Now need to implement Scaalz Foldable and figure out how to run the Scalaz tests in the various Scalaz integration libraries.

@mr-calvert
Copy link
Owner Author

After getting the Scalaz integration up we'll need to write some tests ensuring that the RandomAccess optimizations, namely overriding get(int) and size, work and are being used.

The Scala standard library has foldLeft for iterators so I'm deferring
to it now. Also the trait names were a bit copy-pasta'ed; fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant