unison icon indicating copy to clipboard operation
unison copied to clipboard

There should be a way to replace the term and/or type signature of a hash

Open pchiusano opened this issue 4 years ago • 2 comments

This came up when trying to fix some type signatures for existing hashes.

The definitions don’t have their type signature baked into the hash because it matches what was inferred when the definition was added. Now that the inference algorithm is different, they would get a new inferred type, but UCM won’t let us replace the signature since it matches what is inferred.

In general, there seems to be no way to replace the “variant” associate with a hash.

I’d also like this to clean up the weird blackboard ability variables that appear in some signatures.

Maybe just an add.force command that lets you replace the existing variant.

pchiusano avatar Jul 29 '21 16:07 pchiusano

Idea: the hash of a term should include that term's type. If the term doesn't have a user-provider signature, then that should be added before hashing. If it does have a signature, that could be used.

Downside of this approach is it means terms will get different hashes.

pchiusano avatar Jul 29 '21 17:07 pchiusano

I want to have a separate module that computes hashes in a way that's independent of the codebase storage layer. Hashes for terms, types, namespaces, "type mentions", etc. It can be passed to the codebase constructor and used carefully.

It's okay that terms will have different hashes (or I'm possibly not sure what you mean), with each newer version of the hashing component corresponding to a new "hash version".

aryairani avatar Jul 30 '21 03:07 aryairani