fix suffix.md transcript

This commit is contained in:
Mitchell Rosen 2024-03-19 12:56:03 -04:00
parent 468d6251bf
commit 96e008f153
2 changed files with 34 additions and 13 deletions

View File

@ -39,10 +39,9 @@ Type-based search also benefits from this, we can just say `Nat` rather than `.b
.> find : Nat -> [a] -> [a]
```
## Preferring names not in `lib`
## Preferring names not in `lib.*.lib.*`
Suffix-based resolution prefers names with fewer name segments that are equal to "lib". This
has the effect of preferring names defined in your project to names from dependencies of your project, and names from indirect dependencies have even lower weight.
Suffix-based resolution prefers names that are not in an indirect dependency.
```unison
cool.abra.cadabra = "my project"
@ -55,8 +54,11 @@ lib.distributed.lib.baz.qux = "indirect dependency"
.> add
```
```unison
```unison:error
> abra.cadabra
```
```unison
> baz.qux
```

View File

@ -57,10 +57,9 @@ Type-based search also benefits from this, we can just say `Nat` rather than `.b
```
## Preferring names not in `lib`
## Preferring names not in `lib.*.lib.*`
Suffix-based resolution prefers names with fewer name segments that are equal to "lib". This
has the effect of preferring names defined in your project to names from dependencies of your project, and names from indirect dependencies have even lower weight.
Suffix-based resolution prefers names that are not in an indirect dependency.
```unison
cool.abra.cadabra = "my project"
@ -97,7 +96,6 @@ lib.distributed.lib.baz.qux = "indirect dependency"
```
```unison
> abra.cadabra
> baz.qux
```
@ -112,20 +110,41 @@ lib.distributed.lib.baz.qux = "indirect dependency"
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > abra.cadabra
"my project"
2 | > baz.qux
1 | > baz.qux
"direct dependency 2"
```
```unison
> abra.cadabra
```
```ucm
Loading changes detected in scratch.u.
I couldn't figure out what abra.cadabra refers to here:
1 | > abra.cadabra
The name abra.cadabra is ambiguous. I couldn't narrow it down
by type, as any type would work here.
I found some terms in scope that have matching names and
types. Maybe you meant one of these:
cool.abra.cadabra : Text
distributed.abra.cadabra : Text
```
```ucm
.> view abra.cadabra
cool.abra.cadabra : Text
cool.abra.cadabra = "my project"
lib.distributed.abra.cadabra : Text
lib.distributed.abra.cadabra = "direct dependency 1"
.> view baz.qux