-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 InjectK laws #1725
Add InjectK laws #1725
Conversation
5a80d9f
to
25a33a2
Compare
(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) |
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.
I think it's lawful for prj
to return a None
, isn't it?
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.
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
?
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.
I'd say when it returns a Some
you should check the roundtrip right?
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
25a33a2
to
13ac20c
Compare
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.
👍 Thanks very much!
This addresses issue #1645.