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.
I think it's lawful for prj to return a None, isn't it?
There was a problem hiding this comment.
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.
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
This addresses issue #1645.