unison
unison copied to clipboard
Add name loading to the `Codebase` interface
type UniqueSuffix = Name
Codebase.loadNames
:: Branch.Hash
-> Set (Either Referent Reference)
-> Map (Either Referent Reference)
(Set UniqueSuffix, Set HashQualified)
And then rework Backend to make use of this during its operations.
Later, UCM should use it as well.
This will supercede #2023
I'm thinking that the UniqueSuffixes need to be hash-qualified too, in case they are conflicted. In this case, both sets are hash-qualified; the first is suffixes, and second set is full names.
I'm looking at PPE.declarationPPE and not sure how that fits into this.
Also I am noting that I can't simply reuse existing PPE code, because a) they produce opaque functions instead of maps (we could do this too, but should we?), and b) they choose one arbitrary name when it's maybe premature for them to do so.
@aryairani it seems like we can create a PPE from the results of this function (actually we can create two PPEs, one suffixed and one not, which is all the "declarationPPE" is - just a pair of the two PPEs)
I think you can keep initial PR to just adding the operation to Codebase without hooking it up anywhere.
@pchiusano Right, I meant we couldn't reuse the existing code that creates PPEs — we can still create a PPE from this output and consume it with existing code.
We want both a focused reference -> names lookup for pretty-printing, and also a focused name -> reference lookup for parsing.