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

CAD-4738 stm monad catch instance #16

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

yogeshsajanikar
Copy link
Contributor

@yogeshsajanikar yogeshsajanikar commented Aug 2, 2022

Based on the branch "CAD-4750-generalise-orelse-frame", this commit introduces Catch frame handler. It also adds Catch term in the reference STM for testing.

Resolves IntersectMBO/ouroboros-network#1461

Copy link
Member

@amesgen amesgen left a comment

Choose a reason for hiding this comment

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

Looks great, always cool to see when things get simpler over time 🎉

I only have a few minor comments below. As before, I did not commented on the IOSimPOR part as it is identical.

io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Internal.hs Outdated Show resolved Hide resolved
io-sim/test/Test/IOSim.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

I'll request some changes, just since I hope Yogesh finds a sufficiently lightweight way to address a couple of the eg testing comments. Nice stuff!

io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Show resolved Hide resolved
io-sim/src/Control/Monad/IOSimPOR/Internal.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSimPOR/Internal.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Show resolved Hide resolved
io-sim/test/Test/STM.hs Show resolved Hide resolved
io-sim/test/Test/STM.hs Show resolved Hide resolved
Copy link
Collaborator

@coot coot left a comment

Choose a reason for hiding this comment

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

It's on my todo list to review the PR... However, could you update ouroboros-network and check if all nightly tests are passing: for that one needs to add this snippet to cabal.project.local file:

package ouroboros-network-testing
  flags: -nightly

And then run:

cabal run ouroboros-netowrk-framework:test && cabal run ouroboros-network:test

@yogeshsajanikar
Copy link
Contributor Author

@coot Running the nightly tests now. I will update the results here soon.

@yogeshsajanikar
Copy link
Contributor Author

@coot The tests that you mentioned pass!

Running tests in ouroboros-network with io-sim commit id 9d2e67f

cabal run ouroboros-network-framework:test -> All 47 tests passed (118.51s)
cabal run ouroboros-network:test -> All 314 tests passed (480.21s)

Copy link
Collaborator

@coot coot left a comment

Choose a reason for hiding this comment

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

Very nice, just a few remarks.

io-sim/test/Test/STM.hs Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Internal.hs Outdated Show resolved Hide resolved
@yogeshsajanikar yogeshsajanikar force-pushed the CAD-4738-stm-monad-catch-instance branch from 9d2e67f to 06b61ea Compare August 29, 2022 05:59
@yogeshsajanikar yogeshsajanikar marked this pull request as ready for review August 29, 2022 06:01
@coot coot changed the title Cad 4738 stm monad catch instance CAD-4738 stm monad catch instance Sep 23, 2022
@yogeshsajanikar yogeshsajanikar force-pushed the CAD-4738-stm-monad-catch-instance branch 2 times, most recently from 21f8b9e to 880fa47 Compare October 12, 2022 14:32
@yogeshsajanikar yogeshsajanikar force-pushed the CAD-4738-stm-monad-catch-instance branch from d7d8d9f to d073a5b Compare October 13, 2022 18:06
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

One last round of minor comment adjustments! 👍

io-sim/src/Control/Monad/IOSim/Internal.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Internal.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Show resolved Hide resolved
io-sim/test/Test/STM.hs Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/src/Control/Monad/IOSim/Types.hs Outdated Show resolved Hide resolved
io-sim/test/Test/STM.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

I'm Requesting Changes one last time! I only caught spelling/grammar this time, but one of the typos is important.

Code looks great!

@yogeshsajanikar
Copy link
Contributor Author

yogeshsajanikar commented Nov 9, 2022

#16 (comment) is being addressed here. #35. So now the catch term in this code drop is Catch :: Term t -> Term t -> Term t. The #35 handles exception. It also adds another exception type so that an exception can bubble up if the exception type is not handled. It is a WIP.

@yogeshsajanikar yogeshsajanikar force-pushed the CAD-4738-stm-monad-catch-instance branch from bf7d862 to a68ed16 Compare November 9, 2022 16:22
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

All the comments have been addressed 👍

Except for the new one I'm opening right now---looks like this commit undoes a recently merged PR. That's why I'm Requesting Changes one last time.

io-sim/src/Control/Monad/IOSim/STM.hs Outdated Show resolved Hide resolved
- Add support for Catch in IOSim and IOSimPOR
- Add support for Catch in Test/STM.hs

Co-authored-by: Marcin Szamotulski <coot@coot.me>
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

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

The diff looks minimal again. 🙌

Approved! Nice work 👍

@yogeshsajanikar yogeshsajanikar merged commit 9650e14 into main Nov 12, 2022
@yogeshsajanikar yogeshsajanikar deleted the CAD-4738-stm-monad-catch-instance branch November 12, 2022 03:35
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.

Add MonadCatch instance for IOSim's STM
4 participants