Skip to content

Add InjectK laws#1725

Merged
kailuowang merged 2 commits into
typelevel:masterfrom
andyscott:feature/injectk-laws
Jun 12, 2017
Merged

Add InjectK laws#1725
kailuowang merged 2 commits into
typelevel:masterfrom
andyscott:feature/injectk-laws

Conversation

@andyscott
Copy link
Copy Markdown
Contributor

This addresses issue #1645.

@andyscott andyscott mentioned this pull request Jun 9, 2017
3 tasks
@andyscott andyscott force-pushed the feature/injectk-laws branch from 5a80d9f to 25a33a2 Compare June 9, 2017 21:04
(injectK.prj compose injectK.inj).apply(fa) <-> Some(fa)

def injectKRoundTripPrj[A](ga: G[A]): IsEq[Option[G[A]]] =
injectK.prj(ga).map(fa => injectK.inj(fa)) <-> Some(ga)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's lawful for prj to return a None, isn't it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes! This commit is goofy-- I cherry picked it from ages ago and I'm reworking it now.

That being said, how do you check this kind of behavior with discipline? Would it suffice to just have the injectKRoundTripInj and nix injectKRoundTripPrj?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd say when it returns a Some you should check the roundtrip right?

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 9, 2017

Codecov Report

Merging #1725 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1725      +/-   ##
=========================================
+ Coverage   93.88%   93.9%   +0.01%     
=========================================
  Files         246     248       +2     
  Lines        4088    4099      +11     
  Branches      154     156       +2     
=========================================
+ Hits         3838    3849      +11     
  Misses        250     250
Impacted Files Coverage Δ
laws/src/main/scala/cats/laws/InjectKLaws.scala 100% <100%> (ø)
...main/scala/cats/laws/discipline/InjectKTests.scala 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1931c93...13ac20c. Read the comment docs.

@andyscott andyscott force-pushed the feature/injectk-laws branch from 25a33a2 to 13ac20c Compare June 9, 2017 21:58
Copy link
Copy Markdown
Contributor

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

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

👍 Thanks very much!

@kailuowang kailuowang merged commit 3944108 into typelevel:master Jun 12, 2017
@andyscott andyscott deleted the feature/injectk-laws branch June 12, 2017 19:30
@kailuowang kailuowang modified the milestone: 1.0.0-MF Jun 15, 2017
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.

5 participants