Skip to content

Conversation

natefaubion
Copy link
Collaborator

Fixes #134

@natefaubion natefaubion requested review from jdegoes and garyb December 16, 2017 23:13
@jdegoes
Copy link
Contributor

jdegoes commented Dec 19, 2017

@natefaubion Thanks, will review this today!

r2 ← joinFiber f1
pure (r1 == "foobar" && r2.a == "foo" && r2.b == "bar")

test_parallel_throw eff. TestAff eff Unit
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth adding a test here for parallel a / never.

tmp = true;
kid = killId++;

kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks tricky. Don't understand the encoding well enough to say if this is correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • head = the current Applicative node in the stack
  • head._1 = the left-hand-side node
  • head._2 = the right-hand-side node
  • fail = the resolved exception
  • lhs = the resolved value of the left-hand-side parallel operation (head._1._3)
  • rhs = the resolved value of the right-hand-side parallel operation (head._2._3)

So, if the left-hand-side resolved to a failure, kill the right-hand-side, otherwise kill the left-hand-side.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think I actually need rhs anymore, so I can lose that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nevermind, it's used in the success branches.

@natefaubion
Copy link
Collaborator Author

  • I've changed the test to use never with a timeout guard around it.

@natefaubion natefaubion merged commit 22a3ad8 into purescript-contrib:master Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants