Literal Hash References

A term, type, data constructor, or ability constructor may be unambiguously referenced by hash. Literal hash references have the following structure:

  • Aterm definitionhas a hash of the form#xwherexis the base32Hex encoding of the hash of the term. For example#a0v829.
  • A term or type definition that’s part of acycle of mutually recursive definitionshashes to the form#x.nwherexis the hash of the cycle andnis the term or type’s index in its cycle. A cycle has a canonical order determined by sorting all the members of the cycle by their individual hashes (with the cycle removed).
  • A data constructor hashes to the form#x#cwherexis the hash of the data type definition andcis the index of that data constructor in the type definition.
  • A data constructor in a cyclic type definition hashes to the form#x.n#cwhere#x.nis the hash of the data type andcis the data constructor’s index in the type definition.
  • Abuilt-in referenceto a Unison built-in term or typenhas a hash of the form##n.##Natis an example of a built-in reference.