A = "Hello "
B = "Hello "
C = A ++ "world"
D = B ++ "world"
and then you update the definition of A but not B? A = "Hello "
B = "Hello "
C = A ++ "world"
D = B ++ "world"
and then you update the definition of A but not B? serviceA.requiredHeaders key = Dictionary.of "X-API-KEY" key
serviceB.apiKeyHeader apiKey = Dictionary.of "X-API-KEY" apiKey
If they hash to the same thing and I update `serviceA.requiredHeaders` (because the vendor changed from `X-API-KEY` to `X-VENDOR-API-KEY`) do I have to know that these are two different services in order to review the change and untangle these two methods or is there a way to mark these as "structurally equivalent but semantically distinct"?type UserName = UserName Text type Password = Password Text
since the entire point in introducing types here is to actually declare them as different from one another.
But for other it might actually be beneficial to recognize that they are the same type, for example:
type Optional a = None | Some a type Maybe a = Nothing | Just a
To allow for both, you can prefix type with either "structural" or "unique" depending on what behavior you want (unique is the default). We have tossed around the idea of also introducing unique terms which would let you terms like yours as unique terms that should be salted, and let the current behavior of "structural"? terms be the default. The reality is that this hasn't been such a big problem that it has made it to the top of our list yet ;)
In fact if you had the function:
double x = x + x
and you were to rewrite it to be:
double addend = addend + addend
Unison would say "this is the same function, no update needed" as it produces the same AST