unison/unison-src/transcripts/unique-type-churn.output.md

141 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2023-07-18 20:45:02 +03:00
This transcript demonstrates that unique types no longer always get a fresh GUID: they share GUIDs with already-saved
unique types of the same name.
``` unison
2023-07-18 20:45:02 +03:00
unique type A = A
unique type B = B C
unique type C = C B
```
``` ucm
2023-07-18 20:45:02 +03:00
Loading changes detected in scratch.u.
2023-07-18 20:45:02 +03:00
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
type A
type B
type C
2023-07-18 20:45:02 +03:00
```
``` ucm
scratch/main> add
2023-07-18 20:45:02 +03:00
⍟ I've added these definitions:
type A
type B
type C
2023-07-18 20:45:02 +03:00
```
``` unison
2023-07-18 20:45:02 +03:00
unique type A = A
unique type B = B C
unique type C = C B
```
``` ucm
2023-07-18 20:45:02 +03:00
Loading changes detected in scratch.u.
2023-07-18 20:45:02 +03:00
I found and typechecked the definitions in scratch.u. This
file has been previously added to the codebase.
```
If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form.
``` ucm
scratch/main> names A
Type
Hash: #uj8oalgadr
Names: A
Term
Hash: #uj8oalgadr#0
Names: A.A
```
``` unison
unique type A = A ()
```
``` ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These names already exist. You can `update` them to your
new definition:
type A
```
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
scratch/main> names A
Type
Hash: #ufo5tuc7ho
Names: A
Term
Hash: #ufo5tuc7ho#0
Names: A.A
```
``` unison
unique type A = A
```
``` ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These names already exist. You can `update` them to your
new definition:
type A
```
Note that `A` is back to its original hash.
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
scratch/main> names A
Type
Hash: #uj8oalgadr
Names: A
Term
Hash: #uj8oalgadr#0
Names: A.A
```