2020-04-08 03:21:33 +03:00
### `debug.file`
2024-07-10 17:46:18 +03:00
2020-04-08 03:21:33 +03:00
I can use `debug.file` to see the hashes of the last typechecked file.
Given this .u file:
2024-07-10 17:46:18 +03:00
``` unison
2021-08-24 00:05:37 +03:00
structural type outside.A = A Nat outside.B
structural type outside.B = B Int
2020-04-08 03:21:33 +03:00
outside.c = 3
outside.d = c < (p + 1)
2021-08-24 00:05:37 +03:00
structural type inside.M = M outside.A
2020-04-08 03:21:33 +03:00
inside.p = c
inside.q x = x + p * p
inside.r = d
```
2024-07-10 19:17:15 +03:00
``` ucm
2024-06-12 01:22:09 +03:00
scratch/main> debug.file
2020-04-08 03:21:33 +03:00
2022-02-08 05:29:57 +03:00
type inside.M#h37a56c5ep
type outside.A#6l6krl7n4l
type outside.B#eo6rj0lj1b
inside.p#htoo5rnb54
2024-08-18 05:03:57 +03:00
inside.q#1mqcoh3tnk
2022-02-08 05:29:57 +03:00
inside.r#nkgohbke6n
outside.c#f3lgjvjqoo
outside.d#ukd7tu6kds
2020-04-08 03:21:33 +03:00
```
This will help me make progress in some situations when UCM is being deficient or broken.
### `dependents` / `dependencies`
2024-07-10 17:46:18 +03:00
2020-04-08 03:21:33 +03:00
But wait, there's more. I can check the dependencies and dependents of a definition:
2024-07-10 17:46:18 +03:00
2024-07-10 19:17:15 +03:00
``` ucm
2024-06-12 01:22:09 +03:00
scratch/main> add
2020-04-08 03:21:33 +03:00
⍟ I've added these definitions:
2021-08-24 00:05:37 +03:00
structural type inside.M
structural type outside.A
structural type outside.B
2020-04-08 03:21:33 +03:00
inside.p : Nat
inside.q : Nat -> Nat
inside.r : Boolean
outside.c : Nat
outside.d : Boolean
2024-06-12 01:22:09 +03:00
scratch/main> dependents q
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
q has no dependents.
2020-04-08 03:21:33 +03:00
2024-06-12 01:22:09 +03:00
scratch/main> dependencies q
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Dependencies of: q
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Types:
1. Nat
Terms:
2. Nat.*
3. Nat.+
4. p
Tip: Try `view 4` to see the source of any numbered item in
the above list.
2020-05-09 17:31:52 +03:00
2024-06-12 01:22:09 +03:00
scratch/main> dependencies B
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Dependencies of: type B, B
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Types:
1. B
2. Int
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Tip: Try `view 2` to see the source of any numbered item in
the above list.
2020-04-08 03:21:33 +03:00
2024-06-12 01:22:09 +03:00
scratch/main> dependencies d
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Dependencies of: d
Types:
1. Boolean
2. Nat
Terms:
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
3. <
4. c
5. Nat.+
6. p
Tip: Try `view 6` to see the source of any numbered item in
the above list.
2020-04-08 03:21:33 +03:00
2024-06-12 01:22:09 +03:00
scratch/main> dependents d
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
Dependents of: d
Terms:
2020-04-08 03:21:33 +03:00
2023-05-18 23:07:20 +03:00
1. r
2022-04-07 00:20:44 +03:00
Tip: Try `view 1` to see the source of any numbered item in
the above list.
2020-05-09 17:31:52 +03:00
2020-04-08 03:21:33 +03:00
```
2021-08-24 00:05:37 +03:00
We don't have an index for dependents of constructors, but iirc if you ask for that, it will show you dependents of the structural type that provided the constructor.
2024-07-10 17:46:18 +03:00