2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2021-10-07 00:50:35 +03:00
|
|
|
unique type A = A Text
|
|
|
|
|
|
|
|
foo : A
|
|
|
|
foo = A "foo!"
|
|
|
|
|
|
|
|
bar : Text -> A
|
|
|
|
bar = A
|
|
|
|
|
|
|
|
baz : A -> Text
|
|
|
|
baz = cases
|
|
|
|
A t -> t
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2021-10-07 00:50:35 +03:00
|
|
|
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
|
2024-01-04 11:42:12 +03:00
|
|
|
type A
|
2021-10-07 00:50:35 +03:00
|
|
|
bar : Text -> A
|
|
|
|
baz : A -> Text
|
|
|
|
foo : A
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> find : Text -> A
|
2021-10-07 00:50:35 +03:00
|
|
|
|
|
|
|
1. bar : Text -> A
|
|
|
|
2. A.A : Text -> A
|
|
|
|
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> find : A -> Text
|
2021-10-07 00:50:35 +03:00
|
|
|
|
|
|
|
1. baz : A -> Text
|
|
|
|
|
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> find : A
|
2021-10-07 00:50:35 +03:00
|
|
|
|
|
|
|
1. foo : A
|
|
|
|
|
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> find : Text
|
2021-10-07 00:50:35 +03:00
|
|
|
|
|
|
|
☝️
|
|
|
|
|
|
|
|
I couldn't find exact type matches, resorting to fuzzy
|
|
|
|
matching...
|
|
|
|
|
2022-02-08 05:29:57 +03:00
|
|
|
1. bar : Text -> A
|
|
|
|
2. baz : A -> Text
|
2021-10-07 00:50:35 +03:00
|
|
|
3. A.A : Text -> A
|
|
|
|
|
|
|
|
|
|
|
|
```
|