2019-12-08 23:23:39 +03:00
|
|
|
|
2020-02-13 18:59:53 +03:00
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2020-02-13 18:59:53 +03:00
|
|
|
```
|
|
|
|
|
2019-12-08 23:23:39 +03:00
|
|
|
First we'll add a definition:
|
|
|
|
|
|
|
|
```unison
|
2021-08-24 21:33:27 +03:00
|
|
|
structural ability DeathStar where
|
2019-12-08 23:23:39 +03:00
|
|
|
attack : Text -> ()
|
|
|
|
|
|
|
|
spaceAttack1 x =
|
|
|
|
y = attack "saturn"
|
|
|
|
z = attack "neptune"
|
|
|
|
"All done"
|
|
|
|
```
|
|
|
|
|
|
|
|
Add it to the codebase:
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2019-12-08 23:23:39 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Now we'll try to add a different definition that runs the actions in a different order. This should work fine:
|
|
|
|
|
|
|
|
```unison
|
|
|
|
spaceAttack2 x =
|
|
|
|
z = attack "neptune"
|
|
|
|
y = attack "saturn"
|
|
|
|
"All done"
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2019-12-08 23:23:39 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Previously, this would fail because the hashing algorithm was being given one big let rec block whose binding order was normalized.
|