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

sequenceK semigroup combine fix #922

Merged
merged 3 commits into from Jul 3, 2018

Conversation

richard-gibson
Copy link
Contributor

No description provided.

Copy link
Member

@pakoito pakoito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add the MonoidLaws test at least for SequenceKTests in this same diff? It's not a blocker but I'd rather have it now than later :)

@richard-gibson
Copy link
Contributor Author

@pakoito yeh, I started adding tests but had some problems with generators at first. added to PR for sequenceK now

TraverseLaws.laws(this, this, { n: Int -> SequenceK(sequenceOf(n)) }, eq),
SemigroupKLaws.laws(this, this, eq),
MonoidLaws.laws(SequenceK.monoid(), Gen.list(Gen.int()).map{it.asSequence()}.generate().k(), eq),
SemigroupLaws.laws(SequenceK.semigroup(),
Copy link
Member

@pakoito pakoito Jul 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not needed, as MonoidLaws includes SemigroupLaws.

@@ -32,7 +34,14 @@ class SequenceKTest : UnitSpec() {
ShowLaws.laws(show, eq) { sequenceOf(it).k() },
MonadLaws.laws(this, eq),
MonoidKLaws.laws(this, this, eq),
TraverseLaws.laws(this, this, { n: Int -> SequenceK(sequenceOf(n)) }, eq)
TraverseLaws.laws(this, this, { n: Int -> SequenceK(sequenceOf(n)) }, eq),
SemigroupKLaws.laws(this, this, eq),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not needed, as MonoidKLaws includes SemigroupKLaws.

@pakoito
Copy link
Member

pakoito commented Jul 3, 2018

@richard-gibson one small fix and we're good to go!

@richard-gibson
Copy link
Contributor Author

@pakoito no prob, do you mind if I also make SequenceKMonoidInstance inherit SequenceKSemigroupInstance so there is no duplication of combine?

@raulraja
Copy link
Member

raulraja commented Jul 3, 2018

@richard-gibson thanks for the fix!, merging this now, feel free to submit another one to avoid duplication of combine

@raulraja raulraja merged commit fb306af into arrow-kt:master Jul 3, 2018
RawToast pushed a commit to RawToast/kategory that referenced this pull request Jul 18, 2018
* sequenceK semigroup combine fix

* Add missing closing parens
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.

None yet

3 participants