-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use MonadError for 'LedgerState'. Add Show LedgerState
, IOException
handling in foldBlocks
#422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice API enhancement 👍
@@ -390,9 +396,9 @@ foldBlocks | |||
-- rollback. This is achieved by only calling the accumulator on states/blocks | |||
-- that are older than the security parameter, k. This has the side effect of | |||
-- truncating the last k blocks before the node's tip. | |||
-> ExceptT FoldBlocksError IO a | |||
-> m a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change ❤️
I'm not a big fan of those ExceptT
return types. Constrained monads like you did is better IMHO.
b2bbafa
to
f278cac
Compare
Show LedgerState
, IOException
handling in foldBlocks
Show LedgerState
, IOException
handling in foldBlocks
f278cac
to
d355d66
Compare
cardano-api/cardano-api.cabal
Outdated
@@ -187,7 +187,7 @@ library internal | |||
, iproute | |||
, memory | |||
, microlens | |||
, mtl | |||
, mtl >= 2.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to put this constraint in the other package defined in this (line 319)? Being consistent could avoid surprises later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this constraint is wrong - breaks build with older ghc which require mtl-2.2.2. I've just pushed a compatiblity shim in Cardano.Api.Utils
.
d355d66
to
a5881aa
Compare
fe4acbe
to
3f7b3d8
Compare
…n` handling in `foldBlocks`.
3f7b3d8
to
dc543dc
Compare
Changelog
Context
MonadError e m
allows to use functions without extra lifting if we need to use them in monad stacks withExceptT
underneath.How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist