mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 07:17:25 +03:00
786 B
786 B
Replace with terms and types
Let's set up some definitions to start:
.> builtins.merge
x = 1
y = 2
structural type X = One Nat
structural type Y = Two Nat Nat
.scratch> add
Test that replace works with terms
.scratch> replace x y
.scratch> view x
Test that replace works with types
.scratch> replace X Y
.scratch> find
.scratch> view.patch patch
.scratch> view X
Try with a type/term mismatch
.scratch> replace X x
.scratch> replace y Y
Try with missing references
.scratch> replace X NOPE
.scratch> replace y nope
.scratch> replace nope X
.scratch> replace nope y
.scratch> replace nope nope