unison icon indicating copy to clipboard operation
unison copied to clipboard

Add name loading to the `Codebase` interface

Open pchiusano opened this issue 4 years ago • 6 comments

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.

pchiusano avatar Jun 14 '21 18:06 pchiusano

This will supercede #2023

pchiusano avatar Jun 14 '21 18:06 pchiusano

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.

aryairani avatar Jun 18 '21 01:06 aryairani

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 avatar Jun 18 '21 01:06 aryairani

@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 avatar Jun 18 '21 04:06 pchiusano

@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.

aryairani avatar Jun 18 '21 21:06 aryairani

We want both a focused reference -> names lookup for pretty-printing, and also a focused name -> reference lookup for parsing.

aryairani avatar Jul 13 '21 17:07 aryairani