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

Add stackSafeIterationsCount param for SyncLaws, fix Sync[StateT] #138

Merged
merged 5 commits into from
Mar 7, 2018

Conversation

alexandru
Copy link
Member

@alexandru alexandru commented Mar 7, 2018

Issues:

This adds Parameters to be passed to SyncLaws, because the stack safety loops should be configurable for slower data types. For example Monix's Iterant now implements Sync, but the ScalaCheck tests for the stack safety of flatMap are timing out the Travis builds.

During this process I discovered that the Sync[StateT[F, S, ?]] is not stack safe for "repeated left binds". I fixed it by reintroducing the original AndThen in cats.effect.internals. It was originally used by Daniel in the original IO implementation.

And now Sync[StateT[F, S, ?]] is fine.

@codecov-io
Copy link

codecov-io commented Mar 7, 2018

Codecov Report

Merging #138 into master will increase coverage by 0.1%.
The diff coverage is 94.11%.

@@            Coverage Diff            @@
##           master     #138     +/-   ##
=========================================
+ Coverage   89.14%   89.25%   +0.1%     
=========================================
  Files          44       46      +2     
  Lines         811      847     +36     
  Branches       59       63      +4     
=========================================
+ Hits          723      756     +33     
- Misses         88       91      +3

@alexandru alexandru changed the title Add stackSafeIterationsCount param for SyncLaws Add stackSafeIterationsCount param for SyncLaws, fix Sync[StateT] Mar 7, 2018
@mpilquist mpilquist self-requested a review March 7, 2018 18:33
@mpilquist mpilquist merged commit c64e7c9 into typelevel:master Mar 7, 2018
@alexandru alexandru added this to the 0.10 milestone Mar 15, 2018
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.

For the stack safety laws make the number of iterations configurable
4 participants