-
Notifications
You must be signed in to change notification settings - Fork 2
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
Transaction class constraints #147
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This ensures fully qualified object names end up in the representations, which is nice, but more importantly, it ensures the schema is immune to the user's search_path setting.
Still very early work. The `InTxnT` ctor must be exposed for some of the hoisting, and it's not clear how we can allow hoisting monadic type parameters of custom types without doing so.
The monadic type parameter forced hoisting in lots of places where it was purely unnecessary. This even helped clean up some of the code.
A callback that runs in `InTxnT m` needs to be callable from more than one base monad. In one branch of code, it's called from `m`, but in another, it's called from `ResourceT m`. Its type is clearly insufficient, so we'll probably need a class.
actions in the code. This is a "cheap "escape from more restrictive monadic composition, since now last actions must be able to run in _any_ monad that satisfies a few class constraints, rather than constraints based on the base monad. This is fine for our codebase as it is, but is over-restrictive.
- Lots of type applications to guide type inference - Lots of apparently redundant class constraints - Lots of `txn ~ InTxnT (ResourceT m)`, which should be unnecessary - Pushing `MonadResource m` constraint up, beyond where needed It's time to start tidying up
In general, this pushes MonadResource deeper into where it's necessary, but inside the Internal module it is actually added to one function where it isn't strictly necessary, but where it better aligns monadic types with the other functions, reducing the need for lifting
It is possible to declare a function that is not constrained with `NotInTxn m`, yet it called `beginCommitTxnBracket` by using `liftIO`.
Otherwise retry tests fail, and that's something I prefer to fix some other time.
With the new transaction class constraints, we can be much more certain every transaction is read-write
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #133