mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-19 14:29:27 +03:00
1.3 KiB
1.3 KiB
First we'll add a definition:
structural ability DeathStar where
attack : Text -> ()
spaceAttack1 x =
y = attack "saturn"
z = attack "neptune"
"All done"
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 new definitions are ok to `add`:
structural ability DeathStar
spaceAttack1 : x ->{DeathStar} Text
Add it to the codebase:
.> add
⍟ I've added these definitions:
structural ability DeathStar
spaceAttack1 : x ->{DeathStar} Text
Now we'll try to add a different definition that runs the actions in a different order. This should work fine:
spaceAttack2 x =
z = attack "neptune"
y = attack "saturn"
"All done"
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 new definitions are ok to `add`:
spaceAttack2 : x ->{DeathStar} Text
.> add
⍟ I've added these definitions:
spaceAttack2 : x ->{DeathStar} Text
Previously, this would fail because the hashing algorithm was being given one big let rec block whose binding order was normalized.