-
Notifications
You must be signed in to change notification settings - Fork 453
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
Improving the FpToTheMax example #997
Conversation
Renaming a few things
Codecov Report
@@ Coverage Diff @@
## master #997 +/- ##
============================================
- Coverage 46.95% 46.94% -0.02%
Complexity 688 688
============================================
Files 318 318
Lines 8073 8073
Branches 848 848
============================================
- Hits 3791 3790 -1
Misses 3940 3940
- Partials 342 343 +1
Continue to review full report at Codecov.
|
As a newbie, I don't understand the need to wrap system calls in
It might be necessary in Scala, but it seems pretty purposeless in Kotlin. |
Both fun Applicative<F>.printOpImpure: Kind<F, Unit> = pure(println("whatever"))
// because pure is strict println gets evaluated each time `printOpImpure` is invoked and can't be part of the final IO loop that controls effects and exceptions. In your example it will be similar. If there were no previous bindings in the computation
fun MonadDefer<F>.printOpPure: Kind<F, Unit> = invoke { println("whatever") }
// because `invoke` in MonadDefer is lazy invoking `printOpPure` will not cause printing to happen and the effect will be treated along the rest of computation when executing the `program.unsafeRunSync` at the edge```
(edited) A different question is whether we can leave logging out of the effects we care to track. In regards to Scala is the same as Kotlin, both langs allow devs to perform effect without being in IO. |
Wrap, then merge! |
Hi @pakoito , what do you mean by wrap ? Should I squash the commits ? |
@enhan Replace those |
I see! I'll merge as soon as CI is ready, then |
nice :) ! |
Codecov Report
@@ Coverage Diff @@
## master #997 +/- ##
============================================
+ Coverage 47.04% 47.05% +0.01%
Complexity 694 694
============================================
Files 320 320
Lines 8090 8090
Branches 848 848
============================================
+ Hits 3806 3807 +1
Misses 3941 3941
+ Partials 343 342 -1
Continue to review full report at Codecov.
|
I just added TestIO based on the State datatype & included the version of @raulraja .