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

Bugfix/translate2 #1073

Merged
merged 10 commits into from
Jan 24, 2018
Merged

Bugfix/translate2 #1073

merged 10 commits into from
Jan 24, 2018

Conversation

pchlupacek
Copy link
Contributor

This fixes translate bug in M11/RC1 plus

  • fixes nested scope interruption (fix by @AdamChlupacek )
  • simplifies interruption implementation in Algebra

@SystemFw @mpilquist thanks for comments

case Done(r) => translate0(fK, f(Right(r)), effect)
case Interrupted(_) =>
translate0(fK,
f(Left(new Throwable("Translated scope cannot be interrupted"))),
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems you forgot to properly implement interruption of translated scope here.

}
}
}
// FreeC.Eval[Algebra[F, O, ?], Unit](OpenScope(s, interruptible))
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented out, remove?


// Uncons is interrupted, fallback on `compileFoldLoop` has to be invoked
// The token is a scope from which we should recover.
case class Interrupted[X](token: Token) extends UR[X]
Copy link
Member

Choose a reason for hiding this comment

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

Can we move these classes to directly under Algebra to ensure they don't accidentally close over any state from this method?

Copy link
Member

@mpilquist mpilquist Jan 24, 2018

Choose a reason for hiding this comment

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

Oh I guess they close over F

Copy link
Contributor Author

@pchlupacek pchlupacek Jan 24, 2018

Choose a reason for hiding this comment

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

Well, there is unfortunatelly disrepance (see Continue) between ones used in compile and translate. In fact closing them inside F/G allowed me to discover another typecast bug.

Having said that, once we will battle-test this implementation, we could move them outside compile//translate

@mpilquist
Copy link
Member

Looks great. Let's merge once you address Adam's comments and then I'll release RC2.

@pchlupacek
Copy link
Contributor Author

ok shall be later today. so we shall be good to go fro RC2 tonite. Also could you pls test this against scodec before releasing?

@mpilquist
Copy link
Member

Yep already did and commented on the issue - all tests pass

@SystemFw
Copy link
Collaborator

SystemFw commented Jan 24, 2018

Great stuff!

Should we ask for e.g. doobie to give this a try? Or release RC2 directly?
(although I doubt something like scodec won't fail if the implementation was faulty)

@ChristopherDavenport
Copy link
Member

Testing doobie locally against this branch my only test errors are in postres and examples, which I believe are because I don't have a posgres instance up to test against.

[error] (postgres / Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] (example / Test / test) sbt.TestsFailedException: Tests unsuccessful

I don't know what tests were necessary to check, but all everything not requiring that appears to be passing on the series/0.5.x branch.

@mpilquist
Copy link
Member

@ChristopherDavenport Thanks very much for testing!

@pchlupacek Ready for merge?

@ChristopherDavenport
Copy link
Member

I have now gotten the DB operation and 100% of doobie tests now passed.

@pchlupacek
Copy link
Contributor Author

@ChristopherDavenport cool and thanks. @mpilquist yes, we could make a build.

@mpilquist mpilquist merged commit eb05b6c into series/0.10 Jan 24, 2018
@pchlupacek pchlupacek deleted the bugfix/translate2 branch August 21, 2018 10:09
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