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