Repository navigation
Delete FakeMap - #3283
Closed
ezyang wants to merge 2 commits into
Closed
Delete FakeMap#3283ezyang wants to merge 2 commits into
ezyang wants to merge 2 commits into
Conversation
Currently, dependency solving immediately produces an 'InstallPlan' which is then consumed by cabal install, or elaborated into an 'ElaboratedInstallPlan' for cabal new-build. However, this translation is awkward, because the dependency solver knows nothing about 'UnitId's, yet an 'InstallPlan' must indexed by 'UnitId's. So there's a bit of faffing around to generate a "fake" unit id to satisfy the interface, and then eventually correct it to the right one. So this patch starts moving us in a better direction, by introducing a 'SolverInstallPlan', 'SolverPackage' and 'SolverId', intended to be generated by the solver. Then 'configureInstallPlan' or 'elaborateInstallPlan' elaborate this representation into the representation needed by the destination. The next step will be to generate the 'UnitId' during 'configureInstallPlan', and then we can get rid of the fake map (so only Solver data types generate a fake identity, which is only temporary until we generate 'UnitId's.) Signed-off-by: Edward Z. Yang <[email protected]>
Compute 'UnitId' when we compute a 'ConfiguredPackage'; consequently, we can eliminate 'FakeMap' (finally!) There is one hack remaining, which is that 'SolverInstallPlan' gins up fake unit IDs so that it can be keyed on UnitIds. But this data structure exists only very briefly before being converted into an 'InstallPlan' or 'ElaboratedInstallPlan'. Signed-off-by: Edward Z. Yang <[email protected]>
This file contains hidden or 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
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.
Compute 'UnitId' when we compute a 'ConfiguredPackage';
consequently, we can eliminate 'FakeMap' (finally!)
There is one hack remaining, which is that 'SolverInstallPlan'
gins up fake unit IDs so that it can be keyed on UnitIds.
But this data structure exists only very briefly before
being converted into an 'InstallPlan' or 'ElaboratedInstallPlan'.