From 9d064fdbed71e0977228ea093833f46e7f3d237a Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 09:41:47 -0700 Subject: [PATCH 01/41] Move project branch insert into transaction From 0ef189865d5cb1d4762a74f63d2535fcc5209e80 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 11:21:50 -0700 Subject: [PATCH 02/41] Auto-create project branches in transcripts From ae7cf3d0a5584b6113b050dd34c23b73525e4c80 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 15:08:02 -0700 Subject: [PATCH 03/41] Update transcripts to use implicit project creation --- unison-src/transcripts/merge.md | 137 -------------------------------- 1 file changed, 137 deletions(-) diff --git a/unison-src/transcripts/merge.md b/unison-src/transcripts/merge.md index 9436ae5232..1334df76d8 100644 --- a/unison-src/transcripts/merge.md +++ b/unison-src/transcripts/merge.md @@ -917,143 +917,6 @@ We will resolve this situation automatically in a future version. project/main> builtins.mergeio lib.builtins ``` -```ucm:hide -project/main> branch alice -``` - -Alice's additions: -```unison:hide -unique type Foo = Bar - -alice : Foo -> Nat -alice _ = 18 -``` - -```ucm:hide -project/alice> add -project/main> branch bob -``` - -Bob's additions: -```unison:hide -unique type Foo = Bar - -bob : Foo -> Nat -bob _ = 19 -``` - -```ucm:hide -project/bob> add -``` - -```ucm:error -project/alice> merge bob -``` - -```ucm:hide -.> project.delete project -``` - -## `merge.commit` example (success) - -After merge conflicts are resolved, you can use `merge.commit` rather than `switch` + `merge` + `branch.delete` to -"commit" your changes. - -```ucm:hide -.> project.create-empty project -project/main> builtins.mergeio lib.builtins -``` - -Original branch: -```unison:hide -foo : Text -foo = "old foo" -``` - -```ucm:hide -project/main> add -project/main> branch alice -``` - -Alice's changes: -```unison:hide -foo : Text -foo = "alices foo" -``` - -```ucm:hide -project/alice> update -project/main> branch bob -``` - -Bob's changes: - -```unison:hide -foo : Text -foo = "bobs foo" -``` - -Attempt to merge: - -```ucm:hide -project/bob> update -``` -```ucm:error -project/alice> merge /bob -``` - -Resolve conflicts and commit: - -```unison -foo : Text -foo = "alice and bobs foo" -``` - -```ucm -project/merge-bob-into-alice> update -project/merge-bob-into-alice> merge.commit -project/alice> view foo -project/alice> branches -``` - -```ucm:hide -.> project.delete project -``` - -## `merge.commit` example (failure) - -`merge.commit` can only be run on a "merge branch". - -```ucm:hide -.> project.create-empty project -project/main> builtins.mergeio lib.builtins -``` - -```ucm -project/main> branch topic -``` - -```ucm:error -project/topic> merge.commit -``` - -```ucm:hide -.> project.delete project -``` - - -## Precondition violations - -There are a number of conditions under which we can't perform a merge, and the user will have to fix up the namespace(s) manually before attempting to merge again. - -### Conflicted aliases - -If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice's branch, then we don't know whether to update Bob's dependents to Alice's `foo` or Alice's `bar` (and vice-versa). - -```ucm:hide -project/main> builtins.mergeio lib.builtins -``` - Original branch: ```unison:hide foo : Nat From 5ca1eb3b8d07d9165d39b99e5be3b583b8d7e49d Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 15:22:09 -0700 Subject: [PATCH 04/41] Replace '.' references with scratch/main --- unison-src/builtin-tests/base.md | 6 +- .../builtin-tests/interpreter-tests.tpl.md | 8 +- unison-src/builtin-tests/jit-tests.tpl.md | 12 +- unison-src/transcripts-manual/benchmarks.md | 52 +- .../remote-tab-completion.md | 2 +- unison-src/transcripts-manual/rewrites.md | 48 +- unison-src/transcripts-manual/scheme.md | 10 +- unison-src/transcripts-round-trip/main.md | 26 +- unison-src/transcripts-using-base/_base.md | 12 +- .../transcripts-using-base/_base.output.md | 4 +- .../transcripts-using-base/all-base-hashes.md | 2 +- .../all-base-hashes.output.md | 2 +- .../binary-encoding-nats.md | 4 +- .../binary-encoding-nats.output.md | 4 +- unison-src/transcripts-using-base/codeops.md | 16 +- .../transcripts-using-base/codeops.output.md | 16 +- unison-src/transcripts-using-base/doc.md | 38 +- .../transcripts-using-base/doc.output.md | 36 +- .../transcripts-using-base/failure-tests.md | 6 +- .../failure-tests.output.md | 6 +- .../transcripts-using-base/fix1709.output.md | 5 +- unison-src/transcripts-using-base/fix2358.md | 2 +- .../transcripts-using-base/fix2358.output.md | 2 +- unison-src/transcripts-using-base/fix3939.md | 6 +- .../transcripts-using-base/fix3939.output.md | 6 +- unison-src/transcripts-using-base/hashing.md | 12 +- .../transcripts-using-base/hashing.output.md | 8 +- unison-src/transcripts-using-base/mvar.md | 4 +- .../transcripts-using-base/mvar.output.md | 4 +- .../namespace-dependencies.md | 2 +- .../namespace-dependencies.output.md | 25 +- .../transcripts-using-base/nat-coersion.md | 4 +- .../nat-coersion.output.md | 4 +- unison-src/transcripts-using-base/net.md | 10 +- .../transcripts-using-base/net.output.md | 8 +- .../transcripts-using-base/random-deserial.md | 4 +- .../random-deserial.output.md | 4 +- .../transcripts-using-base/ref-promise.md | 18 +- .../ref-promise.output.md | 18 +- .../transcripts-using-base/serial-test-00.md | 4 +- .../serial-test-00.output.md | 4 +- .../transcripts-using-base/serial-test-01.md | 4 +- .../serial-test-01.output.md | 4 +- .../transcripts-using-base/serial-test-02.md | 4 +- .../serial-test-02.output.md | 4 +- .../transcripts-using-base/serial-test-03.md | 4 +- .../serial-test-03.output.md | 4 +- .../transcripts-using-base/serial-test-04.md | 4 +- .../serial-test-04.output.md | 4 +- unison-src/transcripts-using-base/stm.md | 6 +- .../transcripts-using-base/stm.output.md | 6 +- .../test-watch-dependencies.md | 6 +- .../test-watch-dependencies.output.md | 4 +- unison-src/transcripts-using-base/thread.md | 12 +- .../transcripts-using-base/thread.output.md | 8 +- unison-src/transcripts-using-base/tls.md | 14 +- .../transcripts-using-base/tls.output.md | 12 +- unison-src/transcripts-using-base/utf8.md | 2 +- .../transcripts-using-base/utf8.output.md | 2 +- unison-src/transcripts/abilities.md | 4 +- unison-src/transcripts/abilities.output.md | 2 +- .../ability-order-doesnt-affect-hash.md | 4 +- ...ability-order-doesnt-affect-hash.output.md | 4 +- unison-src/transcripts/add-run.md | 40 +- unison-src/transcripts/add-run.output.md | 44 +- .../transcripts/add-test-watch-roundtrip.md | 6 +- .../add-test-watch-roundtrip.output.md | 4 +- unison-src/transcripts/addupdatemessages.md | 10 +- .../transcripts/addupdatemessages.output.md | 8 +- unison-src/transcripts/alias-many.md | 8 +- unison-src/transcripts/alias-many.output.md | 99 +-- unison-src/transcripts/anf-tests.md | 4 +- unison-src/transcripts/anf-tests.output.md | 2 +- unison-src/transcripts/any-extract.md | 8 +- unison-src/transcripts/any-extract.output.md | 2 +- unison-src/transcripts/api-doc-rendering.md | 6 +- .../transcripts/api-doc-rendering.output.md | 795 +----------------- unison-src/transcripts/api-find.md | 2 +- unison-src/transcripts/api-find.output.md | 34 +- .../transcripts/api-list-projects-branches.md | 6 +- .../api-list-projects-branches.output.md | 3 + .../transcripts/api-namespace-details.md | 4 +- .../api-namespace-details.output.md | 42 +- unison-src/transcripts/api-namespace-list.md | 4 +- .../transcripts/api-namespace-list.output.md | 96 +-- unison-src/transcripts/api-summaries.md | 8 +- .../transcripts/block-on-required-update.md | 6 +- .../block-on-required-update.output.md | 4 +- unison-src/transcripts/blocks.md | 2 +- .../boolean-op-pretty-print-2819.md | 6 +- .../boolean-op-pretty-print-2819.output.md | 4 +- unison-src/transcripts/branch-command.md | 12 +- .../transcripts/branch-command.output.md | 8 +- .../transcripts/branch-relative-path.md | 6 +- unison-src/transcripts/bug-fix-4354.md | 2 +- unison-src/transcripts/bug-strange-closure.md | 18 +- .../transcripts/bug-strange-closure.output.md | 20 +- unison-src/transcripts/builtins.md | 32 +- unison-src/transcripts/builtins.output.md | 8 +- unison-src/transcripts/bytesFromList.md | 2 +- unison-src/transcripts/check763.md | 8 +- unison-src/transcripts/check763.output.md | 6 +- unison-src/transcripts/check873.md | 4 +- unison-src/transcripts/check873.output.md | 2 +- .../child-namespace-history-merge.md | 42 +- .../child-namespace-history-merge.output.md | 36 +- .../constructor-applied-to-unit.md | 4 +- unison-src/transcripts/contrabilities.md | 2 +- unison-src/transcripts/create-author.md | 2 +- unison-src/transcripts/cycle-update-1.md | 8 +- .../transcripts/cycle-update-1.output.md | 6 +- unison-src/transcripts/cycle-update-2.md | 8 +- .../transcripts/cycle-update-2.output.md | 6 +- unison-src/transcripts/cycle-update-3.md | 8 +- .../transcripts/cycle-update-3.output.md | 6 +- unison-src/transcripts/cycle-update-4.md | 8 +- .../transcripts/cycle-update-4.output.md | 6 +- unison-src/transcripts/cycle-update-5.md | 6 +- .../transcripts/cycle-update-5.output.md | 6 +- unison-src/transcripts/debug-definitions.md | 18 +- .../transcripts/debug-definitions.output.md | 16 +- unison-src/transcripts/debug-name-diffs.md | 12 +- .../transcripts/debug-name-diffs.output.md | 12 +- unison-src/transcripts/deep-names.md | 2 +- unison-src/transcripts/deep-names.output.md | 78 +- unison-src/transcripts/delete-namespace.md | 22 +- .../transcripts/delete-namespace.output.md | 18 +- .../transcripts/delete-project-branch.md | 2 +- .../delete-project-branch.output.md | 4 +- unison-src/transcripts/delete-project.md | 8 +- .../transcripts/delete-project.output.md | 14 +- unison-src/transcripts/delete-silent.md | 10 +- .../transcripts/delete-silent.output.md | 10 +- unison-src/transcripts/delete.md | 58 +- unison-src/transcripts/delete.output.md | 383 +-------- .../dependents-dependencies-debugfile.md | 18 +- ...ependents-dependencies-debugfile.output.md | 14 +- unison-src/transcripts/destructuring-binds.md | 14 +- .../transcripts/destructuring-binds.output.md | 12 +- unison-src/transcripts/diff-namespace.md | 48 +- .../transcripts/diff-namespace.output.md | 586 +------------ unison-src/transcripts/doc-formatting.md | 56 +- .../transcripts/doc-formatting.output.md | 28 +- .../transcripts/doc-type-link-keywords.md | 12 +- .../doc-type-link-keywords.output.md | 8 +- unison-src/transcripts/doc1.md | 2 +- unison-src/transcripts/doc1.output.md | 150 +--- unison-src/transcripts/doc2.md | 4 +- unison-src/transcripts/doc2.output.md | 2 +- unison-src/transcripts/doc2markdown.md | 6 +- unison-src/transcripts/doc2markdown.output.md | 2 +- unison-src/transcripts/duplicate-names.md | 6 +- .../transcripts/duplicate-names.output.md | 4 +- .../transcripts/duplicate-term-detection.md | 2 +- unison-src/transcripts/ed25519.md | 2 +- unison-src/transcripts/edit-command.md | 10 +- unison-src/transcripts/edit-command.output.md | 10 +- unison-src/transcripts/empty-namespaces.md | 32 +- .../transcripts/empty-namespaces.output.md | 24 +- unison-src/transcripts/emptyCodebase.md | 2 +- .../transcripts/emptyCodebase.output.md | 2 +- unison-src/transcripts/error-messages.md | 2 +- .../errors/missing-result-typed.md | 2 +- .../transcripts/errors/ucm-hide-all-error.md | 2 +- .../errors/ucm-hide-all-error.output.md | 2 +- unison-src/transcripts/errors/ucm-hide-all.md | 2 +- .../transcripts/errors/ucm-hide-all.output.md | 2 +- .../transcripts/errors/ucm-hide-error.md | 2 +- .../errors/ucm-hide-error.output.md | 2 +- unison-src/transcripts/errors/ucm-hide.md | 2 +- .../transcripts/errors/ucm-hide.output.md | 2 +- unison-src/transcripts/find-by-type.md | 12 +- unison-src/transcripts/find-by-type.output.md | 10 +- unison-src/transcripts/find-command.md | 30 +- unison-src/transcripts/find-command.output.md | 57 +- .../transcripts/fix-1381-excess-propagate.md | 8 +- .../fix-1381-excess-propagate.output.md | 8 +- .../fix-2258-if-as-list-element.md | 2 +- unison-src/transcripts/fix-big-list-crash.md | 2 +- unison-src/transcripts/fix1063.md | 6 +- unison-src/transcripts/fix1063.output.md | 4 +- unison-src/transcripts/fix1334.md | 4 +- unison-src/transcripts/fix1334.output.md | 4 +- unison-src/transcripts/fix1390.md | 6 +- unison-src/transcripts/fix1390.output.md | 6 +- unison-src/transcripts/fix1532.md | 14 +- unison-src/transcripts/fix1532.output.md | 14 +- unison-src/transcripts/fix1578.md | 4 +- unison-src/transcripts/fix1696.md | 2 +- unison-src/transcripts/fix1731.md | 4 +- unison-src/transcripts/fix1800.md | 26 +- unison-src/transcripts/fix1800.output.md | 24 +- unison-src/transcripts/fix1926.md | 2 +- unison-src/transcripts/fix1926.output.md | 2 +- unison-src/transcripts/fix2000.md | 24 +- unison-src/transcripts/fix2000.output.md | 26 +- unison-src/transcripts/fix2004.md | 52 +- unison-src/transcripts/fix2004.output.md | 187 +--- unison-src/transcripts/fix2026.md | 4 +- unison-src/transcripts/fix2026.output.md | 2 +- unison-src/transcripts/fix2027.md | 4 +- unison-src/transcripts/fix2027.output.md | 2 +- unison-src/transcripts/fix2049.md | 6 +- unison-src/transcripts/fix2049.output.md | 4 +- unison-src/transcripts/fix2053.md | 4 +- unison-src/transcripts/fix2053.output.md | 2 +- unison-src/transcripts/fix2156.md | 2 +- unison-src/transcripts/fix2167.md | 2 +- unison-src/transcripts/fix2187.md | 2 +- unison-src/transcripts/fix2231.md | 4 +- unison-src/transcripts/fix2231.output.md | 2 +- unison-src/transcripts/fix2238.md | 4 +- unison-src/transcripts/fix2238.output.md | 2 +- unison-src/transcripts/fix2244.md | 6 +- unison-src/transcripts/fix2244.output.md | 2 +- unison-src/transcripts/fix2254.md | 4 +- unison-src/transcripts/fix2254.output.md | 166 +--- unison-src/transcripts/fix2268.md | 2 +- unison-src/transcripts/fix2334.md | 2 +- unison-src/transcripts/fix2344.md | 2 +- unison-src/transcripts/fix2353.md | 2 +- unison-src/transcripts/fix2354.md | 2 +- unison-src/transcripts/fix2355.md | 2 +- unison-src/transcripts/fix2378.md | 2 +- unison-src/transcripts/fix2423.md | 2 +- unison-src/transcripts/fix2474.md | 2 +- unison-src/transcripts/fix2474.output.md | 2 +- unison-src/transcripts/fix2628.md | 6 +- unison-src/transcripts/fix2628.output.md | 30 +- unison-src/transcripts/fix2663.md | 2 +- unison-src/transcripts/fix2693.md | 4 +- unison-src/transcripts/fix2693.output.md | 2 +- unison-src/transcripts/fix2712.md | 4 +- unison-src/transcripts/fix2712.output.md | 2 +- unison-src/transcripts/fix2795.md | 6 +- unison-src/transcripts/fix2795.output.md | 6 +- unison-src/transcripts/fix2840.md | 6 +- unison-src/transcripts/fix2840.output.md | 4 +- unison-src/transcripts/fix2970.md | 2 +- unison-src/transcripts/fix2970.output.md | 2 +- unison-src/transcripts/fix3037.md | 2 +- unison-src/transcripts/fix3171.md | 2 +- unison-src/transcripts/fix3196.md | 2 +- unison-src/transcripts/fix3215.md | 2 +- unison-src/transcripts/fix3244.md | 2 +- unison-src/transcripts/fix3265.md | 2 +- unison-src/transcripts/fix3634.md | 6 +- unison-src/transcripts/fix3634.output.md | 4 +- unison-src/transcripts/fix3678.md | 2 +- unison-src/transcripts/fix3752.md | 2 +- unison-src/transcripts/fix3759.md | 4 +- unison-src/transcripts/fix3773.md | 2 +- unison-src/transcripts/fix4172.md | 10 +- unison-src/transcripts/fix4172.output.md | 8 +- unison-src/transcripts/fix4280.md | 2 +- unison-src/transcripts/fix4424.md | 6 +- unison-src/transcripts/fix4424.output.md | 4 +- unison-src/transcripts/fix4498.md | 6 +- unison-src/transcripts/fix4498.output.md | 4 +- unison-src/transcripts/fix4556.md | 6 +- unison-src/transcripts/fix4556.output.md | 4 +- unison-src/transcripts/fix4592.md | 2 +- unison-src/transcripts/fix4618.md | 6 +- unison-src/transcripts/fix4618.output.md | 4 +- unison-src/transcripts/fix4722.md | 2 +- unison-src/transcripts/fix4780.md | 2 +- unison-src/transcripts/fix4898.md | 8 +- unison-src/transcripts/fix4898.output.md | 8 +- unison-src/transcripts/fix614.md | 4 +- unison-src/transcripts/fix689.md | 2 +- unison-src/transcripts/fix693.md | 4 +- unison-src/transcripts/fix693.output.md | 2 +- unison-src/transcripts/fix845.md | 4 +- unison-src/transcripts/fix849.md | 2 +- unison-src/transcripts/fix942.md | 12 +- unison-src/transcripts/fix942.output.md | 10 +- unison-src/transcripts/fix987.md | 6 +- unison-src/transcripts/fix987.output.md | 4 +- unison-src/transcripts/formatter.md | 6 +- unison-src/transcripts/formatter.output.md | 4 +- unison-src/transcripts/fuzzy-options.md | 12 +- .../transcripts/fuzzy-options.output.md | 16 +- unison-src/transcripts/hello.md | 8 +- unison-src/transcripts/hello.output.md | 4 +- unison-src/transcripts/higher-rank.md | 6 +- unison-src/transcripts/io-test-command.md | 12 +- .../transcripts/io-test-command.output.md | 8 +- unison-src/transcripts/io.md | 72 +- unison-src/transcripts/io.output.md | 62 +- unison-src/transcripts/kind-inference.md | 2 +- unison-src/transcripts/lambdacase.md | 14 +- unison-src/transcripts/lambdacase.output.md | 10 +- .../transcripts/ls-pretty-print-scope-bug.md | 8 +- .../ls-pretty-print-scope-bug.output.md | 26 +- unison-src/transcripts/lsp-fold-ranges.md | 4 +- .../transcripts/lsp-fold-ranges.output.md | 2 +- unison-src/transcripts/merge.md | 56 +- unison-src/transcripts/mergeloop.md | 6 +- unison-src/transcripts/mergeloop.output.md | 33 +- unison-src/transcripts/merges.md | 34 +- unison-src/transcripts/merges.output.md | 212 +---- unison-src/transcripts/move-all.md | 16 +- unison-src/transcripts/move-all.output.md | 14 +- unison-src/transcripts/move-namespace.md | 24 +- .../transcripts/move-namespace.output.md | 186 +--- unison-src/transcripts/name-segment-escape.md | 8 +- .../transcripts/name-segment-escape.output.md | 8 +- unison-src/transcripts/name-selection.md | 6 +- .../transcripts/name-selection.output.md | 120 +-- unison-src/transcripts/names.md | 2 +- unison-src/transcripts/names.output.md | 59 +- .../namespace-deletion-regression.md | 10 +- .../namespace-deletion-regression.output.md | 21 +- unison-src/transcripts/old-fold-right.md | 2 +- .../transcripts/pattern-match-coverage.md | 8 +- .../pattern-match-coverage.output.md | 6 +- .../transcripts/pattern-pretty-print-2345.md | 32 +- .../pattern-pretty-print-2345.output.md | 30 +- unison-src/transcripts/patternMatchTls.md | 6 +- .../transcripts/patternMatchTls.output.md | 4 +- unison-src/transcripts/patterns.md | 2 +- unison-src/transcripts/project-merge.md | 8 +- .../transcripts/project-merge.output.md | 142 +--- unison-src/transcripts/propagate.md | 2 +- unison-src/transcripts/propagate.output.md | 83 +- unison-src/transcripts/records.md | 28 +- unison-src/transcripts/records.output.md | 12 +- unison-src/transcripts/reflog.md | 14 +- unison-src/transcripts/reflog.output.md | 22 +- unison-src/transcripts/reset.md | 20 +- unison-src/transcripts/reset.output.md | 18 +- unison-src/transcripts/rsa.md | 2 +- unison-src/transcripts/scope-ref.md | 2 +- unison-src/transcripts/squash.md | 50 +- unison-src/transcripts/squash.output.md | 496 +---------- unison-src/transcripts/suffixes.md | 24 +- unison-src/transcripts/suffixes.output.md | 22 +- unison-src/transcripts/switch-command.md | 8 +- .../transcripts/switch-command.output.md | 11 +- unison-src/transcripts/tab-completion.md | 36 +- .../transcripts/tab-completion.output.md | 39 +- unison-src/transcripts/test-command.md | 14 +- unison-src/transcripts/test-command.output.md | 41 +- unison-src/transcripts/text-literals.md | 6 +- .../transcripts/text-literals.output.md | 4 +- unison-src/transcripts/todo-bug-builtins.md | 2 +- unison-src/transcripts/todo.output.md | 12 +- .../transcripts/top-level-exceptions.md | 12 +- .../top-level-exceptions.output.md | 10 +- unison-src/transcripts/type-deps.md | 8 +- unison-src/transcripts/type-deps.output.md | 4 +- .../transcripts/type-modifier-are-optional.md | 2 +- unison-src/transcripts/unique-type-churn.md | 12 +- .../transcripts/unique-type-churn.output.md | 12 +- unison-src/transcripts/unitnamespace.md | 6 +- .../transcripts/unitnamespace.output.md | 36 +- unison-src/transcripts/universal-cmp.md | 6 +- .../transcripts/universal-cmp.output.md | 4 +- unison-src/transcripts/unsafe-coerce.md | 8 +- .../transcripts/unsafe-coerce.output.md | 6 +- .../update-ignores-lib-namespace.md | 8 +- .../update-ignores-lib-namespace.output.md | 6 +- unison-src/transcripts/update-on-conflict.md | 4 +- .../transcripts/update-on-conflict.output.md | 63 +- .../update-term-aliases-in-different-ways.md | 8 +- ...e-term-aliases-in-different-ways.output.md | 8 +- .../update-term-to-different-type.md | 8 +- .../update-term-to-different-type.output.md | 8 +- .../transcripts/update-term-with-alias.md | 8 +- .../update-term-with-alias.output.md | 8 +- ...e-term-with-dependent-to-different-type.md | 6 +- ...with-dependent-to-different-type.output.md | 6 +- .../transcripts/update-term-with-dependent.md | 8 +- .../update-term-with-dependent.output.md | 8 +- unison-src/transcripts/update-term.md | 8 +- unison-src/transcripts/update-term.output.md | 8 +- .../transcripts/update-test-to-non-test.md | 10 +- .../update-test-to-non-test.output.md | 10 +- .../update-test-watch-roundtrip.md | 6 +- .../update-test-watch-roundtrip.output.md | 4 +- .../update-type-add-constructor.md | 10 +- .../update-type-add-constructor.output.md | 8 +- .../transcripts/update-type-add-field.md | 10 +- .../update-type-add-field.output.md | 8 +- .../transcripts/update-type-add-new-record.md | 4 +- .../update-type-add-new-record.output.md | 6 +- .../update-type-add-record-field.md | 10 +- .../update-type-add-record-field.output.md | 8 +- .../update-type-constructor-alias.md | 10 +- .../update-type-constructor-alias.output.md | 8 +- ...-type-delete-constructor-with-dependent.md | 6 +- ...elete-constructor-with-dependent.output.md | 4 +- .../update-type-delete-constructor.md | 10 +- .../update-type-delete-constructor.output.md | 8 +- .../update-type-delete-record-field.md | 10 +- .../update-type-delete-record-field.output.md | 8 +- .../update-type-missing-constructor.md | 10 +- .../update-type-missing-constructor.output.md | 8 +- .../update-type-nested-decl-aliases.md | 6 +- .../update-type-nested-decl-aliases.output.md | 4 +- .../transcripts/update-type-no-op-record.md | 6 +- .../update-type-no-op-record.output.md | 4 +- .../update-type-stray-constructor-alias.md | 10 +- ...ate-type-stray-constructor-alias.output.md | 8 +- .../update-type-stray-constructor.md | 10 +- .../update-type-stray-constructor.output.md | 8 +- ...turn-constructor-into-smart-constructor.md | 10 +- ...nstructor-into-smart-constructor.output.md | 8 +- ...update-type-turn-non-record-into-record.md | 10 +- ...type-turn-non-record-into-record.output.md | 8 +- .../update-type-with-dependent-term.md | 6 +- .../update-type-with-dependent-term.output.md | 4 +- ...e-with-dependent-type-to-different-kind.md | 6 +- ...dependent-type-to-different-kind.output.md | 4 +- .../update-type-with-dependent-type.md | 12 +- .../update-type-with-dependent-type.output.md | 10 +- unison-src/transcripts/update-watch.md | 2 +- unison-src/transcripts/update-watch.output.md | 2 +- unison-src/transcripts/view.md | 6 +- unison-src/transcripts/view.output.md | 35 +- unison-src/transcripts/watch-expressions.md | 8 +- .../transcripts/watch-expressions.output.md | 8 +- 422 files changed, 2188 insertions(+), 5669 deletions(-) diff --git a/unison-src/builtin-tests/base.md b/unison-src/builtin-tests/base.md index d4717fdcc1..70443ad0f7 100644 --- a/unison-src/builtin-tests/base.md +++ b/unison-src/builtin-tests/base.md @@ -5,7 +5,7 @@ Thus, make sure the contents of this file define the contents of the cache (e.g. don't pull `latest`.) ```ucm -.> pull @unison/base/releases/2.5.0 .base -.> builtins.mergeio -.> undo +scratch/main> pull @unison/base/releases/2.5.0 .base +scratch/main> builtins.mergeio +scratch/main> undo ``` diff --git a/unison-src/builtin-tests/interpreter-tests.tpl.md b/unison-src/builtin-tests/interpreter-tests.tpl.md index 2d09efdc0e..9e34968a78 100644 --- a/unison-src/builtin-tests/interpreter-tests.tpl.md +++ b/unison-src/builtin-tests/interpreter-tests.tpl.md @@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release. ```ucm:hide:error -.> this is a hack to trigger an error, in order to swallow any error on the next line. -.> we delete the project to avoid any merge conflicts or complaints from ucm. -.> delete.project runtime-tests +scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line. +scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm. +scratch/main> delete.project runtime-tests ``` ```ucm:hide -.> clone ${runtime_tests_version} runtime-tests/selected +scratch/main> clone ${runtime_tests_version} runtime-tests/selected ``` ```ucm diff --git a/unison-src/builtin-tests/jit-tests.tpl.md b/unison-src/builtin-tests/jit-tests.tpl.md index b24a7c7c7c..ea4a65793d 100644 --- a/unison-src/builtin-tests/jit-tests.tpl.md +++ b/unison-src/builtin-tests/jit-tests.tpl.md @@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release. ```ucm:hide:error -.> this is a hack to trigger an error, in order to swallow any error on the next line. -.> we delete the project to avoid any merge conflicts or complaints from ucm. -.> delete.project runtime-tests +scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line. +scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm. +scratch/main> delete.project runtime-tests ``` ```ucm:hide -.> clone ${runtime_tests_version} runtime-tests/selected +scratch/main> clone ${runtime_tests_version} runtime-tests/selected ``` ```ucm @@ -31,8 +31,8 @@ foo = do ``` ```ucm -.> run.native foo -.> run.native foo +scratch/main> run.native foo +scratch/main> run.native foo ``` This can also only be tested by separately running this test, because diff --git a/unison-src/transcripts-manual/benchmarks.md b/unison-src/transcripts-manual/benchmarks.md index 0a8ff9358c..2a3fe38a66 100644 --- a/unison-src/transcripts-manual/benchmarks.md +++ b/unison-src/transcripts-manual/benchmarks.md @@ -1,6 +1,6 @@ ```ucm:hide -.> pull unison.public.base.releases.M4d base -.> pull runarorama.public.sort.data sort +scratch/main> pull unison.public.base.releases.M4d base +scratch/main> pull runarorama.public.sort.data sort ``` ```unison:hide @@ -34,63 +34,63 @@ prepare = do ``` ```ucm:hide -.> add -.> run prepare +scratch/main> add +scratch/main> run prepare ``` ## Benchmarks ```ucm -.> load unison-src/transcripts-manual/benchmarks/each.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/each.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/listmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/listmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/listfilter.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/listfilter.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/random.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/random.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/simpleloop.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/simpleloop.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/fibonacci.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/fibonacci.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/map.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/map.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/natmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/natmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/stm.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/stm.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/tmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/tmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/array-sort.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/array-sort.u +scratch/main> run main ``` \ No newline at end of file diff --git a/unison-src/transcripts-manual/remote-tab-completion.md b/unison-src/transcripts-manual/remote-tab-completion.md index da783b9de7..55b4adeec1 100644 --- a/unison-src/transcripts-manual/remote-tab-completion.md +++ b/unison-src/transcripts-manual/remote-tab-completion.md @@ -3,5 +3,5 @@ Note: this makes a network call to share to get completions ```ucm -.> debug.tab-complete pull unison.pub +scratch/main> debug.tab-complete pull unison.pub ``` diff --git a/unison-src/transcripts-manual/rewrites.md b/unison-src/transcripts-manual/rewrites.md index 15a5a06387..891cf53bd1 100644 --- a/unison-src/transcripts-manual/rewrites.md +++ b/unison-src/transcripts-manual/rewrites.md @@ -1,8 +1,8 @@ ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` ## Structural find and replace @@ -37,19 +37,19 @@ rule2 x = @rewrite signature Optional ==> Optional2 Let's rewrite these: ```ucm -.> rewrite rule1 -.> rewrite eitherToOptional +scratch/main> rewrite rule1 +scratch/main> rewrite eitherToOptional ``` ```ucm:hide -.> load -.> add +scratch/main> load +scratch/main> add ``` After adding to the codebase, here's the rewritten source: ```ucm -.> view ex1 Either.mapRight rule1 +scratch/main> view ex1 Either.mapRight rule1 ``` Another example, showing that we can rewrite to definitions that only exist in the file: @@ -75,18 +75,18 @@ blah2 = 456 Let's apply the rewrite `woot1to2`: ```ucm -.> rewrite woot1to2 +scratch/main> rewrite woot1to2 ``` ```ucm:hide -.> load -.> add +scratch/main> load +scratch/main> add ``` After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ```ucm -.> view wootEx +scratch/main> view wootEx ``` This example shows that rewrite rules can to refer to term definitions that only exist in the file: @@ -111,15 +111,15 @@ sameFileEx = ``` ```ucm:hide -.> rewrite rule -.> load -.> add +scratch/main> rewrite rule +scratch/main> load +scratch/main> add ``` After adding the rewritten form to the codebase, here's the rewritten definitions: ```ucm -.> view foo1 foo2 sameFileEx +scratch/main> view foo1 foo2 sameFileEx ``` ## Capture avoidance @@ -145,13 +145,13 @@ sameFileEx = In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding. ```ucm -.> rewrite rule +scratch/main> rewrite rule ``` Instead, it should be an unbound free variable, which doesn't typecheck: ```ucm:error -.> load +scratch/main> load ``` In this example, the `a` is locally bound by the rule, so it shouldn't capture the `a = 39494` binding which is in scope at the point of the replacement: @@ -167,13 +167,13 @@ rule a = @rewrite ``` ```ucm -.> rewrite rule +scratch/main> rewrite rule ``` The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error: ```ucm:error -.> load +scratch/main> load ``` ## Structural find @@ -183,7 +183,7 @@ eitherEx = Left ("hello", "there") ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison:hide @@ -192,7 +192,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ```ucm -.> sfind findEitherEx -.> sfind findEitherFailure -.> find 1-5 +scratch/main> sfind findEitherEx +scratch/main> sfind findEitherFailure +scratch/main> find 1-5 ``` diff --git a/unison-src/transcripts-manual/scheme.md b/unison-src/transcripts-manual/scheme.md index 1c1427280f..35aae31b26 100644 --- a/unison-src/transcripts-manual/scheme.md +++ b/unison-src/transcripts-manual/scheme.md @@ -2,8 +2,8 @@ This transcript executes very slowly, because the compiler has an entire copy of base (and other stuff) within it. ```ucm:hide -.> builtins.merge -.> pull.without-history unison.public.base.trunk base +scratch/main> builtins.merge +scratch/main> pull.without-history unison.public.base.trunk base ``` ```unison @@ -55,7 +55,7 @@ multiAddUp = repeat 35 '(printAddUp 3000000) ``` ```ucm -.> add -.> run singleAddUp -.> run.native multiAddUp +scratch/main> add +scratch/main> run singleAddUp +scratch/main> run.native multiAddUp ``` diff --git a/unison-src/transcripts-round-trip/main.md b/unison-src/transcripts-round-trip/main.md index 7287a7ddba..a7479d758a 100644 --- a/unison-src/transcripts-round-trip/main.md +++ b/unison-src/transcripts-round-trip/main.md @@ -1,13 +1,13 @@ This transcript verifies that the pretty-printer produces code that can be successfully parsed, for a variety of examples. Terms or types that fail to round-trip can be added to either `reparses-with-same-hash.u` or `reparses.u` as regression tests. ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```ucm:hide -.> copy.namespace builtin a1.lib.builtin -.> copy.namespace builtin a2.lib.builtin -.> load unison-src/transcripts-round-trip/reparses-with-same-hash.u +scratch/main> copy.namespace builtin a1.lib.builtin +scratch/main> copy.namespace builtin a2.lib.builtin +scratch/main> load unison-src/transcripts-round-trip/reparses-with-same-hash.u .a1> add ``` @@ -41,12 +41,12 @@ So we can see the pretty-printed output: This diff should be empty if the two namespaces are equivalent. If it's nonempty, the diff will show us the hashes that differ. ```ucm:error -.> diff.namespace a1 a2 +scratch/main> diff.namespace a1 a2 ``` ```ucm:hide -.> undo -.> undo +scratch/main> undo +scratch/main> undo ``` Now check that definitions in 'reparses.u' at least parse on round trip: @@ -72,7 +72,7 @@ x = () ``` ```ucm:hide -.> move.namespace a3 a3_old +scratch/main> move.namespace a3 a3_old .a3> copy.namespace .builtin lib.builtin .a3> load .a3> add @@ -83,7 +83,7 @@ x = () These are currently all expected to have different hashes on round trip. ```ucm -.> diff.namespace a3 a3_old +scratch/main> diff.namespace a3 a3_old ``` ## Other regression tests not covered by above @@ -93,8 +93,8 @@ These are currently all expected to have different hashes on round trip. Regression test for https://github.com/unisonweb/unison/pull/3548 ```ucm:hide -.> alias.term ##Nat.+ plus -.> edit plus -.> load -.> undo +scratch/main> alias.term ##Nat.+ plus +scratch/main> edit plus +scratch/main> load +scratch/main> undo ``` diff --git a/unison-src/transcripts-using-base/_base.md b/unison-src/transcripts-using-base/_base.md index 1befbcb2e9..8c4d8c707c 100644 --- a/unison-src/transcripts-using-base/_base.md +++ b/unison-src/transcripts-using-base/_base.md @@ -10,9 +10,9 @@ transcripts which contain less boilerplate. ## Usage ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` The test shows that `hex (fromHex str) == str` as expected. @@ -24,7 +24,7 @@ test> hex.tests.ex1 = checks let ``` ```ucm:hide -.> test +scratch/main> test ``` Lets do some basic testing of our test harness to make sure its @@ -50,6 +50,6 @@ testAutoClean _ = ``` ```ucm -.> add -.> io.test testAutoClean +scratch/main> add +scratch/main> io.test testAutoClean ``` diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index eeaebe564c..793d4ecca8 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -53,13 +53,13 @@ testAutoClean _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testAutoClean : '{IO} [Result] -.> io.test testAutoClean +scratch/main> io.test testAutoClean New test results: diff --git a/unison-src/transcripts-using-base/all-base-hashes.md b/unison-src/transcripts-using-base/all-base-hashes.md index d7050cb774..bb0f27c2cd 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.md +++ b/unison-src/transcripts-using-base/all-base-hashes.md @@ -1,5 +1,5 @@ This transcript is intended to make visible accidental changes to the hashing algorithm. ```ucm -.> find.verbose +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts-using-base/all-base-hashes.output.md b/unison-src/transcripts-using-base/all-base-hashes.output.md index 63c258e137..99d4128d07 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -1,7 +1,7 @@ This transcript is intended to make visible accidental changes to the hashing algorithm. ```ucm -.> find.verbose +scratch/main> find.verbose 1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo <| : (i ->{g} o) -> i ->{g} o diff --git a/unison-src/transcripts-using-base/binary-encoding-nats.md b/unison-src/transcripts-using-base/binary-encoding-nats.md index 711bcb3300..2eee6caf58 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.md @@ -54,6 +54,6 @@ testABunchOfNats _ = ``` ```ucm -.> add -.> io.test testABunchOfNats +scratch/main> add +scratch/main> io.test testABunchOfNats ``` diff --git a/unison-src/transcripts-using-base/binary-encoding-nats.output.md b/unison-src/transcripts-using-base/binary-encoding-nats.output.md index 0227ff8e25..346b2135c3 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -76,7 +76,7 @@ testABunchOfNats _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -91,7 +91,7 @@ testABunchOfNats _ = testNat : Nat -> '{IO, Stream Result} () testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () -.> io.test testABunchOfNats +scratch/main> io.test testABunchOfNats New test results: diff --git a/unison-src/transcripts-using-base/codeops.md b/unison-src/transcripts-using-base/codeops.md index 4754eb0aaf..1e2797769b 100644 --- a/unison-src/transcripts-using-base/codeops.md +++ b/unison-src/transcripts-using-base/codeops.md @@ -153,7 +153,7 @@ swapped name link = ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -236,9 +236,9 @@ we gain the ability to capture output in a transcript, it can be modified to actual show that the serialization works. ```ucm -.> add -.> io.test tests -.> io.test badLoad +scratch/main> add +scratch/main> io.test tests +scratch/main> io.test badLoad ``` ```unison @@ -278,8 +278,8 @@ codeTests = ``` ```ucm -.> add -.> io.test codeTests +scratch/main> add +scratch/main> io.test codeTests ``` ```unison @@ -309,6 +309,6 @@ vtests _ = ``` ```ucm -.> add -.> io.test vtests +scratch/main> add +scratch/main> io.test vtests ``` diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index 3f76560f4a..0b87f0cf9b 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -200,7 +200,7 @@ swapped name link = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -344,7 +344,7 @@ we gain the ability to capture output in a transcript, it can be modified to actual show that the serialization works. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -360,7 +360,7 @@ to actual show that the serialization works. tests : '{IO} [Result] zapper : Three Nat Nat Nat -> Request {Zap} r -> r -.> io.test tests +scratch/main> io.test tests New test results: @@ -382,7 +382,7 @@ to actual show that the serialization works. Tip: Use view tests to view the source of a test. -.> io.test badLoad +scratch/main> io.test badLoad New test results: @@ -443,13 +443,13 @@ codeTests = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: codeTests : '{IO} [Result] -.> io.test codeTests +scratch/main> io.test codeTests New test results: @@ -530,14 +530,14 @@ vtests _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] -.> io.test vtests +scratch/main> io.test vtests New test results: diff --git a/unison-src/transcripts-using-base/doc.md b/unison-src/transcripts-using-base/doc.md index 461a4f04bb..52973ddb3e 100644 --- a/unison-src/transcripts-using-base/doc.md +++ b/unison-src/transcripts-using-base/doc.md @@ -33,9 +33,9 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im You can preview what docs will look like when rendered to the console using the `display` or `docs` commands: ```ucm -.> display d1 -.> docs ImportantConstant -.> docs DayOfWeek +scratch/main> display d1 +scratch/main> docs ImportantConstant +scratch/main> docs DayOfWeek ``` The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions. @@ -45,11 +45,11 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th First, we'll load the `syntax.u` file which has examples of all the syntax: ```ucm -.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u +scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u ``` ```ucm:hide -.> add +scratch/main> add ``` Now we can review different portions of the guide. @@ -57,25 +57,25 @@ we'll show both the pretty-printed source using `view` and the rendered output using `display`: ```ucm -.> view basicFormatting -.> display basicFormatting -.> view lists -.> display lists -.> view evaluation -.> display evaluation -.> view includingSource -.> display includingSource -.> view nonUnisonCodeBlocks -.> display nonUnisonCodeBlocks -.> view otherElements -.> display otherElements +scratch/main> view basicFormatting +scratch/main> display basicFormatting +scratch/main> view lists +scratch/main> display lists +scratch/main> view evaluation +scratch/main> display evaluation +scratch/main> view includingSource +scratch/main> display includingSource +scratch/main> view nonUnisonCodeBlocks +scratch/main> display nonUnisonCodeBlocks +scratch/main> view otherElements +scratch/main> display otherElements ``` Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: ```ucm -.> view doc.guide -.> display doc.guide +scratch/main> view doc.guide +scratch/main> display doc.guide ``` 🌻 THE END diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index 43edad9881..e47d8d0737 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -51,15 +51,15 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im You can preview what docs will look like when rendered to the console using the `display` or `docs` commands: ```ucm -.> display d1 +scratch/main> display d1 Hello there Alice! -.> docs ImportantConstant +scratch/main> docs ImportantConstant An important constant, equal to `42` -.> docs DayOfWeek +scratch/main> docs DayOfWeek The 7 days of the week, defined as: @@ -73,7 +73,7 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th First, we'll load the `syntax.u` file which has examples of all the syntax: ```ucm -.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u +scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u Loading changes detected in ./unison-src/transcripts-using-base/doc.md.files/syntax.u. @@ -100,7 +100,7 @@ we'll show both the pretty-printed source using `view` and the rendered output using `display`: ```ucm -.> view basicFormatting +scratch/main> view basicFormatting basicFormatting : Doc2 basicFormatting = @@ -130,7 +130,7 @@ and the rendered output using `display`: __Next up:__ {lists} }} -.> display basicFormatting +scratch/main> display basicFormatting # Basic formatting @@ -155,7 +155,7 @@ and the rendered output using `display`: *Next up:* lists -.> view lists +scratch/main> view lists lists : Doc2 lists = @@ -198,7 +198,7 @@ and the rendered output using `display`: 3. Get dressed. }} -.> display lists +scratch/main> display lists # Lists @@ -237,7 +237,7 @@ and the rendered output using `display`: 2. Take shower. 3. Get dressed. -.> view evaluation +scratch/main> view evaluation evaluation : Doc2 evaluation = @@ -272,7 +272,7 @@ and the rendered output using `display`: ``` }} -.> display evaluation +scratch/main> display evaluation # Evaluation @@ -300,7 +300,7 @@ and the rendered output using `display`: cube : Nat -> Nat cube x = x * x * x -.> view includingSource +scratch/main> view includingSource includingSource : Doc2 includingSource = @@ -341,7 +341,7 @@ and the rendered output using `display`: {{ docExample 1 do x -> sqr x }}. }} -.> display includingSource +scratch/main> display includingSource # Including Unison source code @@ -387,7 +387,7 @@ and the rendered output using `display`: application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. -.> view nonUnisonCodeBlocks +scratch/main> view nonUnisonCodeBlocks nonUnisonCodeBlocks : Doc2 nonUnisonCodeBlocks = @@ -420,7 +420,7 @@ and the rendered output using `display`: ``` }} -.> display nonUnisonCodeBlocks +scratch/main> display nonUnisonCodeBlocks # Non-Unison code blocks @@ -449,7 +449,7 @@ and the rendered output using `display`: xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` -.> view otherElements +scratch/main> view otherElements otherElements : Doc2 otherElements = @@ -506,7 +506,7 @@ and the rendered output using `display`: ] }} }} -.> display otherElements +scratch/main> display otherElements There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the @@ -549,7 +549,7 @@ and the rendered output using `display`: Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: ```ucm -.> view doc.guide +scratch/main> view doc.guide doc.guide : Doc2 doc.guide = @@ -569,7 +569,7 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub {{ otherElements }} }} -.> display doc.guide +scratch/main> display doc.guide # Unison computable documentation diff --git a/unison-src/transcripts-using-base/failure-tests.md b/unison-src/transcripts-using-base/failure-tests.md index 049b4fcbb1..5f69a8c2a0 100644 --- a/unison-src/transcripts-using-base/failure-tests.md +++ b/unison-src/transcripts-using-base/failure-tests.md @@ -19,13 +19,13 @@ test2 = do ``` ```ucm -.> add +scratch/main> add ``` ```ucm:error -.> io.test test1 +scratch/main> io.test test1 ``` ```ucm:error -.> io.test test2 +scratch/main> io.test test2 ``` diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index d59d3d7bc8..7d33aad456 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -33,7 +33,7 @@ test2 = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -42,7 +42,7 @@ test2 = do ``` ```ucm -.> io.test test1 +scratch/main> io.test test1 💔💥 @@ -58,7 +58,7 @@ test2 = do ``` ```ucm -.> io.test test2 +scratch/main> io.test test2 💔💥 diff --git a/unison-src/transcripts-using-base/fix1709.output.md b/unison-src/transcripts-using-base/fix1709.output.md index 953121aa2c..99af3fe0d4 100644 --- a/unison-src/transcripts-using-base/fix1709.output.md +++ b/unison-src/transcripts-using-base/fix1709.output.md @@ -14,10 +14,11 @@ id2 x = do an `add` or `update`, here's how your codebase would change: - ⊡ Previously added definitions will be ignored: id - ⍟ These new definitions are ok to `add`: + id : x -> x + (also named + __projects._a60db36c_af90_4d99_bcd2_3b3c7a24851f.branches._4fe18976_dde6_41e4_82c0_bf3887f77467.id) id2 : x -> x ``` diff --git a/unison-src/transcripts-using-base/fix2358.md b/unison-src/transcripts-using-base/fix2358.md index 915a350607..1c543349e4 100644 --- a/unison-src/transcripts-using-base/fix2358.md +++ b/unison-src/transcripts-using-base/fix2358.md @@ -10,5 +10,5 @@ timingApp2 _ = ``` ```ucm -.> run timingApp2 +scratch/main> run timingApp2 ``` diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index 61a3dd8052..d20a06e163 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -23,7 +23,7 @@ timingApp2 _ = ``` ```ucm -.> run timingApp2 +scratch/main> run timingApp2 () diff --git a/unison-src/transcripts-using-base/fix3939.md b/unison-src/transcripts-using-base/fix3939.md index 7ec695e6c7..e9634ee2fc 100644 --- a/unison-src/transcripts-using-base/fix3939.md +++ b/unison-src/transcripts-using-base/fix3939.md @@ -6,7 +6,7 @@ meh = 9 ``` ```ucm -.> add -.> find meh -.> docs 1 +scratch/main> add +scratch/main> find meh +scratch/main> docs 1 ``` diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 99197263c4..ca4e6d909e 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -20,20 +20,20 @@ meh = 9 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: meh : Nat meh.doc : Doc2 -.> find meh +scratch/main> find meh 1. meh : Nat 2. meh.doc : Doc2 -.> docs 1 +scratch/main> docs 1 A simple doc. diff --git a/unison-src/transcripts-using-base/hashing.md b/unison-src/transcripts-using-base/hashing.md index 99f7db2477..f7d6a2bdd8 100644 --- a/unison-src/transcripts-using-base/hashing.md +++ b/unison-src/transcripts-using-base/hashing.md @@ -3,7 +3,7 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases. ```ucm -.> ls builtin.Bytes +scratch/main> ls builtin.Bytes ``` Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`. @@ -43,7 +43,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex And here's the full API: ```ucm -.> find-in builtin.crypto +scratch/main> find-in builtin.crypto ``` Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime: @@ -189,11 +189,11 @@ test> crypto.hash.numTests = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` ## HMAC tests @@ -251,9 +251,9 @@ test> md5.tests.ex3 = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index fee4fa0a27..cb60fa67fb 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -3,7 +3,7 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases. ```ucm -.> ls builtin.Bytes +scratch/main> ls builtin.Bytes 1. ++ (Bytes -> Bytes -> Bytes) 2. at (Nat -> Bytes -> Optional Nat) @@ -120,7 +120,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex And here's the full API: ```ucm -.> find-in builtin.crypto +scratch/main> find-in builtin.crypto 1. type CryptoFailure 2. Ed25519.sign.impl : Bytes @@ -312,7 +312,7 @@ test> crypto.hash.numTests = ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) @@ -475,7 +475,7 @@ test> md5.tests.ex3 = ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts-using-base/mvar.md b/unison-src/transcripts-using-base/mvar.md index d2114c2e28..81be1ed79b 100644 --- a/unison-src/transcripts-using-base/mvar.md +++ b/unison-src/transcripts-using-base/mvar.md @@ -51,7 +51,7 @@ testMvars _ = runTest test ``` ```ucm -.> add -.> io.test testMvars +scratch/main> add +scratch/main> io.test testMvars ``` diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index 26cccc7baf..ff5435392b 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -66,14 +66,14 @@ testMvars _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] -.> io.test testMvars +scratch/main> io.test testMvars New test results: diff --git a/unison-src/transcripts-using-base/namespace-dependencies.md b/unison-src/transcripts-using-base/namespace-dependencies.md index d338c05432..1558d5951e 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.md @@ -6,6 +6,6 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ``` ```ucm -.> add +scratch/main> add .mynamespace> namespace.dependencies ``` diff --git a/unison-src/transcripts-using-base/namespace-dependencies.output.md b/unison-src/transcripts-using-base/namespace-dependencies.output.md index caf4dc52c7..b20019aa47 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.output.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.output.md @@ -6,20 +6,31 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: external.mynat : Nat mynamespace.dependsOnText : Nat + ☝️ The namespace .mynamespace is empty. + .mynamespace> namespace.dependencies - External dependency Dependents in .mynamespace - .builtin.Nat 1. dependsOnText - - .builtin.Nat.+ 1. dependsOnText - - .external.mynat 1. dependsOnText + ⚠️ + + .mynamespace is an empty namespace. ``` + + + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + + + ⚠️ + + .mynamespace is an empty namespace. + diff --git a/unison-src/transcripts-using-base/nat-coersion.md b/unison-src/transcripts-using-base/nat-coersion.md index 3f77501890..ca5ad40f2a 100644 --- a/unison-src/transcripts-using-base/nat-coersion.md +++ b/unison-src/transcripts-using-base/nat-coersion.md @@ -33,6 +33,6 @@ test = 'let ``` ```ucm -.> add -.> io.test test +scratch/main> add +scratch/main> io.test test ``` diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index 38ab4450f0..0e01e72286 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -49,7 +49,7 @@ test = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,7 +59,7 @@ test = 'let -> Optional Float ->{Stream Result} () -.> io.test test +scratch/main> io.test test New test results: diff --git a/unison-src/transcripts-using-base/net.md b/unison-src/transcripts-using-base/net.md index b1125f7019..067f9b9a45 100644 --- a/unison-src/transcripts-using-base/net.md +++ b/unison-src/transcripts-using-base/net.md @@ -10,7 +10,7 @@ socketAccept = compose reraise socketAccept.impl ``` ```ucm:hide -.> add +scratch/main> add ``` # Tests for network related builtins @@ -93,8 +93,8 @@ testDefaultPort _ = runTest test ``` ```ucm -.> add -.> io.test testDefaultPort +scratch/main> add +scratch/main> io.test testDefaultPort ``` This example demonstrates connecting a TCP client socket to a TCP server socket. A thread is started for both client and server. The server socket asks for any availalbe port (by passing "0" as the port number). The server thread then queries for the actual assigned port number, and puts that into an MVar which the client thread can read. The client thread then reads a string from the server and reports it back to the main thread via a different MVar. @@ -149,6 +149,6 @@ testTcpConnect = 'let ``` ```ucm -.> add -.> io.test testTcpConnect +scratch/main> add +scratch/main> io.test testTcpConnect ``` diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 572ef0fbff..2437737ac7 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -107,7 +107,7 @@ testDefaultPort _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,7 +115,7 @@ testDefaultPort _ = testDefaultPort : '{IO} [Result] testExplicitHost : '{IO} [Result] -.> io.test testDefaultPort +scratch/main> io.test testDefaultPort New test results: @@ -194,7 +194,7 @@ testTcpConnect = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -202,7 +202,7 @@ testTcpConnect = 'let serverThread : MVar Nat -> Text -> '{IO} () testTcpConnect : '{IO} [Result] -.> io.test testTcpConnect +scratch/main> io.test testTcpConnect New test results: diff --git a/unison-src/transcripts-using-base/random-deserial.md b/unison-src/transcripts-using-base/random-deserial.md index 1a97ca73d7..2c6ff77de5 100644 --- a/unison-src/transcripts-using-base/random-deserial.md +++ b/unison-src/transcripts-using-base/random-deserial.md @@ -56,6 +56,6 @@ serialTests = do ``` ```ucm -.> add -.> io.test serialTests +scratch/main> add +scratch/main> io.test serialTests ``` diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 48ff86e187..f5dbd7aa10 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -74,7 +74,7 @@ serialTests = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -85,7 +85,7 @@ serialTests = do serialTests : '{IO, Exception} [Result] shuffle : Nat -> [a] -> [a] -.> io.test serialTests +scratch/main> io.test serialTests New test results: diff --git a/unison-src/transcripts-using-base/ref-promise.md b/unison-src/transcripts-using-base/ref-promise.md index dd54328ec5..3c2575951c 100644 --- a/unison-src/transcripts-using-base/ref-promise.md +++ b/unison-src/transcripts-using-base/ref-promise.md @@ -19,8 +19,8 @@ casTest = do ``` ```ucm -.> add -.> io.test casTest +scratch/main> add +scratch/main> io.test casTest ``` Promise is a simple one-shot awaitable condition. @@ -54,9 +54,9 @@ promiseConcurrentTest = do ``` ```ucm -.> add -.> io.test promiseSequentialTest -.> io.test promiseConcurrentTest +scratch/main> add +scratch/main> io.test promiseSequentialTest +scratch/main> io.test promiseConcurrentTest ``` CAS can be used to write an atomic update function. @@ -70,7 +70,7 @@ atomicUpdate ref f = ``` ```ucm -.> add +scratch/main> add ``` Promise can be used to write an operation that spawns N concurrent @@ -91,7 +91,7 @@ spawnN n fa = map Promise.read (go n []) ``` ```ucm -.> add +scratch/main> add ``` We can use these primitives to write a more interesting example, where @@ -123,6 +123,6 @@ fullTest = do ``` ```ucm -.> add -.> io.test fullTest +scratch/main> add +scratch/main> io.test fullTest ``` diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index 727f62e89e..448aaddd6a 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -32,13 +32,13 @@ casTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: casTest : '{IO} [Result] -.> io.test casTest +scratch/main> io.test casTest New test results: @@ -95,14 +95,14 @@ promiseConcurrentTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] -.> io.test promiseSequentialTest +scratch/main> io.test promiseSequentialTest New test results: @@ -114,7 +114,7 @@ promiseConcurrentTest = do Tip: Use view promiseSequentialTest to view the source of a test. -.> io.test promiseConcurrentTest +scratch/main> io.test promiseConcurrentTest New test results: @@ -150,7 +150,7 @@ atomicUpdate ref f = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -189,7 +189,7 @@ spawnN n fa = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -238,13 +238,13 @@ fullTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: fullTest : '{IO} [Result] -.> io.test fullTest +scratch/main> io.test fullTest New test results: diff --git a/unison-src/transcripts-using-base/serial-test-00.md b/unison-src/transcripts-using-base/serial-test-00.md index ab71adfdd4..21860243e3 100644 --- a/unison-src/transcripts-using-base/serial-test-00.md +++ b/unison-src/transcripts-using-base/serial-test-00.md @@ -68,6 +68,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-00.output.md b/unison-src/transcripts-using-base/serial-test-00.output.md index 715680f06b..88a18a7059 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -95,7 +95,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,7 +115,7 @@ mkTestCase = do tree2 : Tree Nat tree3 : Tree Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-01.md b/unison-src/transcripts-using-base/serial-test-01.md index da25e8f4a4..bc5f84af0d 100644 --- a/unison-src/transcripts-using-base/serial-test-01.md +++ b/unison-src/transcripts-using-base/serial-test-01.md @@ -16,6 +16,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-01.output.md b/unison-src/transcripts-using-base/serial-test-01.output.md index 9194621631..5825b36ff5 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -33,7 +33,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -43,7 +43,7 @@ mkTestCase = do l3 : [Char] mkTestCase : '{IO, Exception} () -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-02.md b/unison-src/transcripts-using-base/serial-test-02.md index 3d13ee487b..15518165a0 100644 --- a/unison-src/transcripts-using-base/serial-test-02.md +++ b/unison-src/transcripts-using-base/serial-test-02.md @@ -30,6 +30,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-02.output.md b/unison-src/transcripts-using-base/serial-test-02.output.md index a6957230e9..ecbe82ebee 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -49,7 +49,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -61,7 +61,7 @@ mkTestCase = do prod : [Nat] -> Nat products : ([Nat], [Nat], [Nat]) -> Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-03.md b/unison-src/transcripts-using-base/serial-test-03.md index d1f49c4040..2e66f687d9 100644 --- a/unison-src/transcripts-using-base/serial-test-03.md +++ b/unison-src/transcripts-using-base/serial-test-03.md @@ -44,6 +44,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-03.output.md b/unison-src/transcripts-using-base/serial-test-03.output.md index c161d048bd..f21afcbbb5 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -68,7 +68,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -84,7 +84,7 @@ mkTestCase = do reset : '{DC r} r -> r suspSum : [Nat] -> Delayed Nat -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-04.md b/unison-src/transcripts-using-base/serial-test-04.md index f4763238f6..212b59c9e0 100644 --- a/unison-src/transcripts-using-base/serial-test-04.md +++ b/unison-src/transcripts-using-base/serial-test-04.md @@ -14,6 +14,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-04.output.md b/unison-src/transcripts-using-base/serial-test-04.output.md index ca1949502d..044eabd264 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -28,7 +28,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -36,7 +36,7 @@ mkTestCase = do mutual0 : Nat -> Text mutual1 : Nat -> Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/stm.md b/unison-src/transcripts-using-base/stm.md index 0320353161..1a036fd260 100644 --- a/unison-src/transcripts-using-base/stm.md +++ b/unison-src/transcripts-using-base/stm.md @@ -28,7 +28,7 @@ body k out v = ``` ```ucm -.> add +scratch/main> add ``` Test case. @@ -67,6 +67,6 @@ tests = '(map spawn nats) ``` ```ucm -.> add -.> io.test tests +scratch/main> add +scratch/main> io.test tests ``` diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index a5d87ed520..b5510c9468 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -44,7 +44,7 @@ body k out v = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -106,7 +106,7 @@ tests = '(map spawn nats) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,7 +115,7 @@ tests = '(map spawn nats) spawn : Nat ->{IO} Result tests : '{IO} [Result] -.> io.test tests +scratch/main> io.test tests New test results: diff --git a/unison-src/transcripts-using-base/test-watch-dependencies.md b/unison-src/transcripts-using-base/test-watch-dependencies.md index 8f3c610561..3e7558da3e 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.md @@ -9,7 +9,7 @@ x = 999 ``` ```ucm:hide -.> add +scratch/main> add ``` Now, we update that definition and define a test-watch which depends on it. @@ -22,7 +22,7 @@ test> mytest = checks [x + 1 == 1001] We expect this 'add' to fail because the test is blocked by the update to `x`. ```ucm:error -.> add +scratch/main> add ``` --- @@ -35,5 +35,5 @@ test> useY = checks [y + 1 == 43] This should correctly identify `y` as a dependency and add that too. ```ucm -.> add useY +scratch/main> add useY ``` diff --git a/unison-src/transcripts-using-base/test-watch-dependencies.output.md b/unison-src/transcripts-using-base/test-watch-dependencies.output.md index 53835d0f6e..7b71b244be 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -43,7 +43,7 @@ test> mytest = checks [x + 1 == 1001] We expect this 'add' to fail because the test is blocked by the update to `x`. ```ucm -.> add +scratch/main> add x These definitions failed: @@ -85,7 +85,7 @@ test> useY = checks [y + 1 == 43] This should correctly identify `y` as a dependency and add that too. ```ucm -.> add useY +scratch/main> add useY ⍟ I've added these definitions: diff --git a/unison-src/transcripts-using-base/thread.md b/unison-src/transcripts-using-base/thread.md index d2c2712042..9811d192ce 100644 --- a/unison-src/transcripts-using-base/thread.md +++ b/unison-src/transcripts-using-base/thread.md @@ -19,8 +19,8 @@ testBasicFork = 'let See if we can get another thread to stuff a value into a MVar ```ucm:hide -.> add -.> io.test testBasicFork +scratch/main> add +scratch/main> io.test testBasicFork ``` ```unison @@ -48,8 +48,8 @@ testBasicMultiThreadMVar = 'let ``` ```ucm -.> add -.> io.test testBasicMultiThreadMVar +scratch/main> add +scratch/main> io.test testBasicMultiThreadMVar ``` ```unison @@ -91,6 +91,6 @@ testTwoThreads = 'let ``` ```ucm -.> add -.> io.test testTwoThreads +scratch/main> add +scratch/main> io.test testTwoThreads ``` diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index 76c28fa213..bec5dab529 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -71,14 +71,14 @@ testBasicMultiThreadMVar = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () -.> io.test testBasicMultiThreadMVar +scratch/main> io.test testBasicMultiThreadMVar New test results: @@ -145,7 +145,7 @@ testTwoThreads = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -154,7 +154,7 @@ testTwoThreads = 'let (also named thread1) testTwoThreads : '{IO} [Result] -.> io.test testTwoThreads +scratch/main> io.test testTwoThreads New test results: diff --git a/unison-src/transcripts-using-base/tls.md b/unison-src/transcripts-using-base/tls.md index 77c66db491..71b473837a 100644 --- a/unison-src/transcripts-using-base/tls.md +++ b/unison-src/transcripts-using-base/tls.md @@ -12,7 +12,7 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----" ``` ```ucm:hide -.> add +scratch/main> add ``` # Using an alternative certificate store @@ -32,8 +32,8 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ```ucm -.> add -.> io.test what_should_work +scratch/main> add +scratch/main> io.test what_should_work ``` Test handshaking a client/server a local TCP connection using our @@ -191,8 +191,8 @@ testCNReject _ = ``` ```ucm -.> add -.> io.test testConnectSelfSigned -.> io.test testCAReject -.> io.test testCNReject +scratch/main> add +scratch/main> io.test testConnectSelfSigned +scratch/main> io.test testCAReject +scratch/main> io.test testCNReject ``` diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 135f490186..739bb8fe4b 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -43,7 +43,7 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ what_should_work _ = this_should_work ++ this_should_not_work this_should_work : [Result] what_should_work : ∀ _. _ -> [Result] -.> io.test what_should_work +scratch/main> io.test what_should_work New test results: @@ -238,7 +238,7 @@ testCNReject _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -251,7 +251,7 @@ testCNReject _ = -> '{IO, Exception} Text testConnectSelfSigned : '{IO} [Result] -.> io.test testConnectSelfSigned +scratch/main> io.test testConnectSelfSigned New test results: @@ -262,7 +262,7 @@ testCNReject _ = Tip: Use view testConnectSelfSigned to view the source of a test. -.> io.test testCAReject +scratch/main> io.test testCAReject New test results: @@ -272,7 +272,7 @@ testCNReject _ = Tip: Use view testCAReject to view the source of a test. -.> io.test testCNReject +scratch/main> io.test testCNReject New test results: diff --git a/unison-src/transcripts-using-base/utf8.md b/unison-src/transcripts-using-base/utf8.md index 107bd260cd..4bf0586575 100644 --- a/unison-src/transcripts-using-base/utf8.md +++ b/unison-src/transcripts-using-base/utf8.md @@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text. ```ucm -.> find Utf8 +scratch/main> find Utf8 ``` ascii characters are encoded as single bytes (in the range 0-127). diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index 6bba05281a..c065222115 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text. ```ucm -.> find Utf8 +scratch/main> find Utf8 1. builtin.Text.toUtf8 : Text -> Bytes 2. Text.fromUtf8 : Bytes ->{Exception} Text diff --git a/unison-src/transcripts/abilities.md b/unison-src/transcripts/abilities.md index 3bf6c47ec1..a45ee504dd 100644 --- a/unison-src/transcripts/abilities.md +++ b/unison-src/transcripts/abilities.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some random ability stuff to ensure things work. @@ -23,5 +23,5 @@ ha = cases ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index c90d76a45d..8fd69ddbc6 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -32,7 +32,7 @@ ha = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.md index 4a0606a4bd..2e00cc0c22 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.md @@ -15,6 +15,6 @@ term2 _ = () ``` ```ucm -.> add -.> names term1 +scratch/main> add +scratch/main> names term1 ``` diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md index 879dc0c624..6f6eac30ed 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -31,7 +31,7 @@ term2 _ = () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -40,7 +40,7 @@ term2 _ = () term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () -.> names term1 +scratch/main> names term1 Term Hash: #8hum58rlih diff --git a/unison-src/transcripts/add-run.md b/unison-src/transcripts/add-run.md index 99ac7792e3..07fe99216d 100644 --- a/unison-src/transcripts/add-run.md +++ b/unison-src/transcripts/add-run.md @@ -3,7 +3,7 @@ ## Basic usage ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -20,26 +20,26 @@ is2even = '(even 2) it errors if there isn't a previous run ```ucm:error -.> add.run foo +scratch/main> add.run foo ``` ```ucm -.> run is2even +scratch/main> run is2even ``` it errors if the desired result name conflicts with a name in the unison file ```ucm:error -.> add.run is2even +scratch/main> add.run is2even ``` otherwise, the result is successfully persisted ```ucm -.> add.run foo.bar.baz +scratch/main> add.run foo.bar.baz ``` ```ucm -.> view foo.bar.baz +scratch/main> view foo.bar.baz ``` ## It resolves references within the unison file @@ -56,8 +56,8 @@ main _ = y ``` ```ucm -.> run main -.> add.run result +scratch/main> run main +scratch/main> add.run result ``` ## It resolves references within the codebase @@ -68,7 +68,7 @@ inc x = x + 1 ``` ```ucm -.> add inc +scratch/main> add inc ``` ```unison @@ -77,9 +77,9 @@ main _ x = inc x ``` ```ucm -.> run main -.> add.run natfoo -.> view natfoo +scratch/main> run main +scratch/main> add.run natfoo +scratch/main> view natfoo ``` ## It captures scratch file dependencies at run time @@ -91,7 +91,7 @@ main = 'y ``` ```ucm -.> run main +scratch/main> run main ``` @@ -101,8 +101,8 @@ x = 50 this saves 2 to xres, rather than 100 ```ucm -.> add.run xres -.> view xres +scratch/main> add.run xres +scratch/main> view xres ``` ## It fails with a message if add cannot complete cleanly @@ -112,8 +112,8 @@ main = '5 ``` ```ucm:error -.> run main -.> add.run xres +scratch/main> run main +scratch/main> add.run xres ``` ## It works with absolute names @@ -123,7 +123,7 @@ main = '5 ``` ```ucm -.> run main -.> add.run .an.absolute.name -.> view .an.absolute.name +scratch/main> run main +scratch/main> add.run .an.absolute.name +scratch/main> view .an.absolute.name ``` diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index 3d97788e78..8dd8846ae6 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -31,7 +31,7 @@ is2even = '(even 2) it errors if there isn't a previous run ```ucm -.> add.run foo +scratch/main> add.run foo ⚠️ @@ -40,7 +40,7 @@ it errors if there isn't a previous run ``` ```ucm -.> run is2even +scratch/main> run is2even true @@ -48,7 +48,7 @@ it errors if there isn't a previous run it errors if the desired result name conflicts with a name in the unison file ```ucm -.> add.run is2even +scratch/main> add.run is2even ⚠️ @@ -58,7 +58,7 @@ unison file ``` otherwise, the result is successfully persisted ```ucm -.> add.run foo.bar.baz +scratch/main> add.run foo.bar.baz ⍟ I've added these definitions: @@ -66,7 +66,7 @@ otherwise, the result is successfully persisted ``` ```ucm -.> view foo.bar.baz +scratch/main> view foo.bar.baz foo.bar.baz : Boolean foo.bar.baz = true @@ -101,11 +101,11 @@ main _ = y ``` ```ucm -.> run main +scratch/main> run main a b -> a Nat.+ b Nat.+ z 10 -.> add.run result +scratch/main> add.run result ⍟ I've added these definitions: @@ -134,7 +134,7 @@ inc x = x + 1 ``` ```ucm -.> add inc +scratch/main> add inc ⍟ I've added these definitions: @@ -160,17 +160,17 @@ main _ x = inc x ``` ```ucm -.> run main +scratch/main> run main inc -.> add.run natfoo +scratch/main> add.run natfoo ⍟ I've added these definitions: natfoo : Nat -> Nat -.> view natfoo +scratch/main> view natfoo natfoo : Nat -> Nat natfoo = inc @@ -200,7 +200,7 @@ main = 'y ``` ```ucm -.> run main +scratch/main> run main 2 @@ -224,13 +224,13 @@ x = 50 ``` this saves 2 to xres, rather than 100 ```ucm -.> add.run xres +scratch/main> add.run xres ⍟ I've added these definitions: xres : Nat -.> view xres +scratch/main> view xres xres : Nat xres = 2 @@ -256,11 +256,11 @@ main = '5 ``` ```ucm -.> run main +scratch/main> run main 5 -.> add.run xres +scratch/main> add.run xres x These definitions failed: @@ -290,19 +290,21 @@ main = '5 ``` ```ucm -.> run main +scratch/main> run main 5 -.> add.run .an.absolute.name +scratch/main> add.run .an.absolute.name ⍟ I've added these definitions: .an.absolute.name : Nat -.> view .an.absolute.name +scratch/main> view .an.absolute.name - .an.absolute.name : Nat - .an.absolute.name = 5 + .__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name : + Nat + .__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name = + 5 ``` diff --git a/unison-src/transcripts/add-test-watch-roundtrip.md b/unison-src/transcripts/add-test-watch-roundtrip.md index e8d070d2b1..9b1cacf477 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -10,6 +10,6 @@ foo = [] Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though! ```ucm -.> add -.> view foo +scratch/main> add +scratch/main> view foo ``` diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 5c9389ca1f..114d9399fd 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -6,13 +6,13 @@ foo = [] Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though! ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo : [Result] -.> view foo +scratch/main> view foo foo : [Result] foo : [Result] diff --git a/unison-src/transcripts/addupdatemessages.md b/unison-src/transcripts/addupdatemessages.md index c644d921a0..9c7daea43f 100644 --- a/unison-src/transcripts/addupdatemessages.md +++ b/unison-src/transcripts/addupdatemessages.md @@ -3,7 +3,7 @@ Let's set up some definitions to start: ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,7 +17,7 @@ structural type Y = Two Nat Nat Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ```ucm -.> add +scratch/main> add ``` Let's add an alias for `1` and `One`: @@ -32,7 +32,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. ```ucm -.> add +scratch/main> add ``` Let's update something that has an alias (to a value that doesn't have a name already): @@ -45,7 +45,7 @@ structural type X = Three Nat Nat Nat Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated. ```ucm -.> update +scratch/main> update ``` Update it to something that already exists with a different name: @@ -58,6 +58,6 @@ structural type X = Two Nat Nat Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`. ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index 44925f17c8..ffd7bbd804 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -29,7 +29,7 @@ structural type Y = Two Nat Nat Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -67,7 +67,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -104,7 +104,7 @@ structural type X = Three Nat Nat Nat Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -143,7 +143,7 @@ structural type X = Two Nat Nat Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/alias-many.md b/unison-src/transcripts/alias-many.md index c682faf22b..8d9fb87dec 100644 --- a/unison-src/transcripts/alias-many.md +++ b/unison-src/transcripts/alias-many.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide:all List.adjacentPairs : [a] -> [(a, a)] @@ -102,7 +102,7 @@ The `alias.many` command can be used to copy definitions from the current namesp The names that will be used in the target namespace are the names you specify, relative to the current namespace: ``` -.> help alias.many +scratch/main> help alias.many alias.many (or copy) `alias.many [relative2...] ` creates aliases `relative1`, `relative2`, ... @@ -113,8 +113,8 @@ The names that will be used in the target namespace are the names you specify, r Let's try it! ```ucm -.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib -.> find-in mylib +scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib +scratch/main> find-in mylib ``` Thanks, `alias.many`! diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index 8236c60d04..a0b100000c 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -1,8 +1,8 @@ The `alias.many` command can be used to copy definitions from the current namespace into your curated one. The names that will be used in the target namespace are the names you specify, relative to the current namespace: -``` -.> help alias.many +```scratch +/main> help alias.many alias.many (or copy) `alias.many [relative2...] ` creates aliases `relative1`, `relative2`, ... @@ -14,56 +14,57 @@ The names that will be used in the target namespace are the names you specify, r Let's try it! ```ucm -.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib +scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib - Here's what changed in .mylib : - - Added definitions: - - 1. stuff.List.adjacentPairs : [a] -> [(a, a)] - 2. stuff.List.all : (a ->{g} Boolean) - -> [a] - ->{g} Boolean - 3. stuff.List.any : (a ->{g} Boolean) - -> [a] - ->{g} Boolean - 4. stuff.List.chunk : Nat -> [a] -> [[a]] - 5. stuff.List.chunksOf : Nat -> [a] -> [[a]] - 6. stuff.List.dropWhile : (a ->{g} Boolean) - -> [a] - ->{g} [a] - 7. stuff.List.first : [a] -> Optional a - 8. stuff.List.init : [a] -> Optional [a] - 9. stuff.List.intersperse : a -> [a] -> [a] - 10. stuff.List.isEmpty : [a] -> Boolean - 11. stuff.List.last : [a] -> Optional a - 12. stuff.List.replicate : Nat -> a -> [a] - 13. stuff.List.splitAt : Nat -> [a] -> ([a], [a]) - 14. stuff.List.tail : [a] -> Optional [a] - 15. stuff.List.takeWhile : (a ->{𝕖} Boolean) - -> [a] - ->{𝕖} [a] + Nothing changed in .mylib . + + ⚠️ - Tip: You can use `undo` or `reflog` to undo this change. + The following names were not found in the codebase. Check your spelling. + stuff.List.adjacentPairs + stuff.List.all + stuff.List.any + stuff.List.chunk + stuff.List.chunksOf + stuff.List.dropWhile + stuff.List.first + stuff.List.init + stuff.List.intersperse + stuff.List.isEmpty + stuff.List.last + stuff.List.replicate + stuff.List.splitAt + stuff.List.tail + stuff.List.takeWhile -.> find-in mylib +``` - 1. stuff.List.adjacentPairs : [a] -> [(a, a)] - 2. stuff.List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean - 3. stuff.List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean - 4. stuff.List.chunk : Nat -> [a] -> [[a]] - 5. stuff.List.chunksOf : Nat -> [a] -> [[a]] - 6. stuff.List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] - 7. stuff.List.first : [a] -> Optional a - 8. stuff.List.init : [a] -> Optional [a] - 9. stuff.List.intersperse : a -> [a] -> [a] - 10. stuff.List.isEmpty : [a] -> Boolean - 11. stuff.List.last : [a] -> Optional a - 12. stuff.List.replicate : Nat -> a -> [a] - 13. stuff.List.splitAt : Nat -> [a] -> ([a], [a]) - 14. stuff.List.tail : [a] -> Optional [a] - 15. stuff.List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] +```ucm +scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylibscratch/main> find-in mylib +``` + + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + + + ⚠️ + The following names were not found in the codebase. Check your spelling. + stuff.List.adjacentPairs + stuff.List.all + stuff.List.any + stuff.List.chunk + stuff.List.chunksOf + stuff.List.dropWhile + stuff.List.first + stuff.List.init + stuff.List.intersperse + stuff.List.isEmpty + stuff.List.last + stuff.List.replicate + stuff.List.splitAt + stuff.List.tail + stuff.List.takeWhile -``` -Thanks, `alias.many! diff --git a/unison-src/transcripts/anf-tests.md b/unison-src/transcripts/anf-tests.md index 122a673060..2a15836eb2 100644 --- a/unison-src/transcripts/anf-tests.md +++ b/unison-src/transcripts/anf-tests.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This tests a variable related bug in the ANF compiler. @@ -29,6 +29,6 @@ foo _ = ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index c200d1056f..b9360ee4c3 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -45,7 +45,7 @@ foo _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/any-extract.md b/unison-src/transcripts/any-extract.md index 5e9d09324e..e65b36606f 100644 --- a/unison-src/transcripts/any-extract.md +++ b/unison-src/transcripts/any-extract.md @@ -1,9 +1,9 @@ # Unit tests for Any.unsafeExtract ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` Any.unsafeExtract is a way to extract the value contained in an Any. This is unsafe because it allows the programmer to coerce a value into any type, which would cause undefined behaviour if used to coerce a value to the wrong type. @@ -19,5 +19,5 @@ test> Any.unsafeExtract.works = ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index 75567fb411..c8fc99095b 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -32,7 +32,7 @@ test> Any.unsafeExtract.works = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/api-doc-rendering.md b/unison-src/transcripts/api-doc-rendering.md index 6deffaaba8..1ab59a53d7 100644 --- a/unison-src/transcripts/api-doc-rendering.md +++ b/unison-src/transcripts/api-doc-rendering.md @@ -1,7 +1,7 @@ # Doc rendering ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -82,11 +82,11 @@ term = 42 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> display term.doc +scratch/main> display term.doc ``` ```api diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index cac34211af..6c44614548 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -78,7 +78,7 @@ term = 42 ``` ```ucm -.> display term.doc +scratch/main> display term.doc # Heading @@ -149,795 +149,10 @@ term = 42 ```api GET /api/non-project-code/getDefinition?names=term { - "missingDefinitions": [], - "termDefinitions": { - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { - "bestTermName": "term", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "term", - "tag": "HashQualifier" - }, - "segment": "term" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "term", - "tag": "HashQualifier" - }, - "segment": "term" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doc", - "#kjfaflbrgl89j2uq4ruubejakm6s02cp3m61ufu7rv7tkbd4nmkvcn1fciue53v0msir9t7ds111ab9er8qfa06gsa9ddfrdfgc99mo", - { - "contents": [ - { - "contents": [ - { - "contents": "Heading", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - [ - { - "contents": [ - { - "contents": [ - { - "contents": "Heading", - "tag": "Word" - }, - { - "contents": "2", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - [ - { - "contents": [ - { - "contents": "Term", - "tag": "Word" - }, - { - "contents": "Link:", - "tag": "Word" - }, - { - "contents": { - "contents": [ - { - "annotation": { - "contents": "#k5gpql9cbdfau6lf1aja24joc3sfctvjor8esu8bemn0in3l148otb0t3vebgqrt6qml302h62bbfeftg65gec1v8ouin5m6v2969d8", - "tag": "TermReference" - }, - "segment": "otherTerm" - } - ], - "tag": "Link" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Type", - "tag": "Word" - }, - { - "contents": "Link:", - "tag": "Word" - }, - { - "contents": { - "contents": [ - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Maybe" - } - ], - "tag": "Link" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Term", - "tag": "Word" - }, - { - "contents": "source:", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - { - "contents": [ - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - { - "contents": [ - [ - { - "annotation": { - "contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "tag": "TermReference" - }, - "segment": "term" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": ": " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - [ - { - "annotation": { - "contents": "term", - "tag": "HashQualifier" - }, - "segment": "term" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "term", - "tag": "HashQualifier" - }, - "segment": "term" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ] - ], - "tag": "UserObject" - } - ], - "tag": "Term" - } - ], - "tag": "Source" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Term", - "tag": "Word" - }, - { - "contents": "signature:", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - [ - { - "annotation": { - "contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "tag": "TermReference" - }, - "segment": "term" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": ": " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ] - ], - "tag": "Signature" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": [ - { - "contents": "List", - "tag": "Word" - }, - { - "contents": "item", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ], - "tag": "BulletedList" - }, - { - "contents": [ - 1, - [ - { - "contents": [ - { - "contents": "Numbered", - "tag": "Word" - }, - { - "contents": "list", - "tag": "Word" - }, - { - "contents": "item", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "tag": "NumberedList" - }, - { - "contents": [ - { - "contents": ">", - "tag": "Word" - }, - { - "contents": "Block", - "tag": "Word" - }, - { - "contents": "quote", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Code", - "tag": "Word" - }, - { - "contents": "block", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Inline", - "tag": "Word" - }, - { - "contents": "code:", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "Nat.+" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "2" - } - ], - "tag": "Example" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": "\"doesn't typecheck\" + 1", - "tag": "Word" - }, - "tag": "Code" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": [ - { - "contents": [ - { - "contents": "Link", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": { - "contents": "https://unison-lang.org", - "tag": "Word" - }, - "tag": "Group" - } - ], - "tag": "NamedLink" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png)", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - { - "contents": "Bold", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - "tag": "Bold" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - { - "contents": "Italic", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - "tag": "Bold" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - { - "contents": "Strikethrough", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - "tag": "Strikethrough" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Horizontal", - "tag": "Word" - }, - { - "contents": "rule", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "---", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Table", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Header", - "tag": "Word" - }, - { - "contents": "1", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Header", - "tag": "Word" - }, - { - "contents": "2", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "--------", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "--------", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Cell", - "tag": "Word" - }, - { - "contents": "1", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Cell", - "tag": "Word" - }, - { - "contents": "2", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Cell", - "tag": "Word" - }, - { - "contents": "3", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - }, - { - "contents": "Cell", - "tag": "Word" - }, - { - "contents": "4", - "tag": "Word" - }, - { - "contents": "|", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Video", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": { - "contents": [ - [ - { - "mediaSourceMimeType": null, - "mediaSourceUrl": "test.mp4" - } - ], - { - "poster": "test.png" - } - ], - "tag": "Video" - }, - "tag": "Special" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "Transclusion/evaluation:", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": [ - { - "contents": [ - { - "contents": "This", - "tag": "Word" - }, - { - "contents": "doc", - "tag": "Word" - }, - { - "contents": "should", - "tag": "Word" - }, - { - "contents": "be", - "tag": "Word" - }, - { - "contents": "embedded.", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - { - "contents": [ - { - "contents": "message", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ], - "tag": "UntitledSection" - } - ], - "tag": "Paragraph" - } - ] - ], - "tag": "Section" - } - ] - ], - "tag": "Section" - } - ] - ], - "termNames": [ - "term" - ] - } - }, + "missingDefinitions": [ + "term" + ], + "termDefinitions": {}, "typeDefinitions": {} } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-find.md b/unison-src/transcripts/api-find.md index 201d3cad85..cf394bd6b6 100644 --- a/unison-src/transcripts/api-find.md +++ b/unison-src/transcripts/api-find.md @@ -8,7 +8,7 @@ joey.yaml.zz = 45 ``` ```ucm -.> add +scratch/main> add ``` ```api diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 6505a1a320..d8e17c212d 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -24,7 +24,7 @@ joey.yaml.zz = 45 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -43,7 +43,7 @@ GET /api/non-project-code/find?query=http "result": { "segments": [ { - "contents": "ross.", + "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.", "tag": "Gap" }, { @@ -56,14 +56,14 @@ GET /api/non-project-code/find?query=http } ] }, - "score": 156 + "score": 170 }, { "contents": { "bestFoundTermName": "y", "namedTerm": { "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", - "termName": "ross.httpClient.y", + "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.httpClient.y", "termTag": "Plain", "termType": [ { @@ -84,7 +84,7 @@ GET /api/non-project-code/find?query=http "result": { "segments": [ { - "contents": "joey.", + "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.", "tag": "Gap" }, { @@ -97,14 +97,14 @@ GET /api/non-project-code/find?query=http } ] }, - "score": 156 + "score": 170 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", + "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -129,7 +129,7 @@ GET /api/non-project-code/find?query=Server "result": { "segments": [ { - "contents": "joey.http", + "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.http", "tag": "Gap" }, { @@ -142,14 +142,14 @@ GET /api/non-project-code/find?query=Server } ] }, - "score": 223 + "score": 230 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", + "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -174,7 +174,7 @@ GET /api/non-project-code/find?query=lesys "result": { "segments": [ { - "contents": "rachel.fi", + "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.fi", "tag": "Gap" }, { @@ -187,14 +187,14 @@ GET /api/non-project-code/find?query=lesys } ] }, - "score": 175 + "score": 185 }, { "contents": { "bestFoundTermName": "x", "namedTerm": { "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "rachel.filesystem.x", + "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.filesystem.x", "termTag": "Plain", "termType": [ { @@ -218,6 +218,10 @@ GET /api/non-project-code/find?query=joey.http { "result": { "segments": [ + { + "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.", + "tag": "Gap" + }, { "contents": "joey.http", "tag": "Match" @@ -228,14 +232,14 @@ GET /api/non-project-code/find?query=joey.http } ] }, - "score": 300 + "score": 333 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", + "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", "termTag": "Plain", "termType": [ { diff --git a/unison-src/transcripts/api-list-projects-branches.md b/unison-src/transcripts/api-list-projects-branches.md index 111489cf97..872cca22a7 100644 --- a/unison-src/transcripts/api-list-projects-branches.md +++ b/unison-src/transcripts/api-list-projects-branches.md @@ -1,9 +1,9 @@ # List Projects And Branches Test ```ucm:hide -.> project.create-empty project-one -.> project.create-empty project-two -.> project.create-empty project-three +scratch/main> project.create-empty project-one +scratch/main> project.create-empty project-two +scratch/main> project.create-empty project-three project-one/main> branch branch-one project-one/main> branch branch-two project-one/main> branch branch-three diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 1c12eea541..b3c09895da 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -12,6 +12,9 @@ GET /api/projects }, { "projectName": "project-two" + }, + { + "projectName": "scratch" } ] -- Should list projects starting with project-t diff --git a/unison-src/transcripts/api-namespace-details.md b/unison-src/transcripts/api-namespace-details.md index 0cfc7a8353..662d2e4db6 100644 --- a/unison-src/transcripts/api-namespace-details.md +++ b/unison-src/transcripts/api-namespace-details.md @@ -1,7 +1,7 @@ # Namespace Details Test ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -14,7 +14,7 @@ Here's a *README*! ``` ```ucm -.> add +scratch/main> add ``` ```api diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 80d1d6ae0c..34f8303185 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -25,7 +25,7 @@ Here's a *README*! ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -39,43 +39,7 @@ Here's a *README*! GET /api/non-project-code/namespaces/nested.names { "fqn": "nested.names", - "hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o", - "readme": { - "contents": [ - { - "contents": "Here's", - "tag": "Word" - }, - { - "contents": "a", - "tag": "Word" - }, - { - "contents": { - "contents": [ - { - "contents": { - "contents": [ - { - "contents": "README", - "tag": "Word" - } - ], - "tag": "Paragraph" - }, - "tag": "Bold" - }, - { - "contents": "!", - "tag": "Word" - } - ], - "tag": "Join" - }, - "tag": "Group" - } - ], - "tag": "Paragraph" - } + "hash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg", + "readme": null } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-namespace-list.md b/unison-src/transcripts/api-namespace-list.md index 717607269a..1c07433e86 100644 --- a/unison-src/transcripts/api-namespace-list.md +++ b/unison-src/transcripts/api-namespace-list.md @@ -1,7 +1,7 @@ # Namespace list api ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -12,7 +12,7 @@ nested.names.readme = {{ I'm a readme! }} ``` ```ucm -.> add +scratch/main> add ``` ```api diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index 0ef32d1941..ddd7832ce2 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -23,7 +23,7 @@ nested.names.readme = {{ I'm a readme! }} ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -35,100 +35,14 @@ nested.names.readme = {{ I'm a readme! }} ```api GET /api/non-project-code/list?namespace=nested.names { - "namespaceListingChildren": [ - { - "contents": { - "termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o", - "termName": "readme", - "termTag": "Doc", - "termType": [ - { - "annotation": { - "contents": "#ej86si0ur1", - "tag": "HashQualifier" - }, - "segment": "#ej86si0ur1" - } - ] - }, - "tag": "TermObject" - }, - { - "contents": { - "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "x", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - }, - "tag": "TermObject" - }, - { - "contents": { - "namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0", - "namespaceName": "x", - "namespaceSize": 1 - }, - "tag": "Subnamespace" - } - ], + "namespaceListingChildren": [], "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + "namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg" } GET /api/non-project-code/list?namespace=names&relativeTo=nested { - "namespaceListingChildren": [ - { - "contents": { - "termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o", - "termName": "readme", - "termTag": "Doc", - "termType": [ - { - "annotation": { - "contents": "#ej86si0ur1", - "tag": "HashQualifier" - }, - "segment": "#ej86si0ur1" - } - ] - }, - "tag": "TermObject" - }, - { - "contents": { - "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "x", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - }, - "tag": "TermObject" - }, - { - "contents": { - "namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0", - "namespaceName": "x", - "namespaceSize": 1 - }, - "tag": "Subnamespace" - } - ], + "namespaceListingChildren": [], "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + "namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg" } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-summaries.md b/unison-src/transcripts/api-summaries.md index cf473e778a..8a7aa8b220 100644 --- a/unison-src/transcripts/api-summaries.md +++ b/unison-src/transcripts/api-summaries.md @@ -1,7 +1,7 @@ # Definition Summary APIs ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` @@ -25,9 +25,9 @@ structural ability Stream s where ``` ```ucm:hide -.> add -.> alias.type ##Nat Nat -.> alias.term ##IO.putBytes.impl.v3 putBytesImpl +scratch/main> add +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl ``` ## Term Summary APIs diff --git a/unison-src/transcripts/block-on-required-update.md b/unison-src/transcripts/block-on-required-update.md index 1027188b06..3b339e6fe7 100644 --- a/unison-src/transcripts/block-on-required-update.md +++ b/unison-src/transcripts/block-on-required-update.md @@ -3,7 +3,7 @@ Should block an `add` if it requires an update on an in-file dependency. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ x = 1 ``` ```ucm -.> add +scratch/main> add ``` Update `x`, and add a new `y` which depends on the update @@ -24,5 +24,5 @@ y = x + 1 Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. ```ucm:error -.> add y +scratch/main> add y ``` diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 254a281e87..0935b7317a 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -20,7 +20,7 @@ x = 1 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ y = x + 1 Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. ```ucm -.> add y +scratch/main> add y x These definitions failed: diff --git a/unison-src/transcripts/blocks.md b/unison-src/transcripts/blocks.md index bac7ef1874..b89ab45850 100644 --- a/unison-src/transcripts/blocks.md +++ b/unison-src/transcripts/blocks.md @@ -1,7 +1,7 @@ ## Blocks and scoping ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ### Names introduced by a block shadow names introduced in outer scopes diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.md b/unison-src/transcripts/boolean-op-pretty-print-2819.md index efdf493e9f..b788c78334 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.md @@ -1,7 +1,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2819 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ hangExample = ``` ```ucm -.> add -.> view hangExample +scratch/main> add +scratch/main> view hangExample ``` diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md index 690b9fdc6b..48fbfecf68 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -21,13 +21,13 @@ hangExample = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: hangExample : Boolean -.> view hangExample +scratch/main> view hangExample hangExample : Boolean hangExample = diff --git a/unison-src/transcripts/branch-command.md b/unison-src/transcripts/branch-command.md index 4b1636be41..f39b2a071a 100644 --- a/unison-src/transcripts/branch-command.md +++ b/unison-src/transcripts/branch-command.md @@ -1,8 +1,8 @@ The `branch` command creates a new branch. ```ucm:hide -.> project.create-empty foo -.> project.create-empty bar +scratch/main> project.create-empty foo +scratch/main> project.create-empty bar ``` First, we'll just create a loose code namespace with a term in it for later. @@ -33,22 +33,22 @@ foo/main> branch /main /topic8 foo/main> branch /main foo/topic9 foo/main> branch foo/main topic10 foo/main> branch foo/main /topic11 -.> branch foo/main foo/topic12 +scratch/main> branch foo/main foo/topic12 foo/main> branch bar/topic bar/main> branch foo/main topic2 bar/main> branch foo/main /topic3 -.> branch foo/main bar/topic4 +scratch/main> branch foo/main bar/topic4 .some.loose.code> branch foo/topic13 foo/main> branch .some.loose.code topic14 foo/main> branch .some.loose.code /topic15 -.> branch .some.loose.code foo/topic16 +scratch/main> branch .some.loose.code foo/topic16 foo/main> branch.empty empty1 foo/main> branch.empty /empty2 foo/main> branch.empty foo/empty3 -.> branch.empty foo/empty4 +scratch/main> branch.empty foo/empty4 ``` The `branch` command can create branches named `releases/drafts/*` (because why not). diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index c074134bbb..2edb91bb9b 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -103,7 +103,7 @@ foo/main> branch foo/main /topic11 Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. -.> branch foo/main foo/topic12 +scratch/main> branch foo/main foo/topic12 Done. I've created the topic12 branch based off of main. @@ -122,7 +122,7 @@ bar/main> branch foo/main /topic3 Done. I've created the bar/topic3 branch based off foo/main. -.> branch foo/main bar/topic4 +scratch/main> branch foo/main bar/topic4 Done. I've created the bar/topic4 branch based off foo/main. @@ -141,7 +141,7 @@ foo/main> branch .some.loose.code /topic15 Done. I've created the foo/topic15 branch from the namespace .some.loose.code. -.> branch .some.loose.code foo/topic16 +scratch/main> branch .some.loose.code foo/topic16 Done. I've created the foo/topic16 branch from the namespace .some.loose.code. @@ -164,7 +164,7 @@ foo/main> branch.empty foo/empty3 Tip: Use `merge /somebranch` to initialize this branch. -.> branch.empty foo/empty4 +scratch/main> branch.empty foo/empty4 Done. I've created an empty branch foo/empty4. diff --git a/unison-src/transcripts/branch-relative-path.md b/unison-src/transcripts/branch-relative-path.md index 8414db2f16..74298f4b2b 100644 --- a/unison-src/transcripts/branch-relative-path.md +++ b/unison-src/transcripts/branch-relative-path.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.merge -.> project.create-empty p0 -.> project.create-empty p1 +scratch/main> builtins.merge +scratch/main> project.create-empty p0 +scratch/main> project.create-empty p1 ``` ```unison diff --git a/unison-src/transcripts/bug-fix-4354.md b/unison-src/transcripts/bug-fix-4354.md index c1d603258d..1ea7f595dd 100644 --- a/unison-src/transcripts/bug-fix-4354.md +++ b/unison-src/transcripts/bug-fix-4354.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/bug-strange-closure.md b/unison-src/transcripts/bug-strange-closure.md index f2f805d682..bfce3c1422 100644 --- a/unison-src/transcripts/bug-strange-closure.md +++ b/unison-src/transcripts/bug-strange-closure.md @@ -1,15 +1,15 @@ ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/doc.md.files/syntax.u +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/doc.md.files/syntax.u ``` We can display the guide before and after adding it to the codebase: ```ucm -.> display doc.guide -.> add -.> display doc.guide +scratch/main> display doc.guide +scratch/main> add +scratch/main> display doc.guide ``` But we can't display this due to a decompilation problem. @@ -19,10 +19,10 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```ucm -.> display rendered -.> add -.> display rendered -.> undo +scratch/main> display rendered +scratch/main> add +scratch/main> display rendered +scratch/main> undo ``` And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index 8b9f7fa75c..3d70740281 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -2,7 +2,7 @@ We can display the guide before and after adding it to the codebase: ```ucm -.> display doc.guide +scratch/main> display doc.guide # Unison computable documentation @@ -200,7 +200,7 @@ We can display the guide before and after adding it to the codebase: rendered table. Some text More text Zounds! -.> add +scratch/main> add ⍟ I've added these definitions: @@ -213,7 +213,7 @@ We can display the guide before and after adding it to the codebase: otherElements : Doc2 sqr : Nat -> Nat -.> display doc.guide +scratch/main> display doc.guide # Unison computable documentation @@ -432,7 +432,7 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```ucm -.> display rendered +scratch/main> display rendered # Unison computable documentation @@ -630,13 +630,13 @@ rendered = Pretty.get (docFormatConsole doc.guide) rendered table. Some text More text Zounds! -.> add +scratch/main> add ⍟ I've added these definitions: rendered : Annotated () (Either SpecialForm ConsoleText) -.> display rendered +scratch/main> display rendered # Unison computable documentation @@ -834,13 +834,17 @@ rendered = Pretty.get (docFormatConsole doc.guide) rendered table. Some text More text Zounds! -.> undo +scratch/main> undo Here are the changes I undid Added definitions: - 1. rendered : Annotated () (Either SpecialForm ConsoleText) + 1. __projects._141465a8_cfb4_456f_aefa_25b7a6062af2.branches._d233d31d_8101_4a8e_b332_9cd3a64f71e9.rendered : Annotated + ( ) + (Either + SpecialForm + ConsoleText) ``` And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. diff --git a/unison-src/transcripts/builtins.md b/unison-src/transcripts/builtins.md index ab854be39d..6834b85eb1 100644 --- a/unison-src/transcripts/builtins.md +++ b/unison-src/transcripts/builtins.md @@ -1,12 +1,12 @@ # Unit tests for builtin functions ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` -This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. +This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. ## `Int` functions @@ -88,7 +88,7 @@ test> Int.tests.conversions = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Nat` functions @@ -163,7 +163,7 @@ test> Nat.tests.conversions = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Boolean` functions @@ -190,7 +190,7 @@ test> Boolean.tests.notTable = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Text` functions @@ -288,7 +288,7 @@ test> Text.tests.indexOfEmoji = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Bytes` functions @@ -352,7 +352,7 @@ test> Bytes.tests.indexOf = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `List` comparison @@ -371,7 +371,7 @@ test> checks [ ``` ```ucm:hide -.> add +scratch/main> add ``` Other list functions @@ -392,7 +392,7 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ```ucm:hide -.> add +scratch/main> add ``` ## Sandboxing functions @@ -419,7 +419,7 @@ openFile] ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison @@ -436,8 +436,8 @@ openFilesIO = do ``` ```ucm -.> add -.> io.test openFilesIO +scratch/main> add +scratch/main> io.test openFilesIO ``` ## Universal hash functions @@ -450,7 +450,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ```ucm:hide -.> add +scratch/main> add ``` ## Run the tests @@ -458,5 +458,5 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing. ```ucm -.> test +scratch/main> test ``` diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index 4d3089d35e..5c00c49899 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -1,6 +1,6 @@ # Unit tests for builtin functions -This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. +This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. ## `Int` functions @@ -480,13 +480,13 @@ openFilesIO = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: openFilesIO : '{IO} [Result] -.> io.test openFilesIO +scratch/main> io.test openFilesIO New test results: @@ -535,7 +535,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing. ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts/bytesFromList.md b/unison-src/transcripts/bytesFromList.md index 9da15329f3..1abb998791 100644 --- a/unison-src/transcripts/bytesFromList.md +++ b/unison-src/transcripts/bytesFromList.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`: diff --git a/unison-src/transcripts/check763.md b/unison-src/transcripts/check763.md index 3bb162b344..8b32045144 100644 --- a/unison-src/transcripts/check763.md +++ b/unison-src/transcripts/check763.md @@ -1,7 +1,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,8 +10,8 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ```ucm -.> add -.> move.term +-+ boppitybeep -.> move.term boppitybeep +-+ +scratch/main> add +scratch/main> move.term +-+ boppitybeep +scratch/main> move.term boppitybeep +-+ ``` diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md index b8421509d9..fe50b6834d 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -19,17 +19,17 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: +-+ : Nat -> Nat -> Nat -.> move.term +-+ boppitybeep +scratch/main> move.term +-+ boppitybeep Done. -.> move.term boppitybeep +-+ +scratch/main> move.term boppitybeep +-+ Done. diff --git a/unison-src/transcripts/check873.md b/unison-src/transcripts/check873.md index 7145186286..b70937821d 100644 --- a/unison-src/transcripts/check873.md +++ b/unison-src/transcripts/check873.md @@ -1,7 +1,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point being, this shouldn't crash the runtime. :) ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -9,7 +9,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index 289c592f30..5f21cec202 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -18,7 +18,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/child-namespace-history-merge.md b/unison-src/transcripts/child-namespace-history-merge.md index 6ed0e2400e..1b80748062 100644 --- a/unison-src/transcripts/child-namespace-history-merge.md +++ b/unison-src/transcripts/child-namespace-history-merge.md @@ -9,7 +9,7 @@ but I think we should at least notice if we change things by accident. ## Setting up some history ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -20,8 +20,8 @@ parent.child.thing = "parent.child.thing" The child branch has a single history node representing the addition of `parent.child.thing`. ```ucm -.> add -.> history parent.child +scratch/main> add +scratch/main> history parent.child ``` If we add another thing to the child namespace it should add another history node to both the child and parent. @@ -31,9 +31,9 @@ parent.child.thing2 = "parent.child.thing2" ``` ```ucm -.> add -.> history parent -.> history parent.child +scratch/main> add +scratch/main> history parent +scratch/main> history parent.child ``` ## Forking off some history on a separate branch @@ -41,7 +41,7 @@ parent.child.thing2 = "parent.child.thing2" Now we fork the parent namespace to make some changes. ```ucm -.> fork parent parent_fork +scratch/main> fork parent parent_fork ``` ```unison:hide @@ -51,8 +51,8 @@ parent_fork.child.thing3 = "parent_fork.child.thing3" The child should have a new history node after adding `thing3` ```ucm -.> add -.> history parent_fork.child +scratch/main> add +scratch/main> history parent_fork.child ``` ## Saving our parent state @@ -60,8 +60,8 @@ The child should have a new history node after adding `thing3` Split off two separate forks, one for testing squash merges, one for standard merges. ```ucm:hide -.> fork parent parent_squash_base -.> fork parent parent_merge_base +scratch/main> fork parent parent_squash_base +scratch/main> fork parent parent_merge_base ``` ## Squash merge @@ -69,16 +69,16 @@ Split off two separate forks, one for testing squash merges, one for standard me For a squash merge, when I squash-merge back into parent, we expect `parent_fork.child.thing3` to be added. ```ucm -.> merge.old.squash parent_fork parent_squash_base -.> history parent_squash_base +scratch/main> merge.old.squash parent_fork parent_squash_base +scratch/main> history parent_squash_base ``` Notice that with the current behaviour, the history of `parent.child` is completely wiped out, containing nothing from the source OR destination. ```ucm -.> history parent.child -.> history parent_fork.child -.> history parent_squash_base.child +scratch/main> history parent.child +scratch/main> history parent_fork.child +scratch/main> history parent_squash_base.child ``` ## Standard merge @@ -86,14 +86,14 @@ Notice that with the current behaviour, the history of `parent.child` is complet For a standard merge, if I merge back into parent, we expect `parent_fork.child.thing3` to be added. ```ucm -.> merge.old parent_fork parent_merge_base -.> history parent_merge_base +scratch/main> merge.old parent_fork parent_merge_base +scratch/main> history parent_merge_base ``` Child histories should also be *merged*. ```ucm -.> history parent.child -.> history parent_fork.child -.> history parent_merge_base.child +scratch/main> history parent.child +scratch/main> history parent_fork.child +scratch/main> history parent_merge_base.child ``` diff --git a/unison-src/transcripts/child-namespace-history-merge.output.md b/unison-src/transcripts/child-namespace-history-merge.output.md index 18e080e093..8a8b69d1ab 100644 --- a/unison-src/transcripts/child-namespace-history-merge.output.md +++ b/unison-src/transcripts/child-namespace-history-merge.output.md @@ -16,14 +16,14 @@ parent.child.thing = "parent.child.thing" The child branch has a single history node representing the addition of `parent.child.thing`. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: parent.child.thing : Text parent.top : Text -.> history parent.child +scratch/main> history parent.child Note: The most recent namespace hash is immediately below this message. @@ -40,13 +40,13 @@ parent.child.thing2 = "parent.child.thing2" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: parent.child.thing2 : Text -.> history parent +scratch/main> history parent Note: The most recent namespace hash is immediately below this message. @@ -59,7 +59,7 @@ parent.child.thing2 = "parent.child.thing2" □ 2. #i9lji1bli0 (start of history) -.> history parent.child +scratch/main> history parent.child Note: The most recent namespace hash is immediately below this message. @@ -78,7 +78,7 @@ parent.child.thing2 = "parent.child.thing2" Now we fork the parent namespace to make some changes. ```ucm -.> fork parent parent_fork +scratch/main> fork parent parent_fork Done. @@ -90,13 +90,13 @@ parent_fork.child.thing3 = "parent_fork.child.thing3" The child should have a new history node after adding `thing3` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: parent_fork.child.thing3 : Text -.> history parent_fork.child +scratch/main> history parent_fork.child Note: The most recent namespace hash is immediately below this message. @@ -125,7 +125,7 @@ Split off two separate forks, one for testing squash merges, one for standard me For a squash merge, when I squash-merge back into parent, we expect `parent_fork.child.thing3` to be added. ```ucm -.> merge.old.squash parent_fork parent_squash_base +scratch/main> merge.old.squash parent_fork parent_squash_base Here's what's changed in parent_squash_base after the merge: @@ -140,7 +140,7 @@ For a squash merge, when I squash-merge back into parent, we expect `parent_fork Applying changes from patch... -.> history parent_squash_base +scratch/main> history parent_squash_base Note: The most recent namespace hash is immediately below this message. @@ -163,7 +163,7 @@ For a squash merge, when I squash-merge back into parent, we expect `parent_fork Notice that with the current behaviour, the history of `parent.child` is completely wiped out, containing nothing from the source OR destination. ```ucm -.> history parent.child +scratch/main> history parent.child Note: The most recent namespace hash is immediately below this message. @@ -176,7 +176,7 @@ Notice that with the current behaviour, the history of `parent.child` is complet □ 2. #0r73mam57g (start of history) -.> history parent_fork.child +scratch/main> history parent_fork.child Note: The most recent namespace hash is immediately below this message. @@ -195,7 +195,7 @@ Notice that with the current behaviour, the history of `parent.child` is complet □ 3. #0r73mam57g (start of history) -.> history parent_squash_base.child +scratch/main> history parent_squash_base.child Note: The most recent namespace hash is immediately below this message. @@ -210,7 +210,7 @@ Notice that with the current behaviour, the history of `parent.child` is complet For a standard merge, if I merge back into parent, we expect `parent_fork.child.thing3` to be added. ```ucm -.> merge.old parent_fork parent_merge_base +scratch/main> merge.old parent_fork parent_merge_base Here's what's changed in parent_merge_base after the merge: @@ -225,7 +225,7 @@ For a standard merge, if I merge back into parent, we expect `parent_fork.child. Applying changes from patch... -.> history parent_merge_base +scratch/main> history parent_merge_base Note: The most recent namespace hash is immediately below this message. @@ -248,7 +248,7 @@ For a standard merge, if I merge back into parent, we expect `parent_fork.child. Child histories should also be *merged*. ```ucm -.> history parent.child +scratch/main> history parent.child Note: The most recent namespace hash is immediately below this message. @@ -261,7 +261,7 @@ Child histories should also be *merged*. □ 2. #0r73mam57g (start of history) -.> history parent_fork.child +scratch/main> history parent_fork.child Note: The most recent namespace hash is immediately below this message. @@ -280,7 +280,7 @@ Child histories should also be *merged*. □ 3. #0r73mam57g (start of history) -.> history parent_merge_base.child +scratch/main> history parent_merge_base.child Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/constructor-applied-to-unit.md b/unison-src/transcripts/constructor-applied-to-unit.md index df1341aa5c..fc598a883f 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.md +++ b/unison-src/transcripts/constructor-applied-to-unit.md @@ -1,6 +1,6 @@ ```ucm:hide -.> alias.type ##Nat Nat -.> alias.term ##Any.Any Any +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##Any.Any Any ``` ```unison diff --git a/unison-src/transcripts/contrabilities.md b/unison-src/transcripts/contrabilities.md index 795ec15566..5d1fdcb647 100644 --- a/unison-src/transcripts/contrabilities.md +++ b/unison-src/transcripts/contrabilities.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/create-author.md b/unison-src/transcripts/create-author.md index d9a39c735f..18f0ccac2e 100644 --- a/unison-src/transcripts/create-author.md +++ b/unison-src/transcripts/create-author.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` Demonstrating `create.author`: diff --git a/unison-src/transcripts/cycle-update-1.md b/unison-src/transcripts/cycle-update-1.md index 5294f2e49b..b60bc763e4 100644 --- a/unison-src/transcripts/cycle-update-1.md +++ b/unison-src/transcripts/cycle-update-1.md @@ -1,7 +1,7 @@ Update a member of a cycle, but retain the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping _ = !pong + 3 ``` ```ucm -.> update -.> view ping pong +scratch/main> update +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index 3906248333..267bcc9396 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ ping _ = !pong + 3 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,7 +62,7 @@ ping _ = !pong + 3 Done. -.> view ping pong +scratch/main> view ping pong ping : 'Nat ping _ = diff --git a/unison-src/transcripts/cycle-update-2.md b/unison-src/transcripts/cycle-update-2.md index bd8c6edc13..0feb63afc2 100644 --- a/unison-src/transcripts/cycle-update-2.md +++ b/unison-src/transcripts/cycle-update-2.md @@ -1,7 +1,7 @@ Update a member of a cycle with a type-preserving update, but sever the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping _ = 3 ``` ```ucm -.> update -.> view ping pong +scratch/main> update +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index 6884788130..36243e1709 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ ping _ = 3 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,7 +62,7 @@ ping _ = 3 Done. -.> view ping pong +scratch/main> view ping pong ping : 'Nat ping _ = 3 diff --git a/unison-src/transcripts/cycle-update-3.md b/unison-src/transcripts/cycle-update-3.md index dfcd87305e..b5e1e05551 100644 --- a/unison-src/transcripts/cycle-update-3.md +++ b/unison-src/transcripts/cycle-update-3.md @@ -1,7 +1,7 @@ Update a member of a cycle with a type-changing update, thus severing the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping = 3 ``` ```ucm -.> update.old -.> view ping pong +scratch/main> update.old +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index 7a0a499dbc..8609b8b69c 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,13 +51,13 @@ ping = 3 ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: ping : Nat -.> view ping pong +scratch/main> view ping pong ping : Nat ping = 3 diff --git a/unison-src/transcripts/cycle-update-4.md b/unison-src/transcripts/cycle-update-4.md index d2bf98f690..ae389489b9 100644 --- a/unison-src/transcripts/cycle-update-4.md +++ b/unison-src/transcripts/cycle-update-4.md @@ -1,7 +1,7 @@ `update` properly discovers and establishes new cycles. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -25,6 +25,6 @@ clang _ = !pong + 3 ``` ```ucm -.> update.old ping -.> view ping pong clang +scratch/main> update.old ping +scratch/main> view ping pong clang ``` diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index fd525176bf..da7b243543 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -58,7 +58,7 @@ clang _ = !pong + 3 ``` ```ucm -.> update.old ping +scratch/main> update.old ping ⍟ I've added these definitions: @@ -69,7 +69,7 @@ clang _ = !pong + 3 ping : 'Nat pong : 'Nat -.> view ping pong clang +scratch/main> view ping pong clang clang : 'Nat clang _ = diff --git a/unison-src/transcripts/cycle-update-5.md b/unison-src/transcripts/cycle-update-5.md index c09a93c3d7..60d283d55a 100644 --- a/unison-src/transcripts/cycle-update-5.md +++ b/unison-src/transcripts/cycle-update-5.md @@ -1,7 +1,7 @@ Not yet working: properly updating nameless implicit terms. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !inner.ping + 2 ``` ```ucm -.> add +scratch/main> add ``` Here we queue up an update by saving in a namespace where `inner.ping` and `pong` both have names, but then apply the @@ -26,7 +26,7 @@ inner.ping _ = !pong + 3 ```ucm .inner> update.old -.> view inner.ping +scratch/main> view inner.ping ``` The bug here is that `inner.ping` still refers to `pong` by name. But if we properly identified the nameless (in the diff --git a/unison-src/transcripts/cycle-update-5.output.md b/unison-src/transcripts/cycle-update-5.output.md index 3e3361f70c..8f583faaab 100644 --- a/unison-src/transcripts/cycle-update-5.output.md +++ b/unison-src/transcripts/cycle-update-5.output.md @@ -23,7 +23,7 @@ pong _ = !inner.ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -54,13 +54,15 @@ inner.ping _ = !pong + 3 ``` ```ucm + ☝️ The namespace .inner is empty. + .inner> update.old ⍟ I've added these definitions: inner.ping : '##Nat -.> view inner.ping +scratch/main> view inner.ping inner.ping : 'Nat inner.ping _ = diff --git a/unison-src/transcripts/debug-definitions.md b/unison-src/transcripts/debug-definitions.md index 4717486917..0d10165f54 100644 --- a/unison-src/transcripts/debug-definitions.md +++ b/unison-src/transcripts/debug-definitions.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -17,12 +17,12 @@ ability Ask a where ``` ```ucm -.> add -.> debug.term.abt Nat.+ -.> debug.term.abt y -.> debug.term.abt Some -.> debug.term.abt ask -.> debug.type.abt Nat -.> debug.type.abt Optional -.> debug.type.abt Ask +scratch/main> add +scratch/main> debug.term.abt Nat.+ +scratch/main> debug.term.abt y +scratch/main> debug.term.abt Some +scratch/main> debug.term.abt ask +scratch/main> debug.type.abt Nat +scratch/main> debug.type.abt Optional +scratch/main> debug.type.abt Ask ``` diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index cb1b14d1a2..37d6591e25 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -13,7 +13,7 @@ ability Ask a where ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -23,15 +23,15 @@ ability Ask a where x : Nat y : Nat -.> debug.term.abt Nat.+ +scratch/main> debug.term.abt Nat.+ Builtin term: ##Nat.+ -.> debug.term.abt y +scratch/main> debug.term.abt y (let Ref(ReferenceBuiltin "Nat.+") Ref(ReferenceDerived (Id "qpo3o788girkkbb43uf6ggqberfduhtnqbt7096eojlrp27jieco09mdasb7b0b06ej9hj60a00nnbbdo8he0b4e0m7vtopifiuhdig" 0)) 2 in (User "z". Ref(ReferenceBuiltin "Nat.+") (Var User "z") 10)):ReferenceBuiltin "Nat" -.> debug.term.abt Some +scratch/main> debug.term.abt Some Constructor #0 of the following type: DataDeclaration @@ -61,7 +61,7 @@ ability Ask a where ] } -.> debug.term.abt ask +scratch/main> debug.term.abt ask Constructor #0 of the following type: EffectDeclaration @@ -90,11 +90,11 @@ ability Ask a where } } -.> debug.type.abt Nat +scratch/main> debug.type.abt Nat Builtin type: ##Nat -.> debug.type.abt Optional +scratch/main> debug.type.abt Optional DataDeclaration { modifier = Structural @@ -123,7 +123,7 @@ ability Ask a where ] } -.> debug.type.abt Ask +scratch/main> debug.type.abt Ask EffectDeclaration { toDataDecl = DataDeclaration diff --git a/unison-src/transcripts/debug-name-diffs.md b/unison-src/transcripts/debug-name-diffs.md index 361142bf57..5d4970e599 100644 --- a/unison-src/transcripts/debug-name-diffs.md +++ b/unison-src/transcripts/debug-name-diffs.md @@ -10,10 +10,10 @@ structural type a.b.Baz = Boo ``` ```ucm -.> add -.> delete.term.verbose a.b.one -.> alias.term a.two a.newtwo -.> move.namespace a.x a.y -.> history -.> debug.name-diff 4 1 +scratch/main> add +scratch/main> delete.term.verbose a.b.one +scratch/main> alias.term a.two a.newtwo +scratch/main> move.namespace a.x a.y +scratch/main> history +scratch/main> debug.name-diff 4 1 ``` diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index ac6895c14e..9d15bfe476 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -28,7 +28,7 @@ structural type a.b.Baz = Boo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -39,7 +39,7 @@ structural type a.b.Baz = Boo a.x.four : ##Nat a.x.three : ##Nat -.> delete.term.verbose a.b.one +scratch/main> delete.term.verbose a.b.one Removed definitions: @@ -47,15 +47,15 @@ structural type a.b.Baz = Boo Tip: You can use `undo` or `reflog` to undo this change. -.> alias.term a.two a.newtwo +scratch/main> alias.term a.two a.newtwo Done. -.> move.namespace a.x a.y +scratch/main> move.namespace a.x a.y Done. -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -90,7 +90,7 @@ structural type a.b.Baz = Boo □ 4. #gss5s88mo3 (start of history) -.> debug.name-diff 4 1 +scratch/main> debug.name-diff 4 1 Kind Name Change Ref Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg diff --git a/unison-src/transcripts/deep-names.md b/unison-src/transcripts/deep-names.md index 3487497cc3..aa000b578a 100644 --- a/unison-src/transcripts/deep-names.md +++ b/unison-src/transcripts/deep-names.md @@ -12,7 +12,7 @@ http.z = 8 ``` ```ucm:hide -.> add +scratch/main> add ``` Our `app1` project includes the text library twice and the http library twice as direct dependencies. diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 3b6637d8a7..958083bc1b 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -17,83 +17,23 @@ Our `app1` project includes the text library twice and the http library twice as .app1> fork .text lib.text_v1 - Done. - -.app1> fork .text lib.text_v2 - - Done. - -.app1> fork .http lib.http_v3 - - Done. - -.app1> fork .http lib.http_v4 - - Done. - -``` -As such, we see two copies of `a` and two copies of `x` via these direct dependencies. -```ucm -.app1> names a - - Term - Hash: #gjmq673r1v - Names: lib.text_v1.a lib.text_v2.a + ⚠️ - Tip: Use `names.global` to see more results. - -.app1> names x - - Term - Hash: #nsmc4p1ra4 - Names: lib.http_v3.x lib.http_v4.x - - Tip: Use `names.global` to see more results. + The namespace .text doesn't exist. ``` -Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. -It also includes the `text` library twice as indirect dependencies via `webutil` -```ucm - ☝️ The namespace .app2 is empty. -.app2> fork .http lib.http_v1 - - Done. - -.app2> fork .http lib.http_v2 - - Done. - -.app2> fork .text lib.webutil.lib.text_v1 - - Done. - -.app2> fork .text lib.webutil.lib.text_v2 - - Done. +```ucm +.app1> fork .text lib.text_v1.app1> fork .text lib.text_v2.app1> fork .http lib.http_v3.app1> fork .http lib.http_v4 +``` -.app2> fork .http lib.webutil.lib.http - Done. +🛑 -``` -Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. -We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. -```ucm -.app2> names a +The transcript failed due to an error in the stanza above. The error is: - Term - Hash: #gjmq673r1v - Names: lib.webutil.lib.text_v1.a - - Tip: Use `names.global` to see more results. - -.app2> names x - Term - Hash: #nsmc4p1ra4 - Names: lib.http_v1.x lib.http_v2.x + ⚠️ - Tip: Use `names.global` to see more results. + The namespace .text doesn't exist. -``` diff --git a/unison-src/transcripts/delete-namespace.md b/unison-src/transcripts/delete-namespace.md index fe8f346306..5bbdda79e6 100644 --- a/unison-src/transcripts/delete-namespace.md +++ b/unison-src/transcripts/delete-namespace.md @@ -1,7 +1,7 @@ # delete.namespace.force ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -15,47 +15,47 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 ``` ```ucm:hide -.> add +scratch/main> add ``` Deleting a namespace with no external dependencies should succeed. ```ucm -.> delete.namespace no_dependencies +scratch/main> delete.namespace no_dependencies ``` Deleting a namespace with external dependencies should fail and list all dependents. ```ucm:error -.> delete.namespace dependencies +scratch/main> delete.namespace dependencies ``` Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ```ucm -.> delete.namespace.force dependencies +scratch/main> delete.namespace.force dependencies ``` I should be able to view an affected dependency by number ```ucm -.> view 2 +scratch/main> view 2 ``` Deleting the root namespace should require confirmation if not forced. ```ucm -.> delete.namespace . -.> delete.namespace . +scratch/main> delete.namespace . +scratch/main> delete.namespace . -- Should have an empty history -.> history . +scratch/main> history . ``` Deleting the root namespace shouldn't require confirmation if forced. ```ucm -.> delete.namespace.force . +scratch/main> delete.namespace.force . -- Should have an empty history -.> history . +scratch/main> history . ``` diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index e7c09cbaed..563b98ad2c 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -13,7 +13,7 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 Deleting a namespace with no external dependencies should succeed. ```ucm -.> delete.namespace no_dependencies +scratch/main> delete.namespace no_dependencies Done. @@ -21,7 +21,7 @@ Deleting a namespace with no external dependencies should succeed. Deleting a namespace with external dependencies should fail and list all dependents. ```ucm -.> delete.namespace dependencies +scratch/main> delete.namespace dependencies ⚠️ @@ -42,7 +42,7 @@ Deleting a namespace with external dependencies should fail and list all depende Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ```ucm -.> delete.namespace.force dependencies +scratch/main> delete.namespace.force dependencies Done. @@ -62,7 +62,7 @@ Deleting a namespace with external dependencies should succeed when using `delet I should be able to view an affected dependency by number ```ucm -.> view 2 +scratch/main> view 2 dependents.usage2 : Nat dependents.usage2 = @@ -73,21 +73,21 @@ I should be able to view an affected dependency by number Deleting the root namespace should require confirmation if not forced. ```ucm -.> delete.namespace . +scratch/main> delete.namespace . ⚠️ Are you sure you want to clear away everything? You could use `project.create` to switch to a new project instead. -.> delete.namespace . +scratch/main> delete.namespace . Okay, I deleted everything except the history. Use `undo` to undo, or `builtins.merge` to restore the absolute basics to the current path. -- Should have an empty history -.> history . +scratch/main> history . ☝️ The namespace . is empty. @@ -95,14 +95,14 @@ Deleting the root namespace should require confirmation if not forced. Deleting the root namespace shouldn't require confirmation if forced. ```ucm -.> delete.namespace.force . +scratch/main> delete.namespace.force . Okay, I deleted everything except the history. Use `undo` to undo, or `builtins.merge` to restore the absolute basics to the current path. -- Should have an empty history -.> history . +scratch/main> history . ☝️ The namespace . is empty. diff --git a/unison-src/transcripts/delete-project-branch.md b/unison-src/transcripts/delete-project-branch.md index c84dc95cc2..091e9fa71c 100644 --- a/unison-src/transcripts/delete-project-branch.md +++ b/unison-src/transcripts/delete-project-branch.md @@ -17,7 +17,7 @@ You can precede the branch name by a project name. ```ucm foo/main> branch topic -.> delete.branch foo/topic +scratch/main> delete.branch foo/topic ``` You can delete the only branch in a project. diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index d4458e8be0..84568c97da 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -35,9 +35,7 @@ foo/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. - ☝️ The namespace . is empty. - -.> delete.branch foo/topic +scratch/main> delete.branch foo/topic ``` You can delete the only branch in a project. diff --git a/unison-src/transcripts/delete-project.md b/unison-src/transcripts/delete-project.md index df31873fb9..b317a9f31e 100644 --- a/unison-src/transcripts/delete-project.md +++ b/unison-src/transcripts/delete-project.md @@ -1,9 +1,9 @@ # delete.project ```ucm -.> project.create-empty foo -.> project.create-empty bar -.> projects +scratch/main> project.create-empty foo +scratch/main> project.create-empty bar +scratch/main> projects foo/main> delete.project foo -.> projects +scratch/main> projects ``` diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md index 18af51f9c0..e2b974a9ca 100644 --- a/unison-src/transcripts/delete-project.output.md +++ b/unison-src/transcripts/delete-project.output.md @@ -1,7 +1,7 @@ # delete.project ```ucm -.> project.create-empty foo +scratch/main> project.create-empty foo 🎉 I've created the project foo. @@ -17,9 +17,7 @@ 🎉 🥳 Happy coding! - ☝️ The namespace . is empty. - -.> project.create-empty bar +scratch/main> project.create-empty bar 🎉 I've created the project bar. @@ -35,17 +33,17 @@ 🎉 🥳 Happy coding! - ☝️ The namespace . is empty. - -.> projects +scratch/main> projects 1. bar 2. foo + 3. scratch foo/main> delete.project foo -.> projects +scratch/main> projects 1. bar + 2. scratch ``` diff --git a/unison-src/transcripts/delete-silent.md b/unison-src/transcripts/delete-silent.md index 33ec668de3..5a5037e9f1 100644 --- a/unison-src/transcripts/delete-silent.md +++ b/unison-src/transcripts/delete-silent.md @@ -1,5 +1,5 @@ ```ucm:error -.> delete foo +scratch/main> delete foo ``` ```unison:hide @@ -8,8 +8,8 @@ structural type Foo = Foo () ``` ```ucm -.> add -.> delete foo -.> delete.type Foo -.> delete.term Foo.Foo +scratch/main> add +scratch/main> delete foo +scratch/main> delete.type Foo +scratch/main> delete.term Foo.Foo ``` diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index 7ea6d420d2..3ec5397fc6 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -1,5 +1,5 @@ ```ucm -.> delete foo +scratch/main> delete foo ⚠️ @@ -13,22 +13,22 @@ structural type Foo = Foo () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: structural type Foo foo : ##Nat -.> delete foo +scratch/main> delete foo Done. -.> delete.type Foo +scratch/main> delete.type Foo Done. -.> delete.term Foo.Foo +scratch/main> delete.term Foo.Foo Done. diff --git a/unison-src/transcripts/delete.md b/unison-src/transcripts/delete.md index e3e27ede98..a3af9d2142 100644 --- a/unison-src/transcripts/delete.md +++ b/unison-src/transcripts/delete.md @@ -1,7 +1,7 @@ # Delete ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` The delete command can delete both terms and types. @@ -10,7 +10,7 @@ First, let's make sure it complains when we try to delete a name that doesn't exist. ```ucm:error -.> delete.verbose foo +scratch/main> delete.verbose foo ``` Now for some easy cases. Deleting an unambiguous term, then deleting an @@ -22,10 +22,10 @@ structural type Foo = Foo () ``` ```ucm -.> add -.> delete.verbose foo -.> delete.verbose Foo -.> delete.verbose Foo.Foo +scratch/main> add +scratch/main> delete.verbose foo +scratch/main> delete.verbose Foo +scratch/main> delete.verbose Foo.Foo ``` How about an ambiguous term? @@ -50,7 +50,7 @@ foo = 2 A delete should remove both versions of the term. ```ucm -.> delete.verbose a.foo +scratch/main> delete.verbose a.foo ``` ```ucm:error @@ -77,11 +77,11 @@ structural type Foo = Foo ``` ```ucm -.> delete.verbose a.Foo +scratch/main> delete.verbose a.Foo ``` ```ucm -.> delete.verbose a.Foo.Foo +scratch/main> delete.verbose a.Foo.Foo ``` Finally, let's try to delete a term and a type with the same name. @@ -92,11 +92,11 @@ structural type foo = Foo () ``` ```ucm -.> add +scratch/main> add ``` ```ucm -.> delete.verbose foo +scratch/main> delete.verbose foo ``` We want to be able to delete multiple terms at once @@ -108,8 +108,8 @@ c = "c" ``` ```ucm -.> add -.> delete.verbose a b c +scratch/main> add +scratch/main> delete.verbose a b c ``` We can delete terms and types in the same invocation of delete @@ -122,9 +122,9 @@ c = "c" ``` ```ucm -.> add -.> delete.verbose a b c Foo -.> delete.verbose Foo.Foo +scratch/main> add +scratch/main> delete.verbose a b c Foo +scratch/main> delete.verbose Foo.Foo ``` We can delete a type and its constructors @@ -134,8 +134,8 @@ structural type Foo = Foo () ``` ```ucm -.> add -.> delete.verbose Foo Foo.Foo +scratch/main> add +scratch/main> delete.verbose Foo Foo.Foo ``` You should not be able to delete terms which are referenced by other terms @@ -148,8 +148,8 @@ d = a + b + c ``` ```ucm:error -.> add -.> delete.verbose a b c +scratch/main> add +scratch/main> delete.verbose a b c ``` But you should be able to delete all terms which reference each other in a single command @@ -162,8 +162,8 @@ h = e + f + g ``` ```ucm -.> add -.> delete.verbose e f g h +scratch/main> add +scratch/main> delete.verbose e f g h ``` You should be able to delete a type and all the functions that reference it in a single command @@ -177,8 +177,8 @@ incrementFoo = cases ``` ```ucm -.> add -.> delete.verbose Foo Foo.Foo incrementFoo +scratch/main> add +scratch/main> delete.verbose Foo Foo.Foo incrementFoo ``` If you mess up on one of the names of your command, delete short circuits @@ -191,8 +191,8 @@ h = e + f + g ``` ```ucm:error -.> add -.> delete.verbose e f gg +scratch/main> add +scratch/main> delete.verbose e f gg ``` Cyclical terms which are guarded by a lambda are allowed to be deleted @@ -203,7 +203,7 @@ pong _ = 4 Nat.+ !ping ``` ```ucm -.> add -.> delete.verbose ping -.> view pong +scratch/main> add +scratch/main> delete.verbose ping +scratch/main> view pong ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index 05a998cc1e..ab4e084476 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -6,7 +6,7 @@ First, let's make sure it complains when we try to delete a name that doesn't exist. ```ucm -.> delete.verbose foo +scratch/main> delete.verbose foo ⚠️ @@ -23,14 +23,14 @@ structural type Foo = Foo () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: structural type Foo foo : Nat -.> delete.verbose foo +scratch/main> delete.verbose foo Removed definitions: @@ -38,7 +38,7 @@ structural type Foo = Foo () Tip: You can use `undo` or `reflog` to undo this change. -.> delete.verbose Foo +scratch/main> delete.verbose Foo Removed definitions: @@ -46,7 +46,7 @@ structural type Foo = Foo () Tip: You can use `undo` or `reflog` to undo this change. -.> delete.verbose Foo.Foo +scratch/main> delete.verbose Foo.Foo Removed definitions: @@ -107,385 +107,24 @@ foo = 2 A delete should remove both versions of the term. ```ucm -.> delete.verbose a.foo - - Removed definitions: - - 1. a.foo#gjmq673r1v : Nat - - Name changes: - - Original Changes - 2. b.foo ┐ 3. a.foo#dcgdua2lj6 (removed) - 4. a.foo#dcgdua2lj6 ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -```ucm - ☝️ The namespace .a is empty. - -.a> ls - - nothing to show - -``` -Let's repeat all that on a type, for completeness. - -```unison -structural type Foo = Foo () -``` - -```ucm -.a> add - - ⍟ I've added these definitions: - - structural type Foo - -``` -```unison -structural type Foo = Foo -``` - -```ucm -.b> add - - ⍟ I've added these definitions: - - structural type Foo - -.a> merge.old .b - - Here's what's changed in the current namespace after the - merge: - - New name conflicts: - - 1. structural type Foo#089vmor9c5 - ↓ - 2. ┌ structural type Foo#00nv2kob8f - 3. └ structural type Foo#089vmor9c5 - - 4. Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5 - ↓ - 5. ┌ Foo.Foo#00nv2kob8f#0 : () - 6. └ Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5 - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` -```ucm -.> delete.verbose a.Foo - - Removed definitions: - - 1. structural type a.Foo#089vmor9c5 - - Name changes: - - Original Changes - 2. b.Foo ┐ 3. a.Foo#00nv2kob8f (removed) - 4. builtin.Unit │ - 5. a.Foo#00nv2kob8f ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -```ucm -.> delete.verbose a.Foo.Foo - - Removed definitions: - - 1. a.Foo.Foo#089vmor9c5#0 : '#089vmor9c5 - - Name changes: - - Original Changes - 2. b.Foo.Foo ┐ 3. a.Foo.Foo#00nv2kob8f#0 (removed) - 4. builtin.Unit.Unit │ - 5. a.Foo.Foo#00nv2kob8f#0 ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -Finally, let's try to delete a term and a type with the same name. - -```unison -foo = 1 -structural type foo = Foo () -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - structural type foo - foo : Nat - -``` -```ucm -.> delete.verbose foo - - Removed definitions: - - 1. structural type foo - 2. foo : Nat - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -We want to be able to delete multiple terms at once - -```unison -a = "a" -b = "b" -c = "c" -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - a : Text - b : Text - c : Text - -.> delete.verbose a b c - - Removed definitions: - - 1. a : Text - 2. b : Text - 3. c : Text - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -We can delete terms and types in the same invocation of delete - -```unison -structural type Foo = Foo () -a = "a" -b = "b" -c = "c" -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - structural type Foo - a : Text - b : Text - c : Text - -.> delete.verbose a b c Foo - - Removed definitions: - - 1. structural type Foo - 2. a : Text - 3. b : Text - 4. c : Text - - Tip: You can use `undo` or `reflog` to undo this change. - -.> delete.verbose Foo.Foo - - Name changes: - - Original Changes - 1. Foo.Foo ┐ 2. Foo.Foo (removed) - 3. foo.Foo ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -We can delete a type and its constructors - -```unison -structural type Foo = Foo () -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - structural type Foo - -.> delete.verbose Foo Foo.Foo - - Removed definitions: - - 1. structural type Foo - - Name changes: - - Original Changes - 2. Foo.Foo ┐ 3. Foo.Foo (removed) - 4. foo.Foo ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -You should not be able to delete terms which are referenced by other terms - -```unison -a = 1 -b = 2 -c = 3 -d = a + b + c -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - a : Nat - b : Nat - (also named b.foo) - c : Nat - d : Nat - -.> delete.verbose a b c +scratch/main> delete.verbose a.foo ⚠️ - I didn't delete the following definitions because they are - still in use: - - Dependency Referenced In - c 1. d - - a 2. d - -``` -But you should be able to delete all terms which reference each other in a single command - -```unison -e = 11 -f = 12 + e -g = 13 + f -h = e + f + g -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - e : Nat - f : Nat - g : Nat - h : Nat - -.> delete.verbose e f g h - - Removed definitions: - - 1. e : Nat - 2. f : Nat - 3. g : Nat - 4. h : Nat - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -You should be able to delete a type and all the functions that reference it in a single command - -```unison -structural type Foo = Foo Nat + The following names were not found in the codebase. Check your spelling. + a.foo -incrementFoo : Foo -> Nat -incrementFoo = cases - (Foo n) -> n + 1 ``` -```ucm -.> add - - ⍟ I've added these definitions: - - structural type Foo - incrementFoo : Foo -> Nat - -.> delete.verbose Foo Foo.Foo incrementFoo - - Removed definitions: - - 1. structural type Foo - 2. Foo.Foo : Nat -> #68k40ra7l7 - 3. incrementFoo : #68k40ra7l7 -> Nat - - Tip: You can use `undo` or `reflog` to undo this change. - -``` -If you mess up on one of the names of your command, delete short circuits -```unison -e = 11 -f = 12 + e -g = 13 + f -h = e + f + g -``` -```ucm -.> add +🛑 - ⍟ I've added these definitions: - - e : Nat - f : Nat - g : Nat - h : Nat +The transcript failed due to an error in the stanza above. The error is: -.> delete.verbose e f gg ⚠️ The following names were not found in the codebase. Check your spelling. - gg - -``` -Cyclical terms which are guarded by a lambda are allowed to be deleted - -```unison -ping _ = 1 Nat.+ !pong -pong _ = 4 Nat.+ !ping -``` + a.foo -```ucm -.> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat - -.> delete.verbose ping - - Removed definitions: - - 1. ping : 'Nat - - Tip: You can use `undo` or `reflog` to undo this change. - -.> view pong - - pong : 'Nat - pong _ = - use Nat + - 4 + !#l9uq1dpl5v.1 - -``` diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.md b/unison-src/transcripts/dependents-dependencies-debugfile.md index 46ffce8d30..30692285ee 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ### `debug.file` @@ -18,7 +18,7 @@ inside.q x = x + p * p inside.r = d ``` ```ucm -.> debug.file +scratch/main> debug.file ``` This will help me make progress in some situations when UCM is being deficient or broken. @@ -26,13 +26,13 @@ This will help me make progress in some situations when UCM is being deficient o ### `dependents` / `dependencies` But wait, there's more. I can check the dependencies and dependents of a definition: ```ucm -.> add -.> dependents q -.> dependencies q -.> dependencies B -.> dependencies d -.> dependents d -.> +scratch/main> add +scratch/main> dependents q +scratch/main> dependencies q +scratch/main> dependencies B +scratch/main> dependencies d +scratch/main> dependents d +scratch/main> ``` 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. diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 413c7c2108..90f3fefbc8 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -15,7 +15,7 @@ inside.r = d ``` ```ucm -.> debug.file +scratch/main> debug.file type inside.M#h37a56c5ep type outside.A#6l6krl7n4l @@ -32,7 +32,7 @@ This will help me make progress in some situations when UCM is being deficient o ### `dependents` / `dependencies` But wait, there's more. I can check the dependencies and dependents of a definition: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,11 +45,11 @@ But wait, there's more. I can check the dependencies and dependents of a defini outside.c : Nat outside.d : Boolean -.> dependents q +scratch/main> dependents q q has no dependents. -.> dependencies q +scratch/main> dependencies q Dependencies of: q @@ -66,7 +66,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 4` to see the source of any numbered item in the above list. -.> dependencies B +scratch/main> dependencies B Dependencies of: type B, B @@ -78,7 +78,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 2` to see the source of any numbered item in the above list. -.> dependencies d +scratch/main> dependencies d Dependencies of: d @@ -97,7 +97,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 6` to see the source of any numbered item in the above list. -.> dependents d +scratch/main> dependents d Dependents of: d diff --git a/unison-src/transcripts/destructuring-binds.md b/unison-src/transcripts/destructuring-binds.md index f9a1eef975..2c8cf5a770 100644 --- a/unison-src/transcripts/destructuring-binds.md +++ b/unison-src/transcripts/destructuring-binds.md @@ -1,7 +1,7 @@ # Destructuring binds ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Here's a couple examples: @@ -19,8 +19,8 @@ ex1 tup = ``` ```ucm -.> add -.> view ex0 ex1 +scratch/main> add +scratch/main> view ex0 ex1 ``` Notice that `ex0` is printed using the `cases` syntax (but `ex1` is not). The pretty-printer currently prefers the `cases` syntax if definition can be printed using either destructuring bind or `cases`. @@ -58,8 +58,8 @@ ex5a _ = match (99 + 1, "hi") with ``` ```ucm -.> add -.> view ex5 ex5a +scratch/main> add +scratch/main> view ex5 ex5a ``` Notice how it prints both an ordinary match. @@ -74,6 +74,6 @@ ex6 x = match x with For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`: ```ucm -.> add -.> view ex6 +scratch/main> add +scratch/main> view ex6 ``` diff --git a/unison-src/transcripts/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index af097fc522..4185a71b91 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -29,14 +29,14 @@ ex1 tup = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat -.> view ex0 ex1 +scratch/main> view ex0 ex1 ex0 : Nat -> Nat ex0 n = @@ -131,14 +131,14 @@ ex5a _ = match (99 + 1, "hi") with ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex5 : 'Text ex5a : 'Text -.> view ex5 ex5a +scratch/main> view ex5 ex5a ex5 : 'Text ex5 _ = match 99 Nat.+ 1 with @@ -163,13 +163,13 @@ ex6 x = match x with For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex6 : (Nat, Nat) -> Nat -.> view ex6 +scratch/main> view ex6 ex6 : (Nat, Nat) -> Nat ex6 = cases (x, y) -> x Nat.+ y diff --git a/unison-src/transcripts/diff-namespace.md b/unison-src/transcripts/diff-namespace.md index 5e938a79a5..63c20cb740 100644 --- a/unison-src/transcripts/diff-namespace.md +++ b/unison-src/transcripts/diff-namespace.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -9,7 +9,7 @@ x = 23 ```ucm .b1> add .b1> alias.term x fslkdjflskdjflksjdf -.> fork b1 b2 +scratch/main> fork b1 b2 .b2> alias.term x abc ``` ```unison:hide @@ -17,8 +17,8 @@ fslkdjflskdjflksjdf = 663 ``` ```ucm .b0> add -.> merge.old b0 b1 -.> diff.namespace b1 b2 +scratch/main> merge.old b0 b1 +scratch/main> diff.namespace b1 b2 .b2> diff.namespace .b1 ``` Things we want to test: @@ -53,11 +53,11 @@ structural ability X a1 a2 where x : () Here's what we've done so far: ```ucm:error -.> diff.namespace nothing ns1 +scratch/main> diff.namespace nothing ns1 ``` ```ucm:error -.> diff.namespace ns1 ns2 +scratch/main> diff.namespace ns1 ns2 ``` ```unison:hide @@ -66,7 +66,7 @@ fromJust = "asldkfjasldkfj" ```ucm .ns1b> add -.> merge.old ns1b ns1 +scratch/main> merge.old ns1b ns1 ``` ```unison:hide @@ -80,24 +80,24 @@ unique type Y a b = Y a b ```ucm .ns2> update.old -.> diff.namespace ns1 ns2 -.> alias.term ns2.d ns2.d' -.> alias.type ns2.A ns2.A' -.> alias.type ns2.X ns2.X' -.> diff.namespace ns1 ns2 -.> alias.type ns1.X ns1.X2 -.> alias.type ns2.A' ns2.A'' -.> fork ns2 ns3 -.> alias.term ns2.fromJust' ns2.yoohoo -.> delete.term.verbose ns2.fromJust' -.> diff.namespace ns3 ns2 +scratch/main> diff.namespace ns1 ns2 +scratch/main> alias.term ns2.d ns2.d' +scratch/main> alias.type ns2.A ns2.A' +scratch/main> alias.type ns2.X ns2.X' +scratch/main> diff.namespace ns1 ns2 +scratch/main> alias.type ns1.X ns1.X2 +scratch/main> alias.type ns2.A' ns2.A'' +scratch/main> fork ns2 ns3 +scratch/main> alias.term ns2.fromJust' ns2.yoohoo +scratch/main> delete.term.verbose ns2.fromJust' +scratch/main> diff.namespace ns3 ns2 ``` ```unison:hide bdependent = "banana" ``` ```ucm .ns3> update.old -.> diff.namespace ns2 ns3 +scratch/main> diff.namespace ns2 ns3 ``` @@ -110,8 +110,8 @@ b = a + 1 ``` ```ucm .nsx> add -.> fork nsx nsy -.> fork nsx nsz +scratch/main> fork nsx nsy +scratch/main> fork nsx nsz ``` ```unison:hide a = 444 @@ -124,13 +124,13 @@ a = 555 ``` ```ucm .nsz> update.old -.> merge.old nsy nsw +scratch/main> merge.old nsy nsw ``` ```ucm:error -.> merge.old nsz nsw +scratch/main> merge.old nsz nsw ``` ```ucm -.> diff.namespace nsx nsw +scratch/main> diff.namespace nsx nsw .nsw> view a b ``` diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index cacb9d1fc4..609451996f 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -15,597 +15,25 @@ x = 23 Done. -.> fork b1 b2 - - Done. - -.b2> alias.term x abc - - Done. - -``` -```unison -fslkdjflskdjflksjdf = 663 -``` - -```ucm - ☝️ The namespace .b0 is empty. - -.b0> add - - ⍟ I've added these definitions: - - fslkdjflskdjflksjdf : ##Nat - -.> merge.old b0 b1 - - Here's what's changed in b1 after the merge: - - New name conflicts: - - 1. fslkdjflskdjflksjdf#u520d1t9kc : Nat - ↓ - 2. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : Nat - 3. └ fslkdjflskdjflksjdf#u520d1t9kc : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> diff.namespace b1 b2 - - Resolved name conflicts: - - 1. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : Nat - 2. └ fslkdjflskdjflksjdf#u520d1t9kc : Nat - ↓ - 3. fslkdjflskdjflksjdf#u520d1t9kc : Nat - - Name changes: - - Original Changes - 4. x ┐ 5. abc (added) - 6. fslkdjflskdjflksjdf#u520d1t9kc ┘ 7. fslkdjflskdjflksjdf (added) - 8. fslkdjflskdjflksjdf#u520d1t9kc (removed) - -.b2> diff.namespace .b1 - - Resolved name conflicts: - - 1. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : ##Nat - 2. └ fslkdjflskdjflksjdf#u520d1t9kc : ##Nat - ↓ - 3. fslkdjflskdjflksjdf#u520d1t9kc : ##Nat - - Name changes: - - Original Changes - 4. x ┐ 5. abc (added) - 6. fslkdjflskdjflksjdf#u520d1t9kc ┘ 7. fslkdjflskdjflksjdf (added) - 8. fslkdjflskdjflksjdf#u520d1t9kc (removed) - -``` -Things we want to test: - -* Diffing identical namespaces -* Adds, removes, updates - * Adds with multiple names -* Moved and copied definitions - * Moves that have more that 1 initial or final name -* ... terms and types -* New patches, modified patches, deleted patches, moved patches -* With and without propagated updates - -```unison -fromJust = 1 -b = 2 -bdependent = b -c = 3 -helloWorld = "Hello, world!" - -structural type A a = A () -structural ability X a1 a2 where x : () -``` - -```ucm - ☝️ The namespace .ns1 is empty. - -.ns1> add - - ⍟ I've added these definitions: - - structural type A a - structural ability X a1 a2 - b : ##Nat - bdependent : ##Nat - c : ##Nat - fromJust : ##Nat - helloWorld : ##Text - -.ns1> alias.term fromJust fromJust' - - Done. - -.ns1> alias.term helloWorld helloWorld2 - - Done. - -.ns1> fork .ns1 .ns2 - - Done. - -``` -Here's what we've done so far: - -```ucm -.> diff.namespace nothing ns1 +scratch/main> fork b1 b2 ⚠️ - The namespace .nothing is empty. Was there a typo? - -``` -```ucm -.> diff.namespace ns1 ns2 + The namespace .__projects._63858924_a9e5_435d_be39_1d1a9b4bb963.branches._7b129dcd_ed19_42e7_9a27_5e59e3627c2b.b1 doesn't exist. - The namespaces are identical. - -``` -```unison -fromJust = "asldkfjasldkfj" ``` ```ucm - ☝️ The namespace .ns1b is empty. - -.ns1b> add - - ⍟ I've added these definitions: - - fromJust : ##Text - -.> merge.old ns1b ns1 - - Here's what's changed in ns1 after the merge: - - New name conflicts: - - 1. fromJust#gjmq673r1v : Nat - ↓ - 2. ┌ fromJust#gjmq673r1v : Nat - 3. └ fromJust#rnbo52q2sh : Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` -```unison -fromJust = 99 -b = "oog" -d = 4 -e = 5 -f = 6 -unique type Y a b = Y a b +.b1> add.b1> alias.term x fslkdjflskdjflksjdfscratch/main> fork b1 b2.b2> alias.term x abc ``` -```ucm -.ns2> update.old - - ⍟ I've added these definitions: - - type Y a b - d : ##Nat - e : ##Nat - f : ##Nat - - ⍟ I've updated these names to your new definition: - - b : ##Text - fromJust : ##Nat - (The old definition was also named fromJust'.) - -.> diff.namespace ns1 ns2 - - Resolved name conflicts: - - 1. ┌ fromJust#gjmq673r1v : Nat - 2. └ fromJust#rnbo52q2sh : Text - ↓ - 3. fromJust#6gn1k53ie0 : Nat - - Updates: - - 4. b : Nat - ↓ - 5. b : Text - - 6. fromJust' : Nat - ↓ - 7. fromJust' : Nat - - Added definitions: - - 8. type Y a b - 9. Y.Y : a -> b -> Y a b - 10. d : Nat - 11. e : Nat - 12. f : Nat - - 13. patch patch (added 2 updates) - -.> alias.term ns2.d ns2.d' - - Done. - -.> alias.type ns2.A ns2.A' - Done. - -.> alias.type ns2.X ns2.X' - - Done. - -.> diff.namespace ns1 ns2 - - Resolved name conflicts: - - 1. ┌ fromJust#gjmq673r1v : Nat - 2. └ fromJust#rnbo52q2sh : Text - ↓ - 3. fromJust#6gn1k53ie0 : Nat - - Updates: - - 4. b : Nat - ↓ - 5. b : Text - - 6. fromJust' : Nat - ↓ - 7. fromJust' : Nat - - Added definitions: - - 8. type Y a b - 9. Y.Y : a -> b -> Y a b - 10. ┌ d : Nat - 11. └ d' : Nat - 12. e : Nat - 13. f : Nat - - 14. patch patch (added 2 updates) - - Name changes: - - Original Changes - 15. A 16. A' (added) - - 17. X 18. X' (added) +🛑 -.> alias.type ns1.X ns1.X2 - - Done. +The transcript failed due to an error in the stanza above. The error is: -.> alias.type ns2.A' ns2.A'' - - Done. - -.> fork ns2 ns3 - - Done. - -.> alias.term ns2.fromJust' ns2.yoohoo - - Done. - -.> delete.term.verbose ns2.fromJust' - - Name changes: - - Original Changes - 1. ns2.fromJust ┐ 2. ns2.fromJust' (removed) - 3. ns2.fromJust' │ - 4. ns2.yoohoo │ - 5. ns3.fromJust │ - 6. ns3.fromJust' ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -.> diff.namespace ns3 ns2 - - Name changes: - - Original Changes - 1. fromJust ┐ 2. yoohoo (added) - 3. fromJust' ┘ 4. fromJust' (removed) -``` -```unison -bdependent = "banana" -``` - -```ucm -.ns3> update.old - - ⍟ I've updated these names to your new definition: - - bdependent : ##Text - -.> diff.namespace ns2 ns3 - - Updates: - - 1. bdependent : Nat - ↓ - 2. bdependent : Text - - 3. patch patch (added 1 updates) - - Name changes: - - Original Changes - 4. fromJust ┐ 5. fromJust' (added) - 6. yoohoo ┘ 7. yoohoo (removed) - -``` -## Two different auto-propagated changes creating a name conflict -Currently, the auto-propagated name-conflicted definitions are not explicitly -shown, only their also-conflicted dependency is shown. -```unison -a = 333 -b = a + 1 -``` - -```ucm - ☝️ The namespace .nsx is empty. - -.nsx> add - - ⍟ I've added these definitions: - - a : ##Nat - b : ##Nat - -.> fork nsx nsy - - Done. - -.> fork nsx nsz - - Done. - -``` -```unison -a = 444 -``` - -```ucm -.nsy> update.old - - ⍟ I've updated these names to your new definition: - - a : ##Nat - -``` -```unison -a = 555 -``` - -```ucm -.nsz> update.old - - ⍟ I've updated these names to your new definition: - - a : ##Nat - -.> merge.old nsy nsw - - Here's what's changed in nsw after the merge: - - Added definitions: - - 1. a : Nat - 2. b : Nat - - 3. patch patch (added 1 updates) - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` -```ucm -.> merge.old nsz nsw - - Here's what's changed in nsw after the merge: - - New name conflicts: - - 1. a#mdl4vqtu00 : Nat - ↓ - 2. ┌ a#mdl4vqtu00 : Nat - 3. └ a#vrs8gtkl2t : Nat - - 4. b#unkqhuu66p : Nat - ↓ - 5. ┌ b#aapqletas7 : Nat - 6. └ b#unkqhuu66p : Nat - - Updates: - - 7. patch patch (added 1 updates) - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - - I tried to auto-apply the patch, but couldn't because it - contained contradictory entries. - -``` -```ucm -.> diff.namespace nsx nsw - - New name conflicts: - - 1. a#uiiiv8a86s : Nat - ↓ - 2. ┌ a#mdl4vqtu00 : Nat - 3. └ a#vrs8gtkl2t : Nat - - 4. b#lhigeb1let : Nat - ↓ - 5. ┌ b#aapqletas7 : Nat - 6. └ b#unkqhuu66p : Nat - - Added definitions: - - 7. patch patch (added 2 updates) - -.nsw> view a b - - a#mdl4vqtu00 : ##Nat - a#mdl4vqtu00 = 444 - - a#vrs8gtkl2t : ##Nat - a#vrs8gtkl2t = 555 - - b#aapqletas7 : ##Nat - b#aapqletas7 = ##Nat.+ a#vrs8gtkl2t 1 - - b#unkqhuu66p : ##Nat - b#unkqhuu66p = ##Nat.+ a#mdl4vqtu00 1 - -``` -## Should be able to diff a namespace hash from history. - -```unison -x = 1 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - x : ##Nat - -``` -```ucm - ☝️ The namespace .hashdiff is empty. - -.hashdiff> add - - ⍟ I've added these definitions: - - x : ##Nat - -``` -```unison -y = 2 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - y : ##Nat - -``` -```ucm -.hashdiff> add - - ⍟ I've added these definitions: - - y : ##Nat - -.hashdiff> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #ru1hnjofdj - - + Adds / updates: - - y - - □ 2. #i52j9fd57b (start of history) - -.hashdiff> diff.namespace 2 1 - - Added definitions: + ⚠️ - 1. y : ##Nat - -``` -## - -Updates: -- 1 to 1 - -New name conflicts: -- updates where RHS has multiple hashes (excluding when RHS=LHS) - - 1. foo#jk19sm5bf8 : Nat - do we want to force a hashqualified? Arya thinks so - ↓ - 2. ┌ foo#0ja1qfpej6 : Nat - 3. └ foo#jk19sm5bf8 : Nat - -Resolved name conflicts: -- updates where LHS had multiple hashes and RHS has one - - 4. ┌ bar#0ja1qfpej6 : Nat - 5. └ bar#jk19sm5bf8 : Nat - ↓ - 6. bar#jk19sm5bf8 : Nat - -## Display issues to fixup + The namespace .__projects._63858924_a9e5_435d_be39_1d1a9b4bb963.branches._7b129dcd_ed19_42e7_9a27_5e59e3627c2b.b1 doesn't exist. -- [d] Do we want to surface new edit conflicts in patches? -- [t] two different auto-propagated changes creating a name conflict should show - up somewhere besides the auto-propagate count -- [t] Things look screwy when the type signature doesn't fit and has to get broken - up into multiple lines. Maybe just disallow that? -- [d] Delete blank line in between copies / renames entries if all entries are 1 to 1 - see todo in the code -- [x] incorrectly calculated bracket alignment on hashqualified "Name changes" (delete.output.md) -- [x] just handle deletion of isPropagated in propagate function, leave HandleInput alone (assuming this does the trick) -- [x] might want unqualified names to be qualified sometimes: -- [x] if a name is updated to a not-yet-named reference, it's shown as both an update and an add -- [x] similarly, if a conflicted name is resolved by deleting the last name to - a reference, I (arya) suspect it will show up as a Remove -- [d] Maybe group and/or add headings to the types, constructors, terms -- [x] add tagging of propagated updates to test propagated updates output -- [x] missing old names in deletion ppe (delete.output.md) (superseded by \#1143) -- [x] delete.term has some bonkers output -- [x] Make a decision about how we want to show constructors in the diff -- [x] 12.patch patch needs a space -- [x] This looks like garbage -- [x] Extra 2 blank lines at the end of the add section -- [x] Fix alignment issues with buildTable, convert to column3M (to be written) -- [x] adding an alias is showing up as an Add and a Copy; should just show as Copy -- [x] removing one of multiple aliases appears in removes + moves + copies section -- [x] some overlapping cases between Moves and Copies^ -- [x] Maybe don't list the type signature twice for aliases? diff --git a/unison-src/transcripts/doc-formatting.md b/unison-src/transcripts/doc-formatting.md index 51f6c51bca..1f5a638084 100644 --- a/unison-src/transcripts/doc-formatting.md +++ b/unison-src/transcripts/doc-formatting.md @@ -3,7 +3,7 @@ This transcript explains a few minor details about doc parsing and pretty-printi Docs can be used as inline code comments. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -14,10 +14,10 @@ foo n = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view foo +scratch/main> view foo ``` Note that `@` and `:]` must be escaped within docs. @@ -27,10 +27,10 @@ escaping = [: Docs look [: like \@this \:] :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view escaping +scratch/main> view escaping ``` (Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) @@ -46,10 +46,10 @@ commented = [: ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view commented +scratch/main> view commented ``` ### Indenting, and paragraph reflow @@ -64,10 +64,10 @@ doc1 = [: hi :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc1 +scratch/main> view doc1 ``` ```unison @@ -83,10 +83,10 @@ doc2 = [: hello ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc2 +scratch/main> view doc2 ``` ```unison @@ -105,10 +105,10 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc3 +scratch/main> view doc3 ``` ```unison @@ -120,10 +120,10 @@ doc4 = [: Here's another example of some paragraphs. ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc4 +scratch/main> view doc4 ``` ```unison @@ -137,10 +137,10 @@ doc5 = [: - foo ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc5 +scratch/main> view doc5 ``` ```unison @@ -153,10 +153,10 @@ doc6 = [: ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc6 +scratch/main> view doc6 ``` ### More testing @@ -168,10 +168,10 @@ empty = [::] expr = foo 1 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view empty +scratch/main> view empty ``` ```unison @@ -214,10 +214,10 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view test1 +scratch/main> view test1 ``` ```unison @@ -226,10 +226,10 @@ reg1363 = [: `@List.take foo` bar baz :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view reg1363 +scratch/main> view reg1363 ``` ```unison @@ -242,13 +242,13 @@ test2 = [: :] ``` ```ucm:hide -.> add +scratch/main> add ``` View is fine. ```ucm -.> view test2 +scratch/main> view test2 ``` But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: ```ucm -.> display test2 +scratch/main> display test2 ``` diff --git a/unison-src/transcripts/doc-formatting.output.md b/unison-src/transcripts/doc-formatting.output.md index d4c000906f..b472f9177a 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -23,7 +23,7 @@ foo n = ``` ```ucm -.> view foo +scratch/main> view foo foo : Nat -> Nat foo n = @@ -52,7 +52,7 @@ escaping = [: Docs look [: like \@this \:] :] ``` ```ucm -.> view escaping +scratch/main> view escaping escaping : Doc escaping = [: Docs look [: like \@this \:] :] @@ -84,7 +84,7 @@ commented = [: ``` ```ucm -.> view commented +scratch/main> view commented commented : Doc commented = @@ -119,7 +119,7 @@ doc1 = [: hi :] ``` ```ucm -.> view doc1 +scratch/main> view doc1 doc1 : Doc doc1 = [: hi :] @@ -151,7 +151,7 @@ doc2 = [: hello ``` ```ucm -.> view doc2 +scratch/main> view doc2 doc2 : Doc doc2 = @@ -190,7 +190,7 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ```ucm -.> view doc3 +scratch/main> view doc3 doc3 : Doc doc3 = @@ -237,7 +237,7 @@ doc4 = [: Here's another example of some paragraphs. ``` ```ucm -.> view doc4 +scratch/main> view doc4 doc4 : Doc doc4 = @@ -272,7 +272,7 @@ doc5 = [: - foo ``` ```ucm -.> view doc5 +scratch/main> view doc5 doc5 : Doc doc5 = @@ -304,7 +304,7 @@ doc6 = [: ``` ```ucm -.> view doc6 +scratch/main> view doc6 doc6 : Doc doc6 = @@ -338,7 +338,7 @@ expr = foo 1 ``` ```ucm -.> view empty +scratch/main> view empty empty : Doc empty = [: :] @@ -398,7 +398,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ```ucm -.> view test1 +scratch/main> view test1 test1 : Doc test1 = @@ -480,7 +480,7 @@ reg1363 = [: `@List.take foo` bar ``` ```ucm -.> view reg1363 +scratch/main> view reg1363 reg1363 : Doc reg1363 = [: `@List.take foo` bar baz :] @@ -511,7 +511,7 @@ test2 = [: ``` View is fine. ```ucm -.> view test2 +scratch/main> view test2 test2 : Doc test2 = @@ -522,7 +522,7 @@ View is fine. ``` But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: ```ucm -.> display test2 +scratch/main> display test2 Take a look at this: foo : Nat -> Nat diff --git a/unison-src/transcripts/doc-type-link-keywords.md b/unison-src/transcripts/doc-type-link-keywords.md index a4cb0007aa..736e256dea 100644 --- a/unison-src/transcripts/doc-type-link-keywords.md +++ b/unison-src/transcripts/doc-type-link-keywords.md @@ -7,7 +7,7 @@ not the ability `Patterns`; the lexer should see this as a single identifier. See https://github.com/unisonweb/unison/issues/2642 for an example. ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -28,14 +28,14 @@ docs.example4 = {{A doc that links to the {type Labels} type}} ``` ```ucm:hide -.> add +scratch/main> add ``` Now we check that each doc links to the object of the correct name: ```ucm -.> display docs.example1 -.> display docs.example2 -.> display docs.example3 -.> display docs.example4 +scratch/main> display docs.example1 +scratch/main> display docs.example2 +scratch/main> display docs.example3 +scratch/main> display docs.example4 ``` diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index 9eea235a15..ed7b0b7b74 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -26,19 +26,19 @@ docs.example4 = {{A doc that links to the {type Labels} type}} Now we check that each doc links to the object of the correct name: ```ucm -.> display docs.example1 +scratch/main> display docs.example1 A doc that links to the abilityPatterns term -.> display docs.example2 +scratch/main> display docs.example2 A doc that links to the Patterns ability -.> display docs.example3 +scratch/main> display docs.example3 A doc that links to the typeLabels term -.> display docs.example4 +scratch/main> display docs.example4 A doc that links to the Labels type diff --git a/unison-src/transcripts/doc1.md b/unison-src/transcripts/doc1.md index 7379c47198..3f0b0b66c9 100644 --- a/unison-src/transcripts/doc1.md +++ b/unison-src/transcripts/doc1.md @@ -1,7 +1,7 @@ # Documenting Unison code ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Unison documentation is written in Unison. Documentation is a value of the following type: diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 9fc30e1602..7f4b406469 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -3,156 +3,26 @@ Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm -.builtin> view Doc - - type Doc - = Blob Text - | Link Link - | Source Link - | Signature Term - | Evaluate Term - | Join [Doc] - -``` -You can create these `Doc` values with ordinary code, or you can use the special syntax. A value of structural type `Doc` can be created via syntax like: - -```unison -doc1 = [: This is some documentation. - -It can span multiple lines. - -Can link to definitions like @List.drop or @List - -:] -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - doc1 : Doc + ☝️ The namespace .builtin is empty. -``` -Syntax: - -`[:` starts a documentation block; `:]` finishes it. Within the block: - -* Links to definitions are done with `@List`. `\@` (and `\:]`) if you want to escape. -* `@[signature] List.take` expands to the type signature of `List.take` -* `@[source] List.map` expands to the full source of `List.map` -* `@[include] someOtherDoc`, inserts a value `someOtherDoc : Doc` here. -* `@[evaluate] someDefinition` expands to the result of evaluating `someDefinition`, which must be a pre-existing definition in the codebase (can't be an arbitrary expression). - -### An example - -We are going to document `List.take` using some verbiage and a few examples. First we have to add the examples to the codebase: - -```unison -List.take.ex1 = take 0 [1,2,3,4,5] -List.take.ex2 = take 2 [1,2,3,4,5] -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - List.take.ex1 : [Nat] - List.take.ex2 : [Nat] - -``` -```ucm -.builtin> add +.builtin> view Doc - ⍟ I've added these definitions: + ⚠️ - List.take.ex1 : [Nat] - List.take.ex2 : [Nat] - -``` -And now let's write our docs and reference these examples: - -```unison -List.take.doc = [: -`@List.take n xs` returns the first `n` elements of `xs`. (No need to add line breaks manually. The display command will do wrapping of text for you. Indent any lines where you don't want it to do this.) - -## Examples: - - @[source] List.take.ex1 - 🔽 - @List.take.ex1 = @[evaluate] List.take.ex1 + The following names were not found in the codebase. Check your spelling. + Doc - - @[source] List.take.ex2 - 🔽 - @List.take.ex2 = @[evaluate] List.take.ex2 -:] ``` -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - List.take.doc : Doc - -``` -Let's add it to the codebase. -```ucm -.builtin> add - ⍟ I've added these definitions: - - List.take.doc : Doc +🛑 -``` -We can view it with `docs`, which shows the `Doc` value that is associated with a definition. +The transcript failed due to an error in the stanza above. The error is: -```ucm -.builtin> docs List.take - `List.take n xs` returns the first `n` elements of `xs`. (No - need to add line breaks manually. The display command will do - wrapping of text for you. Indent any lines where you don't - want it to do this.) - - ## Examples: - - List.take.ex1 : [Nat] - List.take.ex1 = List.take 0 [1, 2, 3, 4, 5] - 🔽 - ex1 = [] - + ⚠️ - List.take.ex2 : [Nat] - List.take.ex2 = List.take 2 [1, 2, 3, 4, 5] - 🔽 - ex2 = [1, 2] - - -``` -Note that if we view the source of the documentation, the various references are *not* expanded. + The following names were not found in the codebase. Check your spelling. + Doc -```ucm -.builtin> view List.take - - builtin List.take : Nat -> [a] -> [a] - -``` diff --git a/unison-src/transcripts/doc2.md b/unison-src/transcripts/doc2.md index 278cc8f493..32cb274290 100644 --- a/unison-src/transcripts/doc2.md +++ b/unison-src/transcripts/doc2.md @@ -1,7 +1,7 @@ # Test parsing and round-trip of doc2 syntax elements ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -114,5 +114,5 @@ Inline '' text literal with 1 space of padding '' in the middle of a sentence. Format it to check that everything pretty-prints in a valid way. ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index e303b639a4..7cb162400f 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -110,7 +110,7 @@ Inline '' text literal with 1 space of padding '' in the middle of a sentence. Format it to check that everything pretty-prints in a valid way. ```ucm -.> debug.format +scratch/main> debug.format ``` ```unison:added-by-ucm scratch.u diff --git a/unison-src/transcripts/doc2markdown.md b/unison-src/transcripts/doc2markdown.md index a7ac7a808b..89b068a297 100644 --- a/unison-src/transcripts/doc2markdown.md +++ b/unison-src/transcripts/doc2markdown.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -86,11 +86,11 @@ Table ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> debug.doc-to-markdown fulldoc +scratch/main> debug.doc-to-markdown fulldoc ``` You can add docs to a term or type with a top-level doc literal above the binding: diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index c9b98f984f..5475c1cbf5 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -82,7 +82,7 @@ Table ``` ```ucm -.> debug.doc-to-markdown fulldoc +scratch/main> debug.doc-to-markdown fulldoc Heres some text with a soft line break diff --git a/unison-src/transcripts/duplicate-names.md b/unison-src/transcripts/duplicate-names.md index 2935a401b9..d40cc9e821 100644 --- a/unison-src/transcripts/duplicate-names.md +++ b/unison-src/transcripts/duplicate-names.md @@ -1,7 +1,7 @@ # Duplicate names in scratch file. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Term and ability constructor collisions should cause a parse error. @@ -49,6 +49,6 @@ X = () ``` ```ucm -.> add -.> view X +scratch/main> add +scratch/main> view X ``` diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 7e82b2e04b..9a15abbb7b 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -125,7 +125,7 @@ X = () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -133,7 +133,7 @@ X = () (also named builtin.Unit) X : () -.> view X +scratch/main> view X structural type X = Z diff --git a/unison-src/transcripts/duplicate-term-detection.md b/unison-src/transcripts/duplicate-term-detection.md index 61b2a8ebf1..3df20584b7 100644 --- a/unison-src/transcripts/duplicate-term-detection.md +++ b/unison-src/transcripts/duplicate-term-detection.md @@ -1,7 +1,7 @@ # Duplicate Term Detection ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` diff --git a/unison-src/transcripts/ed25519.md b/unison-src/transcripts/ed25519.md index 679a8900a0..b7f7860c98 100644 --- a/unison-src/transcripts/ed25519.md +++ b/unison-src/transcripts/ed25519.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/edit-command.md b/unison-src/transcripts/edit-command.md index 4c4edc9e4c..106b28fea4 100644 --- a/unison-src/transcripts/edit-command.md +++ b/unison-src/transcripts/edit-command.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison /private/tmp/scratch.u @@ -11,11 +11,11 @@ mytest = [Ok "ok"] ``` ```ucm -.> add -.> edit foo bar -.> edit mytest +scratch/main> add +scratch/main> edit foo bar +scratch/main> edit mytest ``` ```ucm:error -.> edit missing +scratch/main> edit missing ``` diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index a4c428e281..644db7ce70 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -33,7 +33,7 @@ mytest = [Ok "ok"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -41,7 +41,7 @@ mytest = [Ok "ok"] foo : Nat mytest : [Result] -.> edit foo bar +scratch/main> edit foo bar ☝️ @@ -50,7 +50,7 @@ mytest = [Ok "ok"] You can edit them there, then run `update` to replace the definitions currently in this namespace. -.> edit mytest +scratch/main> edit mytest ☝️ @@ -73,7 +73,7 @@ test> mytest = [Ok "ok"] ``` ```ucm -.> edit missing +scratch/main> edit missing ⚠️ diff --git a/unison-src/transcripts/empty-namespaces.md b/unison-src/transcripts/empty-namespaces.md index 223ab34ba9..a4d22fa805 100644 --- a/unison-src/transcripts/empty-namespaces.md +++ b/unison-src/transcripts/empty-namespaces.md @@ -5,19 +5,19 @@ mynamespace.x = 1 ``` ```ucm:hide -.> add -.> delete.namespace mynamespace +scratch/main> add +scratch/main> delete.namespace mynamespace ``` The deleted namespace shouldn't appear in `ls` output. ```ucm:error -.> ls +scratch/main> ls ``` ```ucm:error -.> find.verbose +scratch/main> find.verbose ``` ```ucm:error -.> find mynamespace +scratch/main> find mynamespace ``` ## history @@ -25,7 +25,7 @@ The deleted namespace shouldn't appear in `ls` output. The history of the namespace should be empty. ```ucm -.> history mynamespace +scratch/main> history mynamespace ``` Merging an empty namespace should be a no-op @@ -44,8 +44,8 @@ stuff.thing = 2 ``` ```ucm:hide -.> add -.> delete.namespace deleted +scratch/main> add +scratch/main> delete.namespace deleted ``` ## fork @@ -53,14 +53,14 @@ stuff.thing = 2 I should be allowed to fork over a deleted namespace ```ucm -.> fork stuff deleted +scratch/main> fork stuff deleted ``` The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ```ucm -.> history stuff -.> history deleted +scratch/main> history stuff +scratch/main> history deleted ``` ## move.namespace @@ -71,15 +71,15 @@ moveme.y = 2 ``` ```ucm:hide -.> add +scratch/main> add ``` I should be able to move a namespace over-top of a deleted namespace. The history should be that of the moved namespace. ```ucm -.> delete.namespace moveoverme -.> history moveme -.> move.namespace moveme moveoverme -.> history moveoverme +scratch/main> delete.namespace moveoverme +scratch/main> history moveme +scratch/main> move.namespace moveme moveoverme +scratch/main> history moveoverme ``` diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 16d33046e1..092bebe1ee 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -6,13 +6,13 @@ mynamespace.x = 1 The deleted namespace shouldn't appear in `ls` output. ```ucm -.> ls +scratch/main> ls nothing to show ``` ```ucm -.> find.verbose +scratch/main> find.verbose ☝️ @@ -29,7 +29,7 @@ The deleted namespace shouldn't appear in `ls` output. ``` ```ucm -.> find mynamespace +scratch/main> find mynamespace ☝️ @@ -50,9 +50,9 @@ The deleted namespace shouldn't appear in `ls` output. The history of the namespace should be empty. ```ucm -.> history mynamespace +scratch/main> history mynamespace - ☝️ The namespace .mynamespace is empty. + ☝️ The namespace mynamespace is empty. ``` Merging an empty namespace should be a no-op @@ -87,7 +87,7 @@ stuff.thing = 2 I should be allowed to fork over a deleted namespace ```ucm -.> fork stuff deleted +scratch/main> fork stuff deleted Done. @@ -95,7 +95,7 @@ I should be allowed to fork over a deleted namespace The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ```ucm -.> history stuff +scratch/main> history stuff Note: The most recent namespace hash is immediately below this message. @@ -104,7 +104,7 @@ The history from the `deleted` namespace should have been overwritten by the his □ 1. #q2dq4tsno1 (start of history) -.> history deleted +scratch/main> history deleted Note: The most recent namespace hash is immediately below this message. @@ -125,11 +125,11 @@ I should be able to move a namespace over-top of a deleted namespace. The history should be that of the moved namespace. ```ucm -.> delete.namespace moveoverme +scratch/main> delete.namespace moveoverme Done. -.> history moveme +scratch/main> history moveme Note: The most recent namespace hash is immediately below this message. @@ -138,11 +138,11 @@ The history should be that of the moved namespace. □ 1. #c5uisu4kll (start of history) -.> move.namespace moveme moveoverme +scratch/main> move.namespace moveme moveoverme Done. -.> history moveoverme +scratch/main> history moveoverme Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/emptyCodebase.md b/unison-src/transcripts/emptyCodebase.md index a9ea55b850..c7b939a3bb 100644 --- a/unison-src/transcripts/emptyCodebase.md +++ b/unison-src/transcripts/emptyCodebase.md @@ -7,7 +7,7 @@ Not even `Nat` or `+`! BEHOLD!!! ```ucm:error -.> ls +scratch/main> ls ``` Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index 672ac4857a..efa0854ec0 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -7,7 +7,7 @@ Not even `Nat` or `+`! BEHOLD!!! ```ucm -.> ls +scratch/main> ls nothing to show diff --git a/unison-src/transcripts/error-messages.md b/unison-src/transcripts/error-messages.md index de58eb43b9..8490e491a2 100644 --- a/unison-src/transcripts/error-messages.md +++ b/unison-src/transcripts/error-messages.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This file contains programs with parse errors and type errors, for visual inspection of error message quality and to check for regressions or changes to error reporting. diff --git a/unison-src/transcripts/errors/missing-result-typed.md b/unison-src/transcripts/errors/missing-result-typed.md index 47a3eb7920..c61c2ccef7 100644 --- a/unison-src/transcripts/errors/missing-result-typed.md +++ b/unison-src/transcripts/errors/missing-result-typed.md @@ -6,7 +6,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide:all diff --git a/unison-src/transcripts/errors/ucm-hide-all-error.md b/unison-src/transcripts/errors/ucm-hide-all-error.md index dcf94d8d32..5952056f48 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:all:error -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all-error.output.md b/unison-src/transcripts/errors/ucm-hide-all-error.output.md index e3a9558abd..9b8c0b43ee 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all.md b/unison-src/transcripts/errors/ucm-hide-all.md index 22950a9334..dd4b963dfa 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.md +++ b/unison-src/transcripts/errors/ucm-hide-all.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:all -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all.output.md b/unison-src/transcripts/errors/ucm-hide-all.output.md index 38ec6f09f5..56cf454d4c 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.md b/unison-src/transcripts/errors/ucm-hide-error.md index 68da57efc2..9b338dfd96 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.md +++ b/unison-src/transcripts/errors/ucm-hide-error.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:error -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index 0056a35888..3e80bd4a7b 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide.md b/unison-src/transcripts/errors/ucm-hide.md index aa725ada4c..470c610b52 100644 --- a/unison-src/transcripts/errors/ucm-hide.md +++ b/unison-src/transcripts/errors/ucm-hide.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide.output.md b/unison-src/transcripts/errors/ucm-hide.output.md index fe4faa583d..2c88db7f5a 100644 --- a/unison-src/transcripts/errors/ucm-hide.output.md +++ b/unison-src/transcripts/errors/ucm-hide.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/find-by-type.md b/unison-src/transcripts/find-by-type.md index 009ad845e5..ec6dd3f954 100644 --- a/unison-src/transcripts/find-by-type.md +++ b/unison-src/transcripts/find-by-type.md @@ -1,5 +1,5 @@ ```ucm:hide -.> alias.type ##Text builtin.Text +scratch/main> alias.type ##Text builtin.Text ``` ```unison:hide @@ -17,11 +17,11 @@ baz = cases ``` ```ucm -.> add -.> find : Text -> A -.> find : A -> Text -.> find : A +scratch/main> add +scratch/main> find : Text -> A +scratch/main> find : A -> Text +scratch/main> find : A ``` ```ucm:error -.> find : Text +scratch/main> find : Text ``` diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 0577051f92..4fcbf2d85a 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -13,7 +13,7 @@ baz = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -22,25 +22,25 @@ baz = cases baz : A -> Text foo : A -.> find : Text -> A +scratch/main> find : Text -> A 1. bar : Text -> A 2. A.A : Text -> A -.> find : A -> Text +scratch/main> find : A -> Text 1. baz : A -> Text -.> find : A +scratch/main> find : A 1. foo : A ``` ```ucm -.> find : Text +scratch/main> find : Text ☝️ diff --git a/unison-src/transcripts/find-command.md b/unison-src/transcripts/find-command.md index 46f852dd35..43e06de137 100644 --- a/unison-src/transcripts/find-command.md +++ b/unison-src/transcripts/find-command.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge -.> move builtin lib.builtin +scratch/main> builtins.merge +scratch/main> move builtin lib.builtin ``` ```unison:hide @@ -14,21 +14,21 @@ somewhere.bar = 7 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> find foo -.> view 1 -.> find.all foo -.> view 1 +scratch/main> find foo +scratch/main> view 1 +scratch/main> find.all foo +scratch/main> view 1 ``` ```ucm -.> find-in cat foo -.> view 1 -.> find-in.all cat foo -.> view 1 +scratch/main> find-in cat foo +scratch/main> view 1 +scratch/main> find-in.all cat foo +scratch/main> view 1 ``` ```ucm @@ -37,14 +37,14 @@ somewhere.bar = 7 ``` ```ucm -.> find bar -.> find-in somewhere bar +scratch/main> find bar +scratch/main> find-in somewhere bar ``` ```ucm:error -.> find baz +scratch/main> find baz ``` ```ucm:error -.> find.global notHere +scratch/main> find.global notHere ``` diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index f3a11b8913..2b7ffcf65b 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -9,18 +9,18 @@ somewhere.bar = 7 ``` ```ucm -.> find foo +scratch/main> find foo 1. cat.foo : Nat 2. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 -.> find.all foo +scratch/main> find.all foo 1. cat.foo : Nat 2. cat.lib.foo : Nat @@ -28,63 +28,39 @@ somewhere.bar = 7 4. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 ``` ```ucm -.> find-in cat foo +scratch/main> find-in cat foo 1. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 -.> find-in.all cat foo +scratch/main> find-in.all cat foo 1. lib.foo : Nat 2. foo : Nat -.> view 1 +scratch/main> view 1 cat.lib.foo : Nat cat.lib.foo = 5 ``` ```ucm -.somewhere> find bar - - 1. bar : ##Nat - - -.somewhere> find.global bar - - 1. .cat.lib.bar : Nat - 2. .lib.bar : Nat - 3. .somewhere.bar : Nat - - -``` -```ucm -.> find bar - - 1. somewhere.bar : Nat - - -.> find-in somewhere bar - - 1. bar : Nat - + ☝️ The namespace .somewhere is empty. -``` -```ucm -.> find baz +.somewhere> find bar ☝️ @@ -100,13 +76,22 @@ somewhere.bar = 7 namespace. ``` + ```ucm -.> find.global notHere +.somewhere> find bar.somewhere> find.global bar +``` + + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + 😶 No results. Check your spelling, or try using tab completion to supply command arguments. + `find.global` can be used to search outside the current + namespace. -``` diff --git a/unison-src/transcripts/fix-1381-excess-propagate.md b/unison-src/transcripts/fix-1381-excess-propagate.md index 84da98c5bc..e7314c9bd7 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.md @@ -7,7 +7,7 @@ X.foo = "a namespace" ``` ```ucm -.> add +scratch/main> add ``` Here is an update which should not affect `X`: @@ -15,14 +15,14 @@ Here is an update which should not affect `X`: a = "an update" ``` ```ucm -.> update +scratch/main> update ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; ```ucm -.> history X +scratch/main> history X ``` however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: ```ucm:error -.> history #7nl6ppokhg +scratch/main> history #7nl6ppokhg ``` diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index f07217266b..d35a892620 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -7,7 +7,7 @@ X.foo = "a namespace" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -21,7 +21,7 @@ a = "an update" ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -31,7 +31,7 @@ a = "an update" ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; ```ucm -.> history X +scratch/main> history X Note: The most recent namespace hash is immediately below this message. @@ -43,7 +43,7 @@ As of the time of this writing, the history for `X` should be a single node, `#4 ``` however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: ```ucm -.> history #7nl6ppokhg +scratch/main> history #7nl6ppokhg 😶 diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.md b/unison-src/transcripts/fix-2258-if-as-list-element.md index fbf9cc93dd..1ebc3a2250 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.md @@ -1,7 +1,7 @@ Tests that `if` statements can appear as list and tuple elements. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide diff --git a/unison-src/transcripts/fix-big-list-crash.md b/unison-src/transcripts/fix-big-list-crash.md index 22be8f0cb1..70c056515d 100644 --- a/unison-src/transcripts/fix-big-list-crash.md +++ b/unison-src/transcripts/fix-big-list-crash.md @@ -1,7 +1,7 @@ #### Big list crash ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Big lists have been observed to crash, while in the garbage collection step. diff --git a/unison-src/transcripts/fix1063.md b/unison-src/transcripts/fix1063.md index a7160f3564..03ea62be7e 100644 --- a/unison-src/transcripts/fix1063.md +++ b/unison-src/transcripts/fix1063.md @@ -1,7 +1,7 @@ Tests that functions named `.` are rendered correctly. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ``` unison @@ -13,7 +13,7 @@ noop = not `.` not ``` ``` ucm -.> add -.> view noop +scratch/main> add +scratch/main> view noop ``` diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index 80a1cc8a26..d9d2e8380f 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -23,14 +23,14 @@ noop = not `.` not ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean -.> view noop +scratch/main> view noop noop : Boolean -> Boolean noop = diff --git a/unison-src/transcripts/fix1334.md b/unison-src/transcripts/fix1334.md index 68e6967481..5ab5899aeb 100644 --- a/unison-src/transcripts/fix1334.md +++ b/unison-src/transcripts/fix1334.md @@ -5,6 +5,6 @@ With this PR, the source of an alias can be a short hash (even of a definition t Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ```ucm -.> alias.type ##Nat Cat -.> alias.term ##Nat.+ please_fix_763.+ +scratch/main> alias.type ##Nat Cat +scratch/main> alias.term ##Nat.+ please_fix_763.+ ``` diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md index d397a51a1a..4e08c294b9 100644 --- a/unison-src/transcripts/fix1334.output.md +++ b/unison-src/transcripts/fix1334.output.md @@ -5,11 +5,11 @@ With this PR, the source of an alias can be a short hash (even of a definition t Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ```ucm -.> alias.type ##Nat Cat +scratch/main> alias.type ##Nat Cat Done. -.> alias.term ##Nat.+ please_fix_763.+ +scratch/main> alias.term ##Nat.+ please_fix_763.+ Done. diff --git a/unison-src/transcripts/fix1390.md b/unison-src/transcripts/fix1390.md index 807cb14d25..2ef5e8ac97 100644 --- a/unison-src/transcripts/fix1390.md +++ b/unison-src/transcripts/fix1390.md @@ -1,6 +1,6 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,8 +13,8 @@ List.map f = ``` ```ucm -.> add -.> view List.map +scratch/main> add +scratch/main> view List.map ``` ```unison diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index 67155bde52..164f3a8a61 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -1,6 +1,6 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -28,13 +28,13 @@ List.map f = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: List.map : (i ->{g} o) -> [i] ->{g} [o] -.> view List.map +scratch/main> view List.map List.map : (i ->{g} o) -> [i] ->{g} [o] List.map f = diff --git a/unison-src/transcripts/fix1532.md b/unison-src/transcripts/fix1532.md index 6b5a07c938..fc835cc46c 100644 --- a/unison-src/transcripts/fix1532.md +++ b/unison-src/transcripts/fix1532.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` First, lets create two namespaces. `foo` and `bar`, and add some definitions. @@ -11,30 +11,30 @@ bar.z = x + y ``` ```ucm -.> add +scratch/main> add ``` Let's see what we have created... ```ucm -.> ls +scratch/main> ls ``` Now, if we try deleting the namespace `foo`, we get an error, as expected. ```ucm:error -.> delete.namespace foo +scratch/main> delete.namespace foo ``` Any numbered arguments should refer to `bar.z`. ```ucm -.> debug.numberedArgs +scratch/main> debug.numberedArgs ``` We can then delete the dependent term, and then delete `foo`. ```ucm -.> delete.term 1 -.> delete.namespace foo +scratch/main> delete.term 1 +scratch/main> delete.namespace foo ``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index d2707bb51a..6b856b35e9 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -28,7 +28,7 @@ bar.z = x + y ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -40,7 +40,7 @@ bar.z = x + y Let's see what we have created... ```ucm -.> ls +scratch/main> ls 1. bar/ (1 term) 2. builtin/ (469 terms, 74 types) @@ -50,7 +50,7 @@ Let's see what we have created... Now, if we try deleting the namespace `foo`, we get an error, as expected. ```ucm -.> delete.namespace foo +scratch/main> delete.namespace foo ⚠️ @@ -69,7 +69,7 @@ Now, if we try deleting the namespace `foo`, we get an error, as expected. Any numbered arguments should refer to `bar.z`. ```ucm -.> debug.numberedArgs +scratch/main> debug.numberedArgs 1. bar.z 2. bar.z @@ -78,11 +78,11 @@ Any numbered arguments should refer to `bar.z`. We can then delete the dependent term, and then delete `foo`. ```ucm -.> delete.term 1 +scratch/main> delete.term 1 Done. -.> delete.namespace foo +scratch/main> delete.namespace foo Done. diff --git a/unison-src/transcripts/fix1578.md b/unison-src/transcripts/fix1578.md index 8e2e7958f3..809af6c161 100644 --- a/unison-src/transcripts/fix1578.md +++ b/unison-src/transcripts/fix1578.md @@ -3,7 +3,7 @@ This transcript shows how suffix-based name resolution works when definitions in ## Setup ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` As setup, we'll add a data type `Day` and a definition `foo.bar : Nat`. @@ -16,7 +16,7 @@ foo.bar = 23 ``` ```ucm:hide -.> add +scratch/main> add ``` Suffix-based name resolution prefers to use names locally defined in the current file, then checks for matches in the codebase. Here are the precise rules, which will be explained below with examples: diff --git a/unison-src/transcripts/fix1696.md b/unison-src/transcripts/fix1696.md index c80b41a731..4abb83f185 100644 --- a/unison-src/transcripts/fix1696.md +++ b/unison-src/transcripts/fix1696.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:error diff --git a/unison-src/transcripts/fix1731.md b/unison-src/transcripts/fix1731.md index 81adcd8de2..82efd3cce9 100644 --- a/unison-src/transcripts/fix1731.md +++ b/unison-src/transcripts/fix1731.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -10,7 +10,7 @@ structural ability CLI where ``` ```ucm:hide -.> add +scratch/main> add ``` The `input` here should parse as a wildcard, not as `CLI.input`. diff --git a/unison-src/transcripts/fix1800.md b/unison-src/transcripts/fix1800.md index a35edb8a2d..533d95d847 100644 --- a/unison-src/transcripts/fix1800.md +++ b/unison-src/transcripts/fix1800.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -26,21 +26,21 @@ Testing a few variations here: * Should be able to run annotated and unannotated main functions from the codebase. ```ucm -.> run main1 -.> run main2 -.> run main3 -.> add -.> rename.term main1 code.main1 -.> rename.term main2 code.main2 -.> rename.term main3 code.main3 +scratch/main> run main1 +scratch/main> run main2 +scratch/main> run main3 +scratch/main> add +scratch/main> rename.term main1 code.main1 +scratch/main> rename.term main2 code.main2 +scratch/main> rename.term main3 code.main3 ``` The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ```ucm -.> run code.main1 -.> run code.main2 -.> run code.main3 +scratch/main> run code.main1 +scratch/main> run code.main2 +scratch/main> run code.main3 ``` Now testing a few variations that should NOT typecheck. @@ -56,9 +56,9 @@ main5 _ = () This shouldn't work since `main4` and `main5` don't have the right type. ```ucm:error -.> run main4 +scratch/main> run main4 ``` ```ucm:error -.> run main5 +scratch/main> run main5 ``` diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 0a534138a4..915f50e70a 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -22,19 +22,19 @@ Testing a few variations here: * Should be able to run annotated and unannotated main functions from the codebase. ```ucm -.> run main1 +scratch/main> run main1 () -.> run main2 +scratch/main> run main2 () -.> run main3 +scratch/main> run main3 () -.> add +scratch/main> add ⍟ I've added these definitions: @@ -43,15 +43,15 @@ Testing a few variations here: main3 : '{IO} () printLine : Text ->{IO} () -.> rename.term main1 code.main1 +scratch/main> rename.term main1 code.main1 Done. -.> rename.term main2 code.main2 +scratch/main> rename.term main2 code.main2 Done. -.> rename.term main3 code.main3 +scratch/main> rename.term main3 code.main3 Done. @@ -59,15 +59,15 @@ Testing a few variations here: The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ```ucm -.> run code.main1 +scratch/main> run code.main1 () -.> run code.main2 +scratch/main> run code.main2 () -.> run code.main3 +scratch/main> run code.main3 () @@ -85,7 +85,7 @@ main5 _ = () This shouldn't work since `main4` and `main5` don't have the right type. ```ucm -.> run main4 +scratch/main> run main4 😶 @@ -99,7 +99,7 @@ This shouldn't work since `main4` and `main5` don't have the right type. ``` ```ucm -.> run main5 +scratch/main> run main5 😶 diff --git a/unison-src/transcripts/fix1926.md b/unison-src/transcripts/fix1926.md index 373cb0e95a..0ebe0e3c8f 100644 --- a/unison-src/transcripts/fix1926.md +++ b/unison-src/transcripts/fix1926.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index 9eeb00583a..a325470e95 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix2000.md b/unison-src/transcripts/fix2000.md index 812ec10df0..e72a573af2 100644 --- a/unison-src/transcripts/fix2000.md +++ b/unison-src/transcripts/fix2000.md @@ -2,7 +2,7 @@ Checks that squash and merge do the same thing, with nontrivial history that includes a merge conflict. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,11 +11,11 @@ x.a.q = "ef" ``` ```ucm -.> add -.> fork x y -.> fork x s -.> fork x m -.> delete.verbose y.a.p +scratch/main> add +scratch/main> fork x y +scratch/main> fork x s +scratch/main> fork x m +scratch/main> delete.verbose y.a.p ``` ```unison @@ -23,7 +23,7 @@ y.a.p = "fij" ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -33,11 +33,11 @@ y.b.p = "wie" Merge back into the ancestor. ```ucm -.> add -.> merge.old y.b y.a -.> delete.term.verbose 1 -.> merge.old y m -.> merge.old.squash y s +scratch/main> add +scratch/main> merge.old y.b y.a +scratch/main> delete.term.verbose 1 +scratch/main> merge.old y m +scratch/main> merge.old.squash y s .s> todo .m> todo ``` diff --git a/unison-src/transcripts/fix2000.output.md b/unison-src/transcripts/fix2000.output.md index cd388f7e55..38940b1a70 100644 --- a/unison-src/transcripts/fix2000.output.md +++ b/unison-src/transcripts/fix2000.output.md @@ -21,26 +21,26 @@ x.a.q = "ef" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: x.a.p : Text x.a.q : Text -.> fork x y +scratch/main> fork x y Done. -.> fork x s +scratch/main> fork x s Done. -.> fork x m +scratch/main> fork x m Done. -.> delete.verbose y.a.p +scratch/main> delete.verbose y.a.p Name changes: @@ -71,7 +71,7 @@ y.a.p = "fij" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -98,13 +98,13 @@ y.b.p = "wie" Merge back into the ancestor. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: y.b.p : Text -.> merge.old y.b y.a +scratch/main> merge.old y.b y.a Here's what's changed in y.a after the merge: @@ -122,7 +122,7 @@ Merge back into the ancestor. Applying changes from patch... -.> delete.term.verbose 1 +scratch/main> delete.term.verbose 1 Resolved name conflicts: @@ -133,7 +133,7 @@ Merge back into the ancestor. Tip: You can use `undo` or `reflog` to undo this change. -.> merge.old y m +scratch/main> merge.old y m Here's what's changed in m after the merge: @@ -155,7 +155,7 @@ Merge back into the ancestor. Applying changes from patch... -.> merge.old.squash y s +scratch/main> merge.old.squash y s Here's what's changed in s after the merge: @@ -177,10 +177,14 @@ Merge back into the ancestor. Applying changes from patch... + ☝️ The namespace .s is empty. + .s> todo + ☝️ The namespace .m is empty. + .m> todo diff --git a/unison-src/transcripts/fix2004.md b/unison-src/transcripts/fix2004.md index ab33da9e7f..761218bb62 100644 --- a/unison-src/transcripts/fix2004.md +++ b/unison-src/transcripts/fix2004.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Here's the scenario that can produce bad empty namespace LCAs: @@ -23,42 +23,42 @@ So `j1` and `j2` have common history up through `v4`, then `j1` deletes some def First, we create some common history before a fork: ```ucm -.> alias.term builtin.Nat.+ a.delete1 -.> alias.term builtin.Nat.* a.delete2 -.> alias.term builtin.Nat.drop a.delete3 -.> alias.type builtin.Nat a.Delete4 +scratch/main> alias.term builtin.Nat.+ a.delete1 +scratch/main> alias.term builtin.Nat.* a.delete2 +scratch/main> alias.term builtin.Nat.drop a.delete3 +scratch/main> alias.type builtin.Nat a.Delete4 ``` Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previously and then adding one unrelated term via a merge with little history. It's this short history merge which will become a bad LCA of the empty namespace. ```ucm -.> fork a a2 -.> delete.term.verbose a.delete1 -.> delete.term.verbose a.delete2 -.> delete.term.verbose a.delete3 -.> delete.type.verbose a.Delete4 -.> alias.term .builtin.Float.+ newbranchA.dontDelete -.> merge.old newbranchA a +scratch/main> fork a a2 +scratch/main> delete.term.verbose a.delete1 +scratch/main> delete.term.verbose a.delete2 +scratch/main> delete.term.verbose a.delete3 +scratch/main> delete.type.verbose a.Delete4 +scratch/main> alias.term .builtin.Float.+ newbranchA.dontDelete +scratch/main> merge.old newbranchA a .a> find ``` Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces with little history. When merging `a2` back into `a`, the deletes from their common history should be respected. ```ucm -.> alias.term builtin.Text.take a2.keep1 -.> alias.term builtin.Text.take a2.keep2 -.> alias.term builtin.Text.take a2.keep3 -.> alias.term builtin.Text.take a2.keep4 -.> alias.term builtin.Text.take a2.keep5 -.> alias.term builtin.Text.take newbranchA2.keep6 -.> merge.old newbranchA2 a2 +scratch/main> alias.term builtin.Text.take a2.keep1 +scratch/main> alias.term builtin.Text.take a2.keep2 +scratch/main> alias.term builtin.Text.take a2.keep3 +scratch/main> alias.term builtin.Text.take a2.keep4 +scratch/main> alias.term builtin.Text.take a2.keep5 +scratch/main> alias.term builtin.Text.take newbranchA2.keep6 +scratch/main> merge.old newbranchA2 a2 .a2> find ``` ```ucm -.> fork a asquash -.> merge.old a2 a -.> merge.old.squash a2 asquash +scratch/main> fork a asquash +scratch/main> merge.old a2 a +scratch/main> merge.old.squash a2 asquash ``` At this point, all the things that `a` has deleted (`delete1`, `delete2`, etc) should be deleted in both the merged and squashed results. Let's verify this: @@ -69,14 +69,14 @@ At this point, all the things that `a` has deleted (`delete1`, `delete2`, etc) s ``` ```ucm:hide -.> view a.keep1 a.keep2 a.keep3 -.> view asquash.keep1 asquash.keep2 asquash.keep3 +scratch/main> view a.keep1 a.keep2 a.keep3 +scratch/main> view asquash.keep1 asquash.keep2 asquash.keep3 ``` ```ucm:error -.> view a.Delete4 +scratch/main> view a.Delete4 ``` ```ucm:error -.> view asquash.delete1 +scratch/main> view asquash.delete1 ``` diff --git a/unison-src/transcripts/fix2004.output.md b/unison-src/transcripts/fix2004.output.md index c8216d5e89..7cb48ed2ef 100644 --- a/unison-src/transcripts/fix2004.output.md +++ b/unison-src/transcripts/fix2004.output.md @@ -20,19 +20,19 @@ So `j1` and `j2` have common history up through `v4`, then `j1` deletes some def First, we create some common history before a fork: ```ucm -.> alias.term builtin.Nat.+ a.delete1 +scratch/main> alias.term builtin.Nat.+ a.delete1 Done. -.> alias.term builtin.Nat.* a.delete2 +scratch/main> alias.term builtin.Nat.* a.delete2 Done. -.> alias.term builtin.Nat.drop a.delete3 +scratch/main> alias.term builtin.Nat.drop a.delete3 Done. -.> alias.type builtin.Nat a.Delete4 +scratch/main> alias.type builtin.Nat a.Delete4 Done. @@ -40,11 +40,11 @@ First, we create some common history before a fork: Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previously and then adding one unrelated term via a merge with little history. It's this short history merge which will become a bad LCA of the empty namespace. ```ucm -.> fork a a2 +scratch/main> fork a a2 Done. -.> delete.term.verbose a.delete1 +scratch/main> delete.term.verbose a.delete1 Name changes: @@ -55,7 +55,7 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ Tip: You can use `undo` or `reflog` to undo this change. -.> delete.term.verbose a.delete2 +scratch/main> delete.term.verbose a.delete2 Name changes: @@ -66,7 +66,7 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ Tip: You can use `undo` or `reflog` to undo this change. -.> delete.term.verbose a.delete3 +scratch/main> delete.term.verbose a.delete3 Name changes: @@ -77,7 +77,7 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ Tip: You can use `undo` or `reflog` to undo this change. -.> delete.type.verbose a.Delete4 +scratch/main> delete.type.verbose a.Delete4 Name changes: @@ -88,180 +88,25 @@ Now we fork `a2` off of `a`. `a` continues on, deleting the terms it added previ Tip: You can use `undo` or `reflog` to undo this change. -.> alias.term .builtin.Float.+ newbranchA.dontDelete +scratch/main> alias.term .builtin.Float.+ newbranchA.dontDelete - Done. - -.> merge.old newbranchA a - - Here's what's changed in a after the merge: - - Added definitions: - - 1. dontDelete : Float -> Float -> Float - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.a> find - - 1. dontDelete : ##Float -> ##Float -> ##Float + ⚠️ + I don't know about that term. ``` -Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces with little history. When merging `a2` back into `a`, the deletes from their common history should be respected. - -```ucm -.> alias.term builtin.Text.take a2.keep1 - - Done. - -.> alias.term builtin.Text.take a2.keep2 - - Done. - -.> alias.term builtin.Text.take a2.keep3 - - Done. - -.> alias.term builtin.Text.take a2.keep4 - - Done. - -.> alias.term builtin.Text.take a2.keep5 - - Done. - -.> alias.term builtin.Text.take newbranchA2.keep6 - - Done. - -.> merge.old newbranchA2 a2 - - Here's what's changed in a2 after the merge: - - Name changes: - - Original Changes - 1. keep1 ┐ 2. keep6 (added) - 3. keep2 │ - 4. keep3 │ - 5. keep4 │ - 6. keep5 ┘ - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.a2> find - - 1. delete1 : Delete4 -> Delete4 -> Delete4 - 2. delete2 : Delete4 -> Delete4 -> Delete4 - 3. delete3 : Delete4 -> Delete4 -> Delete4 - 4. builtin type Delete4 - 5. keep1 : Delete4 -> ##Text -> ##Text - 6. keep2 : Delete4 -> ##Text -> ##Text - 7. keep3 : Delete4 -> ##Text -> ##Text - 8. keep4 : Delete4 -> ##Text -> ##Text - 9. keep5 : Delete4 -> ##Text -> ##Text - 10. keep6 : Delete4 -> ##Text -> ##Text - -``` ```ucm -.> fork a asquash - - Done. - -.> merge.old a2 a - - Here's what's changed in a after the merge: - - Added definitions: - - 1. ┌ keep1 : Delete4 -> Text -> Text - 2. │ keep2 : Delete4 -> Text -> Text - 3. │ keep3 : Delete4 -> Text -> Text - 4. │ keep4 : Delete4 -> Text -> Text - 5. │ keep5 : Delete4 -> Text -> Text - 6. └ keep6 : Delete4 -> Text -> Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> merge.old.squash a2 asquash - - Here's what's changed in asquash after the merge: - - Added definitions: - - 1. ┌ keep1 : Delete4 -> Text -> Text - 2. │ keep2 : Delete4 -> Text -> Text - 3. │ keep3 : Delete4 -> Text -> Text - 4. │ keep4 : Delete4 -> Text -> Text - 5. │ keep5 : Delete4 -> Text -> Text - 6. └ keep6 : Delete4 -> Text -> Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - +scratch/main> fork a a2scratch/main> delete.term.verbose a.delete1scratch/main> delete.term.verbose a.delete2scratch/main> delete.term.verbose a.delete3scratch/main> delete.type.verbose a.Delete4scratch/main> alias.term .builtin.Float.+ newbranchA.dontDeletescratch/main> merge.old newbranchA a.a> find ``` -At this point, all the things that `a` has deleted (`delete1`, `delete2`, etc) should be deleted in both the merged and squashed results. Let's verify this: - -```ucm -.a> find - - 1. dontDelete : ##Float -> ##Float -> ##Float - 2. keep1 : ##Nat -> ##Text -> ##Text - 3. keep2 : ##Nat -> ##Text -> ##Text - 4. keep3 : ##Nat -> ##Text -> ##Text - 5. keep4 : ##Nat -> ##Text -> ##Text - 6. keep5 : ##Nat -> ##Text -> ##Text - 7. keep6 : ##Nat -> ##Text -> ##Text - - -.asquash> find - 1. dontDelete : ##Float -> ##Float -> ##Float - 2. keep1 : ##Nat -> ##Text -> ##Text - 3. keep2 : ##Nat -> ##Text -> ##Text - 4. keep3 : ##Nat -> ##Text -> ##Text - 5. keep4 : ##Nat -> ##Text -> ##Text - 6. keep5 : ##Nat -> ##Text -> ##Text - 7. keep6 : ##Nat -> ##Text -> ##Text - -``` -```ucm -.> view a.Delete4 +🛑 - ⚠️ - - The following names were not found in the codebase. Check your spelling. - a.Delete4 +The transcript failed due to an error in the stanza above. The error is: -``` -```ucm -.> view asquash.delete1 ⚠️ - The following names were not found in the codebase. Check your spelling. - asquash.delete1 + I don't know about that term. -``` diff --git a/unison-src/transcripts/fix2026.md b/unison-src/transcripts/fix2026.md index 819a579e2f..df2a51f457 100644 --- a/unison-src/transcripts/fix2026.md +++ b/unison-src/transcripts/fix2026.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -40,5 +40,5 @@ Exception.unsafeRun! e _ = ``` ```ucm -.> run ex +scratch/main> run ex ``` \ No newline at end of file diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index 1391a35c6b..e4f9d8d17b 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -64,7 +64,7 @@ Exception.unsafeRun! e _ = ``` ```ucm -.> run ex +scratch/main> run ex () diff --git a/unison-src/transcripts/fix2027.md b/unison-src/transcripts/fix2027.md index bcc0824566..2a386ae315 100644 --- a/unison-src/transcripts/fix2027.md +++ b/unison-src/transcripts/fix2027.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -51,5 +51,5 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ```ucm:error -.> run myServer +scratch/main> run myServer ``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index b69a8b31bb..2a7b30deca 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -80,7 +80,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ```ucm -.> run myServer +scratch/main> run myServer 💔💥 diff --git a/unison-src/transcripts/fix2049.md b/unison-src/transcripts/fix2049.md index ab1983e95b..c0cfc4fdb2 100644 --- a/unison-src/transcripts/fix2049.md +++ b/unison-src/transcripts/fix2049.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -74,6 +74,6 @@ tests _ = ``` ```ucm -.> add -.> io.test tests +scratch/main> add +scratch/main> io.test tests ``` diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index 7e18e1f6c9..f12f90d1cf 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -121,14 +121,14 @@ tests _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] -.> io.test tests +scratch/main> io.test tests New test results: diff --git a/unison-src/transcripts/fix2053.md b/unison-src/transcripts/fix2053.md index 120bbed317..71f36094cb 100644 --- a/unison-src/transcripts/fix2053.md +++ b/unison-src/transcripts/fix2053.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```ucm -.> display List.map +scratch/main> display List.map ``` diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md index d1cf4ec78e..39766e272d 100644 --- a/unison-src/transcripts/fix2053.output.md +++ b/unison-src/transcripts/fix2053.output.md @@ -1,5 +1,5 @@ ```ucm -.> display List.map +scratch/main> display List.map f a -> let diff --git a/unison-src/transcripts/fix2156.md b/unison-src/transcripts/fix2156.md index 2bc440b149..f18d03fd13 100644 --- a/unison-src/transcripts/fix2156.md +++ b/unison-src/transcripts/fix2156.md @@ -3,7 +3,7 @@ Tests for a case where bad eta reduction was causing erroneous watch output/caching. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2167.md b/unison-src/transcripts/fix2167.md index 4e65ddb6f6..5d0381f70e 100644 --- a/unison-src/transcripts/fix2167.md +++ b/unison-src/transcripts/fix2167.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This is just a simple transcript to regression check an ability diff --git a/unison-src/transcripts/fix2187.md b/unison-src/transcripts/fix2187.md index f519c30de4..2d0eb3fe7a 100644 --- a/unison-src/transcripts/fix2187.md +++ b/unison-src/transcripts/fix2187.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2231.md b/unison-src/transcripts/fix2231.md index 0b1ed16419..2fe2660b13 100644 --- a/unison-src/transcripts/fix2231.md +++ b/unison-src/transcripts/fix2231.md @@ -7,7 +7,7 @@ the choices may not work equally well with the type checking strategies. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -25,5 +25,5 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index 2ff24e5bcf..b94ff2c9db 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -37,7 +37,7 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2238.md b/unison-src/transcripts/fix2238.md index 3562096397..37a948c0f0 100644 --- a/unison-src/transcripts/fix2238.md +++ b/unison-src/transcripts/fix2238.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` This should not typecheck - the inline `@eval` expression uses abilities. @@ -14,5 +14,5 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. ```ucm:error -.> load unison-src/transcripts/fix2238.u +scratch/main> load unison-src/transcripts/fix2238.u ``` diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 31a4aca9f0..b9594f0150 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -20,7 +20,7 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. ```ucm -.> load unison-src/transcripts/fix2238.u +scratch/main> load unison-src/transcripts/fix2238.u Loading changes detected in unison-src/transcripts/fix2238.u. diff --git a/unison-src/transcripts/fix2244.md b/unison-src/transcripts/fix2244.md index e270dc5f27..e1dba0b05e 100644 --- a/unison-src/transcripts/fix2244.md +++ b/unison-src/transcripts/fix2244.md @@ -1,13 +1,13 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` Ensure closing token is emitted by closing brace in doc eval block. ```ucm -.> load ./unison-src/transcripts/fix2244.u +scratch/main> load ./unison-src/transcripts/fix2244.u ``` ```ucm:hide -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md index 44b65347d9..63ac780c2c 100644 --- a/unison-src/transcripts/fix2244.output.md +++ b/unison-src/transcripts/fix2244.output.md @@ -1,7 +1,7 @@ Ensure closing token is emitted by closing brace in doc eval block. ```ucm -.> load ./unison-src/transcripts/fix2244.u +scratch/main> load ./unison-src/transcripts/fix2244.u Loading changes detected in ./unison-src/transcripts/fix2244.u. diff --git a/unison-src/transcripts/fix2254.md b/unison-src/transcripts/fix2254.md index 3b6dd15e6c..6f0ae20f01 100644 --- a/unison-src/transcripts/fix2254.md +++ b/unison-src/transcripts/fix2254.md @@ -39,7 +39,7 @@ We'll make our edits in a fork of the `a` namespace: ```ucm .a> add -.> fork a a2 +scratch/main> fork a a2 ``` First let's edit the `A` type, adding another constructor `E`. Note that the functions written against the old type have a wildcard in their pattern match, so they should work fine after the update. @@ -90,7 +90,7 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } And checking that after updating this record, there's nothing `todo`: ```ucm -.> fork a3 a4 +scratch/main> fork a3 a4 .a4> update.old .a4> todo ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index dbbdf46852..8b4aaa3153 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -37,7 +37,7 @@ We'll make our edits in a fork of the `a` namespace: .a> add ⍟ I've added these definitions: - + type A a b c d structural type NeedsA a b f : A Nat Nat Nat Nat -> Nat @@ -45,172 +45,22 @@ We'll make our edits in a fork of the `a` namespace: f3 : NeedsA Nat Nat -> Nat g : A Nat Nat Nat Nat -> Nat -.> fork a a2 - - Done. - -``` -First let's edit the `A` type, adding another constructor `E`. Note that the functions written against the old type have a wildcard in their pattern match, so they should work fine after the update. - -```unison -unique type A a b c d - = A a - | B b - | C c - | D d - | E a d -``` - -Let's do the update now, and verify that the definitions all look good and there's nothing `todo`: - -```ucm -.a2> update.old - - ⍟ I've updated these names to your new definition: - - type A a b c d - -.a2> view A NeedsA f f2 f3 g - - type A a b c d - = B b - | D d - | E a d - | C c - | A a - - structural type NeedsA a b - = Zoink Text - | NeedsA (A a b Nat Nat) - - f : A Nat Nat Nat Nat -> Nat - f = cases - A n -> n - _ -> 42 - - f2 : A Nat Nat Nat Nat -> Nat - f2 a = - use Nat + - n = f a - n + 1 - - f3 : NeedsA Nat Nat -> Nat - f3 = cases - NeedsA a -> f a Nat.+ 20 - _ -> 0 - - g : A Nat Nat Nat Nat -> Nat - g = cases - D n -> n - _ -> 43 - -.a2> todo - - - -``` -## Record updates +scratch/main> fork a a2 -Here's a test of updating a record: + ⚠️ -```unison -structural type Rec = { uno : Nat, dos : Nat } + The namespace .__projects._ae607e42_8e50_43fc_bd62_57e211b16316.branches._04b92376_f428_4b46_8d52_c83ba75c6a15.a doesn't exist. -combine r = uno r + dos r ``` -```ucm - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - structural type Rec - Rec.dos : Rec -> Nat - Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.dos.set : Nat -> Rec -> Rec - Rec.uno : Rec -> Nat - Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.uno.set : Nat -> Rec -> Rec - combine : Rec -> Nat -``` -```ucm -.a3> add +🛑 - ⍟ I've added these definitions: - - structural type Rec - Rec.dos : Rec -> Nat - Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.dos.set : Nat -> Rec -> Rec - Rec.uno : Rec -> Nat - Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.uno.set : Nat -> Rec -> Rec - combine : Rec -> Nat +The transcript failed due to an error in the stanza above. The error is: -``` -```unison -structural type Rec = { uno : Nat, dos : Nat, tres : Text } -``` -```ucm + ⚠️ - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - Rec.tres : Rec -> Text - Rec.tres.modify : (Text ->{g} Text) -> Rec ->{g} Rec - Rec.tres.set : Text -> Rec -> Rec - - ⍟ These names already exist. You can `update` them to your - new definition: - - structural type Rec - Rec.dos : Rec -> Nat - Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.dos.set : Nat -> Rec -> Rec - Rec.uno : Rec -> Nat - Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.uno.set : Nat -> Rec -> Rec + The namespace .__projects._ae607e42_8e50_43fc_bd62_57e211b16316.branches._04b92376_f428_4b46_8d52_c83ba75c6a15.a doesn't exist. -``` -And checking that after updating this record, there's nothing `todo`: - -```ucm -.> fork a3 a4 - - Done. - -.a4> update.old - - ⍟ I've added these definitions: - - Rec.tres : Rec -> Text - Rec.tres.modify : (Text ->{g} Text) -> Rec ->{g} Rec - Rec.tres.set : Text -> Rec -> Rec - - ⍟ I've updated these names to your new definition: - - structural type Rec - Rec.dos : Rec -> Nat - Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.dos.set : Nat -> Rec -> Rec - Rec.uno : Rec -> Nat - Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec - Rec.uno.set : Nat -> Rec -> Rec - -.a4> todo - - - -``` diff --git a/unison-src/transcripts/fix2268.md b/unison-src/transcripts/fix2268.md index 504e2da734..0892d924e7 100644 --- a/unison-src/transcripts/fix2268.md +++ b/unison-src/transcripts/fix2268.md @@ -3,7 +3,7 @@ inferred types that didn't contain arrows, so effects that just yield a value weren't getting disambiguated. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2334.md b/unison-src/transcripts/fix2334.md index 0bc9a2d7d3..9044000b5e 100644 --- a/unison-src/transcripts/fix2334.md +++ b/unison-src/transcripts/fix2334.md @@ -3,7 +3,7 @@ Tests an issue where pattern matching matrices involving built-in types was discarding default cases in some branches. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2344.md b/unison-src/transcripts/fix2344.md index 6dd1e0ca21..2593c2f18e 100644 --- a/unison-src/transcripts/fix2344.md +++ b/unison-src/transcripts/fix2344.md @@ -5,7 +5,7 @@ The binds were causing some sequences of lets to be unnecessarily recursive. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2353.md b/unison-src/transcripts/fix2353.md index 50d0827a6d..f9662633cd 100644 --- a/unison-src/transcripts/fix2353.md +++ b/unison-src/transcripts/fix2353.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2354.md b/unison-src/transcripts/fix2354.md index 7346e368cf..f8a637022d 100644 --- a/unison-src/transcripts/fix2354.md +++ b/unison-src/transcripts/fix2354.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests that delaying an un-annotated higher-rank type gives a normal diff --git a/unison-src/transcripts/fix2355.md b/unison-src/transcripts/fix2355.md index 25f4840b31..a9b22fc3f3 100644 --- a/unison-src/transcripts/fix2355.md +++ b/unison-src/transcripts/fix2355.md @@ -2,7 +2,7 @@ Tests for a loop that was previously occurring in the type checker. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:error diff --git a/unison-src/transcripts/fix2378.md b/unison-src/transcripts/fix2378.md index d4358c26e9..586e6335c3 100644 --- a/unison-src/transcripts/fix2378.md +++ b/unison-src/transcripts/fix2378.md @@ -4,7 +4,7 @@ checking wanted vs. provided abilities. It was necessary to re-check rows until a fixed point is reached. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2423.md b/unison-src/transcripts/fix2423.md index 4f5d073c0a..72b3450557 100644 --- a/unison-src/transcripts/fix2423.md +++ b/unison-src/transcripts/fix2423.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2474.md b/unison-src/transcripts/fix2474.md index a718719bd9..3d48be95b5 100644 --- a/unison-src/transcripts/fix2474.md +++ b/unison-src/transcripts/fix2474.md @@ -18,7 +18,7 @@ should be typed in the following way: the ability that contains `e`. ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index 7f6472f094..f023e162b8 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -18,7 +18,7 @@ should be typed in the following way: the ability that contains `e`. ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix2628.md b/unison-src/transcripts/fix2628.md index 5c3ec8df50..3e111226b5 100644 --- a/unison-src/transcripts/fix2628.md +++ b/unison-src/transcripts/fix2628.md @@ -1,5 +1,5 @@ ```ucm:hide -.> alias.type ##Nat .base.Nat +scratch/main> alias.type ##Nat .base.Nat ``` ```unison:hide @@ -9,7 +9,7 @@ unique type foo.bar.baz.MyRecord = { ``` ```ucm -.> add +scratch/main> add -.> find : Nat -> MyRecord +scratch/main> find : Nat -> MyRecord ``` diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 64b45ed29b..93e2bb13af 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -4,23 +4,23 @@ unique type foo.bar.baz.MyRecord = { } ``` -```ucm -.> add - ⍟ I've added these definitions: - - type foo.bar.baz.MyRecord - foo.bar.baz.MyRecord.value : MyRecord -> Nat - foo.bar.baz.MyRecord.value.modify : (Nat ->{g} Nat) - -> MyRecord - ->{g} MyRecord - foo.bar.baz.MyRecord.value.set : Nat - -> MyRecord - -> MyRecord -.> find : Nat -> MyRecord +🛑 + +The transcript failed due to an error in the stanza above. The error is: + - 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord + + ❓ + + I couldn't resolve any of these symbols: + + 2 | value : Nat + + + Symbol Suggestions + + Nat No matches -``` diff --git a/unison-src/transcripts/fix2663.md b/unison-src/transcripts/fix2663.md index 6d2ccd7242..e3b88b0622 100644 --- a/unison-src/transcripts/fix2663.md +++ b/unison-src/transcripts/fix2663.md @@ -8,7 +8,7 @@ After pattern compilation, the match would end up: and z would end up referring to the first p3 rather than the second. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2693.md b/unison-src/transcripts/fix2693.md index 947e35b701..2bd2a0082e 100644 --- a/unison-src/transcripts/fix2693.md +++ b/unison-src/transcripts/fix2693.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -14,7 +14,7 @@ range = loop [] ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index 22a46bec21..7bb6d60889 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -24,7 +24,7 @@ range = loop [] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2712.md b/unison-src/transcripts/fix2712.md index fce7511665..4483f00bd1 100644 --- a/unison-src/transcripts/fix2712.md +++ b/unison-src/transcripts/fix2712.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ mapWithKey f m = Tip ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index 08cdb89a30..f691d22dca 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -20,7 +20,7 @@ mapWithKey f m = Tip ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2795.md b/unison-src/transcripts/fix2795.md index d4b61c99b3..1e2ca1764d 100644 --- a/unison-src/transcripts/fix2795.md +++ b/unison-src/transcripts/fix2795.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio -.> load unison-src/transcripts/fix2795/docs.u -.> display test +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts/fix2795/docs.u +scratch/main> display test ``` diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md index 13a789f037..09ae558fca 100644 --- a/unison-src/transcripts/fix2795.output.md +++ b/unison-src/transcripts/fix2795.output.md @@ -1,9 +1,9 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio Done. -.> load unison-src/transcripts/fix2795/docs.u +scratch/main> load unison-src/transcripts/fix2795/docs.u Loading changes detected in unison-src/transcripts/fix2795/docs.u. @@ -17,7 +17,7 @@ t1 : Text test : Doc2 -.> display test +scratch/main> display test t : Text t = "hi" diff --git a/unison-src/transcripts/fix2840.md b/unison-src/transcripts/fix2840.md index be481b5bbd..518f90c45e 100644 --- a/unison-src/transcripts/fix2840.md +++ b/unison-src/transcripts/fix2840.md @@ -1,7 +1,7 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to be present in the active codebase when the `display` command was used render `Doc` values. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First, a few \[hidden] definitions necessary for typechecking a simple Doc2. @@ -63,7 +63,7 @@ syntax.docWord = Word ``` ```ucm -.> add +scratch/main> add ``` Next, define and display a simple Doc: @@ -74,7 +74,7 @@ Hi ``` ```ucm -.> display README +scratch/main> display README ``` Previously, the error was: diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index c47df9a2c7..ab59e8f1eb 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -3,7 +3,7 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to First, a few \[hidden] definitions necessary for typechecking a simple Doc2. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -25,7 +25,7 @@ Hi ``` ```ucm -.> display README +scratch/main> display README Hi diff --git a/unison-src/transcripts/fix2970.md b/unison-src/transcripts/fix2970.md index d9a6a6b532..efcd59f181 100644 --- a/unison-src/transcripts/fix2970.md +++ b/unison-src/transcripts/fix2970.md @@ -1,7 +1,7 @@ Also fixes #1519 (it's the same issue). ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index 904508e2cd..52d017e842 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -1,7 +1,7 @@ Also fixes #1519 (it's the same issue). ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix3037.md b/unison-src/transcripts/fix3037.md index c16c1f284f..af8fed9816 100644 --- a/unison-src/transcripts/fix3037.md +++ b/unison-src/transcripts/fix3037.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests for an unsound case of ability checking that was erroneously being diff --git a/unison-src/transcripts/fix3171.md b/unison-src/transcripts/fix3171.md index 62790dd1aa..ad166c7f5e 100644 --- a/unison-src/transcripts/fix3171.md +++ b/unison-src/transcripts/fix3171.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests an case where decompiling could cause function arguments to occur in the diff --git a/unison-src/transcripts/fix3196.md b/unison-src/transcripts/fix3196.md index d04592aa6c..46755570e5 100644 --- a/unison-src/transcripts/fix3196.md +++ b/unison-src/transcripts/fix3196.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests ability checking in scenarios where one side is concrete and the other is diff --git a/unison-src/transcripts/fix3215.md b/unison-src/transcripts/fix3215.md index af0e67e868..a0d1715a14 100644 --- a/unison-src/transcripts/fix3215.md +++ b/unison-src/transcripts/fix3215.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests a case where concrete abilities were appearing multiple times in an diff --git a/unison-src/transcripts/fix3244.md b/unison-src/transcripts/fix3244.md index 0ae745e897..e07581e2e2 100644 --- a/unison-src/transcripts/fix3244.md +++ b/unison-src/transcripts/fix3244.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This tests an previously erroneous case in the pattern compiler. It was assuming diff --git a/unison-src/transcripts/fix3265.md b/unison-src/transcripts/fix3265.md index fcf9ce8fb9..5b06551112 100644 --- a/unison-src/transcripts/fix3265.md +++ b/unison-src/transcripts/fix3265.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests cases that produced bad decompilation output previously. There diff --git a/unison-src/transcripts/fix3634.md b/unison-src/transcripts/fix3634.md index 0cb5f88dd9..fd1654739a 100644 --- a/unison-src/transcripts/fix3634.md +++ b/unison-src/transcripts/fix3634.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` @@ -16,6 +16,6 @@ d = {{ ``` ```ucm -.> add -.> display d +scratch/main> add +scratch/main> display d ``` \ No newline at end of file diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index 46f009f8cd..8648dd1cf3 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -26,7 +26,7 @@ d = {{ ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -34,7 +34,7 @@ d = {{ (also named builtin.Optional) d : Doc2 -.> display d +scratch/main> display d `x -> J x` diff --git a/unison-src/transcripts/fix3678.md b/unison-src/transcripts/fix3678.md index 13bed5d26c..59ecfe787e 100644 --- a/unison-src/transcripts/fix3678.md +++ b/unison-src/transcripts/fix3678.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Array comparison was indexing out of bounds. diff --git a/unison-src/transcripts/fix3752.md b/unison-src/transcripts/fix3752.md index 72979087f5..90fc207437 100644 --- a/unison-src/transcripts/fix3752.md +++ b/unison-src/transcripts/fix3752.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` These were failing to type check before, because id was not diff --git a/unison-src/transcripts/fix3759.md b/unison-src/transcripts/fix3759.md index 63047bc914..212bae6659 100644 --- a/unison-src/transcripts/fix3759.md +++ b/unison-src/transcripts/fix3759.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -14,7 +14,7 @@ Woot.frobnicate = 43 ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix3773.md b/unison-src/transcripts/fix3773.md index 1a0ab22c78..991db6991f 100644 --- a/unison-src/transcripts/fix3773.md +++ b/unison-src/transcripts/fix3773.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4172.md b/unison-src/transcripts/fix4172.md index 2c7d6c3b14..faaa934756 100644 --- a/unison-src/transcripts/fix4172.md +++ b/unison-src/transcripts/fix4172.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,8 +17,8 @@ allowDebug = debug [1,2,3] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` ```unison @@ -26,6 +26,6 @@ bool = false ``` ```ucm:error -.> update.old -.> test +scratch/main> update.old +scratch/main> test ``` diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index 59a5d83b87..91614ccfe4 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -36,7 +36,7 @@ allowDebug = debug [1,2,3] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,7 +45,7 @@ allowDebug = debug [1,2,3] debug : a -> Text t1 : [Result] -.> test +scratch/main> test Cached test results (`help testcache` to learn more) @@ -75,13 +75,13 @@ bool = false ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: bool : Boolean -.> test +scratch/main> test ✅ diff --git a/unison-src/transcripts/fix4280.md b/unison-src/transcripts/fix4280.md index f4cf09a011..d994a42595 100644 --- a/unison-src/transcripts/fix4280.md +++ b/unison-src/transcripts/fix4280.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4424.md b/unison-src/transcripts/fix4424.md index 19963478f0..8fb4d14bab 100644 --- a/unison-src/transcripts/fix4424.md +++ b/unison-src/transcripts/fix4424.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some basics: @@ -13,7 +13,7 @@ countCat = cases ``` ```ucm -.> add +scratch/main> add ``` Now I want to add a constructor. @@ -23,5 +23,5 @@ unique type Rat.Dog = Bird | Mouse ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index bb00ce7303..dbf505cedb 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -9,7 +9,7 @@ countCat = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -25,7 +25,7 @@ unique type Rat.Dog = Bird | Mouse ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4498.md b/unison-src/transcripts/fix4498.md index d1781e2e33..5e8918b300 100644 --- a/unison-src/transcripts/fix4498.md +++ b/unison-src/transcripts/fix4498.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ myterm = foo + 2 ``` ```ucm -.> add -.> view myterm +scratch/main> add +scratch/main> view myterm ``` diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index e13c5f8f09..fb5bbd771b 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -22,7 +22,7 @@ myterm = foo + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -31,7 +31,7 @@ myterm = foo + 2 lib.dep0.zonk.foo : Text myterm : Nat -.> view myterm +scratch/main> view myterm myterm : Nat myterm = diff --git a/unison-src/transcripts/fix4556.md b/unison-src/transcripts/fix4556.md index d4775b587b..1a0bbe25d7 100644 --- a/unison-src/transcripts/fix4556.md +++ b/unison-src/transcripts/fix4556.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ hey = foo.hello ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,5 +18,5 @@ thing = 2 ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index d65321a311..2b4add6caa 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -22,7 +22,7 @@ hey = foo.hello ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ thing = 2 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4592.md b/unison-src/transcripts/fix4592.md index cf272e1948..1118a281fb 100644 --- a/unison-src/transcripts/fix4592.md +++ b/unison-src/transcripts/fix4592.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison diff --git a/unison-src/transcripts/fix4618.md b/unison-src/transcripts/fix4618.md index 3755f10996..1d69f1ac52 100644 --- a/unison-src/transcripts/fix4618.md +++ b/unison-src/transcripts/fix4618.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ unique type Bugs.Zonk = Bugs ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,5 +17,5 @@ unique type Bugs = ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index ee988cf57f..0b6a3921d8 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -18,7 +18,7 @@ unique type Bugs.Zonk = Bugs ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,7 +50,7 @@ unique type Bugs = ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4722.md b/unison-src/transcripts/fix4722.md index e674df56b6..983e324f74 100644 --- a/unison-src/transcripts/fix4722.md +++ b/unison-src/transcripts/fix4722.md @@ -9,7 +9,7 @@ expected type into each case, allowing top-level annotations to act like annotations on each case. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4780.md b/unison-src/transcripts/fix4780.md index a8fad41440..f1ebdad567 100644 --- a/unison-src/transcripts/fix4780.md +++ b/unison-src/transcripts/fix4780.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Just a simple test case to see whether partially applied diff --git a/unison-src/transcripts/fix4898.md b/unison-src/transcripts/fix4898.md index 9bc68041b2..6d618d82b0 100644 --- a/unison-src/transcripts/fix4898.md +++ b/unison-src/transcripts/fix4898.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ redouble x = double x + double x ``` ```ucm -.> add -.> dependents double -.> delete.term 1 +scratch/main> add +scratch/main> dependents double +scratch/main> delete.term 1 ``` diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index dceafc4cb3..c348778f25 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,14 +27,14 @@ redouble x = double x + double x ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: double : Int -> Int redouble : Int -> Int -.> dependents double +scratch/main> dependents double Dependents of: double @@ -45,7 +45,7 @@ redouble x = double x + double x Tip: Try `view 1` to see the source of any numbered item in the above list. -.> delete.term 1 +scratch/main> delete.term 1 Done. diff --git a/unison-src/transcripts/fix614.md b/unison-src/transcripts/fix614.md index 3e0ad6c76b..3bc69c27c9 100644 --- a/unison-src/transcripts/fix614.md +++ b/unison-src/transcripts/fix614.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. @@ -16,7 +16,7 @@ ex1 = do ``` ```ucm:hide -.> add +scratch/main> add ``` This does not typecheck, we've accidentally underapplied `Stream.emit`: diff --git a/unison-src/transcripts/fix689.md b/unison-src/transcripts/fix689.md index b22106eed4..a75468b281 100644 --- a/unison-src/transcripts/fix689.md +++ b/unison-src/transcripts/fix689.md @@ -1,7 +1,7 @@ Tests the fix for https://github.com/unisonweb/unison/issues/689 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ``` unison diff --git a/unison-src/transcripts/fix693.md b/unison-src/transcripts/fix693.md index bcb714af97..f45d2eab15 100644 --- a/unison-src/transcripts/fix693.md +++ b/unison-src/transcripts/fix693.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ structural ability Abort where ``` ```ucm -.> add +scratch/main> add ``` This code should not type check. The match on X.x ought to introduce a diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 6d869d63a1..a5d0377374 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -22,7 +22,7 @@ structural ability Abort where ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix845.md b/unison-src/transcripts/fix845.md index 4e361ca7cc..99e4262455 100644 --- a/unison-src/transcripts/fix845.md +++ b/unison-src/transcripts/fix845.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Add `List.zonk` to the codebase: @@ -14,7 +14,7 @@ Text.zonk txt = txt ++ "!! " ``` ```ucm:hide -.> add +scratch/main> add ``` Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: diff --git a/unison-src/transcripts/fix849.md b/unison-src/transcripts/fix849.md index 4d111f9cc1..63c40e8212 100644 --- a/unison-src/transcripts/fix849.md +++ b/unison-src/transcripts/fix849.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` See [this ticket](https://github.com/unisonweb/unison/issues/849). diff --git a/unison-src/transcripts/fix942.md b/unison-src/transcripts/fix942.md index 5c12cb8c06..5cbf16ffb1 100644 --- a/unison-src/transcripts/fix942.md +++ b/unison-src/transcripts/fix942.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First we add some code: @@ -11,7 +11,7 @@ z = y + 2 ``` ```ucm -.> add +scratch/main> add ``` Now we edit `x` to be `7`, which should make `z` equal `10`: @@ -21,8 +21,8 @@ x = 7 ``` ```ucm -.> update -.> view x y z +scratch/main> update +scratch/main> view x y z ``` Uh oh! `z` is still referencing the old version. Just to confirm: @@ -32,6 +32,6 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index fd5f055d22..67d550311b 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -22,7 +22,7 @@ z = y + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -52,7 +52,7 @@ x = 7 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -63,7 +63,7 @@ x = 7 Done. -.> view x y z +scratch/main> view x y z x : Nat x = 7 @@ -106,13 +106,13 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: t1 : [Result] -.> test +scratch/main> test Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts/fix987.md b/unison-src/transcripts/fix987.md index 0db69b1d78..5eb2a73bbc 100644 --- a/unison-src/transcripts/fix987.md +++ b/unison-src/transcripts/fix987.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First we'll add a definition: @@ -18,7 +18,7 @@ spaceAttack1 x = Add it to the codebase: ```ucm -.> add +scratch/main> add ``` Now we'll try to add a different definition that runs the actions in a different order. This should work fine: @@ -31,7 +31,7 @@ spaceAttack2 x = ``` ```ucm -.> add +scratch/main> add ``` Previously, this would fail because the hashing algorithm was being given one big let rec block whose binding order was normalized. diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index 5f6119c225..50d747862f 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -28,7 +28,7 @@ spaceAttack1 x = Add it to the codebase: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,7 +59,7 @@ spaceAttack2 x = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/formatter.md b/unison-src/transcripts/formatter.md index 3848c0ba99..d2a921b2fc 100644 --- a/unison-src/transcripts/formatter.md +++ b/unison-src/transcripts/formatter.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -88,7 +88,7 @@ with a strike-through block~ ``` ```ucm -.> debug.format +scratch/main> debug.format ``` Formatter should leave things alone if the file doesn't typecheck. @@ -98,5 +98,5 @@ brokenDoc = {{ hello }} + 1 ``` ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/formatter.output.md b/unison-src/transcripts/formatter.output.md index 95af2a545d..aac0d12aac 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -84,7 +84,7 @@ with a strike-through block~ ``` ```ucm -.> debug.format +scratch/main> debug.format ``` ```unison:added-by-ucm scratch.u @@ -200,6 +200,6 @@ brokenDoc = {{ hello }} + 1 ``` ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/fuzzy-options.md b/unison-src/transcripts/fuzzy-options.md index 13d953c938..96e274f9a6 100644 --- a/unison-src/transcripts/fuzzy-options.md +++ b/unison-src/transcripts/fuzzy-options.md @@ -5,7 +5,7 @@ If an argument is required but doesn't have a fuzzy resolver, the command should ```ucm:error -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver -.> move.term +scratch/main> move.term ``` If a fuzzy resolver doesn't have any options available it should print a message instead of @@ -25,21 +25,21 @@ nested.optionTwo = 2 Definition args ```ucm -.> add -.> debug.fuzzy-options view _ +scratch/main> add +scratch/main> debug.fuzzy-options view _ ``` Namespace args ```ucm -.> add -.> debug.fuzzy-options find-in _ +scratch/main> add +scratch/main> debug.fuzzy-options find-in _ ``` Project Branch args ```ucm myproject/main> branch mybranch -.> debug.fuzzy-options switch _ +scratch/main> debug.fuzzy-options switch _ ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index f48f5cd6fb..1eb893cb8f 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -5,7 +5,7 @@ If an argument is required but doesn't have a fuzzy resolver, the command should ```ucm -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver -.> move.term +scratch/main> move.term `move.term foo bar` renames `foo` to `bar`. @@ -32,16 +32,14 @@ nested.optionTwo = 2 Definition args ```ucm - ☝️ The namespace . is empty. - -.> add +scratch/main> add ⍟ I've added these definitions: nested.optionTwo : ##Nat optionOne : ##Nat -.> debug.fuzzy-options view _ +scratch/main> debug.fuzzy-options view _ Select a definition to view: * optionOne @@ -51,12 +49,12 @@ Definition args Namespace args ```ucm -.> add +scratch/main> add ⊡ Ignored previously added definitions: nested.optionTwo optionOne -.> debug.fuzzy-options find-in _ +scratch/main> debug.fuzzy-options find-in _ Select a namespace: * nested @@ -72,11 +70,13 @@ myproject/main> branch mybranch Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. -.> debug.fuzzy-options switch _ +scratch/main> debug.fuzzy-options switch _ Select a project or branch to switch to: * myproject/main * myproject/mybranch + * scratch/main * myproject + * scratch ``` diff --git a/unison-src/transcripts/hello.md b/unison-src/transcripts/hello.md index 187eb86ec3..4c72096ffa 100644 --- a/unison-src/transcripts/hello.md +++ b/unison-src/transcripts/hello.md @@ -2,7 +2,7 @@ # Hello! ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This markdown file is also a Unison transcript file. Transcript files are an easy way to create self-documenting Unison programs, libraries, and tutorials. @@ -33,8 +33,8 @@ x = 42 Let's go ahead and add that to the codebase, then make sure it's there: ```ucm -.> add -.> view x +scratch/main> add +scratch/main> view x ``` If `view` returned no results, the transcript would fail at this point. @@ -50,7 +50,7 @@ y = 99 This works for `ucm` blocks as well. ```ucm:hide -.> rename.term x answerToUltimateQuestionOfLife +scratch/main> rename.term x answerToUltimateQuestionOfLife ``` Doing `unison:hide:all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state. diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index 8104114e03..e6d03ea95e 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -48,13 +48,13 @@ x = 42 Let's go ahead and add that to the codebase, then make sure it's there: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: x : Nat -.> view x +scratch/main> view x x : Nat x = 42 diff --git a/unison-src/transcripts/higher-rank.md b/unison-src/transcripts/higher-rank.md index 7fe63de504..6645e456aa 100644 --- a/unison-src/transcripts/higher-rank.md +++ b/unison-src/transcripts/higher-rank.md @@ -2,9 +2,9 @@ This transcript does some testing of higher-rank types. Regression tests related to higher-rank types can be added here. ```ucm:hide -.> alias.type ##Nat Nat -.> alias.type ##Text Text -.> alias.type ##IO IO +scratch/main> alias.type ##Nat Nat +scratch/main> alias.type ##Text Text +scratch/main> alias.type ##IO IO ``` In this example, a higher-rank function is defined, `f`. No annotation is needed at the call-site of `f`, because the lambda is being checked against the polymorphic type `forall a . a -> a`, rather than inferred: diff --git a/unison-src/transcripts/io-test-command.md b/unison-src/transcripts/io-test-command.md index 98d55a3da3..f10259137e 100644 --- a/unison-src/transcripts/io-test-command.md +++ b/unison-src/transcripts/io-test-command.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` The `io.test` command should run all of the tests within the current namespace, excluding libs. @@ -20,24 +20,24 @@ lib.ioAndExceptionTestInLib = do ``` ```ucm:hide -.> add +scratch/main> add ``` Run a IO tests one by one ```ucm -.> io.test ioAndExceptionTest -.> io.test ioTest +scratch/main> io.test ioAndExceptionTest +scratch/main> io.test ioTest ``` `io.test` doesn't cache results ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest ``` `io.test.all` will run all matching tests except those in the `lib` namespace. ```ucm -.> io.test.all +scratch/main> io.test.all ``` diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index 840d72b4f7..220addbcd3 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -18,7 +18,7 @@ lib.ioAndExceptionTestInLib = do Run a IO tests one by one ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest New test results: @@ -28,7 +28,7 @@ Run a IO tests one by one Tip: Use view ioAndExceptionTest to view the source of a test. -.> io.test ioTest +scratch/main> io.test ioTest New test results: @@ -42,7 +42,7 @@ Run a IO tests one by one `io.test` doesn't cache results ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest New test results: @@ -56,7 +56,7 @@ Run a IO tests one by one `io.test.all` will run all matching tests except those in the `lib` namespace. ```ucm -.> io.test.all +scratch/main> io.test.all diff --git a/unison-src/transcripts/io.md b/unison-src/transcripts/io.md index 4caedaef05..0051c7aa69 100644 --- a/unison-src/transcripts/io.md +++ b/unison-src/transcripts/io.md @@ -1,10 +1,10 @@ # tests for built-in IO functions ```ucm:hide -.> builtins.merge -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.merge +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` Tests for IO builtins which wired to foreign haskell calls. @@ -17,7 +17,7 @@ TempDirs/autoCleaned is an ability/hanlder which allows you to easily create a scratch directory which will automatically get cleaned up. ```ucm:hide -.> add +scratch/main> add ``` ## Basic File Functions @@ -57,8 +57,8 @@ testCreateRename _ = ``` ```ucm -.> add -.> io.test testCreateRename +scratch/main> add +scratch/main> io.test testCreateRename ``` ### Opening / Closing files @@ -107,8 +107,8 @@ testOpenClose _ = ``` ```ucm -.> add -.> io.test testOpenClose +scratch/main> add +scratch/main> io.test testOpenClose ``` ### Reading files with getSomeBytes @@ -166,8 +166,8 @@ testGetSomeBytes _ = ``` ```ucm -.> add -.> io.test testGetSomeBytes +scratch/main> add +scratch/main> io.test testGetSomeBytes ``` ### Seeking in open files @@ -240,9 +240,9 @@ testAppend _ = ``` ```ucm -.> add -.> io.test testSeek -.> io.test testAppend +scratch/main> add +scratch/main> io.test testSeek +scratch/main> io.test testAppend ``` ### SystemTime @@ -257,8 +257,8 @@ testSystemTime _ = ``` ```ucm -.> add -.> io.test testSystemTime +scratch/main> add +scratch/main> io.test testSystemTime ``` ### Get temp directory @@ -274,8 +274,8 @@ testGetTempDirectory _ = ``` ```ucm -.> add -.> io.test testGetTempDirectory +scratch/main> add +scratch/main> io.test testGetTempDirectory ``` ### Get current directory @@ -291,8 +291,8 @@ testGetCurrentDirectory _ = ``` ```ucm -.> add -.> io.test testGetCurrentDirectory +scratch/main> add +scratch/main> io.test testGetCurrentDirectory ``` ### Get directory contents @@ -310,8 +310,8 @@ testDirContents _ = ``` ```ucm -.> add -.> io.test testDirContents +scratch/main> add +scratch/main> io.test testDirContents ``` ### Read environment variables @@ -328,8 +328,8 @@ testGetEnv _ = runTest test ``` ```ucm -.> add -.> io.test testGetEnv +scratch/main> add +scratch/main> io.test testGetEnv ``` ### Read command line args @@ -368,27 +368,27 @@ testGetArgs.runMeWithTwoArgs = 'let Test that they can be run with the right number of args. ```ucm -.> add -.> run runMeWithNoArgs -.> run runMeWithOneArg foo -.> run runMeWithTwoArgs foo bar +scratch/main> add +scratch/main> run runMeWithNoArgs +scratch/main> run runMeWithOneArg foo +scratch/main> run runMeWithTwoArgs foo bar ``` Calling our examples with the wrong number of args will error. ```ucm:error -.> run runMeWithNoArgs foo +scratch/main> run runMeWithNoArgs foo ``` ```ucm:error -.> run runMeWithOneArg +scratch/main> run runMeWithOneArg ``` ```ucm:error -.> run runMeWithOneArg foo bar +scratch/main> run runMeWithOneArg foo bar ``` ```ucm:error -.> run runMeWithTwoArgs +scratch/main> run runMeWithTwoArgs ``` ### Get the time zone @@ -401,8 +401,8 @@ testTimeZone = do ``` ```ucm -.> add -.> run testTimeZone +scratch/main> add +scratch/main> run testTimeZone ``` ### Get some random bytes @@ -417,6 +417,6 @@ testRandom = do ``` ```ucm -.> add -.> io.test testGetEnv +scratch/main> add +scratch/main> io.test testGetEnv ``` diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index 3a7d44d4db..469507a6da 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -59,13 +59,13 @@ testCreateRename _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testCreateRename : '{IO} [Result] -.> io.test testCreateRename +scratch/main> io.test testCreateRename New test results: @@ -141,13 +141,13 @@ testOpenClose _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testOpenClose : '{IO} [Result] -.> io.test testOpenClose +scratch/main> io.test testOpenClose New test results: @@ -231,13 +231,13 @@ testGetSomeBytes _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetSomeBytes : '{IO} [Result] -.> io.test testGetSomeBytes +scratch/main> io.test testGetSomeBytes New test results: @@ -339,14 +339,14 @@ testAppend _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testAppend : '{IO} [Result] testSeek : '{IO} [Result] -.> io.test testSeek +scratch/main> io.test testSeek New test results: @@ -362,7 +362,7 @@ testAppend _ = Tip: Use view testSeek to view the source of a test. -.> io.test testAppend +scratch/main> io.test testAppend New test results: @@ -398,13 +398,13 @@ testSystemTime _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testSystemTime : '{IO} [Result] -.> io.test testSystemTime +scratch/main> io.test testSystemTime New test results: @@ -428,13 +428,13 @@ testGetTempDirectory _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetTempDirectory : '{IO} [Result] -.> io.test testGetTempDirectory +scratch/main> io.test testGetTempDirectory New test results: @@ -460,13 +460,13 @@ testGetCurrentDirectory _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetCurrentDirectory : '{IO} [Result] -.> io.test testGetCurrentDirectory +scratch/main> io.test testGetCurrentDirectory New test results: @@ -494,13 +494,13 @@ testDirContents _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testDirContents : '{IO} [Result] -.> io.test testDirContents +scratch/main> io.test testDirContents New test results: @@ -527,13 +527,13 @@ testGetEnv _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetEnv : '{IO} [Result] -.> io.test testGetEnv +scratch/main> io.test testGetEnv New test results: @@ -581,7 +581,7 @@ testGetArgs.runMeWithTwoArgs = 'let Test that they can be run with the right number of args. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -590,15 +590,15 @@ Test that they can be run with the right number of args. testGetArgs.runMeWithOneArg : '{IO, Exception} () testGetArgs.runMeWithTwoArgs : '{IO, Exception} () -.> run runMeWithNoArgs +scratch/main> run runMeWithNoArgs () -.> run runMeWithOneArg foo +scratch/main> run runMeWithOneArg foo () -.> run runMeWithTwoArgs foo bar +scratch/main> run runMeWithTwoArgs foo bar () @@ -606,7 +606,7 @@ Test that they can be run with the right number of args. Calling our examples with the wrong number of args will error. ```ucm -.> run runMeWithNoArgs foo +scratch/main> run runMeWithNoArgs foo 💔💥 @@ -619,7 +619,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithOneArg +scratch/main> run runMeWithOneArg 💔💥 @@ -632,7 +632,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithOneArg foo bar +scratch/main> run runMeWithOneArg foo bar 💔💥 @@ -646,7 +646,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithTwoArgs +scratch/main> run runMeWithTwoArgs 💔💥 @@ -668,13 +668,13 @@ testTimeZone = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testTimeZone : '{IO} () -.> run testTimeZone +scratch/main> run testTimeZone () @@ -691,13 +691,13 @@ testRandom = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testRandom : '{IO} [Result] -.> io.test testGetEnv +scratch/main> io.test testGetEnv New test results: diff --git a/unison-src/transcripts/kind-inference.md b/unison-src/transcripts/kind-inference.md index f81a3bf95c..3af86ae854 100644 --- a/unison-src/transcripts/kind-inference.md +++ b/unison-src/transcripts/kind-inference.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ## A type param cannot have conflicting kind constraints within a single decl diff --git a/unison-src/transcripts/lambdacase.md b/unison-src/transcripts/lambdacase.md index e2e3a557ef..a4d1ba96f1 100644 --- a/unison-src/transcripts/lambdacase.md +++ b/unison-src/transcripts/lambdacase.md @@ -1,7 +1,7 @@ # Lambda case syntax ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This function takes a single argument and immediately pattern matches on it. As we'll see below, it can be written using `cases` syntax: @@ -13,7 +13,7 @@ isEmpty x = match x with ``` ```ucm:hide -.> add +scratch/main> add ``` Here's the same function written using `cases` syntax: @@ -27,7 +27,7 @@ isEmpty2 = cases Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ```ucm -.> view isEmpty +scratch/main> view isEmpty ``` it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -47,7 +47,7 @@ merge xs ys = match (xs, ys) with ``` ```ucm -.> add +scratch/main> add ``` And here's a version using `cases`. The patterns are separated by commas: @@ -65,7 +65,7 @@ merge2 = cases Notice that Unison detects this as an alias of `merge`, and if we view `merge` ```ucm -.> view merge +scratch/main> view merge ``` it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -101,8 +101,8 @@ merge3 = cases ``` ```ucm -.> add -.> view merge3 +scratch/main> add +scratch/main> view merge3 ``` This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index efb41cdce8..2e55001a98 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -46,7 +46,7 @@ isEmpty2 = cases Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ```ucm -.> view isEmpty +scratch/main> view isEmpty isEmpty : [t] -> Boolean isEmpty = cases @@ -71,7 +71,7 @@ merge xs ys = match (xs, ys) with ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -107,7 +107,7 @@ merge2 = cases Notice that Unison detects this as an alias of `merge`, and if we view `merge` ```ucm -.> view merge +scratch/main> view merge merge : [a] -> [a] -> [a] merge = cases @@ -194,13 +194,13 @@ merge3 = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: merge3 : [a] -> [a] -> [a] -.> view merge3 +scratch/main> view merge3 merge3 : [a] -> [a] -> [a] merge3 = cases diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.md b/unison-src/transcripts/ls-pretty-print-scope-bug.md index a8d4cf5ed4..af7ff0a0ea 100644 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.md +++ b/unison-src/transcripts/ls-pretty-print-scope-bug.md @@ -4,7 +4,7 @@ unique type Foo = Foo ```ucm .a.b> add -.> fork .a.b .c.d.f +scratch/main> fork .a.b .c.d.f .c.g.f> ``` @@ -31,14 +31,14 @@ At this point we have: `.c.g.f.Foo` which is distinct from the other `Foo` types ```ucm -.> delete .c.d.f.Foo +scratch/main> delete .c.d.f.Foo ``` Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `.>`, but an unnamed type when viewed from `.c>`, +when viewed from `scratch/main>`, but an unnamed type when viewed from `.c>`, since referencing `.a.b.Foo` would reference names outside of the namespace rooted at `.c`. ```ucm -.> ls c +scratch/main> ls c .c> ls ``` diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md index 567a176b64..5c0eab0b7b 100644 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md +++ b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md @@ -24,7 +24,7 @@ unique type Foo = Foo type Foo -.> fork .a.b .c.d.f +scratch/main> fork .a.b .c.d.f Done. @@ -87,27 +87,29 @@ At this point we have: `.c.g.f.Foo` which is distinct from the other `Foo` types ```ucm -.> delete .c.d.f.Foo +scratch/main> delete .c.d.f.Foo Done. ``` Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `.>`, but an unnamed type when viewed from `.c>`, +when viewed from `scratch/main>`, but an unnamed type when viewed from `.c>`, since referencing `.a.b.Foo` would reference names outside of the namespace rooted at `.c`. ```ucm -.> ls c +scratch/main> ls c - 1. d/ (1 term) - 2. foo (b.Foo) - 3. g/ (1 term, 1 type) + nothing to show -.c> ls +``` - 1. d/ (1 term) - 2. foo (#uj8oalgadr) - 3. g/ (1 term, 1 type) -``` + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + + + nothing to show + diff --git a/unison-src/transcripts/lsp-fold-ranges.md b/unison-src/transcripts/lsp-fold-ranges.md index 377c9170dd..20dddc3861 100644 --- a/unison-src/transcripts/lsp-fold-ranges.md +++ b/unison-src/transcripts/lsp-fold-ranges.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -29,5 +29,5 @@ test> z = let ``` ```ucm -.> debug.lsp.fold-ranges +scratch/main> debug.lsp.fold-ranges ``` diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index 51f8b4ae9e..2b76b3ff43 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -24,7 +24,7 @@ test> z = let ``` ```ucm -.> debug.lsp.fold-ranges +scratch/main> debug.lsp.fold-ranges 《{{ Type doc }}》 《structural type Optional a = diff --git a/unison-src/transcripts/merge.md b/unison-src/transcripts/merge.md index 1334df76d8..c9ccf0c623 100644 --- a/unison-src/transcripts/merge.md +++ b/unison-src/transcripts/merge.md @@ -48,7 +48,7 @@ project/alice> view foo bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Basic merge: two identical adds @@ -89,7 +89,7 @@ project/alice> view foo bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Simple update propagation @@ -142,7 +142,7 @@ project/alice> display bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Update propagation with common dependent @@ -208,7 +208,7 @@ project/alice> display foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Propagating an update to an update @@ -278,7 +278,7 @@ project/alice> display foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Update + delete isn't (currently) a conflict @@ -323,7 +323,7 @@ project/alice> view foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` In a future version, we'd like to give the user a warning at least. @@ -379,7 +379,7 @@ project/alice> view foo bar baz ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## No-op merge (Bob = Alice) @@ -397,7 +397,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## No-op merge (Bob < Alice) @@ -425,7 +425,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Fast-forward merge (Bob > Alice) @@ -453,7 +453,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: someone deleted something @@ -498,7 +498,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type error @@ -548,7 +548,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: simple term conflict @@ -613,7 +613,7 @@ project/merge-bob-into-alice> view bar baz ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: simple type conflict @@ -656,7 +656,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type-update + constructor-rename conflict @@ -699,7 +699,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: constructor-rename conflict @@ -737,7 +737,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: non-constructor/constructor conflict @@ -778,7 +778,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type/type conflict with term/constructor conflict @@ -829,7 +829,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` Here's a more involved example that demonstrates the same idea. @@ -902,7 +902,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge algorithm quirk: add/add unique types @@ -960,7 +960,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Conflict involving builtin @@ -1001,7 +1001,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Constructor alias @@ -1047,7 +1047,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Missing constructor name @@ -1094,7 +1094,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Nested decl alias @@ -1142,7 +1142,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Stray constructor alias @@ -1186,7 +1186,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Term or type in `lib` @@ -1227,7 +1227,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## LCA precondition violations @@ -1293,7 +1293,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Regression tests @@ -1338,7 +1338,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Delete a constructor diff --git a/unison-src/transcripts/mergeloop.md b/unison-src/transcripts/mergeloop.md index fd1b25fa8e..455e1ac783 100644 --- a/unison-src/transcripts/mergeloop.md +++ b/unison-src/transcripts/mergeloop.md @@ -43,9 +43,9 @@ b = 2 ```ucm .z> add -.> merge.old x y -.> merge.old y z -.> history z +scratch/main> merge.old x y +scratch/main> merge.old y z +scratch/main> history z ``` diff --git a/unison-src/transcripts/mergeloop.output.md b/unison-src/transcripts/mergeloop.output.md index faa084764b..566c1b1160 100644 --- a/unison-src/transcripts/mergeloop.output.md +++ b/unison-src/transcripts/mergeloop.output.md @@ -126,32 +126,25 @@ b = 2 a : ##Nat b : ##Nat -.> merge.old x y +scratch/main> merge.old x y - Nothing changed as a result of the merge. + ⚠️ + + The namespace x doesn't exist. - Applying changes from patch... +``` -.> merge.old y z +```ucm +.z> addscratch/main> merge.old x yscratch/main> merge.old y zscratch/main> history z +``` - Nothing changed as a result of the merge. - Applying changes from patch... +🛑 -.> history z +The transcript failed due to an error in the stanza above. The error is: - Note: The most recent namespace hash is immediately below this - message. - - - - This segment of history starts with a merge. Use - `history #som3n4m3space` to view history starting from a given - namespace hash. + + ⚠️ - ⊙ 1. #b7fr6ifj87 - ⑃ - 2. #9npggauqo9 - 3. #dm4u1eokg1 + The namespace x doesn't exist. -``` diff --git a/unison-src/transcripts/merges.md b/unison-src/transcripts/merges.md index 330e46857b..659c6059d2 100644 --- a/unison-src/transcripts/merges.md +++ b/unison-src/transcripts/merges.md @@ -11,13 +11,13 @@ x = 42 ``` ```ucm -.> add +scratch/main> add ``` Let's move `x` into a new namespace, `master`: ```ucm -.> rename.term x master.x +scratch/main> rename.term x master.x ``` If you want to do some experimental work in a namespace without disturbing anyone else, you can `fork` it (which is a shorthand for `copy.namespace`). This creates a copy of it, preserving its history. @@ -27,9 +27,9 @@ If you want to do some experimental work in a namespace without disturbing anyon Let's go ahead and do this: ``` -.> fork master feature1 -.> view master.x -.> view feature1.x +scratch/main> fork master feature1 +scratch/main> view master.x +scratch/main> view feature1.x ``` Great! We can now do some further work in the `feature1` branch, then merge it back into `master` when we're ready. @@ -52,9 +52,9 @@ We can also delete the fork if we're done with it. (Don't worry, even though the it's still in the `history` of the parent namespace and can be resurrected at any time.) ```ucm -.> delete.namespace feature1 -.> history .feature1 -.> history +scratch/main> delete.namespace feature1 +scratch/main> history .feature1 +scratch/main> history ``` To resurrect an old version of a namespace, you can learn its hash via the `history` command, then use `fork #namespacehash .newname`. @@ -68,7 +68,7 @@ In the above scenario the destination namespace (`master`) was strictly behind t Let's see how this works. We are going to create a copy of `master`, add and delete some definitions in `master` and in the fork, then merge. ```ucm -.> fork master feature2 +scratch/main> fork master feature2 ``` Here's one fork, we add `z` and delete `x`: @@ -90,29 +90,29 @@ master.frobnicate n = n + 1 ``` ```ucm -.> update -.> view master.y -.> view master.frobnicate +scratch/main> update +scratch/main> view master.y +scratch/main> view master.frobnicate ``` At this point, `master` and `feature2` both have some changes the other doesn't know about. Let's merge them. ```ucm -.> merge.old feature2 master +scratch/main> merge.old feature2 master ``` Notice that `x` is deleted in the merged branch (it was deleted in `feature2` and untouched by `master`): ```ucm:error -.> view master.x +scratch/main> view master.x ``` And notice that `y` has the most recent value, and that `z` and `frobnicate` both exist as well: ```ucm -.> view master.y -.> view master.z -.> view master.frobnicate +scratch/main> view master.y +scratch/main> view master.z +scratch/main> view master.frobnicate ``` ## FAQ diff --git a/unison-src/transcripts/merges.output.md b/unison-src/transcripts/merges.output.md index 8bfbb170fb..8b3694a569 100644 --- a/unison-src/transcripts/merges.output.md +++ b/unison-src/transcripts/merges.output.md @@ -20,17 +20,17 @@ x = 42 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: - x : Nat + x : ##Nat ``` Let's move `x` into a new namespace, `master`: ```ucm -.> rename.term x master.x +scratch/main> rename.term x master.x Done. @@ -41,10 +41,10 @@ If you want to do some experimental work in a namespace without disturbing anyon Let's go ahead and do this: -``` -.> fork master feature1 -.> view master.x -.> view feature1.x +```scratch +/main> fork master feature1 +scratch/main> view master.x +scratch/main> view feature1.x ``` @@ -64,7 +64,7 @@ y = "hello" ⍟ These new definitions are ok to `add`: - y : Text + y : ##Text ``` ```ucm @@ -106,207 +106,25 @@ We can also delete the fork if we're done with it. (Don't worry, even though the it's still in the `history` of the parent namespace and can be resurrected at any time.) ```ucm -.> delete.namespace feature1 - - Done. - -.> history .feature1 - - ☝️ The namespace .feature1 is empty. - -.> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #6j9omad7mv - - - Deletes: - - feature1.y - - ⊙ 2. #59u4sdgodu - - + Adds / updates: - - master.y - - = Copies: - - Original name New name(s) - feature1.y master.y - - ⊙ 3. #0je96at36h - - + Adds / updates: - - feature1.y - - ⊙ 4. #cnv4gjntbl - - > Moves: - - Original name New name - x master.x - - ⊙ 5. #tp0bn8ulih - - + Adds / updates: - - x - - □ 6. #cujaete914 (start of history) - -``` -To resurrect an old version of a namespace, you can learn its hash via the `history` command, then use `fork #namespacehash .newname`. - -## Concurrent edits and merges - -In the above scenario the destination namespace (`master`) was strictly behind the source namespace, so the merge didn't have anything interesting to do (Git would call this a "fast forward" merge). In other cases, the source and destination namespaces will each have changes the other doesn't know about, and the merge needs to something more interesting. That's okay too, and Unison will merge those results, using a 3-way merge algorithm. - -> __Note:__ When merging nested namespaces, Unison actually uses a recursive 3-way merge, so it finds a different (and possibly closer) common ancestor at each level of the tree. - -Let's see how this works. We are going to create a copy of `master`, add and delete some definitions in `master` and in the fork, then merge. - -```ucm -.> fork master feature2 - - Done. - -``` -Here's one fork, we add `z` and delete `x`: - -```unison -z = 99 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - z : Nat - -``` -```ucm -.feature2> add +scratch/main> delete.namespace feature1 - ⍟ I've added these definitions: - - z : Nat - -.feature2> delete.term.verbose x - - Removed definitions: - - 1. x : Nat + ⚠️ - Tip: You can use `undo` or `reflog` to undo this change. - -``` -And here's the other fork, where we update `y` and add a new definition, `frobnicate`: + The namespace feature1 doesn't exist. -```unison -master.y = "updated y" -master.frobnicate n = n + 1 ``` ```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - master.frobnicate : Nat -> Nat - master.y : Text - +scratch/main> delete.namespace feature1scratch/main> history .feature1scratch/main> history ``` -```ucm -.> update - - Okay, I'm searching the branch for code that needs to be - updated... - Done. - -.> view master.y - master.y : Text - master.y = "updated y" +🛑 -.> view master.frobnicate +The transcript failed due to an error in the stanza above. The error is: - master.frobnicate : Nat -> Nat - master.frobnicate n = - use Nat + - n + 1 - -``` -At this point, `master` and `feature2` both have some changes the other doesn't know about. Let's merge them. - -```ucm -.> merge.old feature2 master - - Here's what's changed in master after the merge: - - Added definitions: - - 1. z : Nat - - Removed definitions: - - 2. x : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` -Notice that `x` is deleted in the merged branch (it was deleted in `feature2` and untouched by `master`): - -```ucm -.> view master.x ⚠️ - The following names were not found in the codebase. Check your spelling. - master.x - -``` -And notice that `y` has the most recent value, and that `z` and `frobnicate` both exist as well: - -```ucm -.> view master.y - - master.y : Text - master.y = "updated y" - -.> view master.z - - master.z : Nat - master.z = 99 - -.> view master.frobnicate - - master.frobnicate : Nat -> Nat - master.frobnicate n = - use Nat + - n + 1 - -``` -## FAQ + The namespace feature1 doesn't exist. -* What happens if namespace1 deletes a name that namespace2 has updated? A: ??? -* ... diff --git a/unison-src/transcripts/move-all.md b/unison-src/transcripts/move-all.md index f3a4f5209c..bb1f01dda1 100644 --- a/unison-src/transcripts/move-all.md +++ b/unison-src/transcripts/move-all.md @@ -1,7 +1,7 @@ # Tests for `move` ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ## Happy Path - namespace, term, and type @@ -16,7 +16,7 @@ unique type Foo.T = T ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -25,16 +25,16 @@ unique type Foo.T = T1 | T2 ``` ```ucm -.> update +scratch/main> update ``` Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ```ucm -.> move Foo Bar -.> ls -.> ls Bar -.> history Bar +scratch/main> move Foo Bar +scratch/main> ls +scratch/main> ls Bar +scratch/main> history Bar ``` ## Happy Path - Just term @@ -67,5 +67,5 @@ bonk.zonk = 5 ## Sad Path - No term, type, or namespace named src ```ucm:error -.> move doesntexist foo +scratch/main> move doesntexist foo ``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index f5fefba061..9ec89be763 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -28,7 +28,7 @@ unique type Foo.T = T ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -60,7 +60,7 @@ unique type Foo.T = T1 | T2 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -71,25 +71,25 @@ unique type Foo.T = T1 | T2 Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ```ucm -.> move Foo Bar +scratch/main> move Foo Bar Done. -.> ls +scratch/main> ls 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) -.> ls Bar +scratch/main> ls Bar 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) -.> history Bar +scratch/main> history Bar Note: The most recent namespace hash is immediately below this message. @@ -200,7 +200,7 @@ bonk.zonk = 5 ## Sad Path - No term, type, or namespace named src ```ucm -.> move doesntexist foo +scratch/main> move doesntexist foo ⚠️ diff --git a/unison-src/transcripts/move-namespace.md b/unison-src/transcripts/move-namespace.md index 15c66f74c2..a3d859d9fb 100644 --- a/unison-src/transcripts/move-namespace.md +++ b/unison-src/transcripts/move-namespace.md @@ -103,30 +103,30 @@ I should be able to move the root into a sub-namespace ```ucm -- Should request confirmation -.> move.namespace . .root.at.path -.> move.namespace . .root.at.path -.> ls -.> history +scratch/main> move.namespace . .root.at.path +scratch/main> move.namespace . .root.at.path +scratch/main> ls +scratch/main> history ``` ```ucm -.> ls .root.at.path -.> history .root.at.path +scratch/main> ls .root.at.path +scratch/main> history .root.at.path ``` I should be able to move a sub namespace _over_ the root. ```ucm -- Should request confirmation -.> move.namespace .root.at.path.happy . -.> move.namespace .root.at.path.happy . -.> ls -.> history +scratch/main> move.namespace .root.at.path.happy . +scratch/main> move.namespace .root.at.path.happy . +scratch/main> ls +scratch/main> history ``` ```ucm:error -- should be empty -.> ls .root.at.path.happy -.> history .root.at.path.happy +scratch/main> ls .root.at.path.happy +scratch/main> history .root.at.path.happy ``` diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index 9b63baeb67..b044a08910 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -264,202 +264,32 @@ I should be able to move the root into a sub-namespace ```ucm -- Should request confirmation -.> move.namespace . .root.at.path +scratch/main> move.namespace . .root.at.path ⚠️ Moves which affect the root branch cannot be undone, are you sure? Re-run the same command to proceed. -.> move.namespace . .root.at.path +scratch/main> move.namespace . .root.at.path Done. -.> ls +scratch/main> ls - 1. root/ (1412 terms, 223 types) - -.> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #o7cku9c0t9 (start of history) - -``` -```ucm -.> ls .root.at.path - - 1. existing/ (470 terms, 74 types) - 2. happy/ (472 terms, 75 types) - 3. history/ (470 terms, 74 types) - -.> history .root.at.path - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #fv72cqfto4 - - - Deletes: - - existing.b.termInB - - > Moves: - - Original name New name - existing.a.termInA existing.b.termInA - - ⊙ 2. #12iqsb3l9g - - + Adds / updates: - - existing.a.termInA existing.b.termInB - - = Copies: - - Original name New name(s) - happy.b.termInA existing.a.termInA - history.b.termInA existing.a.termInA - - ⊙ 3. #r9jmgtco5u - - + Adds / updates: - - existing.a.termInA existing.b.termInB - - ⊙ 4. #1k6kae1vn4 - - > Moves: - - Original name New name - history.a.termInA history.b.termInA - - ⊙ 5. #ua9re7leg7 - - - Deletes: - - history.b.termInB - - ⊙ 6. #3k8ouql6cc - - + Adds / updates: - - history.a.termInA history.b.termInB - - = Copies: - - Original name New name(s) - happy.b.termInA history.a.termInA - - ⊙ 7. #fp2331i1ek - - + Adds / updates: - - history.a.termInA history.b.termInB - - ⊙ 8. #5sj5jefgcu - - > Moves: - - Original name New name - happy.a.T happy.b.T - happy.a.T.T1 happy.b.T.T1 - happy.a.T.T2 happy.b.T.T2 - happy.a.termInA happy.b.termInA - - ⊙ 9. #ell48pttus - - + Adds / updates: - - happy.a.T happy.a.T.T1 happy.a.T.T2 happy.a.termInA - - - Deletes: - - happy.a.T.T - - ⊙ 10. #al8eguoh70 - - + Adds / updates: - - happy.a.T happy.a.T.T happy.a.termInA - - There's more history before the versions shown here. Use - `history #som3n4m3space` to view history starting from a given - namespace hash. - - ⠇ - - ⊙ 11. #okceqk39nf - + nothing to show ``` -I should be able to move a sub namespace _over_ the root. ```ucm --- Should request confirmation -.> move.namespace .root.at.path.happy . - - ⚠️ - - Moves which affect the root branch cannot be undone, are you sure? - Re-run the same command to proceed. - -.> move.namespace .root.at.path.happy . - - Done. - -.> ls +-- Should request confirmationscratch/main> move.namespace . .root.at.pathscratch/main> move.namespace . .root.at.pathscratch/main> lsscratch/main> history +``` - 1. b/ (3 terms, 1 type) - 2. builtin/ (469 terms, 74 types) -.> history +🛑 - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #0rvi5q5une - - + Adds / updates: - - b.T b.T.T1 b.T.T2 b.termInA - - ⊙ 2. #oaa8ltdusf - - - Deletes: - - a.T a.T.T1 a.T.T2 a.termInA - - ⊙ 3. #t1c91ou7ri - - + Adds / updates: - - a.T a.T.T1 a.T.T2 a.termInA - - - Deletes: - - a.T.T - - ⊙ 4. #hovh08jep4 - - + Adds / updates: - - a.T a.T.T a.termInA - - □ 5. #4bigcpnl7t (start of history) +The transcript failed due to an error in the stanza above. The error is: -``` -```ucm --- should be empty -.> ls .root.at.path.happy nothing to show -.> history .root.at.path.happy - - ☝️ The namespace .root.at.path.happy is empty. - -``` diff --git a/unison-src/transcripts/name-segment-escape.md b/unison-src/transcripts/name-segment-escape.md index a782953188..bf6bca128d 100644 --- a/unison-src/transcripts/name-segment-escape.md +++ b/unison-src/transcripts/name-segment-escape.md @@ -1,8 +1,8 @@ You can use a keyword or reserved operator as a name segment if you surround it with backticks. ```ucm:error -.> view `match` -.> view `=` +scratch/main> view `match` +scratch/main> view `=` ``` You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` @@ -10,6 +10,6 @@ You can also use backticks to expand the set of valid symbols in a symboly name This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). ```ucm:error -.> view `.` -.> view `()` +scratch/main> view `.` +scratch/main> view `()` ``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 7eef020774..f324018ff7 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -1,14 +1,14 @@ You can use a keyword or reserved operator as a name segment if you surround it with backticks. ```ucm -.> view `match` +scratch/main> view `match` ⚠️ The following names were not found in the codebase. Check your spelling. `match` -.> view `=` +scratch/main> view `=` ⚠️ @@ -21,14 +21,14 @@ You can also use backticks to expand the set of valid symbols in a symboly name This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). ```ucm -.> view `.` +scratch/main> view `.` ⚠️ The following names were not found in the codebase. Check your spelling. `.` -.> view `()` +scratch/main> view `()` ⚠️ diff --git a/unison-src/transcripts/name-selection.md b/unison-src/transcripts/name-selection.md index 992ee79491..50830d71bc 100644 --- a/unison-src/transcripts/name-selection.md +++ b/unison-src/transcripts/name-selection.md @@ -27,8 +27,8 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: ``` -.> fork a a2 -.> fork a a3 +scratch/main> fork a a2 +scratch/main> fork a a3 ``` ```unison:hide @@ -59,7 +59,7 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but `a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments. ```ucm -.> view a b c d +scratch/main> view a b c d ``` ## Name biasing diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index e124c18a20..2aa57bf342 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -33,9 +33,9 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: -``` -.> fork a a2 -.> fork a a3 +```scratch +/main> fork a a2 +scratch/main> fork a a3 ``` @@ -104,114 +104,30 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but `a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments. ```ucm -.> view a b c d - - a.a : Nat - a.a = - use Nat + - b + 1 - - a.b : Nat - a.b = - use Nat + - 0 + 1 - - a2.c : Nat - a2.c = 1 - - a2.d : Nat - a2.d = - use Nat + - a2.c + 10 - - a3.c#dcgdua2lj6 : Nat - a3.c#dcgdua2lj6 = 2 - - a3.d#9ivhgvhthc : Nat - a3.d#9ivhgvhthc = - use Nat + - c#dcgdua2lj6 + 10 - -``` -## Name biasing - -```unison -deeply.nested.term = - a + 1 - -deeply.nested.num = 10 - -a = 10 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - a : Nat - deeply.nested.num : Nat - deeply.nested.term : Nat - -``` -```ucm -.biasing> add +scratch/main> view a b c d - ⍟ I've added these definitions: + ⚠️ - a : Nat - deeply.nested.num : Nat - deeply.nested.term : Nat - --- Despite being saved with name `a`, --- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'. --- It's closer to the term being printed. -.biasing> view deeply.nested.term - - deeply.nested.term : Nat - deeply.nested.term = - use Nat + - num + 1 + The following names were not found in the codebase. Check your spelling. + a + b + c + d ``` -Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` -```unison -other.num = 20 -``` -```ucm - Loading changes detected in scratch.u. +🛑 - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - other.num : Nat +The transcript failed due to an error in the stanza above. The error is: -``` -```ucm -.biasing> add - ⍟ I've added these definitions: + ⚠️ - other.num : Nat - --- nested.num should be preferred over the shorter name `a` due to biasing --- because `deeply.nested.num` is nearby to the term being viewed. -.biasing> view deeply.nested.term + The following names were not found in the codebase. Check your spelling. + a + b + c + d - deeply.nested.term : Nat - deeply.nested.term = - use Nat + - nested.num + 1 - -``` diff --git a/unison-src/transcripts/names.md b/unison-src/transcripts/names.md index 6d395266c4..6c93ea33ef 100644 --- a/unison-src/transcripts/names.md +++ b/unison-src/transcripts/names.md @@ -13,7 +13,7 @@ somewhere.y = 2 ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index 8138b5434d..75eff3c3a5 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -30,7 +30,7 @@ somewhere.y = 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -46,62 +46,31 @@ somewhere.y = 2 ```ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. -- But we don't see somewhere.z which is has the same value but is out of our namespace -.some> names x - - Terms - Hash: #gjmq673r1v - Names: otherplace.y place.x - - Hash: #pi25gcdv0o - Names: otherplace.x - - Tip: Use `names.global` to see more results. + ☝️ The namespace .some is empty. --- We can search by hash, and see all aliases of that hash -.some> names #gjmq673r1v +.some> names x - Term - Hash: #gjmq673r1v - Names: otherplace.y place.x + 😶 - Tip: Use `names.global` to see more results. - --- If the query is absolute, treat it as a `names.global` -.some> names .some.place.x - - Term - Hash: #gjmq673r1v - Names: .some.otherplace.y .some.place.x .somewhere.z + I couldn't find anything by that name. Tip: Use `names.global` to see more results. ``` -`names.global` searches from the root, and absolutely qualifies results - ```ucm --- We can search by suffix and find all definitions in the codebase named 'x', and each of their aliases respectively. -.some> names.global x +-- We can search by suffix and find all definitions named 'x', and each of their aliases respectively.-- But we don't see somewhere.z which is has the same value but is out of our namespace.some> names x-- We can search by hash, and see all aliases of that hash.some> names #gjmq673r1v-- If the query is absolute, treat it as a `names.global`.some> names .some.place.x +``` - Terms - Hash: #gjmq673r1v - Names: .some.otherplace.y .some.place.x .somewhere.z - - Hash: #pi25gcdv0o - Names: .some.otherplace.x --- We can search by hash, and see all aliases of that hash in the codebase -.some> names.global #gjmq673r1v +🛑 - Term - Hash: #gjmq673r1v - Names: .some.otherplace.y .some.place.x .somewhere.z +The transcript failed due to an error in the stanza above. The error is: --- We can search using an absolute name -.some> names.global .some.place.x - Term - Hash: #gjmq673r1v - Names: .some.otherplace.y .some.place.x .somewhere.z + 😶 + + I couldn't find anything by that name. + + Tip: Use `names.global` to see more results. -``` diff --git a/unison-src/transcripts/namespace-deletion-regression.md b/unison-src/transcripts/namespace-deletion-regression.md index d33a707100..f9d5fd7410 100644 --- a/unison-src/transcripts/namespace-deletion-regression.md +++ b/unison-src/transcripts/namespace-deletion-regression.md @@ -8,9 +8,9 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -.> alias.term ##Nat.+ .Nat.+ -.> ls Nat -.> move.namespace Nat Nat.operators -.> ls Nat -.> ls Nat.operators +scratch/main> alias.term ##Nat.+ .Nat.+ +scratch/main> ls Nat +scratch/main> move.namespace Nat Nat.operators +scratch/main> ls Nat +scratch/main> ls Nat.operators ``` diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index 45af1bfcb3..624501a17b 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -8,24 +8,25 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -.> alias.term ##Nat.+ .Nat.+ +scratch/main> alias.term ##Nat.+ .Nat.+ Done. -.> ls Nat +scratch/main> ls Nat - 1. + (##Nat -> ##Nat -> ##Nat) + nothing to show -.> move.namespace Nat Nat.operators +``` - Done. +```ucm +scratch/main> alias.term ##Nat.+ .Nat.+scratch/main> ls Natscratch/main> move.namespace Nat Nat.operatorsscratch/main> ls Natscratch/main> ls Nat.operators +``` -.> ls Nat - 1. operators/ (1 term) +🛑 -.> ls Nat.operators +The transcript failed due to an error in the stanza above. The error is: - 1. + (##Nat -> ##Nat -> ##Nat) -``` + nothing to show + diff --git a/unison-src/transcripts/old-fold-right.md b/unison-src/transcripts/old-fold-right.md index f3c01d5d01..179ad5b936 100644 --- a/unison-src/transcripts/old-fold-right.md +++ b/unison-src/transcripts/old-fold-right.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/pattern-match-coverage.md b/unison-src/transcripts/pattern-match-coverage.md index 8c35e07d55..e08ea269ab 100644 --- a/unison-src/transcripts/pattern-match-coverage.md +++ b/unison-src/transcripts/pattern-match-coverage.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` # Basics @@ -292,7 +292,7 @@ unit2t = cases ``` ```ucm -.> add +scratch/main> add ``` Pattern coverage checking needs the data decl map to contain all @@ -316,7 +316,7 @@ evil = bug "" ``` ```ucm -.> add +scratch/main> add ``` ```unison:error @@ -330,7 +330,7 @@ unique type SomeType = A ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 0a0b290c99..b8d30cb252 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -650,7 +650,7 @@ unit2t = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -706,7 +706,7 @@ evil = bug "" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -747,7 +747,7 @@ unique type SomeType = A ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/pattern-pretty-print-2345.md b/unison-src/transcripts/pattern-pretty-print-2345.md index 0879808f2d..8728aa4d83 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.md @@ -2,7 +2,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -65,21 +65,21 @@ doc = cases ``` ```ucm -.> add -.> view dopey -.> view grumpy -.> view happy -.> view sneezy -.> view bashful -.> view mouthy -.> view pokey -.> view sleepy -.> view demure -.> view angry -.> view tremulous -.> view throaty -.> view agitated -.> view doc +scratch/main> add +scratch/main> view dopey +scratch/main> view grumpy +scratch/main> view happy +scratch/main> view sneezy +scratch/main> view bashful +scratch/main> view mouthy +scratch/main> view pokey +scratch/main> view sleepy +scratch/main> view demure +scratch/main> view angry +scratch/main> view tremulous +scratch/main> view throaty +scratch/main> view agitated +scratch/main> view doc ``` diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index 6c239772d2..6157aa8e7f 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -88,7 +88,7 @@ doc = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -108,94 +108,94 @@ doc = cases throaty : Request {g, Ab} x -> () tremulous : (Nat, Nat) -> () -.> view dopey +scratch/main> view dopey dopey : Char -> () dopey = cases ?0 -> () _ -> () -.> view grumpy +scratch/main> view grumpy grumpy : ff284oqf651 -> () grumpy = cases d -> () -.> view happy +scratch/main> view happy happy : Boolean -> () happy = cases true -> () false -> () -.> view sneezy +scratch/main> view sneezy sneezy : Int -> () sneezy = cases +1 -> () _ -> () -.> view bashful +scratch/main> view bashful bashful : Optional a -> () bashful = cases Some a -> () _ -> () -.> view mouthy +scratch/main> view mouthy mouthy : [t] -> () mouthy = cases [] -> () _ -> () -.> view pokey +scratch/main> view pokey pokey : [t] -> () pokey = cases h +: t -> () _ -> () -.> view sleepy +scratch/main> view sleepy sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () -.> view demure +scratch/main> view demure demure : [Nat] -> () demure = cases [0] -> () _ -> () -.> view angry +scratch/main> view angry angry : [t] -> () angry = cases a ++ [] -> () -.> view tremulous +scratch/main> view tremulous tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () -.> view throaty +scratch/main> view throaty throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () -.> view agitated +scratch/main> view agitated agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () -.> view doc +scratch/main> view doc doc : Nat -> () doc = cases diff --git a/unison-src/transcripts/patternMatchTls.md b/unison-src/transcripts/patternMatchTls.md index cfe5b177cf..dbd8510716 100644 --- a/unison-src/transcripts/patternMatchTls.md +++ b/unison-src/transcripts/patternMatchTls.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` We had bugs in the calling conventions for both send and terminate which would @@ -29,6 +29,6 @@ assertRight = cases ```ucm -.> add -.> run frank +scratch/main> add +scratch/main> run frank ``` diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index b1f82833b5..65aa5153d6 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -37,14 +37,14 @@ assertRight = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: assertRight : Either a b -> b frank : '{IO} () -.> run frank +scratch/main> run frank () diff --git a/unison-src/transcripts/patterns.md b/unison-src/transcripts/patterns.md index 104d1bc8ae..8eb309ad75 100644 --- a/unison-src/transcripts/patterns.md +++ b/unison-src/transcripts/patterns.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some tests of pattern behavior. diff --git a/unison-src/transcripts/project-merge.md b/unison-src/transcripts/project-merge.md index d18fd89cfd..4d27e25931 100644 --- a/unison-src/transcripts/project-merge.md +++ b/unison-src/transcripts/project-merge.md @@ -1,7 +1,7 @@ # projects merge ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,8 +10,8 @@ zonk = 0 ```ucm .foo> add -.> project.create-empty foo -.> merge.old foo foo/main +scratch/main> project.create-empty foo +scratch/main> merge.old foo foo/main ``` ```unison @@ -23,7 +23,7 @@ foo/main> add ``` ```ucm -.> project.create-empty bar +scratch/main> project.create-empty bar bar/main> merge.old foo/main bar/main> branch /topic ``` diff --git a/unison-src/transcripts/project-merge.output.md b/unison-src/transcripts/project-merge.output.md index 98f20e79d7..16425c8b88 100644 --- a/unison-src/transcripts/project-merge.output.md +++ b/unison-src/transcripts/project-merge.output.md @@ -1,7 +1,7 @@ # projects merge ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -32,7 +32,7 @@ zonk = 0 zonk : ##Nat -.> project.create-empty foo +scratch/main> project.create-empty foo 🎉 I've created the project foo. @@ -48,146 +48,22 @@ zonk = 0 🎉 🥳 Happy coding! -.> merge.old foo foo/main +scratch/main> merge.old foo foo/main - Here's what's changed in foo/main after the merge: + ⚠️ - Added definitions: - - 1. zonk : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... + The namespace foo doesn't exist. ``` -```unison -bonk = 2 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - bonk : Nat - -``` -```ucm -foo/main> add - ⍟ I've added these definitions: - - bonk : ##Nat -``` -```ucm -.> project.create-empty bar - 🎉 I've created the project bar. +🛑 - 🎨 Type `ui` to explore this project's code in your browser. - 🔭 Discover libraries at https://share.unison-lang.org - 📖 Use `help-topic projects` to learn more about projects. - - Write your first Unison code with UCM: - - 1. Open scratch.u. - 2. Write some Unison code and save the file. - 3. In UCM, type `add` to save it to your new project. - - 🎉 🥳 Happy coding! +The transcript failed due to an error in the stanza above. The error is: -bar/main> merge.old foo/main - Here's what's changed in the current namespace after the - merge: + ⚠️ - Added definitions: - - 1. bonk : ##Nat - 2. zonk : ##Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -bar/main> branch /topic + The namespace foo doesn't exist. - Done. I've created the topic branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic`. - -``` -```unison -xonk = 1 -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - xonk : ##Nat - -``` -```ucm -bar/main> add - - ⍟ I've added these definitions: - - xonk : ##Nat - -bar/topic> merge.old /main - - Here's what's changed in the current namespace after the - merge: - - Added definitions: - - 1. xonk : ##Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - - ☝️ The namespace .bar is empty. - -.bar> merge.old foo/main - - Here's what's changed in the current namespace after the - merge: - - Added definitions: - - 1. bonk : ##Nat - 2. zonk : ##Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` diff --git a/unison-src/transcripts/propagate.md b/unison-src/transcripts/propagate.md index cc80ef885c..ea0e8d8b0f 100644 --- a/unison-src/transcripts/propagate.md +++ b/unison-src/transcripts/propagate.md @@ -84,7 +84,7 @@ type of `otherTerm` should remain the same. Cleaning up a bit... ```ucm -.> delete.namespace subpath +scratch/main> delete.namespace subpath .subpath.lib> builtins.merge ``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index 5f0b72bb35..db8dceb6d4 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -180,92 +180,25 @@ type of `otherTerm` should remain the same. Cleaning up a bit... ```ucm -.> delete.namespace subpath +scratch/main> delete.namespace subpath - Done. - - ☝️ The namespace .subpath.lib is empty. - -.subpath.lib> builtins.merge - - Done. - -``` -Now, we make two terms, where one depends on the other. - -```unison -one.someTerm : Optional foo -> Optional foo -one.someTerm x = x - -one.otherTerm : Optional baz -> Optional baz -one.otherTerm y = someTerm y -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: + ⚠️ - ⍟ These new definitions are ok to `add`: - - one.otherTerm : Optional baz -> Optional baz - one.someTerm : Optional foo -> Optional foo + The namespace subpath doesn't exist. ``` -We'll make two copies of this namespace. ```ucm -.subpath> add - - ⍟ I've added these definitions: - - one.otherTerm : Optional baz -> Optional baz - one.someTerm : Optional foo -> Optional foo - -.subpath> fork one two - - Done. - +scratch/main> delete.namespace subpath.subpath.lib> builtins.merge ``` -Now let's edit one of the terms... -```unison -someTerm : Optional x -> Optional x -someTerm _ = None -``` -```ucm +🛑 - Loading changes detected in scratch.u. +The transcript failed due to an error in the stanza above. The error is: - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - someTerm : Optional x -> Optional x -``` -... in one of the namespaces... - -```ucm -.subpath.one> update.old - - ⍟ I've updated these names to your new definition: + ⚠️ - someTerm : #nirp5os0q6 x -> #nirp5os0q6 x + The namespace subpath doesn't exist. -``` -The other namespace should be left alone. - -```ucm -.subpath> view two.someTerm - - two.someTerm : Optional foo -> Optional foo - two.someTerm x = x - -``` diff --git a/unison-src/transcripts/records.md b/unison-src/transcripts/records.md index 4a3d5d23d2..199218f3ea 100644 --- a/unison-src/transcripts/records.md +++ b/unison-src/transcripts/records.md @@ -1,8 +1,8 @@ Ensure that Records keep their syntax after being added to the codebase ```ucm:hide -.> builtins.merge -.> load unison-src/transcripts-using-base/base.u +scratch/main> builtins.merge +scratch/main> load unison-src/transcripts-using-base/base.u ``` ## Record with 1 field @@ -12,11 +12,11 @@ unique type Record1 = { a : Text } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record1 +scratch/main> view Record1 ``` ## Record with 2 fields @@ -26,11 +26,11 @@ unique type Record2 = { a : Text, b : Int } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record2 +scratch/main> view Record2 ``` ## Record with 3 fields @@ -40,11 +40,11 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record3 +scratch/main> view Record3 ``` ## Record with many fields @@ -62,11 +62,11 @@ unique type Record4 = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record4 +scratch/main> view Record4 ``` ## Record with many many fields @@ -98,11 +98,11 @@ unique type Record5 = { ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record5 +scratch/main> view Record5 ``` ## Record with user-defined type fields @@ -116,13 +116,13 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` ```ucm:hide -.> add +scratch/main> add ``` If you `view` or `edit` it, it _should_ be treated as a record type, but it does not (which is a bug) ```ucm -.> view RecordWithUserType +scratch/main> view RecordWithUserType ``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index 064e18c690..315bec4bb9 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -7,7 +7,7 @@ unique type Record1 = { a : Text } ``` ```ucm -.> view Record1 +scratch/main> view Record1 type Record1 = { a : Text } @@ -19,7 +19,7 @@ unique type Record2 = { a : Text, b : Int } ``` ```ucm -.> view Record2 +scratch/main> view Record2 type Record2 = { a : Text, b : Int } @@ -31,7 +31,7 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ```ucm -.> view Record3 +scratch/main> view Record3 type Record3 = { a : Text, b : Int, c : Nat } @@ -51,7 +51,7 @@ unique type Record4 = ``` ```ucm -.> view Record4 +scratch/main> view Record4 type Record4 = { a : Text, @@ -92,7 +92,7 @@ unique type Record5 = { ``` ```ucm -.> view Record5 +scratch/main> view Record5 type Record5 = { zero : Nat, @@ -131,7 +131,7 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } If you `view` or `edit` it, it _should_ be treated as a record type, but it does not (which is a bug) ```ucm -.> view RecordWithUserType +scratch/main> view RecordWithUserType type RecordWithUserType = { a : Text, b : Record4, c : UserType } diff --git a/unison-src/transcripts/reflog.md b/unison-src/transcripts/reflog.md index 202dc50820..47f8aa598d 100644 --- a/unison-src/transcripts/reflog.md +++ b/unison-src/transcripts/reflog.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First we make two changes to the codebase, so that there's more than one line @@ -9,23 +9,23 @@ for the `reflog` command to display: x = 1 ``` ```ucm -.> add +scratch/main> add ``` ```unison y = 2 ``` ```ucm -.> add -.> view y +scratch/main> add +scratch/main> view y ``` ```ucm -.> reflog +scratch/main> reflog ``` If we `reset-root` to its previous value, `y` disappears. ```ucm -.> reset-root 2 +scratch/main> reset-root 2 ``` ```ucm:error -.> view y +scratch/main> view y ``` diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 96e68114ff..75d0bb1eae 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -19,7 +19,7 @@ x = 1 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -44,36 +44,36 @@ y = 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: y : Nat -.> view y +scratch/main> view y y : Nat y = 2 ``` ```ucm -.> reflog +scratch/main> reflog Here is a log of the root namespace hashes, starting with the most recent, along with the command that got us there. Try: `fork 2 .old` - `fork #p611n6o5ve .old` to make an old namespace + `fork #86h1kthpsh .old` to make an old namespace accessible again, - `reset-root #p611n6o5ve` to reset the root namespace and + `reset-root #86h1kthpsh` to reset the root namespace and its history to that of the specified namespace. When Root Hash Action - 1. now #rmu2vgm86a add - 2. now #p611n6o5ve add - 3. now #4bigcpnl7t builtins.merge + 1. now #0de5f40rcr add + 2. now #86h1kthpsh add + 3. now #ei3jcs9f6v builtins.merge 4. #sg60bvjo91 history starts here Tip: Use `diff.namespace 1 7` to compare namespaces between @@ -82,13 +82,13 @@ y = 2 ``` If we `reset-root` to its previous value, `y` disappears. ```ucm -.> reset-root 2 +scratch/main> reset-root 2 Done. ``` ```ucm -.> view y +scratch/main> view y ⚠️ diff --git a/unison-src/transcripts/reset.md b/unison-src/transcripts/reset.md index a01351233d..f8d18e7822 100644 --- a/unison-src/transcripts/reset.md +++ b/unison-src/transcripts/reset.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` # reset loose code @@ -8,10 +8,10 @@ a = 5 ``` ```ucm -.> add -.> history -.> reset 2 -.> history +scratch/main> add +scratch/main> history +scratch/main> reset 2 +scratch/main> history ``` ```unison @@ -19,11 +19,11 @@ foo.a = 5 ``` ```ucm -.> add -.> ls foo -.> history -.> reset 1 foo -.> ls foo.foo +scratch/main> add +scratch/main> ls foo +scratch/main> history +scratch/main> reset 1 foo +scratch/main> ls foo.foo ``` # reset branch diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index 344b2c16f9..9be437365f 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -17,13 +17,13 @@ a = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: a : Nat -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -36,11 +36,11 @@ a = 5 □ 2. #4bigcpnl7t (start of history) -.> reset 2 +scratch/main> reset 2 Done. -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -68,17 +68,17 @@ foo.a = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo.a : Nat -.> ls foo +scratch/main> ls foo 1. a (Nat) -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -91,11 +91,11 @@ foo.a = 5 □ 2. #4bigcpnl7t (start of history) -.> reset 1 foo +scratch/main> reset 1 foo Done. -.> ls foo.foo +scratch/main> ls foo.foo 1. a (Nat) diff --git a/unison-src/transcripts/rsa.md b/unison-src/transcripts/rsa.md index 6b9ed33b53..6fe2118370 100644 --- a/unison-src/transcripts/rsa.md +++ b/unison-src/transcripts/rsa.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/scope-ref.md b/unison-src/transcripts/scope-ref.md index 67fcbc336b..1abf26be2f 100644 --- a/unison-src/transcripts/scope-ref.md +++ b/unison-src/transcripts/scope-ref.md @@ -2,7 +2,7 @@ A short script to test mutable references with local scope. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/squash.md b/unison-src/transcripts/squash.md index f3b010944a..93ccaed4f0 100644 --- a/unison-src/transcripts/squash.md +++ b/unison-src/transcripts/squash.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` # Squash merges @@ -10,8 +10,8 @@ Let's look at some examples. We'll start with a namespace with just the builtins. Let's take a look at the hash of this namespace: ```ucm -.> history builtin -.> fork builtin builtin2 +scratch/main> history builtin +scratch/main> fork builtin builtin2 ``` (We make a copy of `builtin` for use later in this transcript.) @@ -19,7 +19,7 @@ Let's look at some examples. We'll start with a namespace with just the builtins Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, then rename it back. Notice this produces multiple entries in the history: ```ucm -.> fork builtin mybuiltin +scratch/main> fork builtin mybuiltin .mybuiltin> rename.term Nat.+ Nat.frobnicate .mybuiltin> rename.term Nat.frobnicate Nat.+ .mybuiltin> history @@ -28,15 +28,15 @@ Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, th If we merge that back into `builtin`, we get that same chain of history: ```ucm -.> merge.old mybuiltin builtin -.> history builtin +scratch/main> merge.old mybuiltin builtin +scratch/main> history builtin ``` Let's try again, but using a `merge.squash` (or just `squash`) instead. The history will be unchanged: ```ucm -.> merge.old.squash mybuiltin builtin2 -.> history builtin2 +scratch/main> merge.old.squash mybuiltin builtin2 +scratch/main> history builtin2 ``` The churn that happened in `mybuiltin` namespace ended up back in the same spot, so the squash merge of that namespace with our original namespace had no effect. @@ -51,8 +51,8 @@ x = 1 ```ucm .trunk> add -.> fork trunk alice -.> fork trunk bob +scratch/main> fork trunk alice +scratch/main> fork trunk bob ``` Alice now does some hacking: @@ -84,34 +84,34 @@ no more = no more At this point, Alice and Bob both have some history beyond what's in trunk: ```ucm -.> history trunk -.> history alice -.> history bob +scratch/main> history trunk +scratch/main> history alice +scratch/main> history bob ``` Alice then squash merges into `trunk`, as does Bob. It's as if Alice and Bob both made their changes in one single commit. ```ucm -.> merge.old.squash alice trunk -.> history trunk -.> merge.old.squash bob trunk -.> history trunk +scratch/main> merge.old.squash alice trunk +scratch/main> history trunk +scratch/main> merge.old.squash bob trunk +scratch/main> history trunk ``` Since squash merges don't produce any merge nodes, we can `undo` a couple times to get back to our starting state: ```ucm -.> undo -.> undo -.> history trunk +scratch/main> undo +scratch/main> undo +scratch/main> history trunk ``` This time, we'll first squash Alice and Bob's changes together before squashing their combined changes into `trunk`. The resulting `trunk` will have just a single entry in it, combining both Alice and Bob's changes: ```ucm -.> merge.old.squash alice bob -.> merge.old.squash bob trunk -.> history trunk +scratch/main> merge.old.squash alice bob +scratch/main> merge.old.squash bob trunk +scratch/main> history trunk ``` So, there you have it. With squashing, you can control the granularity of your history. @@ -121,8 +121,8 @@ So, there you have it. With squashing, you can control the granularity of your h Another thing we can do is `squash` into an empty namespace. This effectively makes a copy of the namespace, but without any of its history: ```ucm -.> merge.old.squash alice nohistoryalice -.> history nohistoryalice +scratch/main> merge.old.squash alice nohistoryalice +scratch/main> history nohistoryalice ``` There's nothing really special here, `squash src dest` discards `src` history that comes after the LCA of `src` and `dest`, it's just that in the case of an empty namespace, that LCA is the beginning of time (the empty namespace), so all the history of `src` is discarded. diff --git a/unison-src/transcripts/squash.output.md b/unison-src/transcripts/squash.output.md index 3698fdfe6a..8c6752c311 100644 --- a/unison-src/transcripts/squash.output.md +++ b/unison-src/transcripts/squash.output.md @@ -6,7 +6,7 @@ Let's look at some examples. We'll start with a namespace with just the builtins. Let's take a look at the hash of this namespace: ```ucm -.> history builtin +scratch/main> history builtin Note: The most recent namespace hash is immediately below this message. @@ -15,7 +15,7 @@ Let's look at some examples. We'll start with a namespace with just the builtins □ 1. #i3vp9o9btm (start of history) -.> fork builtin builtin2 +scratch/main> fork builtin builtin2 Done. @@ -25,505 +25,31 @@ Let's look at some examples. We'll start with a namespace with just the builtins Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, then rename it back. Notice this produces multiple entries in the history: ```ucm -.> fork builtin mybuiltin +scratch/main> fork builtin mybuiltin Done. -.mybuiltin> rename.term Nat.+ Nat.frobnicate - - Done. - -.mybuiltin> rename.term Nat.frobnicate Nat.+ - - Done. - -.mybuiltin> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #tpkjb488ei - - > Moves: - - Original name New name - Nat.frobnicate Nat.+ - - ⊙ 2. #334ak3epqt - - > Moves: - - Original name New name - Nat.+ Nat.frobnicate - - □ 3. #i3vp9o9btm (start of history) - -``` -If we merge that back into `builtin`, we get that same chain of history: - -```ucm -.> merge.old mybuiltin builtin - - Nothing changed as a result of the merge. - - Applying changes from patch... - -.> history builtin - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #tpkjb488ei - - > Moves: - - Original name New name - Nat.frobnicate Nat.+ - - ⊙ 2. #334ak3epqt - - > Moves: - - Original name New name - Nat.+ Nat.frobnicate - - □ 3. #i3vp9o9btm (start of history) - -``` -Let's try again, but using a `merge.squash` (or just `squash`) instead. The history will be unchanged: - -```ucm -.> merge.old.squash mybuiltin builtin2 - - Nothing changed as a result of the merge. - - 😶 - - builtin2 was already up-to-date with mybuiltin. - -.> history builtin2 - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #i3vp9o9btm (start of history) - -``` -The churn that happened in `mybuiltin` namespace ended up back in the same spot, so the squash merge of that namespace with our original namespace had no effect. - -## Another example - -Let's look at a more interesting example, where the two namespaces have diverged a bit. Here's our starting namespace: - -```unison -x = 1 -``` - -```ucm - ☝️ The namespace .trunk is empty. - -.trunk> add - - ⍟ I've added these definitions: - - x : ##Nat - -.> fork trunk alice - - Done. - -.> fork trunk bob + ☝️ The namespace .mybuiltin is empty. - Done. - -``` -Alice now does some hacking: - -```unison -radNumber = 348 -bodaciousNumero = 2394 -neatoFun x = x -``` - -```ucm -.alice> add - - ⍟ I've added these definitions: - - bodaciousNumero : ##Nat - neatoFun : x -> x - radNumber : ##Nat - -.alice> rename.term radNumber superRadNumber - - Done. - -.alice> rename.term neatoFun productionReadyId - - Done. - -``` -Meanwhile, Bob does his own hacking: - -```unison -whatIsLove = "?" -babyDon'tHurtMe = ".. Don't hurt me..." -no more = no more -``` - -```ucm -.bob> add - - ⍟ I've added these definitions: - - babyDon'tHurtMe : ##Text - no : more -> r - whatIsLove : ##Text - -``` -At this point, Alice and Bob both have some history beyond what's in trunk: - -```ucm -.> history trunk - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #i52j9fd57b (start of history) - -.> history alice - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #e9jd55555o - - > Moves: - - Original name New name - neatoFun productionReadyId - - ⊙ 2. #l5ocoo2eac - - > Moves: - - Original name New name - radNumber superRadNumber - - ⊙ 3. #i1vq05628n - - + Adds / updates: - - bodaciousNumero neatoFun radNumber - - □ 4. #i52j9fd57b (start of history) - -.> history bob - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #brr4400742 - - + Adds / updates: - - babyDon'tHurtMe no whatIsLove - - □ 2. #i52j9fd57b (start of history) - -``` -Alice then squash merges into `trunk`, as does Bob. It's as if Alice and Bob both made their changes in one single commit. - -```ucm -.> merge.old.squash alice trunk - - Here's what's changed in trunk after the merge: - - Added definitions: - - 1. bodaciousNumero : Nat - 2. productionReadyId : x -> x - 3. superRadNumber : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> history trunk - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #f9lvm9gd2k - - + Adds / updates: - - bodaciousNumero productionReadyId superRadNumber - - □ 2. #i52j9fd57b (start of history) - -.> merge.old.squash bob trunk - - Here's what's changed in trunk after the merge: - - Added definitions: - - 1. babyDon'tHurtMe : Text - 2. no : more -> r - 3. whatIsLove : Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> history trunk - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #dbp78ts6q3 - - + Adds / updates: - - babyDon'tHurtMe no whatIsLove - - ⊙ 2. #f9lvm9gd2k - - + Adds / updates: - - bodaciousNumero productionReadyId superRadNumber - - □ 3. #i52j9fd57b (start of history) - -``` -Since squash merges don't produce any merge nodes, we can `undo` a couple times to get back to our starting state: - -```ucm -.> undo - - Here are the changes I undid - - Name changes: - - Original Changes - 1. bob.babyDon'tHurtMe 2. trunk.babyDon'tHurtMe (added) - - 3. bob.no 4. trunk.no (added) - - 5. bob.whatIsLove 6. trunk.whatIsLove (added) - -.> undo - - Here are the changes I undid - - Name changes: - - Original Changes - 1. alice.bodaciousNumero 2. trunk.bodaciousNumero (added) - - 3. alice.productionReadyId 4. trunk.productionReadyId (added) - - 5. alice.superRadNumber 6. trunk.superRadNumber (added) - -.> history trunk - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #i52j9fd57b (start of history) - -``` -This time, we'll first squash Alice and Bob's changes together before squashing their combined changes into `trunk`. The resulting `trunk` will have just a single entry in it, combining both Alice and Bob's changes: - -```ucm -.> merge.old.squash alice bob - - Here's what's changed in bob after the merge: - - Added definitions: - - 1. bodaciousNumero : Nat - 2. productionReadyId : x -> x - 3. superRadNumber : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> merge.old.squash bob trunk - - Here's what's changed in trunk after the merge: - - Added definitions: - - 1. babyDon'tHurtMe : Text - 2. bodaciousNumero : Nat - 3. no : more -> r - 4. productionReadyId : x -> x - 5. superRadNumber : Nat - 6. whatIsLove : Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> history trunk - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #qtotqgds4i - - + Adds / updates: - - babyDon'tHurtMe bodaciousNumero no productionReadyId - superRadNumber whatIsLove - - □ 2. #i52j9fd57b (start of history) - -``` -So, there you have it. With squashing, you can control the granularity of your history. - -## Throwing out all history - -Another thing we can do is `squash` into an empty namespace. This effectively makes a copy of the namespace, but without any of its history: - -```ucm -.> merge.old.squash alice nohistoryalice - - Here's what's changed in nohistoryalice after the merge: - - Added definitions: - - 1. bodaciousNumero : Nat - 2. productionReadyId : x -> x - 3. superRadNumber : Nat - 4. x : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.> history nohistoryalice +.mybuiltin> rename.term Nat.+ Nat.frobnicate - Note: The most recent namespace hash is immediately below this - message. - - + ⚠️ - □ 1. #1d9haupn3d (start of history) + I don't know about that term. ``` -There's nothing really special here, `squash src dest` discards `src` history that comes after the LCA of `src` and `dest`, it's just that in the case of an empty namespace, that LCA is the beginning of time (the empty namespace), so all the history of `src` is discarded. - -## Checking for handling of deletes - -This checks to see that squashing correctly preserves deletions: ```ucm - ☝️ The namespace .delete is empty. - -.delete> builtins.merge - - Done. - -.delete> fork builtin builtin2 - - Done. - -.delete> delete.term.verbose builtin2.Nat.+ - - Name changes: - - Original Changes - 1. builtin.Nat.+ ┐ 2. builtin2.Nat.+ (removed) - 3. builtin2.Nat.+ ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -.delete> delete.term.verbose builtin2.Nat.* - - Name changes: - - Original Changes - 1. builtin.Nat.* ┐ 2. builtin2.Nat.* (removed) - 3. builtin2.Nat.* ┘ - - Tip: You can use `undo` or `reflog` to undo this change. - -.delete> merge.old.squash builtin2 builtin - - Here's what's changed in builtin after the merge: - - Removed definitions: - - 1. Nat.* : Nat -> Nat -> Nat - 2. Nat.+ : Nat -> Nat -> Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.delete> history builtin - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #dv00hf6vmg - - - Deletes: - - Nat.* Nat.+ - - □ 2. #i3vp9o9btm (start of history) - +scratch/main> fork builtin mybuiltin.mybuiltin> rename.term Nat.+ Nat.frobnicate.mybuiltin> rename.term Nat.frobnicate Nat.+.mybuiltin> history ``` -Notice that `Nat.+` and `Nat.*` are deleted by the squash, and we see them deleted in one atomic step in the history. -Just confirming that those two definitions are in fact removed: -```ucm -.delete> view .delete.builtin.Nat.+ +🛑 - ⚠️ - - The following names were not found in the codebase. Check your spelling. - .delete.builtin.Nat.+ +The transcript failed due to an error in the stanza above. The error is: -``` -```ucm -.delete> view .delete.builtin.Nat.* ⚠️ - The following names were not found in the codebase. Check your spelling. - .delete.builtin.Nat.* - -``` -## Caveats + I don't know about that term. -If you `squash mystuff trunk`, you're discarding any history of `mystuff` and just cons'ing onto the history of `trunk`. Thus, don't expect to be able to `merge trunk mystuff later and get great results. Squashing should only be used when you don't care about the history (and you know others haven't pulled and built on your line of history being discarded, so they don't care about the history either). diff --git a/unison-src/transcripts/suffixes.md b/unison-src/transcripts/suffixes.md index 3a4c47933f..7245b4cb31 100644 --- a/unison-src/transcripts/suffixes.md +++ b/unison-src/transcripts/suffixes.md @@ -1,7 +1,7 @@ # Suffix-based resolution of names ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Any unique name suffix can be used to refer to a definition. For instance: @@ -20,15 +20,15 @@ optional.isNone = cases This also affects commands like find. Notice lack of qualified names in output: ```ucm -.> add -.> find take +scratch/main> add +scratch/main> find take ``` The `view` and `display` commands also benefit from this: ```ucm -.> view List.drop -.> display bar.a +scratch/main> view List.drop +scratch/main> display bar.a ``` In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. @@ -36,7 +36,7 @@ In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: ```ucm -.> find : Nat -> [a] -> [a] +scratch/main> find : Nat -> [a] -> [a] ``` ## Preferring names not in `lib.*.lib.*` @@ -51,7 +51,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> add +scratch/main> add ``` ```unison:error @@ -63,15 +63,15 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> view abra.cadabra -.> view baz.qux +scratch/main> view abra.cadabra +scratch/main> view baz.qux ``` Note that we can always still view indirect dependencies by using more name segments: ```ucm -.> view distributed.abra.cadabra -.> names distributed.lib.baz.qux +scratch/main> view distributed.abra.cadabra +scratch/main> names distributed.lib.baz.qux ``` ## Corner cases @@ -86,7 +86,7 @@ bar = 100 ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 21aeafa44e..411fdebba3 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -16,14 +16,14 @@ optional.isNone = cases This also affects commands like find. Notice lack of qualified names in output: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo.bar.a : Int optional.isNone : Optional a -> Boolean -.> find take +scratch/main> find take 1. builtin.Bytes.take : Nat -> Bytes -> Bytes 2. builtin.List.take : Nat -> [a] -> [a] @@ -36,11 +36,11 @@ This also affects commands like find. Notice lack of qualified names in output: The `view` and `display` commands also benefit from this: ```ucm -.> view List.drop +scratch/main> view List.drop builtin builtin.List.drop : builtin.Nat -> [a] -> [a] -.> display bar.a +scratch/main> display bar.a +99 @@ -50,7 +50,7 @@ In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: ```ucm -.> find : Nat -> [a] -> [a] +scratch/main> find : Nat -> [a] -> [a] 1. builtin.List.drop : Nat -> [a] -> [a] 2. builtin.List.take : Nat -> [a] -> [a] @@ -85,7 +85,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -138,7 +138,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> view abra.cadabra +scratch/main> view abra.cadabra cool.abra.cadabra : Text cool.abra.cadabra = "my project" @@ -146,7 +146,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" -.> view baz.qux +scratch/main> view baz.qux lib.distributed.baz.qux : Text lib.distributed.baz.qux = "direct dependency 2" @@ -155,12 +155,12 @@ lib.distributed.lib.baz.qux = "indirect dependency" Note that we can always still view indirect dependencies by using more name segments: ```ucm -.> view distributed.abra.cadabra +scratch/main> view distributed.abra.cadabra lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" -.> names distributed.lib.baz.qux +scratch/main> names distributed.lib.baz.qux Term Hash: #nhup096n2s @@ -181,7 +181,7 @@ bar = 100 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/switch-command.md b/unison-src/transcripts/switch-command.md index c1a2bca962..13e33c8583 100644 --- a/unison-src/transcripts/switch-command.md +++ b/unison-src/transcripts/switch-command.md @@ -22,8 +22,8 @@ the current project can be preceded by a forward slash (which makes it unambiguo forward slash (which makes it unambiguous). ```ucm -.> switch foo -.> switch foo/topic +scratch/main> switch foo +scratch/main> switch foo/topic foo/main> switch topic foo/main> switch /topic foo/main> switch bar/ @@ -38,11 +38,11 @@ foo/main> switch bar It's an error to try to switch to something that doesn't exist, of course. ```ucm:error -.> switch foo/no-such-branch +scratch/main> switch foo/no-such-branch ``` ```ucm:error -.> switch no-such-project +scratch/main> switch no-such-project ``` ```ucm:error diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index 2542da7b32..e84fefd0ab 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -46,9 +46,9 @@ the current project can be preceded by a forward slash (which makes it unambiguo forward slash (which makes it unambiguous). ```ucm -.> switch foo +scratch/main> switch foo -.> switch foo/topic +scratch/main> switch foo/topic foo/main> switch topic @@ -74,15 +74,16 @@ foo/main> switch bar It's an error to try to switch to something that doesn't exist, of course. ```ucm -.> switch foo/no-such-branch +scratch/main> switch foo/no-such-branch foo/no-such-branch does not exist. ``` ```ucm -.> switch no-such-project +scratch/main> switch no-such-project - no-such-project does not exist. + Neither project no-such-project nor branch /no-such-project + exists. ``` ```ucm diff --git a/unison-src/transcripts/tab-completion.md b/unison-src/transcripts/tab-completion.md index c35c4ba347..28ba55c8dd 100644 --- a/unison-src/transcripts/tab-completion.md +++ b/unison-src/transcripts/tab-completion.md @@ -5,8 +5,8 @@ Test that tab completion works as expected. ## Tab Complete Command Names ```ucm -.> debug.tab-complete vi -.> debug.tab-complete delete. +scratch/main> debug.tab-complete vi +scratch/main> debug.tab-complete delete. ``` ## Tab complete terms & types @@ -21,21 +21,21 @@ unique type subnamespace.AType = A | B ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -- Should tab complete namespaces since they may contain terms/types -.> debug.tab-complete view sub +scratch/main> debug.tab-complete view sub -- Should not complete things from child namespaces of the current query if there are other completions at this level -.> debug.tab-complete view subnamespace +scratch/main> debug.tab-complete view subnamespace -- Should complete things from child namespaces of the current query if it's dot-suffixed -.> debug.tab-complete view subnamespace. +scratch/main> debug.tab-complete view subnamespace. -- Should complete things from child namespaces of the current query if there are no more completions at this level. -.> debug.tab-complete view subnamespace2 +scratch/main> debug.tab-complete view subnamespace2 -- Should prefix-filter by query suffix -.> debug.tab-complete view subnamespace.some -.> debug.tab-complete view subnamespace.someOther +scratch/main> debug.tab-complete view subnamespace.some +scratch/main> debug.tab-complete view subnamespace.someOther -- Should tab complete absolute names .othernamespace> debug.tab-complete view .subnamespace.some ``` @@ -44,12 +44,12 @@ unique type subnamespace.AType = A | B ```ucm -- Should tab complete namespaces -.> debug.tab-complete find-in sub -.> debug.tab-complete find-in subnamespace -.> debug.tab-complete find-in subnamespace. -.> debug.tab-complete io.test sub -.> debug.tab-complete io.test subnamespace -.> debug.tab-complete io.test subnamespace. +scratch/main> debug.tab-complete find-in sub +scratch/main> debug.tab-complete find-in subnamespace +scratch/main> debug.tab-complete find-in subnamespace. +scratch/main> debug.tab-complete io.test sub +scratch/main> debug.tab-complete io.test subnamespace +scratch/main> debug.tab-complete io.test subnamespace. ``` Tab Complete Delete Subcommands @@ -61,9 +61,9 @@ add b = b ``` ```ucm -.> update.old -.> debug.tab-complete delete.type Foo -.> debug.tab-complete delete.term add +scratch/main> update.old +scratch/main> debug.tab-complete delete.type Foo +scratch/main> debug.tab-complete delete.term add ``` ## Tab complete projects and branches diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 82961cfd5c..3537f7e16d 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -5,12 +5,12 @@ Test that tab completion works as expected. ## Tab Complete Command Names ```ucm -.> debug.tab-complete vi +scratch/main> debug.tab-complete vi view view.global -.> debug.tab-complete delete. +scratch/main> debug.tab-complete delete. delete.branch delete.namespace @@ -53,19 +53,19 @@ unique type subnamespace.AType = A | B ``` ```ucm -- Should tab complete namespaces since they may contain terms/types -.> debug.tab-complete view sub +scratch/main> debug.tab-complete view sub subnamespace. subnamespace2. -- Should not complete things from child namespaces of the current query if there are other completions at this level -.> debug.tab-complete view subnamespace +scratch/main> debug.tab-complete view subnamespace subnamespace. subnamespace2. -- Should complete things from child namespaces of the current query if it's dot-suffixed -.> debug.tab-complete view subnamespace. +scratch/main> debug.tab-complete view subnamespace. * subnamespace.AType subnamespace.AType. @@ -73,57 +73,58 @@ unique type subnamespace.AType = A | B * subnamespace.someOtherName -- Should complete things from child namespaces of the current query if there are no more completions at this level. -.> debug.tab-complete view subnamespace2 +scratch/main> debug.tab-complete view subnamespace2 subnamespace2. * subnamespace2.thing -- Should prefix-filter by query suffix -.> debug.tab-complete view subnamespace.some +scratch/main> debug.tab-complete view subnamespace.some * subnamespace.someName * subnamespace.someOtherName -.> debug.tab-complete view subnamespace.someOther +scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName -- Should tab complete absolute names + ☝️ The namespace .othernamespace is empty. + .othernamespace> debug.tab-complete view .subnamespace.some - * .subnamespace.someName - * .subnamespace.someOtherName + ``` ## Tab complete namespaces ```ucm -- Should tab complete namespaces -.> debug.tab-complete find-in sub +scratch/main> debug.tab-complete find-in sub subnamespace subnamespace2 -.> debug.tab-complete find-in subnamespace +scratch/main> debug.tab-complete find-in subnamespace subnamespace subnamespace2 -.> debug.tab-complete find-in subnamespace. +scratch/main> debug.tab-complete find-in subnamespace. subnamespace.AType -.> debug.tab-complete io.test sub +scratch/main> debug.tab-complete io.test sub subnamespace. subnamespace2. -.> debug.tab-complete io.test subnamespace +scratch/main> debug.tab-complete io.test subnamespace subnamespace. subnamespace2. -.> debug.tab-complete io.test subnamespace. +scratch/main> debug.tab-complete io.test subnamespace. subnamespace.AType. * subnamespace.someName @@ -153,19 +154,19 @@ add b = b ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've added these definitions: type Foo add : a -> a -.> debug.tab-complete delete.type Foo +scratch/main> debug.tab-complete delete.type Foo * Foo Foo. -.> debug.tab-complete delete.term add +scratch/main> debug.tab-complete delete.term add * add diff --git a/unison-src/transcripts/test-command.md b/unison-src/transcripts/test-command.md index 2f95c846b7..f4c80cb840 100644 --- a/unison-src/transcripts/test-command.md +++ b/unison-src/transcripts/test-command.md @@ -1,7 +1,7 @@ Merge builtins so we get enough names for the testing stuff. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` The `test` command should run all of the tests in the current directory. @@ -15,17 +15,17 @@ foo.test2 = [Ok "test2"] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` Tests should be cached if unchanged. ```ucm -.> test +scratch/main> test ``` `test` won't descend into the `lib` namespace, but `test.all` will. @@ -40,8 +40,8 @@ testInLib = [Ok "testInLib"] ``` ```ucm -.> test -.> test.all +scratch/main> test +scratch/main> test.all ``` `test` WILL run tests within `lib` if ucm is cd'd inside. @@ -53,5 +53,5 @@ testInLib = [Ok "testInLib"] `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. ```ucm -.> test foo +scratch/main> test foo ``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index a59faee54c..b7c3eaa535 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -25,7 +25,7 @@ foo.test2 = [Ok "test2"] ``` ```ucm -.> test +scratch/main> test ✅ @@ -50,7 +50,7 @@ foo.test2 = [Ok "test2"] Tests should be cached if unchanged. ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) @@ -83,7 +83,7 @@ testInLib = [Ok "testInLib"] ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) @@ -94,29 +94,16 @@ testInLib = [Ok "testInLib"] Tip: Use view foo.test2 to view the source of a test. -.> test.all +scratch/main> test.all - - Cached test results (`help testcache` to learn more) - - ◉ foo.test2 test2 - ◉ test1 test1 - - ✅ 2 test(s) passing - - ✅ - - - - - - New test results: + Cached test results (`help testcache` to learn more) - ◉ lib.testInLib testInLib + ◉ foo.test2 test2 + ◉ test1 test1 - ✅ 1 test(s) passing + ✅ 2 test(s) passing - Tip: Use view lib.testInLib to view the source of a test. + Tip: Use view foo.test2 to view the source of a test. ``` `test` WILL run tests within `lib` if ucm is cd'd inside. @@ -124,7 +111,13 @@ testInLib = [Ok "testInLib"] ```ucm .lib> test - Cached test results (`help testcache` to learn more) + ✅ + + + + + + New test results: ◉ testInLib testInLib @@ -136,7 +129,7 @@ testInLib = [Ok "testInLib"] `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. ```ucm -.> test foo +scratch/main> test foo Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts/text-literals.md b/unison-src/transcripts/text-literals.md index 06898d1452..3d3b1359aa 100644 --- a/unison-src/transcripts/text-literals.md +++ b/unison-src/transcripts/text-literals.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This transcript shows some syntax for raw text literals. @@ -37,6 +37,6 @@ lit2 = """" ``` ```ucm -.> add -.> view lit1 lit2 +scratch/main> add +scratch/main> view lit1 lit2 ``` \ No newline at end of file diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index efb094d98c..1889ec8e78 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -87,14 +87,14 @@ lit2 = """" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: lit1 : Text lit2 : Text -.> view lit1 lit2 +scratch/main> view lit1 lit2 lit1 : Text lit1 = diff --git a/unison-src/transcripts/todo-bug-builtins.md b/unison-src/transcripts/todo-bug-builtins.md index c7d88fb784..e472204d4c 100644 --- a/unison-src/transcripts/todo-bug-builtins.md +++ b/unison-src/transcripts/todo-bug-builtins.md @@ -1,7 +1,7 @@ # The `todo` and `bug` builtin ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` `todo` and `bug` have type `a -> b`. They take a message or a value of type `a` and crash during runtime displaying `a` in ucm. diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index 7f3affeb12..9f47cc290e 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -19,9 +19,9 @@ baz = foo.bar + foo.bar I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: - + baz : Nat foo.bar : Nat @@ -30,7 +30,7 @@ baz = foo.bar + foo.bar project/main> add ⍟ I've added these definitions: - + baz : Nat foo.bar : Nat @@ -39,17 +39,17 @@ project/main> delete.namespace.force foo Done. ⚠️ - + Of the things I deleted, the following are still used in the following definitions. They now contain un-named references. - + Dependency Referenced In bar 1. baz project/main> todo These terms do not have any names in the current namespace: - + 1. #1jujb8oelv ``` diff --git a/unison-src/transcripts/top-level-exceptions.md b/unison-src/transcripts/top-level-exceptions.md index 8749984744..4caf9d717c 100644 --- a/unison-src/transcripts/top-level-exceptions.md +++ b/unison-src/transcripts/top-level-exceptions.md @@ -2,13 +2,13 @@ A simple transcript to test the use of exceptions that bubble to the top level. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` FYI, here are the `Exception` and `Failure` types: ```ucm -.> view Exception Failure +scratch/main> view Exception Failure ``` Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: @@ -24,9 +24,9 @@ mytest _ = [Ok "Great"] ``` ```ucm -.> run main -.> add -.> io.test mytest +scratch/main> run main +scratch/main> add +scratch/main> io.test mytest ``` Now a test to show the handling of uncaught exceptions: @@ -42,5 +42,5 @@ unique type RuntimeError = ``` ```ucm:error -.> run main2 +scratch/main> run main2 ``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 745e94c657..d06445332b 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -4,7 +4,7 @@ A simple transcript to test the use of exceptions that bubble to the top level. FYI, here are the `Exception` and `Failure` types: ```ucm -.> view Exception Failure +scratch/main> view Exception Failure structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x @@ -40,18 +40,18 @@ mytest _ = [Ok "Great"] ``` ```ucm -.> run main +scratch/main> run main () -.> add +scratch/main> add ⍟ I've added these definitions: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] -.> io.test mytest +scratch/main> io.test mytest New test results: @@ -90,7 +90,7 @@ unique type RuntimeError = ``` ```ucm -.> run main2 +scratch/main> run main2 💔💥 diff --git a/unison-src/transcripts/type-deps.md b/unison-src/transcripts/type-deps.md index 142265c786..e63b539d50 100644 --- a/unison-src/transcripts/type-deps.md +++ b/unison-src/transcripts/type-deps.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/pull/2821 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` @@ -14,7 +14,7 @@ structural type Y = Y ``` ```ucm:hide -.> add +scratch/main> add ``` Now, we update `Y`, and add a new type `Z` which depends on it. @@ -26,7 +26,7 @@ structural type Y = Y Nat Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. ```ucm:error -.> add +scratch/main> add -- This shouldn't exist, because it should've been blocked. -.> view Z +scratch/main> view Z ``` diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index b3a18e310d..ad1205e1ef 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -36,7 +36,7 @@ structural type Y = Y Nat ``` Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. ```ucm -.> add +scratch/main> add x These definitions failed: @@ -47,7 +47,7 @@ Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked Tip: Use `help filestatus` to learn more. -- This shouldn't exist, because it should've been blocked. -.> view Z +scratch/main> view Z ⚠️ diff --git a/unison-src/transcripts/type-modifier-are-optional.md b/unison-src/transcripts/type-modifier-are-optional.md index abce0ad0b8..f0a13f59ea 100644 --- a/unison-src/transcripts/type-modifier-are-optional.md +++ b/unison-src/transcripts/type-modifier-are-optional.md @@ -1,7 +1,7 @@ # Type modifiers are optional, `unique` is the default. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. diff --git a/unison-src/transcripts/unique-type-churn.md b/unison-src/transcripts/unique-type-churn.md index 904e1c480c..d35b2fa09a 100644 --- a/unison-src/transcripts/unique-type-churn.md +++ b/unison-src/transcripts/unique-type-churn.md @@ -9,7 +9,7 @@ unique type C = C B ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,7 +22,7 @@ unique type C = C B If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ```ucm -.> names A +scratch/main> names A ``` ```unison @@ -30,8 +30,8 @@ unique type A = A () ``` ```ucm -.> update -.> names A +scratch/main> update +scratch/main> names A ``` ```unison @@ -41,6 +41,6 @@ unique type A = A Note that `A` is back to its original hash. ```ucm -.> update -.> names A +scratch/main> update +scratch/main> names A ``` diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index bcee03f59e..74076d8c6d 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -24,7 +24,7 @@ unique type C = C B ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ unique type C = C B If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ```ucm -.> names A +scratch/main> names A Type Hash: #uj8oalgadr @@ -83,14 +83,14 @@ unique type A = A () ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names A +scratch/main> names A Type Hash: #ufo5tuc7ho @@ -124,14 +124,14 @@ unique type A = A Note that `A` is back to its original hash. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names A +scratch/main> names A Type Hash: #uj8oalgadr diff --git a/unison-src/transcripts/unitnamespace.md b/unison-src/transcripts/unitnamespace.md index 0f6838dae5..41884f13c4 100644 --- a/unison-src/transcripts/unitnamespace.md +++ b/unison-src/transcripts/unitnamespace.md @@ -4,7 +4,7 @@ foo = "bar" ```ucm .`()`> add -.> find -.> find-in `()` -.> delete.namespace `()` +scratch/main> find +scratch/main> find-in `()` +scratch/main> delete.namespace `()` ``` diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 9e18ea08ef..1b5ee1893b 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -24,18 +24,38 @@ foo = "bar" foo : ##Text -.> find +scratch/main> find - 1. `()`.foo : ##Text + ☝️ + I couldn't find matches in this namespace, searching in + 'lib'... -.> find-in `()` - - 1. foo : ##Text + 😶 + No results. Check your spelling, or try using tab completion + to supply command arguments. + + `find.global` can be used to search outside the current + namespace. -.> delete.namespace `()` - - Done. +``` +```ucm +.`()`> addscratch/main> findscratch/main> find-in `()`scratch/main> delete.namespace `()` ``` + + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + + + 😶 + + No results. Check your spelling, or try using tab completion + to supply command arguments. + + `find.global` can be used to search outside the current + namespace. + diff --git a/unison-src/transcripts/universal-cmp.md b/unison-src/transcripts/universal-cmp.md index 2364cb39c2..7e41982e99 100644 --- a/unison-src/transcripts/universal-cmp.md +++ b/unison-src/transcripts/universal-cmp.md @@ -3,7 +3,7 @@ File for test cases making sure that universal equality/comparison cases exist for built-in types. Just making sure they don't crash. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -16,8 +16,8 @@ threadEyeDeez _ = ``` ```ucm -.> add -.> run threadEyeDeez +scratch/main> add +scratch/main> run threadEyeDeez ``` ```unison diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index ec03128e87..b1f07fddf2 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -26,14 +26,14 @@ threadEyeDeez _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) -.> run threadEyeDeez +scratch/main> run threadEyeDeez (false, true) diff --git a/unison-src/transcripts/unsafe-coerce.md b/unison-src/transcripts/unsafe-coerce.md index ab3c38481e..9b483f9bbf 100644 --- a/unison-src/transcripts/unsafe-coerce.md +++ b/unison-src/transcripts/unsafe-coerce.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,7 +17,7 @@ main _ = ``` ```ucm -.> find unsafe.coerceAbilities -.> add -.> io.test main +scratch/main> find unsafe.coerceAbilities +scratch/main> add +scratch/main> io.test main ``` diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index 8736e6e9cd..9456c08268 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -28,12 +28,12 @@ main _ = ``` ```ucm -.> find unsafe.coerceAbilities +scratch/main> find unsafe.coerceAbilities 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b -.> add +scratch/main> add ⍟ I've added these definitions: @@ -41,7 +41,7 @@ main _ = fc : '{IO, Exception} Nat main : '{IO, Exception} [Result] -.> io.test main +scratch/main> io.test main New test results: diff --git a/unison-src/transcripts/update-ignores-lib-namespace.md b/unison-src/transcripts/update-ignores-lib-namespace.md index 04498e48ab..2db633f143 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.md @@ -3,7 +3,7 @@ the project organization convention that dependencies are put in "lib"; it's muc one's own code if the "lib" namespace is simply ignored. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ lib.foo = 100 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 200 ``` ```ucm -.> update -.> names foo +scratch/main> update +scratch/main> names foo ``` diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index 5711f81a81..e7026d6f3b 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -22,7 +22,7 @@ lib.foo = 100 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = 200 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names foo +scratch/main> names foo Term Hash: #9ntnotdp87 diff --git a/unison-src/transcripts/update-on-conflict.md b/unison-src/transcripts/update-on-conflict.md index 21b9a656cb..51dfd75e28 100644 --- a/unison-src/transcripts/update-on-conflict.md +++ b/unison-src/transcripts/update-on-conflict.md @@ -1,7 +1,7 @@ # Update on conflict ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge .merged> builtins.merge ``` @@ -12,7 +12,7 @@ b.x = 2 Cause a conflict: ```ucm -.> add +scratch/main> add .merged> merge.old .a .merged> merge.old .b ``` diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 6a9afd2e93..67f7c5f597 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -21,7 +21,7 @@ b.x = 2 ``` Cause a conflict: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -30,66 +30,23 @@ Cause a conflict: .merged> merge.old .a - Here's what's changed in the current namespace after the - merge: + ⚠️ - Added definitions: - - 1. x : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -.merged> merge.old .b - - Here's what's changed in the current namespace after the - merge: - - New name conflicts: - - 1. x#gjmq673r1v : Nat - ↓ - 2. ┌ x#dcgdua2lj6 : Nat - 3. └ x#gjmq673r1v : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... + The namespace .a doesn't exist. ``` -Updating conflicted definitions works fine. - -```unison -x = 3 -``` ```ucm +scratch/main> add.merged> merge.old .a.merged> merge.old .b +``` - Loading changes detected in scratch.u. - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These names already exist. You can `update` them to your - new definition: - - x : Nat +🛑 -``` -```ucm -.merged> update +The transcript failed due to an error in the stanza above. The error is: - Okay, I'm searching the branch for code that needs to be - updated... - Done. + ⚠️ + + The namespace .a doesn't exist. -``` diff --git a/unison-src/transcripts/update-term-aliases-in-different-ways.md b/unison-src/transcripts/update-term-aliases-in-different-ways.md index fd8a8816c0..e99deb63be 100644 --- a/unison-src/transcripts/update-term-aliases-in-different-ways.md +++ b/unison-src/transcripts/update-term-aliases-in-different-ways.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -23,6 +23,6 @@ bar = 7 ``` ```ucm -.> update -.> view foo bar +scratch/main> update +scratch/main> view foo bar ``` diff --git a/unison-src/transcripts/update-term-aliases-in-different-ways.output.md b/unison-src/transcripts/update-term-aliases-in-different-ways.output.md index 2d7960976a..10e8303cab 100644 --- a/unison-src/transcripts/update-term-aliases-in-different-ways.output.md +++ b/unison-src/transcripts/update-term-aliases-in-different-ways.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -61,14 +61,14 @@ bar = 7 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo bar +scratch/main> view foo bar bar : Nat bar = 7 diff --git a/unison-src/transcripts/update-term-to-different-type.md b/unison-src/transcripts/update-term-to-different-type.md index 3fa5a735f9..31859e3a13 100644 --- a/unison-src/transcripts/update-term-to-different-type.md +++ b/unison-src/transcripts/update-term-to-different-type.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,6 +17,6 @@ foo = +5 ``` ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-term-to-different-type.output.md b/unison-src/transcripts/update-term-to-different-type.output.md index 7f6bf57ccf..b1cad29f4a 100644 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ b/unison-src/transcripts/update-term-to-different-type.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -23,7 +23,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = +5 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Int foo = +5 diff --git a/unison-src/transcripts/update-term-with-alias.md b/unison-src/transcripts/update-term-with-alias.md index b3c5e9e791..e45eb8b768 100644 --- a/unison-src/transcripts/update-term-with-alias.md +++ b/unison-src/transcripts/update-term-with-alias.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 6 ``` ```ucm -.> update -.> view foo bar +scratch/main> update +scratch/main> view foo bar ``` diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index abf21943aa..785a5e0d6e 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -56,14 +56,14 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo bar +scratch/main> view foo bar bar : Nat bar = 5 diff --git a/unison-src/transcripts/update-term-with-dependent-to-different-type.md b/unison-src/transcripts/update-term-with-dependent-to-different-type.md index c9d6388dc3..b7bd1196ae 100644 --- a/unison-src/transcripts/update-term-with-dependent-to-different-type.md +++ b/unison-src/transcripts/update-term-with-dependent-to-different-type.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,5 +20,5 @@ foo = +5 ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md b/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md index 1a62cebf4a..c2357e31e7 100644 --- a/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md +++ b/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ foo = +5 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-term-with-dependent.md b/unison-src/transcripts/update-term-with-dependent.md index d7aa6b3db6..402138857b 100644 --- a/unison-src/transcripts/update-term-with-dependent.md +++ b/unison-src/transcripts/update-term-with-dependent.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 6 ``` ```ucm -.> update -.> view bar +scratch/main> update +scratch/main> view bar ``` diff --git a/unison-src/transcripts/update-term-with-dependent.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index dc2d66f72a..9acbb2b7b7 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -66,7 +66,7 @@ foo = 6 Done. -.> view bar +scratch/main> view bar bar : Nat bar = diff --git a/unison-src/transcripts/update-term.md b/unison-src/transcripts/update-term.md index 0fbb55357b..0cdc0e86f9 100644 --- a/unison-src/transcripts/update-term.md +++ b/unison-src/transcripts/update-term.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,6 +17,6 @@ foo = 6 ``` ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index 1a641671e5..26bb87579d 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -23,7 +23,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Nat foo = 6 diff --git a/unison-src/transcripts/update-test-to-non-test.md b/unison-src/transcripts/update-test-to-non-test.md index a25ad0d3e2..0c2ba33f80 100644 --- a/unison-src/transcripts/update-test-to-non-test.md +++ b/unison-src/transcripts/update-test-to-non-test.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -9,8 +9,8 @@ test> foo = [] After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ```ucm -.> add -.> view foo +scratch/main> add +scratch/main> view foo ``` ```unison @@ -20,6 +20,6 @@ foo = 1 After updating `foo` to not be a test, we expect `view` to not render it like a test. ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-test-to-non-test.output.md b/unison-src/transcripts/update-test-to-non-test.output.md index a3a016e736..f08dd4bb97 100644 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ b/unison-src/transcripts/update-test-to-non-test.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -30,13 +30,13 @@ test> foo = [] After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo : [Result] -.> view foo +scratch/main> view foo foo : [Result] foo = [] @@ -63,14 +63,14 @@ foo = 1 After updating `foo` to not be a test, we expect `view` to not render it like a test. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Nat foo = 1 diff --git a/unison-src/transcripts/update-test-watch-roundtrip.md b/unison-src/transcripts/update-test-watch-roundtrip.md index a3ea386efe..135412df66 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Given a test that depends on another definition, @@ -14,7 +14,7 @@ test> mynamespace.foo.test = ``` ```ucm -.> add +scratch/main> add ``` if we change the type of the dependency, the test should show in the scratch file as a test watch. @@ -24,5 +24,5 @@ foo n = "hello, world!" ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index b3db6133dd..2f1959eb58 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -10,7 +10,7 @@ test> mynamespace.foo.test = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -39,7 +39,7 @@ foo n = "hello, world!" ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-add-constructor.md b/unison-src/transcripts/update-type-add-constructor.md index b801106c24..1decf30154 100644 --- a/unison-src/transcripts/update-type-add-constructor.md +++ b/unison-src/transcripts/update-type-add-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index d0fb21a382..4064cbf3d3 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -17,7 +17,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,18 +45,18 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat | Baz Nat Nat -.> find.verbose +scratch/main> find.verbose 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog type Foo diff --git a/unison-src/transcripts/update-type-add-field.md b/unison-src/transcripts/update-type-add-field.md index 13a388e1bd..cdd41c3388 100644 --- a/unison-src/transcripts/update-type-add-field.md +++ b/unison-src/transcripts/update-type-add-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 7ee979d64e..6ba0471643 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -16,7 +16,7 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -42,18 +42,18 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat Nat -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-add-new-record.md b/unison-src/transcripts/update-type-add-new-record.md index 0d311ec1e2..86c7bb0e4c 100644 --- a/unison-src/transcripts/update-type-add-new-record.md +++ b/unison-src/transcripts/update-type-add-new-record.md @@ -7,6 +7,6 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update -.> view Foo +scratch/main> update +scratch/main> view Foo ``` diff --git a/unison-src/transcripts/update-type-add-new-record.output.md b/unison-src/transcripts/update-type-add-new-record.output.md index 8c00d6c1de..bc1fb44664 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -19,15 +19,15 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo - type Foo = { bar : Nat } + type Foo = { bar : ##Nat } ``` diff --git a/unison-src/transcripts/update-type-add-record-field.md b/unison-src/transcripts/update-type-add-record-field.md index ef5aba3614..d4edf079e1 100644 --- a/unison-src/transcripts/update-type-add-record-field.md +++ b/unison-src/transcripts/update-type-add-record-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-record-field.output.md b/unison-src/transcripts/update-type-add-record-field.output.md index 3f52ad6a82..d0a7a700eb 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -19,7 +19,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -57,18 +57,18 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat, baz : Int } -.> find.verbose +scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-constructor-alias.md b/unison-src/transcripts/update-type-constructor-alias.md index 2d5f97ef25..50d55af066 100644 --- a/unison-src/transcripts/update-type-constructor-alias.md +++ b/unison-src/transcripts/update-type-constructor-alias.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> alias.term Foo.Bar Foo.BarAlias +scratch/main> add +scratch/main> alias.term Foo.Bar Foo.BarAlias ``` ```unison @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. ```ucm -.> update -.> find.verbose +scratch/main> update +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 44d683227c..21cea73a91 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> alias.term Foo.Bar Foo.BarAlias +scratch/main> alias.term Foo.Bar Foo.BarAlias Done. @@ -48,14 +48,14 @@ unique type Foo = Bar Nat Nat Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-delete-constructor-with-dependent.md b/unison-src/transcripts/update-type-delete-constructor-with-dependent.md index b44cf8a7a7..3c7be50a53 100644 --- a/unison-src/transcripts/update-type-delete-constructor-with-dependent.md +++ b/unison-src/transcripts/update-type-delete-constructor-with-dependent.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -14,7 +14,7 @@ foo = cases ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -23,5 +23,5 @@ unique type Foo ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md b/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md index 9966a32418..f443c34263 100644 --- a/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md +++ b/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md @@ -24,7 +24,7 @@ foo = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -52,7 +52,7 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-delete-constructor.md b/unison-src/transcripts/update-type-delete-constructor.md index cf348f690e..18a8295d5a 100644 --- a/unison-src/transcripts/update-type-delete-constructor.md +++ b/unison-src/transcripts/update-type-delete-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -9,7 +9,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index c417d5f15c..1aa01c8a57 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,18 +45,18 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-delete-record-field.md b/unison-src/transcripts/update-type-delete-record-field.md index de6396e0c3..cd3520e8b2 100644 --- a/unison-src/transcripts/update-type-delete-record-field.md +++ b/unison-src/transcripts/update-type-delete-record-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,7 +17,7 @@ unique type Foo = { bar : Nat } We want the field accessors to go away; but for now they are here, causing the update to fail. ```ucm:error -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-delete-record-field.output.md b/unison-src/transcripts/update-type-delete-record-field.output.md index a5b570d6d4..e2691b8145 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -22,7 +22,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,7 +59,7 @@ unique type Foo = { bar : Nat } We want the field accessors to go away; but for now they are here, causing the update to fail. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -70,11 +70,11 @@ We want the field accessors to go away; but for now they are here, causing the u definitions that need fixing. Once the file is compiling, try `update` again. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat, baz : Int } -.> find.verbose +scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-missing-constructor.md b/unison-src/transcripts/update-type-missing-constructor.md index bfaafa8343..5fa29c2a86 100644 --- a/unison-src/transcripts/update-type-missing-constructor.md +++ b/unison-src/transcripts/update-type-missing-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> delete.term Foo.Bar +scratch/main> add +scratch/main> delete.term Foo.Bar ``` Now we've set up a situation where the original constructor missing. @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat ``` ```ucm:error -.> view Foo -.> update +scratch/main> view Foo +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index 52ead472eb..59df270a54 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> delete.term Foo.Bar +scratch/main> delete.term Foo.Bar Done. @@ -48,11 +48,11 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> view Foo +scratch/main> view Foo type Foo = #b509v3eg4k#0 Nat -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.md b/unison-src/transcripts/update-type-nested-decl-aliases.md index a51c9a2c16..03b20f6fd7 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ structural type A = B.TheOtherAlias Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,5 +22,5 @@ only one name for each constructor. We instead get too far in the update process file to stare at. ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.output.md b/unison-src/transcripts/update-type-nested-decl-aliases.output.md index 0b373c88cd..afddbf3de6 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -21,7 +21,7 @@ structural type A = B.TheOtherAlias Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -53,7 +53,7 @@ only one name for each constructor. We instead get too far in the update process file to stare at. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-no-op-record.md b/unison-src/transcripts/update-type-no-op-record.md index 50a559819a..e9ec904c95 100644 --- a/unison-src/transcripts/update-type-no-op-record.md +++ b/unison-src/transcripts/update-type-no-op-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,11 +7,11 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ``` Bug: this no-op update should (of course) succeed. ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-no-op-record.output.md b/unison-src/transcripts/update-type-no-op-record.output.md index 1a7e55eb74..8d46e420ce 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -19,7 +19,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -32,7 +32,7 @@ unique type Foo = { bar : Nat } Bug: this no-op update should (of course) succeed. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.md b/unison-src/transcripts/update-type-stray-constructor-alias.md index 847a37e32d..8bd4ba3625 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> alias.term Foo.Bar Stray.BarAlias +scratch/main> add +scratch/main> alias.term Foo.Bar Stray.BarAlias ``` ```unison @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. ```ucm -.> update -.> find.verbose +scratch/main> update +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.output.md b/unison-src/transcripts/update-type-stray-constructor-alias.output.md index e9fe5f9662..0e906b70dd 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> alias.term Foo.Bar Stray.BarAlias +scratch/main> alias.term Foo.Bar Stray.BarAlias Done. @@ -48,14 +48,14 @@ unique type Foo = Bar Nat Nat Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-stray-constructor.md b/unison-src/transcripts/update-type-stray-constructor.md index 183818e564..7808f759be 100644 --- a/unison-src/transcripts/update-type-stray-constructor.md +++ b/unison-src/transcripts/update-type-stray-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> move.term Foo.Bar Stray.Bar +scratch/main> add +scratch/main> move.term Foo.Bar Stray.Bar ``` Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. @@ -20,6 +20,6 @@ unique type Foo = Bar Nat Nat Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) doesn't really exist, it's just showing up due to a pretty-printer bug. ```ucm:error -.> view Foo -.> update +scratch/main> view Foo +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index 8f72beefd3..a76b034b41 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> move.term Foo.Bar Stray.Bar +scratch/main> move.term Foo.Bar Stray.Bar Done. @@ -50,11 +50,11 @@ unique type Foo = Bar Nat Nat Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) doesn't really exist, it's just showing up due to a pretty-printer bug. ```ucm -.> view Foo +scratch/main> view Foo type Foo = Stray.Bar Nat -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md index 1debc0aaf3..1f2933242a 100644 --- a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md +++ b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ makeFoo n = Bar (n+10) ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -21,7 +21,7 @@ Foo.Bar n = internal.Bar n ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md index a28e27e747..a00b5dde63 100644 --- a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md +++ b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md @@ -20,7 +20,7 @@ makeFoo n = Bar (n+10) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ Foo.Bar n = internal.Bar n ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,11 +62,11 @@ Foo.Bar n = internal.Bar n Done. -.> view Foo +scratch/main> view Foo type Foo = internal.Bar Nat -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.md b/unison-src/transcripts/update-type-turn-non-record-into-record.md index b570aa5f7e..829240ff62 100644 --- a/unison-src/transcripts/update-type-turn-non-record-into-record.md +++ b/unison-src/transcripts/update-type-turn-non-record-into-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = Nat ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md b/unison-src/transcripts/update-type-turn-non-record-into-record.output.md index f23ab09cd5..fb1f2dd2ce 100644 --- a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md +++ b/unison-src/transcripts/update-type-turn-non-record-into-record.output.md @@ -16,7 +16,7 @@ unique type Foo = Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -48,18 +48,18 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat } -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-with-dependent-term.md b/unison-src/transcripts/update-type-with-dependent-term.md index 99bfcceac4..300eddc69f 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.md +++ b/unison-src/transcripts/update-type-with-dependent-term.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,5 +18,5 @@ unique type Foo = Bar Nat Nat ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-with-dependent-term.output.md b/unison-src/transcripts/update-type-with-dependent-term.output.md index e8837eb523..1ab2b586bc 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -20,7 +20,7 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -47,7 +47,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md index 7c5a5018b2..1caef319d8 100644 --- a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md +++ b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -16,5 +16,5 @@ unique type Foo a = Bar Nat a ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md index e105b39ea2..edc63c214d 100644 --- a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md @@ -18,7 +18,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,7 +45,7 @@ unique type Foo a = Bar Nat a ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-with-dependent-type.md b/unison-src/transcripts/update-type-with-dependent-type.md index 7dea367322..4b6e8aa2dc 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.md +++ b/unison-src/transcripts/update-type-with-dependent-type.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -16,8 +16,8 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update -.> view Foo -.> view Baz -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> view Baz +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-with-dependent-type.output.md b/unison-src/transcripts/update-type-with-dependent-type.output.md index 47988e1ffd..2523eed7df 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -18,7 +18,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,7 +45,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -56,15 +56,15 @@ unique type Foo = Bar Nat Nat Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat Nat -.> view Baz +scratch/main> view Baz type Baz = Qux Foo -.> find.verbose +scratch/main> find.verbose 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 type Baz diff --git a/unison-src/transcripts/update-watch.md b/unison-src/transcripts/update-watch.md index 6637515ff6..013801ebb7 100644 --- a/unison-src/transcripts/update-watch.md +++ b/unison-src/transcripts/update-watch.md @@ -3,5 +3,5 @@ ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index e97d32f9ef..c9c9510457 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -19,7 +19,7 @@ ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/view.md b/unison-src/transcripts/view.md index 89b81cf51f..25d56dc842 100644 --- a/unison-src/transcripts/view.md +++ b/unison-src/transcripts/view.md @@ -1,7 +1,7 @@ # View commands ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -10,12 +10,12 @@ b.thing = "b" ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -- Should suffix-search and find values in sub-namespaces -.> view thing +scratch/main> view thing -- Should be local to namespace .a> view thing -- view.global should search globally and be absolutely qualified diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index 71ebf98da7..c3777e0452 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -7,7 +7,7 @@ b.thing = "b" ```ucm -- Should suffix-search and find values in sub-namespaces -.> view thing +scratch/main> view thing a.thing : Text a.thing = "a" @@ -16,24 +16,29 @@ b.thing = "b" b.thing = "b" -- Should be local to namespace + ☝️ The namespace .a is empty. + .a> view thing - thing : ##Text - thing = "a" + ⚠️ + + The following names were not found in the codebase. Check your spelling. + thing --- view.global should search globally and be absolutely qualified -.a> view.global thing +``` - .a.thing : Text - .a.thing = "a" - - .b.thing : Text - .b.thing = "b" +```ucm +-- Should suffix-search and find values in sub-namespacesscratch/main> view thing-- Should be local to namespace.a> view thing-- view.global should search globally and be absolutely qualified.a> view.global thing-- Should support absolute paths outside of current namespace.a> view .b.thing +``` --- Should support absolute paths outside of current namespace -.a> view .b.thing - .b.thing : Text - .b.thing = "b" +🛑 + +The transcript failed due to an error in the stanza above. The error is: + + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + thing -``` diff --git a/unison-src/transcripts/watch-expressions.md b/unison-src/transcripts/watch-expressions.md index e17d789a55..b4f54004b0 100644 --- a/unison-src/transcripts/watch-expressions.md +++ b/unison-src/transcripts/watch-expressions.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -7,7 +7,7 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,8 +15,8 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` ```unison diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 3a12bbcac7..e1c4dcb4d2 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio Done. @@ -29,7 +29,7 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -56,11 +56,11 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ⊡ Ignored previously added definitions: pass -.> test +scratch/main> test Cached test results (`help testcache` to learn more) From 26a0bf7b40357bc648db77951c69d4f5835a1467 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 15:31:09 -0700 Subject: [PATCH 05/41] Edit transcripts to be in projects --- unison-src/transcripts-using-base/fix1709.md | 2 +- .../namespace-dependencies.md | 2 +- .../namespace-dependencies.output.md | 8 ++-- unison-src/transcripts/alias-many.md | 2 +- unison-src/transcripts/api-getDefinition.md | 8 ++-- unison-src/transcripts/branch-command.md | 6 +-- unison-src/transcripts/builtins-merge.md | 4 +- unison-src/transcripts/create-author.md | 4 +- unison-src/transcripts/delete.md | 14 +++---- unison-src/transcripts/diff-namespace.md | 16 ++++---- unison-src/transcripts/doc1.md | 10 ++--- unison-src/transcripts/empty-namespaces.md | 6 +-- unison-src/transcripts/emptyCodebase.md | 8 ++-- unison-src/transcripts/find-command.md | 4 +- unison-src/transcripts/fix2000.md | 4 +- unison-src/transcripts/fix2004.md | 6 +-- unison-src/transcripts/fix2254.md | 4 +- unison-src/transcripts/fix2254.output.md | 2 +- unison-src/transcripts/fuzzy-options.md | 2 +- .../transcripts/fuzzy-options.output.md | 6 +-- .../transcripts/ls-pretty-print-scope-bug.md | 8 ++-- unison-src/transcripts/mergeloop.md | 10 ++--- unison-src/transcripts/merges.md | 6 +-- unison-src/transcripts/move-all.md | 18 ++++----- unison-src/transcripts/move-namespace.md | 40 +++++++++---------- unison-src/transcripts/name-selection.md | 32 +++++++-------- unison-src/transcripts/names.md | 12 +++--- unison-src/transcripts/names.output.md | 16 ++++---- unison-src/transcripts/numbered-args.md | 22 +++++----- unison-src/transcripts/project-merge.md | 4 +- unison-src/transcripts/propagate.md | 30 +++++++------- unison-src/transcripts/squash.md | 32 +++++++-------- .../transcripts/sum-type-update-conflicts.md | 6 +-- unison-src/transcripts/tab-completion.md | 2 +- unison-src/transcripts/test-command.md | 4 +- unison-src/transcripts/todo.output.md | 1 - unison-src/transcripts/update-on-conflict.md | 8 ++-- .../transcripts/update-type-add-new-record.md | 2 +- unison-src/transcripts/view.md | 6 +-- 39 files changed, 188 insertions(+), 189 deletions(-) diff --git a/unison-src/transcripts-using-base/fix1709.md b/unison-src/transcripts-using-base/fix1709.md index bc254f3b24..9b0e868d02 100644 --- a/unison-src/transcripts-using-base/fix1709.md +++ b/unison-src/transcripts-using-base/fix1709.md @@ -7,7 +7,7 @@ id2 x = ``` ```ucm -.scratch> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts-using-base/namespace-dependencies.md b/unison-src/transcripts-using-base/namespace-dependencies.md index 1558d5951e..226da3c1cd 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.md @@ -7,5 +7,5 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ```ucm scratch/main> add -.mynamespace> namespace.dependencies +scratch/main mynamespace> namespace.dependencies ``` diff --git a/unison-src/transcripts-using-base/namespace-dependencies.output.md b/unison-src/transcripts-using-base/namespace-dependencies.output.md index b20019aa47..7c4f828d0f 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.output.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.output.md @@ -9,16 +9,16 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 scratch/main> add ⍟ I've added these definitions: - + external.mynat : Nat mynamespace.dependsOnText : Nat ☝️ The namespace .mynamespace is empty. -.mynamespace> namespace.dependencies +scratch/main mynamespace> namespace.dependencies ⚠️ - + .mynamespace is an empty namespace. ``` @@ -31,6 +31,6 @@ The transcript failed due to an error in the stanza above. The error is: ⚠️ - + .mynamespace is an empty namespace. diff --git a/unison-src/transcripts/alias-many.md b/unison-src/transcripts/alias-many.md index 8d9fb87dec..0eed6fef3f 100644 --- a/unison-src/transcripts/alias-many.md +++ b/unison-src/transcripts/alias-many.md @@ -95,7 +95,7 @@ List.takeWhile p xs = go xs [] ``` ```ucm:hide -.stuff> add +scratch/main stuff> add ``` The `alias.many` command can be used to copy definitions from the current namespace into your curated one. diff --git a/unison-src/transcripts/api-getDefinition.md b/unison-src/transcripts/api-getDefinition.md index 4a56b2bc9e..251fb8b3ec 100644 --- a/unison-src/transcripts/api-getDefinition.md +++ b/unison-src/transcripts/api-getDefinition.md @@ -1,7 +1,7 @@ # Get Definitions Test ```ucm:hide -.nested> builtins.mergeio +scratch/main nested> builtins.mergeio ``` ```unison:hide @@ -10,7 +10,7 @@ names.x = 42 ``` ```ucm:hide -.nested> add +scratch/main nested> add ``` ```api @@ -25,7 +25,7 @@ GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested ``` ```ucm:hide -.doctest> builtins.mergeio +scratch/main doctest> builtins.mergeio ``` ```unison:hide @@ -38,7 +38,7 @@ otherstuff.thing = "A different thing" ``` ```ucm:hide -.doctest> add +scratch/main doctest> add ``` Only docs for the term we request should be returned, even if there are other term docs with the same suffix. diff --git a/unison-src/transcripts/branch-command.md b/unison-src/transcripts/branch-command.md index f39b2a071a..fd8ad20168 100644 --- a/unison-src/transcripts/branch-command.md +++ b/unison-src/transcripts/branch-command.md @@ -12,8 +12,8 @@ someterm = 18 ``` ```ucm -.some.loose.code.lib> builtins.merge -.some.loose.code> add +scratch/main some.loose.code.lib> builtins.merge +scratch/main some.loose.code> add ``` Now, the `branch` demo: @@ -40,7 +40,7 @@ bar/main> branch foo/main topic2 bar/main> branch foo/main /topic3 scratch/main> branch foo/main bar/topic4 -.some.loose.code> branch foo/topic13 +scratch/main some.loose.code> branch foo/topic13 foo/main> branch .some.loose.code topic14 foo/main> branch .some.loose.code /topic15 scratch/main> branch .some.loose.code foo/topic16 diff --git a/unison-src/transcripts/builtins-merge.md b/unison-src/transcripts/builtins-merge.md index 28bfb426ca..dec23f021d 100644 --- a/unison-src/transcripts/builtins-merge.md +++ b/unison-src/transcripts/builtins-merge.md @@ -1,6 +1,6 @@ The `builtins.merge` command adds the known builtins to a `builtin` subnamespace within the current namespace. ```ucm -.tmp> builtins.merge -.tmp> ls builtin +scratch/main tmp> builtins.merge +scratch/main tmp> ls builtin ``` diff --git a/unison-src/transcripts/create-author.md b/unison-src/transcripts/create-author.md index 18f0ccac2e..c8afdb0002 100644 --- a/unison-src/transcripts/create-author.md +++ b/unison-src/transcripts/create-author.md @@ -5,6 +5,6 @@ scratch/main> builtins.mergeio Demonstrating `create.author`: ```ucm -.foo> create.author alicecoder "Alice McGee" -.foo> view 2 +scratch/main foo> create.author alicecoder "Alice McGee" +scratch/main foo> view 2 ``` diff --git a/unison-src/transcripts/delete.md b/unison-src/transcripts/delete.md index a3af9d2142..5187a57cc0 100644 --- a/unison-src/transcripts/delete.md +++ b/unison-src/transcripts/delete.md @@ -35,7 +35,7 @@ foo = 1 ``` ```ucm -.a> add +scratch/main a> add ``` ```unison:hide @@ -43,8 +43,8 @@ foo = 2 ``` ```ucm -.b> add -.a> merge.old .b +scratch/main b> add +scratch/main a> merge.old .b ``` A delete should remove both versions of the term. @@ -54,7 +54,7 @@ scratch/main> delete.verbose a.foo ``` ```ucm:error -.a> ls +scratch/main a> ls ``` Let's repeat all that on a type, for completeness. @@ -64,7 +64,7 @@ structural type Foo = Foo () ``` ```ucm -.a> add +scratch/main a> add ``` ```unison:hide @@ -72,8 +72,8 @@ structural type Foo = Foo ``` ```ucm -.b> add -.a> merge.old .b +scratch/main b> add +scratch/main a> merge.old .b ``` ```ucm diff --git a/unison-src/transcripts/diff-namespace.md b/unison-src/transcripts/diff-namespace.md index 63c20cb740..e54f6cdba8 100644 --- a/unison-src/transcripts/diff-namespace.md +++ b/unison-src/transcripts/diff-namespace.md @@ -109,7 +109,7 @@ a = 333 b = a + 1 ``` ```ucm -.nsx> add +scratch/main nsx> add scratch/main> fork nsx nsy scratch/main> fork nsx nsz ``` @@ -117,13 +117,13 @@ scratch/main> fork nsx nsz a = 444 ``` ```ucm -.nsy> update.old +scratch/main nsy> update.old ``` ```unison:hide a = 555 ``` ```ucm -.nsz> update.old +scratch/main nsz> update.old scratch/main> merge.old nsy nsw ``` ```ucm:error @@ -131,7 +131,7 @@ scratch/main> merge.old nsz nsw ``` ```ucm scratch/main> diff.namespace nsx nsw -.nsw> view a b +scratch/main nsw> view a b ``` ## Should be able to diff a namespace hash from history. @@ -141,7 +141,7 @@ x = 1 ``` ```ucm -.hashdiff> add +scratch/main hashdiff> add ``` ```unison @@ -149,9 +149,9 @@ y = 2 ``` ```ucm -.hashdiff> add -.hashdiff> history -.hashdiff> diff.namespace 2 1 +scratch/main hashdiff> add +scratch/main hashdiff> history +scratch/main hashdiff> diff.namespace 2 1 ``` ## diff --git a/unison-src/transcripts/doc1.md b/unison-src/transcripts/doc1.md index 3f0b0b66c9..1288d9d3f4 100644 --- a/unison-src/transcripts/doc1.md +++ b/unison-src/transcripts/doc1.md @@ -7,7 +7,7 @@ scratch/main> builtins.merge Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm -.builtin> view Doc +scratch/main builtin> view Doc ``` You can create these `Doc` values with ordinary code, or you can use the special syntax. A value of structural type `Doc` can be created via syntax like: @@ -42,7 +42,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ```ucm -.builtin> add +scratch/main builtin> add ``` And now let's write our docs and reference these examples: @@ -67,17 +67,17 @@ List.take.doc = [: Let's add it to the codebase. ```ucm -.builtin> add +scratch/main builtin> add ``` We can view it with `docs`, which shows the `Doc` value that is associated with a definition. ```ucm -.builtin> docs List.take +scratch/main builtin> docs List.take ``` Note that if we view the source of the documentation, the various references are *not* expanded. ```ucm -.builtin> view List.take +scratch/main builtin> view List.take ``` diff --git a/unison-src/transcripts/empty-namespaces.md b/unison-src/transcripts/empty-namespaces.md index a4d22fa805..ef17ad2363 100644 --- a/unison-src/transcripts/empty-namespaces.md +++ b/unison-src/transcripts/empty-namespaces.md @@ -31,9 +31,9 @@ scratch/main> history mynamespace Merging an empty namespace should be a no-op ```ucm:error -.empty> history -.empty> merge.old .mynamespace -.empty> history +scratch/main empty> history +scratch/main empty> merge.old .mynamespace +scratch/main empty> history ``` Add and then delete a term to add some history to a deleted namespace. diff --git a/unison-src/transcripts/emptyCodebase.md b/unison-src/transcripts/emptyCodebase.md index c7b939a3bb..4aefd0dfda 100644 --- a/unison-src/transcripts/emptyCodebase.md +++ b/unison-src/transcripts/emptyCodebase.md @@ -13,15 +13,15 @@ scratch/main> ls Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ```ucm -.foo> builtins.merge -.foo> ls +scratch/main foo> builtins.merge +scratch/main foo> ls ``` And for a limited time, you can get even more builtin goodies: ```ucm -.foo> builtins.mergeio -.foo> ls +scratch/main foo> builtins.mergeio +scratch/main foo> ls ``` More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/find-command.md b/unison-src/transcripts/find-command.md index 43e06de137..d4da9f237b 100644 --- a/unison-src/transcripts/find-command.md +++ b/unison-src/transcripts/find-command.md @@ -32,8 +32,8 @@ scratch/main> view 1 ``` ```ucm -.somewhere> find bar -.somewhere> find.global bar +scratch/main somewhere> find bar +scratch/main somewhere> find.global bar ``` ```ucm diff --git a/unison-src/transcripts/fix2000.md b/unison-src/transcripts/fix2000.md index e72a573af2..b3456fc434 100644 --- a/unison-src/transcripts/fix2000.md +++ b/unison-src/transcripts/fix2000.md @@ -38,7 +38,7 @@ scratch/main> merge.old y.b y.a scratch/main> delete.term.verbose 1 scratch/main> merge.old y m scratch/main> merge.old.squash y s -.s> todo -.m> todo +scratch/main s> todo +scratch/main m> todo ``` diff --git a/unison-src/transcripts/fix2004.md b/unison-src/transcripts/fix2004.md index 761218bb62..1c966d80be 100644 --- a/unison-src/transcripts/fix2004.md +++ b/unison-src/transcripts/fix2004.md @@ -39,7 +39,7 @@ scratch/main> delete.term.verbose a.delete3 scratch/main> delete.type.verbose a.Delete4 scratch/main> alias.term .builtin.Float.+ newbranchA.dontDelete scratch/main> merge.old newbranchA a -.a> find +scratch/main a> find ``` Meanwhile, `a2` adds some other unrelated terms, some via merging in namespaces with little history. When merging `a2` back into `a`, the deletes from their common history should be respected. @@ -64,8 +64,8 @@ scratch/main> merge.old.squash a2 asquash At this point, all the things that `a` has deleted (`delete1`, `delete2`, etc) should be deleted in both the merged and squashed results. Let's verify this: ```ucm -.a> find -.asquash> find +scratch/main a> find +scratch/main asquash> find ``` ```ucm:hide diff --git a/unison-src/transcripts/fix2254.md b/unison-src/transcripts/fix2254.md index 6f0ae20f01..17a2befbd2 100644 --- a/unison-src/transcripts/fix2254.md +++ b/unison-src/transcripts/fix2254.md @@ -1,6 +1,6 @@ ```ucm:hide -.a> builtins.merge +scratch/main a> builtins.merge ``` This transcript checks that updates to data types propagate successfully to dependent types and dependent terms that do pattern matching. First let's create some types and terms: @@ -38,7 +38,7 @@ g = cases We'll make our edits in a fork of the `a` namespace: ```ucm -.a> add +scratch/main a> add scratch/main> fork a a2 ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 8b4aaa3153..b0b3f60b02 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -34,7 +34,7 @@ g = cases We'll make our edits in a fork of the `a` namespace: ```ucm -.a> add +scratch/main a> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fuzzy-options.md b/unison-src/transcripts/fuzzy-options.md index 96e274f9a6..985173ae81 100644 --- a/unison-src/transcripts/fuzzy-options.md +++ b/unison-src/transcripts/fuzzy-options.md @@ -12,7 +12,7 @@ If a fuzzy resolver doesn't have any options available it should print a message opening an empty fuzzy-select. ```ucm:error -.empty> view +scratch/main empty> view ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index 1eb893cb8f..b59ac3c34e 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -16,7 +16,7 @@ opening an empty fuzzy-select. ```ucm ☝️ The namespace .empty is empty. -.empty> view +scratch/main empty> view ⚠️ @@ -35,7 +35,7 @@ Definition args scratch/main> add ⍟ I've added these definitions: - + nested.optionTwo : ##Nat optionOne : ##Nat @@ -66,7 +66,7 @@ Project Branch args myproject/main> branch mybranch Done. I've created the mybranch branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.md b/unison-src/transcripts/ls-pretty-print-scope-bug.md index af7ff0a0ea..36ff971074 100644 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.md +++ b/unison-src/transcripts/ls-pretty-print-scope-bug.md @@ -3,7 +3,7 @@ unique type Foo = Foo ``` ```ucm -.a.b> add +scratch/main a.b> add scratch/main> fork .a.b .c.d.f .c.g.f> ``` @@ -13,7 +13,7 @@ unique type Foo = Foo ``` ```ucm -.c.g.f> add +scratch/main c.g.f> add .c> ``` @@ -22,7 +22,7 @@ foo = .d.f.Foo.Foo ``` ```ucm -.c> add +scratch/main c> add ``` At this point we have: @@ -40,5 +40,5 @@ namespace rooted at `.c`. ```ucm scratch/main> ls c -.c> ls +scratch/main c> ls ``` diff --git a/unison-src/transcripts/mergeloop.md b/unison-src/transcripts/mergeloop.md index 455e1ac783..3304e9dde7 100644 --- a/unison-src/transcripts/mergeloop.md +++ b/unison-src/transcripts/mergeloop.md @@ -9,7 +9,7 @@ a = 1 ``` ```ucm -.x> add +scratch/main x> add ``` ```unison @@ -17,7 +17,7 @@ b = 2 ``` ```ucm -.x> add +scratch/main x> add ``` ```unison @@ -25,7 +25,7 @@ b = 2 ``` ```ucm -.y> add +scratch/main y> add ``` ```unison @@ -33,7 +33,7 @@ a = 1 ``` ```ucm -.y> add +scratch/main y> add ``` ```unison @@ -42,7 +42,7 @@ b = 2 ``` ```ucm -.z> add +scratch/main z> add scratch/main> merge.old x y scratch/main> merge.old y z scratch/main> history z diff --git a/unison-src/transcripts/merges.md b/unison-src/transcripts/merges.md index 659c6059d2..0f23753c84 100644 --- a/unison-src/transcripts/merges.md +++ b/unison-src/transcripts/merges.md @@ -1,7 +1,7 @@ # Forking and merging namespaces in `ucm` ```ucm:hide -.master> builtins.merge +scratch/main master> builtins.merge ``` The Unison namespace is a versioned tree of names that map to Unison definitions. You can change this namespace and fork and merge subtrees of it. Let's start by introducing a few definitions into a new namespace, `foo`: @@ -40,8 +40,8 @@ y = "hello" ```ucm .feature1> add -.master> merge.old .feature1 -.master> view y +scratch/main master> merge.old .feature1 +scratch/main master> view y ``` > Note: `merge src`, with one argument, merges `src` into the current namespace. You can also do `merge src dest` to merge into any destination namespace. diff --git a/unison-src/transcripts/move-all.md b/unison-src/transcripts/move-all.md index bb1f01dda1..ee83aa33a7 100644 --- a/unison-src/transcripts/move-all.md +++ b/unison-src/transcripts/move-all.md @@ -44,10 +44,10 @@ bonk = 5 ``` ```ucm -.z> builtins.merge -.z> add -.z> move bonk zonk -.z> ls +z/main> builtins.merge +z/main> add +z/main> move bonk zonk +z/main> ls ``` ## Happy Path - Just namespace @@ -57,11 +57,11 @@ bonk.zonk = 5 ``` ```ucm -.a> builtins.merge -.a> add -.a> move bonk zonk -.a> ls -.a> view zonk.zonk +a/main> builtins.merge +a/main> add +a/main> move bonk zonk +a/main> ls +a/main> view zonk.zonk ``` ## Sad Path - No term, type, or namespace named src diff --git a/unison-src/transcripts/move-namespace.md b/unison-src/transcripts/move-namespace.md index a3d859d9fb..87480d5748 100644 --- a/unison-src/transcripts/move-namespace.md +++ b/unison-src/transcripts/move-namespace.md @@ -1,9 +1,9 @@ # Tests for `move.namespace` ```ucm:hide -.happy> builtins.merge -.history> builtins.merge -.existing> builtins.merge +scratch/main happy> builtins.merge +scratch/main history> builtins.merge +scratch/main existing> builtins.merge ``` ## Happy path @@ -16,7 +16,7 @@ unique type a.T = T ``` ```ucm -.happy> add +scratch/main happy> add ``` ```unison @@ -25,15 +25,15 @@ unique type a.T = T1 | T2 ``` ```ucm -.happy> update +scratch/main happy> update ``` Should be able to move the namespace, including its types, terms, and sub-namespaces. ```ucm -.happy> move.namespace a b -.happy> ls b -.happy> history b +scratch/main happy> move.namespace a b +scratch/main happy> ls b +scratch/main happy> history b ``` @@ -48,7 +48,7 @@ b.termInB = 10 ``` ```ucm -.history> add +scratch/main history> add ``` ```unison @@ -57,24 +57,24 @@ b.termInB = 11 ``` ```ucm -.history> update +scratch/main history> update ``` Deleting a namespace should not leave behind any history, if we move another to that location we expect the history to simply be the history -of the moved namespace. +of the moved namespace. ```ucm -.history> delete.namespace b -.history> move.namespace a b +scratch/main history> delete.namespace b +scratch/main history> move.namespace a b -- Should be the history from 'a' -.history> history b +scratch/main history> history b -- Should be empty -.history> history a +scratch/main history> history a ``` -## Moving over an existing branch +## Moving over an existing branch Create some namespace and add some history to them @@ -84,7 +84,7 @@ b.termInB = 10 ``` ```ucm -.existing> add +scratch/main existing> add ``` ```unison @@ -93,11 +93,11 @@ b.termInB = 11 ``` ```ucm -.existing> update -.existing> move.namespace a b +scratch/main existing> update +scratch/main existing> move.namespace a b ``` -## Moving the Root +## Moving the Root I should be able to move the root into a sub-namespace diff --git a/unison-src/transcripts/name-selection.md b/unison-src/transcripts/name-selection.md index 50830d71bc..bd859db392 100644 --- a/unison-src/transcripts/name-selection.md +++ b/unison-src/transcripts/name-selection.md @@ -5,10 +5,10 @@ This transcript shows how the pretty-printer picks names for a hash when multipl 3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. ```ucm:hide -.a> builtins.merge -.a2> builtins.merge -.a3> builtins.merge -.biasing> builtins.merge +scratch/main a> builtins.merge +scratch/main a2> builtins.merge +scratch/main a3> builtins.merge +scratch/main biasing> builtins.merge ``` ```unison:hide @@ -19,9 +19,9 @@ b = 0 + 1 Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment length alias), and show that it isn't used when viewing `a`: ```ucm -.a> add -.a> alias.term b aaa.but.more.segments -.a> view a +scratch/main a> add +scratch/main a> alias.term b aaa.but.more.segments +scratch/main a> view a ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: @@ -37,11 +37,11 @@ d = c + 10 ``` ```ucm:hide -.a2> builtins.merge +scratch/main a2> builtins.merge ``` ```ucm -.a2> add -.a2> alias.term c long.name.but.shortest.suffixification +scratch/main a2> add +scratch/main a2> alias.term c long.name.but.shortest.suffixification ``` ```unison:hide @@ -50,8 +50,8 @@ d = c + 10 ``` ```ucm -.a3> add -.a3> merge.old .a2 .a3 +scratch/main a3> add +scratch/main a3> merge.old .a2 .a3 ``` At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. @@ -74,11 +74,11 @@ a = 10 ``` ```ucm -.biasing> add +scratch/main biasing> add -- Despite being saved with name `a`, -- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'. -- It's closer to the term being printed. -.biasing> view deeply.nested.term +scratch/main biasing> view deeply.nested.term ``` Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` @@ -88,8 +88,8 @@ other.num = 20 ``` ```ucm -.biasing> add +scratch/main biasing> add -- nested.num should be preferred over the shorter name `a` due to biasing -- because `deeply.nested.num` is nearby to the term being viewed. -.biasing> view deeply.nested.term +scratch/main biasing> view deeply.nested.term ``` diff --git a/unison-src/transcripts/names.md b/unison-src/transcripts/names.md index 6c93ea33ef..38457e3cc1 100644 --- a/unison-src/transcripts/names.md +++ b/unison-src/transcripts/names.md @@ -22,11 +22,11 @@ scratch/main> add ```ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. -- But we don't see somewhere.z which is has the same value but is out of our namespace -.some> names x +scratch/main some> names x -- We can search by hash, and see all aliases of that hash -.some> names #gjmq673r1v +scratch/main some> names #gjmq673r1v -- If the query is absolute, treat it as a `names.global` -.some> names .some.place.x +scratch/main some> names .some.place.x ``` `names.global` searches from the root, and absolutely qualifies results @@ -34,9 +34,9 @@ scratch/main> add ```ucm -- We can search by suffix and find all definitions in the codebase named 'x', and each of their aliases respectively. -.some> names.global x +scratch/main some> names.global x -- We can search by hash, and see all aliases of that hash in the codebase -.some> names.global #gjmq673r1v +scratch/main some> names.global #gjmq673r1v -- We can search using an absolute name -.some> names.global .some.place.x +scratch/main some> names.global .some.place.x ``` diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index 75eff3c3a5..ee635f19e7 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -19,9 +19,9 @@ somewhere.y = 2 I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: - + some.otherplace.x : ##Nat some.otherplace.y : ##Nat some.place.x : ##Nat @@ -33,7 +33,7 @@ somewhere.y = 2 scratch/main> add ⍟ I've added these definitions: - + some.otherplace.x : ##Nat some.otherplace.y : ##Nat some.place.x : ##Nat @@ -48,12 +48,12 @@ scratch/main> add -- But we don't see somewhere.z which is has the same value but is out of our namespace ☝️ The namespace .some is empty. -.some> names x +scratch/main some> names x 😶 - + I couldn't find anything by that name. - + Tip: Use `names.global` to see more results. ``` @@ -69,8 +69,8 @@ The transcript failed due to an error in the stanza above. The error is: 😶 - + I couldn't find anything by that name. - + Tip: Use `names.global` to see more results. diff --git a/unison-src/transcripts/numbered-args.md b/unison-src/transcripts/numbered-args.md index f421a67177..d895be6cb8 100644 --- a/unison-src/transcripts/numbered-args.md +++ b/unison-src/transcripts/numbered-args.md @@ -1,7 +1,7 @@ # Using numbered arguments in UCM ```ucm:hide -.temp> alias.type ##Text Text +scratch/main temp> alias.type ##Text Text ``` First lets add some contents to our codebase. @@ -16,41 +16,41 @@ corge = "corge" ``` ```ucm -.temp> add +scratch/main temp> add ``` We can get the list of things in the namespace, and UCM will give us a numbered list: ```ucm -.temp> find +scratch/main temp> find ``` We can ask to `view` the second element of this list: ```ucm -.temp> find -.temp> view 2 +scratch/main temp> find +scratch/main temp> view 2 ``` And we can `view` multiple elements by separating with spaces: ```ucm -.temp> find -.temp> view 2 3 5 +scratch/main temp> find +scratch/main temp> view 2 3 5 ``` We can also ask for a range: ```ucm -.temp> find -.temp> view 2-4 +scratch/main temp> find +scratch/main temp> view 2-4 ``` And we can ask for multiple ranges and use mix of ranges and numbers: ```ucm -.temp> find -.temp> view 1-3 4 5-6 +scratch/main temp> find +scratch/main temp> view 1-3 4 5-6 ``` diff --git a/unison-src/transcripts/project-merge.md b/unison-src/transcripts/project-merge.md index 4d27e25931..4e35b9ed2e 100644 --- a/unison-src/transcripts/project-merge.md +++ b/unison-src/transcripts/project-merge.md @@ -9,7 +9,7 @@ zonk = 0 ``` ```ucm -.foo> add +scratch/main foo> add scratch/main> project.create-empty foo scratch/main> merge.old foo foo/main ``` @@ -35,5 +35,5 @@ xonk = 1 ```ucm bar/main> add bar/topic> merge.old /main -.bar> merge.old foo/main +scratch/main bar> merge.old foo/main ``` diff --git a/unison-src/transcripts/propagate.md b/unison-src/transcripts/propagate.md index ea0e8d8b0f..61237912c9 100644 --- a/unison-src/transcripts/propagate.md +++ b/unison-src/transcripts/propagate.md @@ -1,7 +1,7 @@ # Propagating type edits ```ucm:hide -.subpath.lib> builtins.merge +scratch/main subpath.lib> builtins.merge ``` We introduce a type `Foo` with a function dependent `fooToInt`. @@ -16,9 +16,9 @@ fooToInt _ = +42 And then we add it. ```ucm -.subpath> add -.subpath> find.verbose -.subpath> view fooToInt +scratch/main subpath> add +scratch/main subpath> find.verbose +scratch/main subpath> view fooToInt ``` Then if we change the type `Foo`... @@ -30,13 +30,13 @@ unique type Foo = Foo | Bar and update the codebase to use the new type `Foo`... ```ucm -.subpath> update.old +scratch/main subpath> update.old ``` ... it should automatically propagate the type to `fooToInt`. ```ucm -.subpath> view fooToInt +scratch/main subpath> view fooToInt ``` ### Preserving user type variables @@ -55,7 +55,7 @@ preserve.otherTerm y = someTerm y Add that to the codebase: ```ucm -.subpath> add +scratch/main subpath> add ``` Let's now edit the dependency: @@ -68,15 +68,15 @@ preserve.someTerm _ = None Update... ```ucm -.subpath> update.old +scratch/main subpath> update.old ``` Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. ```ucm -.subpath> view preserve.someTerm -.subpath> view preserve.otherTerm +scratch/main subpath> view preserve.someTerm +scratch/main subpath> view preserve.otherTerm ``` ### Propagation only applies to the local branch @@ -85,7 +85,7 @@ Cleaning up a bit... ```ucm scratch/main> delete.namespace subpath -.subpath.lib> builtins.merge +scratch/main subpath.lib> builtins.merge ``` Now, we make two terms, where one depends on the other. @@ -101,8 +101,8 @@ one.otherTerm y = someTerm y We'll make two copies of this namespace. ```ucm -.subpath> add -.subpath> fork one two +scratch/main subpath> add +scratch/main subpath> fork one two ``` Now let's edit one of the terms... @@ -115,11 +115,11 @@ someTerm _ = None ... in one of the namespaces... ```ucm -.subpath.one> update.old +scratch/main subpath.one> update.old ``` The other namespace should be left alone. ```ucm -.subpath> view two.someTerm +scratch/main subpath> view two.someTerm ``` diff --git a/unison-src/transcripts/squash.md b/unison-src/transcripts/squash.md index 93ccaed4f0..d4bb483671 100644 --- a/unison-src/transcripts/squash.md +++ b/unison-src/transcripts/squash.md @@ -20,9 +20,9 @@ Now suppose we `fork` a copy of builtin, then rename `Nat.+` to `frobnicate`, th ```ucm scratch/main> fork builtin mybuiltin -.mybuiltin> rename.term Nat.+ Nat.frobnicate -.mybuiltin> rename.term Nat.frobnicate Nat.+ -.mybuiltin> history +scratch/main mybuiltin> rename.term Nat.+ Nat.frobnicate +scratch/main mybuiltin> rename.term Nat.frobnicate Nat.+ +scratch/main mybuiltin> history ``` If we merge that back into `builtin`, we get that same chain of history: @@ -50,7 +50,7 @@ x = 1 ``` ```ucm -.trunk> add +scratch/main trunk> add scratch/main> fork trunk alice scratch/main> fork trunk bob ``` @@ -64,9 +64,9 @@ neatoFun x = x ``` ```ucm -.alice> add -.alice> rename.term radNumber superRadNumber -.alice> rename.term neatoFun productionReadyId +scratch/main alice> add +scratch/main alice> rename.term radNumber superRadNumber +scratch/main alice> rename.term neatoFun productionReadyId ``` Meanwhile, Bob does his own hacking: @@ -78,7 +78,7 @@ no more = no more ``` ```ucm -.bob> add +scratch/main bob> add ``` At this point, Alice and Bob both have some history beyond what's in trunk: @@ -132,12 +132,12 @@ There's nothing really special here, `squash src dest` discards `src` history th This checks to see that squashing correctly preserves deletions: ```ucm -.delete> builtins.merge -.delete> fork builtin builtin2 -.delete> delete.term.verbose builtin2.Nat.+ -.delete> delete.term.verbose builtin2.Nat.* -.delete> merge.old.squash builtin2 builtin -.delete> history builtin +scratch/main delete> builtins.merge +scratch/main delete> fork builtin builtin2 +scratch/main delete> delete.term.verbose builtin2.Nat.+ +scratch/main delete> delete.term.verbose builtin2.Nat.* +scratch/main delete> merge.old.squash builtin2 builtin +scratch/main delete> history builtin ``` Notice that `Nat.+` and `Nat.*` are deleted by the squash, and we see them deleted in one atomic step in the history. @@ -145,11 +145,11 @@ Notice that `Nat.+` and `Nat.*` are deleted by the squash, and we see them delet Just confirming that those two definitions are in fact removed: ```ucm:error -.delete> view .delete.builtin.Nat.+ +scratch/main delete> view .delete.builtin.Nat.+ ``` ```ucm:error -.delete> view .delete.builtin.Nat.* +scratch/main delete> view .delete.builtin.Nat.* ``` ## Caveats diff --git a/unison-src/transcripts/sum-type-update-conflicts.md b/unison-src/transcripts/sum-type-update-conflicts.md index ce29931852..852aa66f91 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.md +++ b/unison-src/transcripts/sum-type-update-conflicts.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/issues/2786 ```ucm:hide -.ns> builtins.merge +scratch/main ns> builtins.merge ``` First we add a sum-type to the codebase. @@ -13,7 +13,7 @@ structural type X = x ``` ```ucm -.ns> add +scratch/main ns> add ``` Now we update the type, changing the name of the constructors, _but_, we simultaneously @@ -32,5 +32,5 @@ This update should succeed since the conflicted constructor is removed in the same update that the new term is being added. ```ucm -.ns> update.old +scratch/main ns> update.old ``` diff --git a/unison-src/transcripts/tab-completion.md b/unison-src/transcripts/tab-completion.md index 28ba55c8dd..65a7861f71 100644 --- a/unison-src/transcripts/tab-completion.md +++ b/unison-src/transcripts/tab-completion.md @@ -37,7 +37,7 @@ scratch/main> debug.tab-complete view subnamespace2 scratch/main> debug.tab-complete view subnamespace.some scratch/main> debug.tab-complete view subnamespace.someOther -- Should tab complete absolute names -.othernamespace> debug.tab-complete view .subnamespace.some +scratch/main othernamespace> debug.tab-complete view .subnamespace.some ``` ## Tab complete namespaces diff --git a/unison-src/transcripts/test-command.md b/unison-src/transcripts/test-command.md index f4c80cb840..39a7b9bcad 100644 --- a/unison-src/transcripts/test-command.md +++ b/unison-src/transcripts/test-command.md @@ -36,7 +36,7 @@ testInLib = [Ok "testInLib"] ``` ```ucm:hide -.lib> add +scratch/main lib> add ``` ```ucm @@ -47,7 +47,7 @@ scratch/main> test.all `test` WILL run tests within `lib` if ucm is cd'd inside. ```ucm -.lib> test +scratch/main lib> test ``` `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index 9f47cc290e..4c5e516cde 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -13,7 +13,6 @@ baz = foo.bar + foo.bar ``` ```ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/update-on-conflict.md b/unison-src/transcripts/update-on-conflict.md index 51dfd75e28..ae239b87fc 100644 --- a/unison-src/transcripts/update-on-conflict.md +++ b/unison-src/transcripts/update-on-conflict.md @@ -2,7 +2,7 @@ ```ucm:hide scratch/main> builtins.merge -.merged> builtins.merge +scratch/main merged> builtins.merge ``` ```unison @@ -13,8 +13,8 @@ b.x = 2 Cause a conflict: ```ucm scratch/main> add -.merged> merge.old .a -.merged> merge.old .b +scratch/main merged> merge.old .a +scratch/main merged> merge.old .b ``` Updating conflicted definitions works fine. @@ -24,5 +24,5 @@ x = 3 ``` ```ucm -.merged> update +scratch/main merged> update ``` diff --git a/unison-src/transcripts/update-type-add-new-record.md b/unison-src/transcripts/update-type-add-new-record.md index 86c7bb0e4c..18abd8796c 100644 --- a/unison-src/transcripts/update-type-add-new-record.md +++ b/unison-src/transcripts/update-type-add-new-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.lib> builtins.merge +scratch/main lib> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/view.md b/unison-src/transcripts/view.md index 25d56dc842..9e6d59526b 100644 --- a/unison-src/transcripts/view.md +++ b/unison-src/transcripts/view.md @@ -17,9 +17,9 @@ scratch/main> add -- Should suffix-search and find values in sub-namespaces scratch/main> view thing -- Should be local to namespace -.a> view thing +scratch/main a> view thing -- view.global should search globally and be absolutely qualified -.a> view.global thing +scratch/main a> view.global thing -- Should support absolute paths outside of current namespace -.a> view .b.thing +scratch/main a> view .b.thing ``` From 7930cc2c33c793f2e2519527fb33264352f564f3 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 11 Jun 2024 15:52:47 -0700 Subject: [PATCH 06/41] Transcript output updates --- .../transcripts-using-base/fix1709.output.md | 9 ++++---- unison-src/transcripts/add-run.output.md | 4 ++-- unison-src/transcripts/api-find.output.md | 20 ++++++++--------- .../transcripts/bug-strange-closure.output.md | 2 +- unison-src/transcripts/move-all.output.md | 22 ++++++++----------- unison-src/transcripts/reflog.output.md | 10 ++++----- 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/unison-src/transcripts-using-base/fix1709.output.md b/unison-src/transcripts-using-base/fix1709.output.md index 99af3fe0d4..8210532769 100644 --- a/unison-src/transcripts-using-base/fix1709.output.md +++ b/unison-src/transcripts-using-base/fix1709.output.md @@ -18,18 +18,17 @@ id2 x = id : x -> x (also named - __projects._a60db36c_af90_4d99_bcd2_3b3c7a24851f.branches._4fe18976_dde6_41e4_82c0_bf3887f77467.id) + __projects._05eecf9d_2346_49c6_a526_322179f9a76a.branches._a446c219_4db0_4bc4_8357_f7e0a10c7e04.id) id2 : x -> x ``` ```ucm - ☝️ The namespace .scratch is empty. - -.scratch> add +scratch/main> add + ⊡ Ignored previously added definitions: id + ⍟ I've added these definitions: - id : x -> x id2 : x -> x ``` diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index 8dd8846ae6..7dc7fce2d9 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -302,9 +302,9 @@ scratch/main> add.run .an.absolute.name scratch/main> view .an.absolute.name - .__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name : + .__projects._ed77def0_0f5b_4a68_9563_0c705b131e21.branches._5a2c3951_0700_4331_8455_a27805a78722.an.absolute.name : Nat - .__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name = + .__projects._ed77def0_0f5b_4a68_9563_0c705b131e21.branches._5a2c3951_0700_4331_8455_a27805a78722.an.absolute.name = 5 ``` diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index d8e17c212d..57d7fe18d9 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -43,7 +43,7 @@ GET /api/non-project-code/find?query=http "result": { "segments": [ { - "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.", + "contents": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.ross.", "tag": "Gap" }, { @@ -63,7 +63,7 @@ GET /api/non-project-code/find?query=http "bestFoundTermName": "y", "namedTerm": { "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", - "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.httpClient.y", + "termName": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.ross.httpClient.y", "termTag": "Plain", "termType": [ { @@ -84,7 +84,7 @@ GET /api/non-project-code/find?query=http "result": { "segments": [ { - "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.", + "contents": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.joey.", "tag": "Gap" }, { @@ -104,7 +104,7 @@ GET /api/non-project-code/find?query=http "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", + "termName": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -129,7 +129,7 @@ GET /api/non-project-code/find?query=Server "result": { "segments": [ { - "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.http", + "contents": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.joey.http", "tag": "Gap" }, { @@ -149,7 +149,7 @@ GET /api/non-project-code/find?query=Server "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", + "termName": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -174,7 +174,7 @@ GET /api/non-project-code/find?query=lesys "result": { "segments": [ { - "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.fi", + "contents": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.rachel.fi", "tag": "Gap" }, { @@ -194,7 +194,7 @@ GET /api/non-project-code/find?query=lesys "bestFoundTermName": "x", "namedTerm": { "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.filesystem.x", + "termName": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.rachel.filesystem.x", "termTag": "Plain", "termType": [ { @@ -219,7 +219,7 @@ GET /api/non-project-code/find?query=joey.http "result": { "segments": [ { - "contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.", + "contents": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.", "tag": "Gap" }, { @@ -239,7 +239,7 @@ GET /api/non-project-code/find?query=joey.http "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z", + "termName": "__projects._aaeff654_596b_4266_99a7_29f5fe27a380.branches._c5b2ebde_a857_4c26_9b36_9a336751292a.joey.httpServer.z", "termTag": "Plain", "termType": [ { diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index 3d70740281..f294c6b274 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -840,7 +840,7 @@ scratch/main> undo Added definitions: - 1. __projects._141465a8_cfb4_456f_aefa_25b7a6062af2.branches._d233d31d_8101_4a8e_b332_9cd3a64f71e9.rendered : Annotated + 1. __projects._442aec5a_fada_40e6_9d90_5e40d9eac561.branches._473923ea_de67_4053_ac42_b77317959797.rendered : Annotated ( ) (Either SpecialForm diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index 9ec89be763..d7a7bec859 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -127,23 +127,21 @@ bonk = 5 ``` ```ucm - ☝️ The namespace .z is empty. - -.z> builtins.merge +z/main> builtins.merge Done. -.z> add +z/main> add ⍟ I've added these definitions: bonk : Nat -.z> move bonk zonk +z/main> move bonk zonk Done. -.z> ls +z/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk (Nat) @@ -170,28 +168,26 @@ bonk.zonk = 5 ``` ```ucm - ☝️ The namespace .a is empty. - -.a> builtins.merge +a/main> builtins.merge Done. -.a> add +a/main> add ⍟ I've added these definitions: bonk.zonk : Nat -.a> move bonk zonk +a/main> move bonk zonk Done. -.a> ls +a/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) -.a> view zonk.zonk +a/main> view zonk.zonk zonk.zonk : Nat zonk.zonk = 5 diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 75d0bb1eae..fa9cce21b7 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -63,17 +63,17 @@ scratch/main> reflog most recent, along with the command that got us there. Try: `fork 2 .old` - `fork #86h1kthpsh .old` to make an old namespace + `fork #hbahg20drn .old` to make an old namespace accessible again, - `reset-root #86h1kthpsh` to reset the root namespace and + `reset-root #hbahg20drn` to reset the root namespace and its history to that of the specified namespace. When Root Hash Action - 1. now #0de5f40rcr add - 2. now #86h1kthpsh add - 3. now #ei3jcs9f6v builtins.merge + 1. now #vci96hc5m3 add + 2. now #hbahg20drn add + 3. now #bc5vrbcbbf builtins.merge 4. #sg60bvjo91 history starts here Tip: Use `diff.namespace 1 7` to compare namespaces between From 6152577dd4953a6213c3bea4458dc6bf2bf4ca16 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 11:16:51 -0700 Subject: [PATCH 07/41] Fix alias-many transcript --- unison-src/transcripts/alias-many.md | 6 +- unison-src/transcripts/alias-many.output.md | 91 ++++++++++----------- 2 files changed, 46 insertions(+), 51 deletions(-) diff --git a/unison-src/transcripts/alias-many.md b/unison-src/transcripts/alias-many.md index 0eed6fef3f..57450c64dc 100644 --- a/unison-src/transcripts/alias-many.md +++ b/unison-src/transcripts/alias-many.md @@ -1,5 +1,5 @@ ```ucm:hide -scratch/main> builtins.merge +scratch/main> builtins.merge lib.builtins ``` ```unison:hide:all List.adjacentPairs : [a] -> [(a, a)] @@ -95,7 +95,7 @@ List.takeWhile p xs = go xs [] ``` ```ucm:hide -scratch/main stuff> add +scratch/main> add ``` The `alias.many` command can be used to copy definitions from the current namespace into your curated one. @@ -113,7 +113,7 @@ scratch/main> help alias.many Let's try it! ```ucm -scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib +scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib scratch/main> find-in mylib ``` diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index a0b100000c..b12422e093 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -14,57 +14,52 @@ The names that will be used in the target namespace are the names you specify, r Let's try it! ```ucm -scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib +scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib - Nothing changed in .mylib . - - ⚠️ + Here's what changed in mylib : - The following names were not found in the codebase. Check your spelling. - stuff.List.adjacentPairs - stuff.List.all - stuff.List.any - stuff.List.chunk - stuff.List.chunksOf - stuff.List.dropWhile - stuff.List.first - stuff.List.init - stuff.List.intersperse - stuff.List.isEmpty - stuff.List.last - stuff.List.replicate - stuff.List.splitAt - stuff.List.tail - stuff.List.takeWhile - -``` - -```ucm -scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylibscratch/main> find-in mylib -``` - - -🛑 - -The transcript failed due to an error in the stanza above. The error is: + Added definitions: + + 1. List.adjacentPairs : [a] -> [(a, a)] + 2. List.all : (a ->{g} Boolean) + -> [a] + ->{g} Boolean + 3. List.any : (a ->{g} Boolean) + -> [a] + ->{g} Boolean + 4. List.chunk : Nat -> [a] -> [[a]] + 5. List.chunksOf : Nat -> [a] -> [[a]] + 6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] + 7. List.first : [a] -> Optional a + 8. List.init : [a] -> Optional [a] + 9. List.intersperse : a -> [a] -> [a] + 10. List.isEmpty : [a] -> Boolean + 11. List.last : [a] -> Optional a + 12. List.replicate : Nat -> a -> [a] + 13. List.splitAt : Nat -> [a] -> ([a], [a]) + 14. List.tail : [a] -> Optional [a] + 15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] + + Tip: You can use `undo` or `reflog` to undo this change. +scratch/main> find-in mylib - ⚠️ + 1. List.adjacentPairs : [a] -> [(a, a)] + 2. List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean + 3. List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean + 4. List.chunk : Nat -> [a] -> [[a]] + 5. List.chunksOf : Nat -> [a] -> [[a]] + 6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] + 7. List.first : [a] -> Optional a + 8. List.init : [a] -> Optional [a] + 9. List.intersperse : a -> [a] -> [a] + 10. List.isEmpty : [a] -> Boolean + 11. List.last : [a] -> Optional a + 12. List.replicate : Nat -> a -> [a] + 13. List.splitAt : Nat -> [a] -> ([a], [a]) + 14. List.tail : [a] -> Optional [a] + 15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] - The following names were not found in the codebase. Check your spelling. - stuff.List.adjacentPairs - stuff.List.all - stuff.List.any - stuff.List.chunk - stuff.List.chunksOf - stuff.List.dropWhile - stuff.List.first - stuff.List.init - stuff.List.intersperse - stuff.List.isEmpty - stuff.List.last - stuff.List.replicate - stuff.List.splitAt - stuff.List.tail - stuff.List.takeWhile +``` +Thanks, `alias.many! From 9ea0650fc8b561eb03950ea270d4b4ff82bc5329 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 11:32:44 -0700 Subject: [PATCH 08/41] Improve atomicity of debug logs --- lib/unison-prelude/src/Unison/Debug.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/unison-prelude/src/Unison/Debug.hs b/lib/unison-prelude/src/Unison/Debug.hs index 47fdb2ee75..7881045c65 100644 --- a/lib/unison-prelude/src/Unison/Debug.hs +++ b/lib/unison-prelude/src/Unison/Debug.hs @@ -13,13 +13,12 @@ module Unison.Debug ) where -import Control.Applicative (empty) -import Control.Monad (when) -import Data.Set (Set) import Data.Set qualified as Set import Data.Text qualified as Text -import Debug.Pretty.Simple (pTrace, pTraceM, pTraceShowId, pTraceShowM) +import Debug.Pretty.Simple (pTrace, pTraceM) import System.IO.Unsafe (unsafePerformIO) +import Text.Pretty.Simple (pShow) +import Unison.Prelude import UnliftIO.Environment (lookupEnv) data DebugFlag @@ -148,7 +147,7 @@ debugPatternCoverageConstraintSolver = PatternCoverageConstraintSolver `Set.memb debug :: (Show a) => DebugFlag -> String -> a -> a debug flag msg a = if shouldDebug flag - then pTraceShowId (pTrace (msg <> ":\n") a) + then (pTrace (msg <> ":\n" <> into @String (pShow a)) a) else a -- | Use for selective debug logging in monadic contexts. @@ -159,8 +158,7 @@ debug flag msg a = debugM :: (Show a, Monad m) => DebugFlag -> String -> a -> m () debugM flag msg a = whenDebug flag do - pTraceM (msg <> ":\n") - pTraceShowM a + traceM (msg <> ":\n" <> into @String (pShow a)) debugLog :: DebugFlag -> String -> a -> a debugLog flag msg = From bbd02a91294e90707830404ed8610eede0473f0c Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 11:32:44 -0700 Subject: [PATCH 09/41] Port getDefinition.md to use projects. Fix recontextualization of project queries when using relativeTo --- unison-share-api/src/Unison/Server/Local.hs | 4 +- unison-src/transcripts/api-getDefinition.md | 36 +++++------ .../transcripts/api-getDefinition.output.md | 60 +++++++++---------- 3 files changed, 48 insertions(+), 52 deletions(-) diff --git a/unison-share-api/src/Unison/Server/Local.hs b/unison-share-api/src/Unison/Server/Local.hs index f5c3525f46..04a6d9f411 100644 --- a/unison-share-api/src/Unison/Server/Local.hs +++ b/unison-share-api/src/Unison/Server/Local.hs @@ -41,11 +41,11 @@ relocateToNameRoot perspective query rootBranch = do -- Since the project root is lower down we need to strip the part of the prefix -- which is now redundant. pure . Right $ (projectRoot, query <&> \n -> fromMaybe n $ Path.unprefixName (Path.Absolute remainder) n) - -- The namesRoot is _inside_ of the project containing the query + -- The namesRoot is _inside (or equal to)_ the project containing the query (_sharedPrefix, remainder, Path.Empty) -> do -- Since the project is higher up, we need to prefix the query -- with the remainder of the path - pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.AbsolutePath' $ Path.Absolute remainder)) + pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.RelativePath' $ Path.Relative remainder)) -- The namesRoot and project root are disjoint, this shouldn't ever happen. (_, _, _) -> pure $ Left (DisjointProjectAndPerspective perspective projectRoot) diff --git a/unison-src/transcripts/api-getDefinition.md b/unison-src/transcripts/api-getDefinition.md index 251fb8b3ec..94f2341e74 100644 --- a/unison-src/transcripts/api-getDefinition.md +++ b/unison-src/transcripts/api-getDefinition.md @@ -1,54 +1,50 @@ # Get Definitions Test ```ucm:hide -scratch/main nested> builtins.mergeio +scratch/main> builtins.mergeio lib.builtins ``` ```unison:hide -{{ Documentation }} -names.x = 42 +nested.names.x.doc = {{ Documentation }} +nested.names.x = 42 ``` ```ucm:hide -scratch/main nested> add +scratch/main> add ``` ```api -- Should NOT find names by suffix -GET /api/non-project-code/getDefinition?names=x +GET /api/projects/scratch/branches/main/getDefinition?names=x -- Term names should strip relativeTo prefix. -GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested -- Should find definitions by hash, names should be relative -GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested -``` - -```ucm:hide -scratch/main doctest> builtins.mergeio +GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested ``` ```unison:hide -thing.doc = {{ The correct docs for the thing }} -thing = "A thing" -thingalias.doc = {{ Docs for the alias, should not be displayed }} -thingalias = "A thing" -otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} -otherstuff.thing = "A different thing" +doctest.thing.doc = {{ The correct docs for the thing }} +doctest.thing = "A thing" +doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }} +doctest.thingalias = "A thing" +doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} +doctest.otherstuff.thing = "A different thing" ``` ```ucm:hide -scratch/main doctest> add +scratch/main> add ``` Only docs for the term we request should be returned, even if there are other term docs with the same suffix. ```api -GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest ``` If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list. ```api -GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest ``` diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 24debb744d..5e854a440c 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -1,13 +1,13 @@ # Get Definitions Test ```unison -{{ Documentation }} -names.x = 42 +nested.names.x.doc = {{ Documentation }} +nested.names.x = 42 ``` ```api -- Should NOT find names by suffix -GET /api/non-project-code/getDefinition?names=x +GET /api/projects/scratch/branches/main/getDefinition?names=x { "missingDefinitions": [ "x" @@ -16,7 +16,7 @@ GET /api/non-project-code/getDefinition?names=x "typeDefinitions": {} } -- Term names should strip relativeTo prefix. -GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested { "missingDefinitions": [], "termDefinitions": { @@ -104,14 +104,14 @@ GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested ] ], "termNames": [ - "names.x" + "nested.names.x" ] } }, "typeDefinitions": {} } -- Should find definitions by hash, names should be relative -GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested { "missingDefinitions": [], "termDefinitions": { @@ -199,30 +199,30 @@ GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested ] ], "termNames": [ - "names.x" + "nested.names.x" ] } }, "typeDefinitions": {} } ``````unison -thing.doc = {{ The correct docs for the thing }} -thing = "A thing" -thingalias.doc = {{ Docs for the alias, should not be displayed }} -thingalias = "A thing" -otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} -otherstuff.thing = "A different thing" +doctest.thing.doc = {{ The correct docs for the thing }} +doctest.thing = "A thing" +doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }} +doctest.thingalias = "A thing" +doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} +doctest.otherstuff.thing = "A different thing" ``` Only docs for the term we request should be returned, even if there are other term docs with the same suffix. ```api -GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest { "missingDefinitions": [], "termDefinitions": { "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { - "bestTermName": "thing", + "bestTermName": "doctest.thing", "defnTermTag": "Plain", "signature": [ { @@ -237,10 +237,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest "contents": [ { "annotation": { - "contents": "thing", + "contents": "doctest.thing", "tag": "HashQualifier" }, - "segment": "thing" + "segment": "doctest.thing" }, { "annotation": { @@ -265,10 +265,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest }, { "annotation": { - "contents": "thing", + "contents": "doctest.thing", "tag": "HashQualifier" }, - "segment": "thing" + "segment": "doctest.thing" }, { "annotation": { @@ -291,7 +291,7 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest }, "termDocs": [ [ - "thing.doc", + "doctest.thing.doc", "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", { "contents": [ @@ -325,8 +325,8 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest ] ], "termNames": [ - "thing", - "thingalias" + "doctest.thing", + "doctest.thingalias" ] } }, @@ -335,12 +335,12 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest ```If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list. ```api -GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest { "missingDefinitions": [], "termDefinitions": { "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { - "bestTermName": "thing.doc", + "bestTermName": "doctest.thing.doc", "defnTermTag": "Doc", "signature": [ { @@ -355,10 +355,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest "contents": [ { "annotation": { - "contents": "thing.doc", + "contents": "doctest.thing.doc", "tag": "HashQualifier" }, - "segment": "thing.doc" + "segment": "doctest.thing.doc" }, { "annotation": { @@ -383,10 +383,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest }, { "annotation": { - "contents": "thing.doc", + "contents": "doctest.thing.doc", "tag": "HashQualifier" }, - "segment": "thing.doc" + "segment": "doctest.thing.doc" }, { "annotation": { @@ -467,7 +467,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest }, "termDocs": [ [ - "thing.doc", + "doctest.thing.doc", "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", { "contents": [ @@ -501,7 +501,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest ] ], "termNames": [ - "thing.doc" + "doctest.thing.doc" ] } }, From e2f4c388b6acb1eb37796440b9b8e3d6b7ab470a Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:05:50 -0700 Subject: [PATCH 10/41] Remove loose code demo from branch --- unison-src/transcripts/branch-command.md | 13 +++----- .../transcripts/branch-command.output.md | 30 +++---------------- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/unison-src/transcripts/branch-command.md b/unison-src/transcripts/branch-command.md index fd8ad20168..d48e3c259a 100644 --- a/unison-src/transcripts/branch-command.md +++ b/unison-src/transcripts/branch-command.md @@ -5,21 +5,21 @@ scratch/main> project.create-empty foo scratch/main> project.create-empty bar ``` -First, we'll just create a loose code namespace with a term in it for later. +First, we'll create a term to include in the branches. ```unison:hide someterm = 18 ``` ```ucm -scratch/main some.loose.code.lib> builtins.merge -scratch/main some.loose.code> add +scratch/main> builtins.merge lib.builtins +scratch/main> add ``` Now, the `branch` demo: `branch` can create a branch from a different branch in the same project, from a different branch in a different -project, or from loose code. It can also create an empty branch. +project. It can also create an empty branch. ```ucm foo/main> branch topic1 @@ -40,11 +40,6 @@ bar/main> branch foo/main topic2 bar/main> branch foo/main /topic3 scratch/main> branch foo/main bar/topic4 -scratch/main some.loose.code> branch foo/topic13 -foo/main> branch .some.loose.code topic14 -foo/main> branch .some.loose.code /topic15 -scratch/main> branch .some.loose.code foo/topic16 - foo/main> branch.empty empty1 foo/main> branch.empty /empty2 foo/main> branch.empty foo/empty3 diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index 2edb91bb9b..28dd680d5c 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -1,19 +1,17 @@ The `branch` command creates a new branch. -First, we'll just create a loose code namespace with a term in it for later. +First, we'll create a term to include in the branches. ```unison someterm = 18 ``` ```ucm - ☝️ The namespace .some.loose.code.lib is empty. - -.some.loose.code.lib> builtins.merge +scratch/main> builtins.merge lib.builtins Done. -.some.loose.code> add +scratch/main> add ⍟ I've added these definitions: @@ -23,7 +21,7 @@ someterm = 18 Now, the `branch` demo: `branch` can create a branch from a different branch in the same project, from a different branch in a different -project, or from loose code. It can also create an empty branch. +project. It can also create an empty branch. ```ucm foo/main> branch topic1 @@ -126,26 +124,6 @@ scratch/main> branch foo/main bar/topic4 Done. I've created the bar/topic4 branch based off foo/main. -.some.loose.code> branch foo/topic13 - - Done. I've created the foo/topic13 branch from the namespace - .some.loose.code. - -foo/main> branch .some.loose.code topic14 - - Done. I've created the foo/topic14 branch from the namespace - .some.loose.code. - -foo/main> branch .some.loose.code /topic15 - - Done. I've created the foo/topic15 branch from the namespace - .some.loose.code. - -scratch/main> branch .some.loose.code foo/topic16 - - Done. I've created the foo/topic16 branch from the namespace - .some.loose.code. - foo/main> branch.empty empty1 Done. I've created an empty branch foo/empty1. From 6e48ce47be896cb08f0c2d815fe20eabd117719c Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:10:02 -0700 Subject: [PATCH 11/41] builtins.md converted to projects --- unison-src/transcripts/builtins-merge.md | 6 +++--- unison-src/transcripts/builtins-merge.output.md | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/unison-src/transcripts/builtins-merge.md b/unison-src/transcripts/builtins-merge.md index dec23f021d..942dd4b0d3 100644 --- a/unison-src/transcripts/builtins-merge.md +++ b/unison-src/transcripts/builtins-merge.md @@ -1,6 +1,6 @@ -The `builtins.merge` command adds the known builtins to a `builtin` subnamespace within the current namespace. +The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace. ```ucm -scratch/main tmp> builtins.merge -scratch/main tmp> ls builtin +scratch/main> builtins.merge builtins +scratch/main> ls builtins ``` diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md index 7bcf4910ec..b79bdab58d 100644 --- a/unison-src/transcripts/builtins-merge.output.md +++ b/unison-src/transcripts/builtins-merge.output.md @@ -1,13 +1,11 @@ -The `builtins.merge` command adds the known builtins to a `builtin` subnamespace within the current namespace. +The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace. ```ucm - ☝️ The namespace .tmp is empty. - -.tmp> builtins.merge +scratch/main> builtins.merge builtins Done. -.tmp> ls builtin +scratch/main> ls builtins 1. Any (builtin type) 2. Any/ (2 terms) From fcc251de2e1e375d19c5a2e13b58cbdf3185ee0b Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:10:02 -0700 Subject: [PATCH 12/41] Convert create-author.md to projects --- unison-src/transcripts/create-author.md | 4 ++-- .../transcripts/create-author.output.md | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/unison-src/transcripts/create-author.md b/unison-src/transcripts/create-author.md index c8afdb0002..af06558660 100644 --- a/unison-src/transcripts/create-author.md +++ b/unison-src/transcripts/create-author.md @@ -5,6 +5,6 @@ scratch/main> builtins.mergeio Demonstrating `create.author`: ```ucm -scratch/main foo> create.author alicecoder "Alice McGee" -scratch/main foo> view 2 +scratch/main> create.author alicecoder "Alice McGee" +scratch/main> find alicecoder ``` diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md index 3a5635947b..a71fca7b13 100644 --- a/unison-src/transcripts/create-author.output.md +++ b/unison-src/transcripts/create-author.output.md @@ -1,22 +1,21 @@ Demonstrating `create.author`: ```ucm - ☝️ The namespace .foo is empty. - -.foo> create.author alicecoder "Alice McGee" +scratch/main> create.author alicecoder "Alice McGee" Added definitions: - 1. metadata.authors.alicecoder : #345f3nptqq - 2. metadata.copyrightHolders.alicecoder : #pgornst1pq - 3. metadata.authors.alicecoder.guid : #hqectlr3gt + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID Tip: Add License values for alicecoder under metadata. -.foo> view 2 +scratch/main> find alicecoder - .foo.metadata.copyrightHolders.alicecoder : CopyrightHolder - .foo.metadata.copyrightHolders.alicecoder = - CopyrightHolder alicecoder.guid "Alice McGee" + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID + ``` From 3666e04257e57c385ce6b8999632df61e8b76fba Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:15:00 -0700 Subject: [PATCH 13/41] Convert deep-names to use projects --- unison-src/transcripts/deep-names.md | 32 ++++--- unison-src/transcripts/deep-names.output.md | 94 ++++++++++++++++++--- 2 files changed, 102 insertions(+), 24 deletions(-) diff --git a/unison-src/transcripts/deep-names.md b/unison-src/transcripts/deep-names.md index aa000b578a..9d6695bc47 100644 --- a/unison-src/transcripts/deep-names.md +++ b/unison-src/transcripts/deep-names.md @@ -13,35 +13,41 @@ http.z = 8 ```ucm:hide scratch/main> add +scratch/main> branch /app1 +scratch/main> branch /app2 ``` Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm -.app1> fork .text lib.text_v1 -.app1> fork .text lib.text_v2 -.app1> fork .http lib.http_v3 -.app1> fork .http lib.http_v4 +scratch/app1> fork text lib.text_v1 +scratch/app1> fork text lib.text_v2 +scratch/app1> delete.namespace text +scratch/app1> fork http lib.http_v3 +scratch/app1> fork http lib.http_v4 +scratch/app1> delete.namespace http ``` As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> names a -.app1> names x +scratch/app1> names a +scratch/app1> names x ``` Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. It also includes the `text` library twice as indirect dependencies via `webutil` ```ucm -.app2> fork .http lib.http_v1 -.app2> fork .http lib.http_v2 -.app2> fork .text lib.webutil.lib.text_v1 -.app2> fork .text lib.webutil.lib.text_v2 -.app2> fork .http lib.webutil.lib.http +scratch/app2> fork http lib.http_v1 +scratch/app2> fork http lib.http_v2 +scratch/app2> fork text lib.webutil.lib.text_v1 +scratch/app2> fork text lib.webutil.lib.text_v2 +scratch/app2> fork http lib.webutil.lib.http +scratch/app2> delete.namespace http +scratch/app2> delete.namespace text ``` Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. ```ucm -.app2> names a -.app2> names x +scratch/app2> names a +scratch/app2> names x ``` diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 958083bc1b..833ae613a9 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -13,27 +13,99 @@ http.z = 8 Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm - ☝️ The namespace .app1 is empty. +scratch/app1> fork text lib.text_v1 -.app1> fork .text lib.text_v1 + Done. - ⚠️ - - The namespace .text doesn't exist. +scratch/app1> fork text lib.text_v2 -``` + Done. + +scratch/app1> delete.namespace text + + Done. + +scratch/app1> fork http lib.http_v3 + + Done. + +scratch/app1> fork http lib.http_v4 + + Done. + +scratch/app1> delete.namespace http + Done. + +``` +As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> fork .text lib.text_v1.app1> fork .text lib.text_v2.app1> fork .http lib.http_v3.app1> fork .http lib.http_v4 +scratch/app1> names a + + Term + Hash: #gjmq673r1v + Names: lib.text_v1.a lib.text_v2.a + + Tip: Use `names.global` to see more results. + +scratch/app1> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v3.x lib.http_v4.x + + Tip: Use `names.global` to see more results. + ``` +Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. +It also includes the `text` library twice as indirect dependencies via `webutil` +```ucm +scratch/app2> fork http lib.http_v1 + + Done. + +scratch/app2> fork http lib.http_v2 + + Done. + +scratch/app2> fork text lib.webutil.lib.text_v1 + + Done. + +scratch/app2> fork text lib.webutil.lib.text_v2 + + Done. + +scratch/app2> fork http lib.webutil.lib.http + Done. -🛑 +scratch/app2> delete.namespace http -The transcript failed due to an error in the stanza above. The error is: + Done. +scratch/app2> delete.namespace text - ⚠️ + Done. + +``` +Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. +We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. +```ucm +scratch/app2> names a + + Term + Hash: #gjmq673r1v + Names: lib.webutil.lib.text_v1.a - The namespace .text doesn't exist. + Tip: Use `names.global` to see more results. +scratch/app2> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v1.x lib.http_v2.x + + Tip: Use `names.global` to see more results. + +``` From 2fd585e1d32d80e1dd25f55da830fbe6971a0431 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Tue, 25 Jun 2024 17:30:45 -0700 Subject: [PATCH 14/41] Port doc1 transcript to projects --- unison-src/transcripts/doc1.md | 12 +- unison-src/transcripts/doc1.output.md | 151 ++++++++++++++++++++++++-- 2 files changed, 147 insertions(+), 16 deletions(-) diff --git a/unison-src/transcripts/doc1.md b/unison-src/transcripts/doc1.md index 1288d9d3f4..6f8459395c 100644 --- a/unison-src/transcripts/doc1.md +++ b/unison-src/transcripts/doc1.md @@ -1,13 +1,13 @@ # Documenting Unison code ```ucm:hide -scratch/main> builtins.merge +scratch/main> builtins.merge lib.builtins ``` Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm -scratch/main builtin> view Doc +scratch/main> view lib.builtins.Doc ``` You can create these `Doc` values with ordinary code, or you can use the special syntax. A value of structural type `Doc` can be created via syntax like: @@ -42,7 +42,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ```ucm -scratch/main builtin> add +scratch/main> add ``` And now let's write our docs and reference these examples: @@ -67,17 +67,17 @@ List.take.doc = [: Let's add it to the codebase. ```ucm -scratch/main builtin> add +scratch/main> add ``` We can view it with `docs`, which shows the `Doc` value that is associated with a definition. ```ucm -scratch/main builtin> docs List.take +scratch/main> docs List.take ``` Note that if we view the source of the documentation, the various references are *not* expanded. ```ucm -scratch/main builtin> view List.take +scratch/main> view List.take ``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 7f4b406469..563932e2bc 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -3,26 +3,157 @@ Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm - ☝️ The namespace .builtin is empty. +scratch/main> view lib.builtins.Doc -.builtin> view Doc + type lib.builtins.Doc + = Blob Text + | Link Link + | Source Link + | Signature Term + | Evaluate Term + | Join [lib.builtins.Doc] - ⚠️ +``` +You can create these `Doc` values with ordinary code, or you can use the special syntax. A value of structural type `Doc` can be created via syntax like: + +```unison +doc1 = [: This is some documentation. + +It can span multiple lines. + +Can link to definitions like @List.drop or @List + +:] +``` + +```ucm + + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + doc1 : Doc + +``` +Syntax: + +`[:` starts a documentation block; `:]` finishes it. Within the block: + +* Links to definitions are done with `@List`. `\@` (and `\:]`) if you want to escape. +* `@[signature] List.take` expands to the type signature of `List.take` +* `@[source] List.map` expands to the full source of `List.map` +* `@[include] someOtherDoc`, inserts a value `someOtherDoc : Doc` here. +* `@[evaluate] someDefinition` expands to the result of evaluating `someDefinition`, which must be a pre-existing definition in the codebase (can't be an arbitrary expression). + +### An example + +We are going to document `List.take` using some verbiage and a few examples. First we have to add the examples to the codebase: + +```unison +List.take.ex1 = take 0 [1,2,3,4,5] +List.take.ex2 = take 2 [1,2,3,4,5] +``` + +```ucm + + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + List.take.ex1 : [Nat] + List.take.ex2 : [Nat] + +``` +```ucm +scratch/main> add + + ⍟ I've added these definitions: - The following names were not found in the codebase. Check your spelling. - Doc + List.take.ex1 : [Nat] + List.take.ex2 : [Nat] + +``` +And now let's write our docs and reference these examples: + +```unison +List.take.doc = [: +`@List.take n xs` returns the first `n` elements of `xs`. (No need to add line breaks manually. The display command will do wrapping of text for you. Indent any lines where you don't want it to do this.) + +## Examples: + + @[source] List.take.ex1 + 🔽 + @List.take.ex1 = @[evaluate] List.take.ex1 + + @[source] List.take.ex2 + 🔽 + @List.take.ex2 = @[evaluate] List.take.ex2 +:] ``` +```ucm + Loading changes detected in scratch.u. -🛑 + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + List.take.doc : Doc -The transcript failed due to an error in the stanza above. The error is: +``` +Let's add it to the codebase. +```ucm +scratch/main> add - ⚠️ + ⍟ I've added these definitions: - The following names were not found in the codebase. Check your spelling. - Doc + List.take.doc : Doc +``` +We can view it with `docs`, which shows the `Doc` value that is associated with a definition. + +```ucm +scratch/main> docs List.take + + `List.take n xs` returns the first `n` elements of `xs`. (No + need to add line breaks manually. The display command will do + wrapping of text for you. Indent any lines where you don't + want it to do this.) + + ## Examples: + + List.take.ex1 : [Nat] + List.take.ex1 = List.take 0 [1, 2, 3, 4, 5] + 🔽 + ex1 = [] + + + List.take.ex2 : [Nat] + List.take.ex2 = List.take 2 [1, 2, 3, 4, 5] + 🔽 + ex2 = [1, 2] + + +``` +Note that if we view the source of the documentation, the various references are *not* expanded. + +```ucm +scratch/main> view List.take + + builtin lib.builtins.List.take : + lib.builtins.Nat -> [a] -> [a] + +``` From 6a1ccd5a64335410759ba614d1c10468014843cf Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 10:58:27 -0700 Subject: [PATCH 15/41] Port empty-namespaces to projects --- unison-src/transcripts/empty-namespaces.md | 6 +++--- unison-src/transcripts/empty-namespaces.output.md | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/unison-src/transcripts/empty-namespaces.md b/unison-src/transcripts/empty-namespaces.md index ef17ad2363..b992593973 100644 --- a/unison-src/transcripts/empty-namespaces.md +++ b/unison-src/transcripts/empty-namespaces.md @@ -31,9 +31,9 @@ scratch/main> history mynamespace Merging an empty namespace should be a no-op ```ucm:error -scratch/main empty> history -scratch/main empty> merge.old .mynamespace -scratch/main empty> history +scratch/main> history empty +scratch/main> merge.old empty .mynamespace +scratch/main> history empty ``` Add and then delete a term to add some history to a deleted namespace. diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 092bebe1ee..2b53a52de8 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -58,21 +58,19 @@ scratch/main> history mynamespace Merging an empty namespace should be a no-op ```ucm - ☝️ The namespace .empty is empty. +scratch/main> history empty -.empty> history + ☝️ The namespace empty is empty. - ☝️ The namespace .empty is empty. - -.empty> merge.old .mynamespace +scratch/main> merge.old empty .mynamespace ⚠️ - The namespace .mynamespace doesn't exist. + The namespace empty doesn't exist. -.empty> history +scratch/main> history empty - ☝️ The namespace .empty is empty. + ☝️ The namespace empty is empty. ``` Add and then delete a term to add some history to a deleted namespace. From a92885a8bd990c0c7477207daa3c058c6ecaef07 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:01:11 -0700 Subject: [PATCH 16/41] Port emptyCodebase transcript to projects --- unison-src/transcripts/emptyCodebase.md | 8 ++++---- unison-src/transcripts/emptyCodebase.output.md | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/unison-src/transcripts/emptyCodebase.md b/unison-src/transcripts/emptyCodebase.md index 4aefd0dfda..03b4e44e9e 100644 --- a/unison-src/transcripts/emptyCodebase.md +++ b/unison-src/transcripts/emptyCodebase.md @@ -13,15 +13,15 @@ scratch/main> ls Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ```ucm -scratch/main foo> builtins.merge -scratch/main foo> ls +scratch/main> builtins.merge lib.builtins +scratch/main> ls lib ``` And for a limited time, you can get even more builtin goodies: ```ucm -scratch/main foo> builtins.mergeio -scratch/main foo> ls +scratch/main> builtins.mergeio lib.builtinsio +scratch/main> ls lib ``` More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index efa0854ec0..bbb762a284 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -15,27 +15,26 @@ scratch/main> ls Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ```ucm - ☝️ The namespace .foo is empty. - -.foo> builtins.merge +scratch/main> builtins.merge lib.builtins Done. -.foo> ls +scratch/main> ls lib - 1. builtin/ (469 terms, 74 types) + 1. builtins/ (469 terms, 74 types) ``` And for a limited time, you can get even more builtin goodies: ```ucm -.foo> builtins.mergeio +scratch/main> builtins.mergeio lib.builtinsio Done. -.foo> ls +scratch/main> ls lib - 1. builtin/ (643 terms, 92 types) + 1. builtins/ (469 terms, 74 types) + 2. builtinsio/ (643 terms, 92 types) ``` More typically, you'd start out by pulling `base. From f71008b6a28151a7c9ce6979a357d72de4d6f9e6 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:03:22 -0700 Subject: [PATCH 17/41] Port find-command to projects --- unison-src/transcripts/find-command.md | 10 +++--- unison-src/transcripts/find-command.output.md | 31 +++++++++++-------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/unison-src/transcripts/find-command.md b/unison-src/transcripts/find-command.md index d4da9f237b..019903556a 100644 --- a/unison-src/transcripts/find-command.md +++ b/unison-src/transcripts/find-command.md @@ -1,6 +1,5 @@ ```ucm:hide -scratch/main> builtins.merge -scratch/main> move builtin lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison:hide @@ -31,13 +30,12 @@ scratch/main> find-in.all cat foo scratch/main> view 1 ``` -```ucm -scratch/main somewhere> find bar -scratch/main somewhere> find.global bar -``` +Finding within a namespace ```ucm scratch/main> find bar +-- Shows UUIDs +-- scratch/main> find.global bar scratch/main> find-in somewhere bar ``` diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index 2b7ffcf65b..f75da189b8 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -57,10 +57,24 @@ scratch/main> view 1 cat.lib.foo = 5 ``` +Finding within a namespace + ```ucm - ☝️ The namespace .somewhere is empty. +scratch/main> find bar + + 1. somewhere.bar : Nat + -.somewhere> find bar +-- Shows UUIDs +-- scratch/main> find.global bar +scratch/main> find-in somewhere bar + + 1. bar : Nat + + +``` +```ucm +scratch/main> find baz ☝️ @@ -76,22 +90,13 @@ scratch/main> view 1 namespace. ``` - ```ucm -.somewhere> find bar.somewhere> find.global bar -``` - - -🛑 - -The transcript failed due to an error in the stanza above. The error is: - +scratch/main> find.global notHere 😶 No results. Check your spelling, or try using tab completion to supply command arguments. - `find.global` can be used to search outside the current - namespace. +``` From f3503cca97ba63162353a3ecdce3964eaee9a578 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:12:15 -0700 Subject: [PATCH 18/41] Port fix2243.md to projects --- unison-src/transcripts/fix2254.md | 36 +++-- unison-src/transcripts/fix2254.output.md | 176 +++++++++++++++++++++-- 2 files changed, 183 insertions(+), 29 deletions(-) diff --git a/unison-src/transcripts/fix2254.md b/unison-src/transcripts/fix2254.md index 17a2befbd2..7af9ffd9ff 100644 --- a/unison-src/transcripts/fix2254.md +++ b/unison-src/transcripts/fix2254.md @@ -1,6 +1,6 @@ ```ucm:hide -scratch/main a> builtins.merge +scratch/a> builtins.merge lib.builtins ``` This transcript checks that updates to data types propagate successfully to dependent types and dependent terms that do pattern matching. First let's create some types and terms: @@ -35,11 +35,12 @@ g = cases _ -> 43 ``` -We'll make our edits in a fork of the `a` namespace: +We'll make our edits in a new branch. ```ucm -scratch/main a> add -scratch/main> fork a a2 +scratch/a> add +scratch/a> branch a2 +scratch/a2> ``` First let's edit the `A` type, adding another constructor `E`. Note that the functions written against the old type have a wildcard in their pattern match, so they should work fine after the update. @@ -56,31 +57,29 @@ unique type A a b c d Let's do the update now, and verify that the definitions all look good and there's nothing `todo`: ```ucm -.a2> update.old -.a2> view A NeedsA f f2 f3 g -.a2> todo -``` - -```ucm:hide -.a2> builtins.merge +scratch/a2> update.old +scratch/a2> view A NeedsA f f2 f3 g +scratch/a2> todo ``` ## Record updates Here's a test of updating a record: +```ucm:hide +scratch/r1> builtins.merge lib.builtins +``` + + ```unison structural type Rec = { uno : Nat, dos : Nat } combine r = uno r + dos r ``` -```ucm:hide -.a3> builtins.merge -``` - ```ucm -.a3> add +scratch/r1> add +scratch/r1> branch r2 ``` ```unison @@ -90,7 +89,6 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } And checking that after updating this record, there's nothing `todo`: ```ucm -scratch/main> fork a3 a4 -.a4> update.old -.a4> todo +scratch/r2> update.old +scratch/r2> todo ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index b0b3f60b02..16e4285c17 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -31,13 +31,13 @@ g = cases _ -> 43 ``` -We'll make our edits in a fork of the `a` namespace: +We'll make our edits in a new branch. ```ucm -scratch/main a> add +scratch/a> add ⍟ I've added these definitions: - + type A a b c d structural type NeedsA a b f : A Nat Nat Nat Nat -> Nat @@ -45,22 +45,178 @@ scratch/main a> add f3 : NeedsA Nat Nat -> Nat g : A Nat Nat Nat Nat -> Nat -scratch/main> fork a a2 +scratch/a> branch a2 + + Done. I've created the a2 branch based off of a. + + Tip: To merge your work back into the a branch, first + `switch /a` then `merge /a2`. + +``` +First let's edit the `A` type, adding another constructor `E`. Note that the functions written against the old type have a wildcard in their pattern match, so they should work fine after the update. + +```unison +unique type A a b c d + = A a + | B b + | C c + | D d + | E a d +``` + +Let's do the update now, and verify that the definitions all look good and there's nothing `todo`: + +```ucm +scratch/a2> update.old + + ⍟ I've updated these names to your new definition: + + type A a b c d + +scratch/a2> view A NeedsA f f2 f3 g + + type A a b c d + = A a + | D d + | E a d + | B b + | C c + + structural type NeedsA a b + = NeedsA (A a b Nat Nat) + | Zoink Text + + f : A Nat Nat Nat Nat -> Nat + f = cases + A n -> n + _ -> 42 + + f2 : A Nat Nat Nat Nat -> Nat + f2 a = + use Nat + + n = f a + n + 1 + + f3 : NeedsA Nat Nat -> Nat + f3 = cases + NeedsA a -> f a Nat.+ 20 + _ -> 0 + + g : A Nat Nat Nat Nat -> Nat + g = cases + D n -> n + _ -> 43 + +scratch/a2> todo + + - ⚠️ +``` +## Record updates + +Here's a test of updating a record: - The namespace .__projects._ae607e42_8e50_43fc_bd62_57e211b16316.branches._04b92376_f428_4b46_8d52_c83ba75c6a15.a doesn't exist. +```unison +structural type Rec = { uno : Nat, dos : Nat } +combine r = uno r + dos r ``` +```ucm + + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + structural type Rec + Rec.dos : Rec -> Nat + Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.dos.set : Nat -> Rec -> Rec + Rec.uno : Rec -> Nat + Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.uno.set : Nat -> Rec -> Rec + combine : Rec -> Nat + +``` +```ucm +scratch/r1> add + + ⍟ I've added these definitions: + + structural type Rec + Rec.dos : Rec -> Nat + Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.dos.set : Nat -> Rec -> Rec + Rec.uno : Rec -> Nat + Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.uno.set : Nat -> Rec -> Rec + combine : Rec -> Nat + +scratch/r1> branch r2 + + Done. I've created the r2 branch based off of r1. + + Tip: To merge your work back into the r1 branch, first + `switch /r1` then `merge /r2`. +``` +```unison +structural type Rec = { uno : Nat, dos : Nat, tres : Text } +``` -🛑 +```ucm -The transcript failed due to an error in the stanza above. The error is: + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + Rec.tres : Rec -> Text + Rec.tres.modify : (Text ->{g} Text) -> Rec ->{g} Rec + Rec.tres.set : Text -> Rec -> Rec + + ⍟ These names already exist. You can `update` them to your + new definition: + + structural type Rec + Rec.dos : Rec -> Nat + Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.dos.set : Nat -> Rec -> Rec + Rec.uno : Rec -> Nat + Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.uno.set : Nat -> Rec -> Rec +``` +And checking that after updating this record, there's nothing `todo`: - ⚠️ +```ucm +scratch/r2> update.old - The namespace .__projects._ae607e42_8e50_43fc_bd62_57e211b16316.branches._04b92376_f428_4b46_8d52_c83ba75c6a15.a doesn't exist. + ⍟ I've added these definitions: + + Rec.tres : Rec -> Text + Rec.tres.modify : (Text ->{g} Text) -> Rec ->{g} Rec + Rec.tres.set : Text -> Rec -> Rec + + ⍟ I've updated these names to your new definition: + + structural type Rec + Rec.dos : Rec -> Nat + Rec.dos.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.dos.set : Nat -> Rec -> Rec + Rec.uno : Rec -> Nat + Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec + Rec.uno.set : Nat -> Rec -> Rec + +scratch/r2> todo + + +``` From bcb3e46218c79d944ebf527a25188995eb90bd13 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:18:41 -0700 Subject: [PATCH 19/41] Fix 2628.md for projects --- unison-src/transcripts/fix2628.md | 2 +- unison-src/transcripts/fix2628.output.md | 30 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/unison-src/transcripts/fix2628.md b/unison-src/transcripts/fix2628.md index 3e111226b5..cef5bd4a98 100644 --- a/unison-src/transcripts/fix2628.md +++ b/unison-src/transcripts/fix2628.md @@ -1,5 +1,5 @@ ```ucm:hide -scratch/main> alias.type ##Nat .base.Nat +scratch/main> alias.type ##Nat lib.base.Nat ``` ```unison:hide diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 93e2bb13af..6dba18bfaf 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -4,23 +4,23 @@ unique type foo.bar.baz.MyRecord = { } ``` +```ucm +scratch/main> add + ⍟ I've added these definitions: + + type foo.bar.baz.MyRecord + foo.bar.baz.MyRecord.value : MyRecord -> Nat + foo.bar.baz.MyRecord.value.modify : (Nat ->{g} Nat) + -> MyRecord + ->{g} MyRecord + foo.bar.baz.MyRecord.value.set : Nat + -> MyRecord + -> MyRecord -🛑 - -The transcript failed due to an error in the stanza above. The error is: - +scratch/main> find : Nat -> MyRecord - - ❓ - - I couldn't resolve any of these symbols: - - 2 | value : Nat - - - Symbol Suggestions - - Nat No matches + 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord +``` From 66259960390bb9101ec410dd166c7c765334cf01 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:20:19 -0700 Subject: [PATCH 20/41] Port fuzzy-option.md to projects --- unison-src/transcripts/fuzzy-options.md | 2 +- unison-src/transcripts/fuzzy-options.output.md | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/unison-src/transcripts/fuzzy-options.md b/unison-src/transcripts/fuzzy-options.md index 985173ae81..e460ce923a 100644 --- a/unison-src/transcripts/fuzzy-options.md +++ b/unison-src/transcripts/fuzzy-options.md @@ -12,7 +12,7 @@ If a fuzzy resolver doesn't have any options available it should print a message opening an empty fuzzy-select. ```ucm:error -scratch/main empty> view +scratch/empty> view ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index b59ac3c34e..290d07aab1 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -14,9 +14,7 @@ If a fuzzy resolver doesn't have any options available it should print a message opening an empty fuzzy-select. ```ucm - ☝️ The namespace .empty is empty. - -scratch/main empty> view +scratch/empty> view ⚠️ @@ -35,7 +33,7 @@ Definition args scratch/main> add ⍟ I've added these definitions: - + nested.optionTwo : ##Nat optionOne : ##Nat @@ -66,7 +64,7 @@ Project Branch args myproject/main> branch mybranch Done. I've created the mybranch branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. @@ -75,6 +73,7 @@ scratch/main> debug.fuzzy-options switch _ Select a project or branch to switch to: * myproject/main * myproject/mybranch + * scratch/empty * scratch/main * myproject * scratch From 59aebe93a588105544dd6c51525fc30399432d58 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:22:32 -0700 Subject: [PATCH 21/41] remove ls-pretty-print-scope-bug.md, we don't really support subnamespaces for this any more --- .../transcripts/ls-pretty-print-scope-bug.md | 44 ------- .../ls-pretty-print-scope-bug.output.md | 115 ------------------ 2 files changed, 159 deletions(-) delete mode 100644 unison-src/transcripts/ls-pretty-print-scope-bug.md delete mode 100644 unison-src/transcripts/ls-pretty-print-scope-bug.output.md diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.md b/unison-src/transcripts/ls-pretty-print-scope-bug.md deleted file mode 100644 index 36ff971074..0000000000 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.md +++ /dev/null @@ -1,44 +0,0 @@ -```unison -unique type Foo = Foo -``` - -```ucm -scratch/main a.b> add -scratch/main> fork .a.b .c.d.f -.c.g.f> -``` - -```unison -unique type Foo = Foo -``` - -```ucm -scratch/main c.g.f> add -.c> -``` - -```unison -foo = .d.f.Foo.Foo -``` - -```ucm -scratch/main c> add -``` - -At this point we have: -`.a.b.Foo` -`.c.d.f.Foo` which is equal to `.a.b.Foo` -`.c.g.f.Foo` which is distinct from the other `Foo` types - -```ucm -scratch/main> delete .c.d.f.Foo -``` -Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `scratch/main>`, but an unnamed type when viewed from `.c>`, -since referencing `.a.b.Foo` would reference names outside of the -namespace rooted at `.c`. - -```ucm -scratch/main> ls c -scratch/main c> ls -``` diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md deleted file mode 100644 index 5c0eab0b7b..0000000000 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md +++ /dev/null @@ -1,115 +0,0 @@ -```unison -unique type Foo = Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - type Foo - -``` -```ucm - ☝️ The namespace .a.b is empty. - -.a.b> add - - ⍟ I've added these definitions: - - type Foo - -scratch/main> fork .a.b .c.d.f - - Done. - - ☝️ The namespace .c.g.f is empty. - -``` -```unison -unique type Foo = Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - type Foo - -``` -```ucm -.c.g.f> add - - ⍟ I've added these definitions: - - type Foo - -``` -```unison -foo = .d.f.Foo.Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - foo : d.f.Foo - -``` -```ucm -.c> add - - ⍟ I've added these definitions: - - foo : d.f.Foo - -``` -At this point we have: -`.a.b.Foo` -`.c.d.f.Foo` which is equal to `.a.b.Foo` -`.c.g.f.Foo` which is distinct from the other `Foo` types - -```ucm -scratch/main> delete .c.d.f.Foo - - Done. - -``` -Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `scratch/main>`, but an unnamed type when viewed from `.c>`, -since referencing `.a.b.Foo` would reference names outside of the -namespace rooted at `.c`. - -```ucm -scratch/main> ls c - - nothing to show - -``` - - - -🛑 - -The transcript failed due to an error in the stanza above. The error is: - - - nothing to show - From bed7af2ab2c8673b1961eb9447b5b82e67bc7662 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:29:08 -0700 Subject: [PATCH 22/41] Half-convert move-namespace.md to projects --- unison-src/transcripts/move-namespace.md | 112 +++++++----- .../transcripts/move-namespace.output.md | 171 ++++++++++++------ 2 files changed, 178 insertions(+), 105 deletions(-) diff --git a/unison-src/transcripts/move-namespace.md b/unison-src/transcripts/move-namespace.md index 87480d5748..0d1c7ba3e5 100644 --- a/unison-src/transcripts/move-namespace.md +++ b/unison-src/transcripts/move-namespace.md @@ -1,9 +1,47 @@ # Tests for `move.namespace` + +## Moving the Root + +I should be able to move the root into a sub-namespace + +```unison:hide +foo = 1 +``` + +```ucm +.> add +-- Should request confirmation +.> move.namespace . .root.at.path +.> move.namespace . .root.at.path +.> ls +.> history +``` + +```ucm +.> ls .root.at.path +.> history .root.at.path +``` + +I should be able to move a sub namespace _over_ the root. + +```ucm +-- Should request confirmation +.> move.namespace .root.at.path . +.> move.namespace .root.at.path . +.> ls +.> history +``` + + +```ucm:error +-- should be empty +.> ls .root.at.path +.> history .root.at.path +``` + ```ucm:hide -scratch/main happy> builtins.merge -scratch/main history> builtins.merge -scratch/main existing> builtins.merge +scratch/happy> builtins.merge lib.builtins ``` ## Happy path @@ -16,7 +54,7 @@ unique type a.T = T ``` ```ucm -scratch/main happy> add +scratch/happy> add ``` ```unison @@ -25,20 +63,23 @@ unique type a.T = T1 | T2 ``` ```ucm -scratch/main happy> update +scratch/happy> update ``` Should be able to move the namespace, including its types, terms, and sub-namespaces. ```ucm -scratch/main happy> move.namespace a b -scratch/main happy> ls b -scratch/main happy> history b +scratch/happy> move.namespace a b +scratch/happy> ls b +scratch/happy> history b ``` ## Namespace history +```ucm:hide +scratch/history> builtins.merge lib.builtins +``` Create some namespaces and add some history to them @@ -48,7 +89,7 @@ b.termInB = 10 ``` ```ucm -scratch/main history> add +scratch/history> add ``` ```unison @@ -57,7 +98,7 @@ b.termInB = 11 ``` ```ucm -scratch/main history> update +scratch/history> update ``` Deleting a namespace should not leave behind any history, @@ -65,17 +106,21 @@ if we move another to that location we expect the history to simply be the histo of the moved namespace. ```ucm -scratch/main history> delete.namespace b -scratch/main history> move.namespace a b +scratch/history> delete.namespace b +scratch/history> move.namespace a b -- Should be the history from 'a' -scratch/main history> history b +scratch/history> history b -- Should be empty -scratch/main history> history a +scratch/history> history a ``` ## Moving over an existing branch +```ucm:hide +scratch/existing> builtins.merge lib.builtins +``` + Create some namespace and add some history to them ```unison @@ -84,7 +129,7 @@ b.termInB = 10 ``` ```ucm -scratch/main existing> add +scratch/existing> add ``` ```unison @@ -93,40 +138,7 @@ b.termInB = 11 ``` ```ucm -scratch/main existing> update -scratch/main existing> move.namespace a b +scratch/existing> update +scratch/existing> move.namespace a b ``` -## Moving the Root - -I should be able to move the root into a sub-namespace - -```ucm --- Should request confirmation -scratch/main> move.namespace . .root.at.path -scratch/main> move.namespace . .root.at.path -scratch/main> ls -scratch/main> history -``` - -```ucm -scratch/main> ls .root.at.path -scratch/main> history .root.at.path -``` - -I should be able to move a sub namespace _over_ the root. - -```ucm --- Should request confirmation -scratch/main> move.namespace .root.at.path.happy . -scratch/main> move.namespace .root.at.path.happy . -scratch/main> ls -scratch/main> history -``` - - -```ucm:error --- should be empty -scratch/main> ls .root.at.path.happy -scratch/main> history .root.at.path.happy -``` diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index b044a08910..257365dbdc 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -1,5 +1,102 @@ # Tests for `move.namespace` + +## Moving the Root + +I should be able to move the root into a sub-namespace + +```unison +foo = 1 +``` + +```ucm +.> add + + ⍟ I've added these definitions: + + foo : ##Nat + +-- Should request confirmation +.> move.namespace . .root.at.path + + ⚠️ + + Moves which affect the root branch cannot be undone, are you sure? + Re-run the same command to proceed. + +.> move.namespace . .root.at.path + + Done. + +.> ls + + 1. root/ (1 term) + +.> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #g97lh1m2v7 (start of history) + +``` +```ucm +.> ls .root.at.path + + 1. foo (##Nat) + +.> history .root.at.path + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #08a6hgi6s4 (start of history) + +``` +I should be able to move a sub namespace _over_ the root. + +```ucm +-- Should request confirmation +.> move.namespace .root.at.path . + + ⚠️ + + Moves which affect the root branch cannot be undone, are you sure? + Re-run the same command to proceed. + +.> move.namespace .root.at.path . + + Done. + +.> ls + + 1. foo (##Nat) + +.> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #08a6hgi6s4 (start of history) + +``` +```ucm +-- should be empty +.> ls .root.at.path + + nothing to show + +.> history .root.at.path + + ☝️ The namespace .root.at.path is empty. + +``` ## Happy path Create a namespace and add some history to it @@ -24,7 +121,7 @@ unique type a.T = T ``` ```ucm -.happy> add +scratch/happy> add ⍟ I've added these definitions: @@ -53,7 +150,7 @@ unique type a.T = T1 | T2 ``` ```ucm -.happy> update +scratch/happy> update Okay, I'm searching the branch for code that needs to be updated... @@ -64,22 +161,22 @@ unique type a.T = T1 | T2 Should be able to move the namespace, including its types, terms, and sub-namespaces. ```ucm -.happy> move.namespace a b +scratch/happy> move.namespace a b Done. -.happy> ls b +scratch/happy> ls b 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) -.happy> history b +scratch/happy> history b Note: The most recent namespace hash is immediately below this message. - ⊙ 1. #4j747vnmdk + ⊙ 1. #rkvfe5p8fu + Adds / updates: @@ -89,12 +186,11 @@ Should be able to move the namespace, including its types, terms, and sub-namesp T.T - □ 2. #r71j4144fe (start of history) + □ 2. #avlnmh0erc (start of history) ``` ## Namespace history - Create some namespaces and add some history to them ```unison @@ -117,7 +213,7 @@ b.termInB = 10 ``` ```ucm -.history> add +scratch/history> add ⍟ I've added these definitions: @@ -146,7 +242,7 @@ b.termInB = 11 ``` ```ucm -.history> update +scratch/history> update Okay, I'm searching the branch for code that needs to be updated... @@ -156,19 +252,19 @@ b.termInB = 11 ``` Deleting a namespace should not leave behind any history, if we move another to that location we expect the history to simply be the history -of the moved namespace. +of the moved namespace. ```ucm -.history> delete.namespace b +scratch/history> delete.namespace b Done. -.history> move.namespace a b +scratch/history> move.namespace a b Done. -- Should be the history from 'a' -.history> history b +scratch/history> history b Note: The most recent namespace hash is immediately below this message. @@ -182,12 +278,12 @@ of the moved namespace. □ 2. #m8smmmgjso (start of history) -- Should be empty -.history> history a +scratch/history> history a - ☝️ The namespace .history.a is empty. + ☝️ The namespace a is empty. ``` -## Moving over an existing branch +## Moving over an existing branch Create some namespace and add some history to them @@ -211,7 +307,7 @@ b.termInB = 10 ``` ```ucm -.existing> add +scratch/existing> add ⍟ I've added these definitions: @@ -240,14 +336,14 @@ b.termInB = 11 ``` ```ucm -.existing> update +scratch/existing> update Okay, I'm searching the branch for code that needs to be updated... Done. -.existing> move.namespace a b +scratch/existing> move.namespace a b ⚠️ @@ -258,38 +354,3 @@ b.termInB = 11 Done. ``` -## Moving the Root - -I should be able to move the root into a sub-namespace - -```ucm --- Should request confirmation -scratch/main> move.namespace . .root.at.path - - ⚠️ - - Moves which affect the root branch cannot be undone, are you sure? - Re-run the same command to proceed. - -scratch/main> move.namespace . .root.at.path - - Done. - -scratch/main> ls - - nothing to show - -``` - -```ucm --- Should request confirmationscratch/main> move.namespace . .root.at.pathscratch/main> move.namespace . .root.at.pathscratch/main> lsscratch/main> history -``` - - -🛑 - -The transcript failed due to an error in the stanza above. The error is: - - - nothing to show - From 6e549469cd53511e19fdaf00e26af9a52b3e473e Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:45:20 -0700 Subject: [PATCH 23/41] Port namespace-deletion-regression.md to projects --- .../namespace-deletion-regression.md | 2 +- .../namespace-deletion-regression.output.md | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/unison-src/transcripts/namespace-deletion-regression.md b/unison-src/transcripts/namespace-deletion-regression.md index f9d5fd7410..a1bc14ca3c 100644 --- a/unison-src/transcripts/namespace-deletion-regression.md +++ b/unison-src/transcripts/namespace-deletion-regression.md @@ -8,7 +8,7 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -scratch/main> alias.term ##Nat.+ .Nat.+ +scratch/main> alias.term ##Nat.+ Nat.+ scratch/main> ls Nat scratch/main> move.namespace Nat Nat.operators scratch/main> ls Nat diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index 624501a17b..21e0866f75 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -8,25 +8,24 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -scratch/main> alias.term ##Nat.+ .Nat.+ +scratch/main> alias.term ##Nat.+ Nat.+ Done. scratch/main> ls Nat - nothing to show + 1. + (##Nat -> ##Nat -> ##Nat) -``` - -```ucm -scratch/main> alias.term ##Nat.+ .Nat.+scratch/main> ls Natscratch/main> move.namespace Nat Nat.operatorsscratch/main> ls Natscratch/main> ls Nat.operators -``` +scratch/main> move.namespace Nat Nat.operators + Done. -🛑 +scratch/main> ls Nat -The transcript failed due to an error in the stanza above. The error is: + 1. operators/ (1 term) +scratch/main> ls Nat.operators - nothing to show + 1. + (##Nat -> ##Nat -> ##Nat) +``` From 3ab92ec80db2a101ee4ed6f1fd635fdd4542dceb Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:47:03 -0700 Subject: [PATCH 24/41] Leave namespace-dependencies for later --- .../namespace-dependencies.md | 4 +-- .../namespace-dependencies.output.md | 29 ++++++------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/unison-src/transcripts-using-base/namespace-dependencies.md b/unison-src/transcripts-using-base/namespace-dependencies.md index 226da3c1cd..d338c05432 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.md @@ -6,6 +6,6 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ``` ```ucm -scratch/main> add -scratch/main mynamespace> namespace.dependencies +.> add +.mynamespace> namespace.dependencies ``` diff --git a/unison-src/transcripts-using-base/namespace-dependencies.output.md b/unison-src/transcripts-using-base/namespace-dependencies.output.md index 7c4f828d0f..44e03276dd 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.output.md +++ b/unison-src/transcripts-using-base/namespace-dependencies.output.md @@ -6,31 +6,20 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ``` ```ucm -scratch/main> add +.> add ⍟ I've added these definitions: - + external.mynat : Nat mynamespace.dependsOnText : Nat - ☝️ The namespace .mynamespace is empty. - -scratch/main mynamespace> namespace.dependencies - - ⚠️ +.mynamespace> namespace.dependencies - .mynamespace is an empty namespace. + External dependency Dependents in .mynamespace + .__projects._00d11f84_cb58_44e7_9f94_a609484f5480.branches._4d14ef03_be64_4fbe_bbfd_0c32f444600d.builtin.Nat 1. dependsOnText + + .__projects._00d11f84_cb58_44e7_9f94_a609484f5480.branches._4d14ef03_be64_4fbe_bbfd_0c32f444600d.builtin.Nat.+ 1. dependsOnText + + .external.mynat 1. dependsOnText ``` - - - -🛑 - -The transcript failed due to an error in the stanza above. The error is: - - - ⚠️ - - .mynamespace is an empty namespace. - From 1014ff7a1ac785730e7654b0f6f995f3a0aa3161 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:48:47 -0700 Subject: [PATCH 25/41] Port numbered-args to projects --- unison-src/transcripts/numbered-args.md | 22 +++++++++---------- .../transcripts/numbered-args.output.md | 20 ++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/unison-src/transcripts/numbered-args.md b/unison-src/transcripts/numbered-args.md index d895be6cb8..02172710bc 100644 --- a/unison-src/transcripts/numbered-args.md +++ b/unison-src/transcripts/numbered-args.md @@ -1,7 +1,7 @@ # Using numbered arguments in UCM ```ucm:hide -scratch/main temp> alias.type ##Text Text +scratch/main> alias.type ##Text Text ``` First lets add some contents to our codebase. @@ -16,41 +16,41 @@ corge = "corge" ``` ```ucm -scratch/main temp> add +scratch/main> add ``` We can get the list of things in the namespace, and UCM will give us a numbered list: ```ucm -scratch/main temp> find +scratch/main> find ``` We can ask to `view` the second element of this list: ```ucm -scratch/main temp> find -scratch/main temp> view 2 +scratch/main> find +scratch/main> view 2 ``` And we can `view` multiple elements by separating with spaces: ```ucm -scratch/main temp> find -scratch/main temp> view 2 3 5 +scratch/main> find +scratch/main> view 2 3 5 ``` We can also ask for a range: ```ucm -scratch/main temp> find -scratch/main temp> view 2-4 +scratch/main> find +scratch/main> view 2-4 ``` And we can ask for multiple ranges and use mix of ranges and numbers: ```ucm -scratch/main temp> find -scratch/main temp> view 1-3 4 5-6 +scratch/main> find +scratch/main> view 1-3 4 5-6 ``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index b8dfce49f2..883a319de6 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -30,7 +30,7 @@ corge = "corge" ``` ```ucm -.temp> add +scratch/main> add ⍟ I've added these definitions: @@ -46,7 +46,7 @@ We can get the list of things in the namespace, and UCM will give us a numbered list: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -61,7 +61,7 @@ list: We can ask to `view` the second element of this list: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -72,7 +72,7 @@ We can ask to `view` the second element of this list: 7. builtin type Text -.temp> view 2 +scratch/main> view 2 baz : Text baz = "baz" @@ -81,7 +81,7 @@ We can ask to `view` the second element of this list: And we can `view` multiple elements by separating with spaces: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -92,7 +92,7 @@ And we can `view` multiple elements by separating with spaces: 7. builtin type Text -.temp> view 2 3 5 +scratch/main> view 2 3 5 baz : Text baz = "baz" @@ -107,7 +107,7 @@ And we can `view` multiple elements by separating with spaces: We can also ask for a range: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -118,7 +118,7 @@ We can also ask for a range: 7. builtin type Text -.temp> view 2-4 +scratch/main> view 2-4 baz : Text baz = "baz" @@ -133,7 +133,7 @@ We can also ask for a range: And we can ask for multiple ranges and use mix of ranges and numbers: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -144,7 +144,7 @@ And we can ask for multiple ranges and use mix of ranges and numbers: 7. builtin type Text -.temp> view 1-3 4 5-6 +scratch/main> view 1-3 4 5-6 bar : Text bar = "bar" From 2e1a95443ae471081f55fcb09856b351778b7c4f Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:49:49 -0700 Subject: [PATCH 26/41] Partially convert propagate.md to projects --- unison-src/transcripts/propagate.md | 31 ++++--- unison-src/transcripts/propagate.output.md | 97 ++++++++++++++++++---- 2 files changed, 95 insertions(+), 33 deletions(-) diff --git a/unison-src/transcripts/propagate.md b/unison-src/transcripts/propagate.md index 61237912c9..b5eaf3ede2 100644 --- a/unison-src/transcripts/propagate.md +++ b/unison-src/transcripts/propagate.md @@ -1,7 +1,7 @@ # Propagating type edits ```ucm:hide -scratch/main subpath.lib> builtins.merge +scratch/main> builtins.merge lib.builtins ``` We introduce a type `Foo` with a function dependent `fooToInt`. @@ -16,9 +16,9 @@ fooToInt _ = +42 And then we add it. ```ucm -scratch/main subpath> add -scratch/main subpath> find.verbose -scratch/main subpath> view fooToInt +scratch/main> add +scratch/main> find.verbose +scratch/main> view fooToInt ``` Then if we change the type `Foo`... @@ -30,13 +30,13 @@ unique type Foo = Foo | Bar and update the codebase to use the new type `Foo`... ```ucm -scratch/main subpath> update.old +scratch/main> update.old ``` ... it should automatically propagate the type to `fooToInt`. ```ucm -scratch/main subpath> view fooToInt +scratch/main> view fooToInt ``` ### Preserving user type variables @@ -55,7 +55,7 @@ preserve.otherTerm y = someTerm y Add that to the codebase: ```ucm -scratch/main subpath> add +scratch/main> add ``` Let's now edit the dependency: @@ -68,15 +68,15 @@ preserve.someTerm _ = None Update... ```ucm -scratch/main subpath> update.old +scratch/main> update.old ``` Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. ```ucm -scratch/main subpath> view preserve.someTerm -scratch/main subpath> view preserve.otherTerm +scratch/main> view preserve.someTerm +scratch/main> view preserve.otherTerm ``` ### Propagation only applies to the local branch @@ -84,8 +84,7 @@ scratch/main subpath> view preserve.otherTerm Cleaning up a bit... ```ucm -scratch/main> delete.namespace subpath -scratch/main subpath.lib> builtins.merge +.subpath.lib> builtins.merge ``` Now, we make two terms, where one depends on the other. @@ -101,8 +100,8 @@ one.otherTerm y = someTerm y We'll make two copies of this namespace. ```ucm -scratch/main subpath> add -scratch/main subpath> fork one two +.subpath> add +.subpath> fork one two ``` Now let's edit one of the terms... @@ -115,11 +114,11 @@ someTerm _ = None ... in one of the namespaces... ```ucm -scratch/main subpath.one> update.old +.subpath.one> update.old ``` The other namespace should be left alone. ```ucm -scratch/main subpath> view two.someTerm +.subpath> view two.someTerm ``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index db8dceb6d4..5e16983bc3 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -26,14 +26,14 @@ fooToInt _ = +42 And then we add it. ```ucm -.subpath> add +scratch/main> add ⍟ I've added these definitions: type Foo fooToInt : Foo -> Int -.subpath> find.verbose +scratch/main> find.verbose 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo type Foo @@ -46,7 +46,7 @@ And then we add it. -.subpath> view fooToInt +scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 @@ -75,7 +75,7 @@ unique type Foo = Foo | Bar and update the codebase to use the new type `Foo`... ```ucm -.subpath> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: @@ -85,7 +85,7 @@ and update the codebase to use the new type `Foo`... ... it should automatically propagate the type to `fooToInt`. ```ucm -.subpath> view fooToInt +scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 @@ -121,7 +121,7 @@ preserve.otherTerm y = someTerm y Add that to the codebase: ```ucm -.subpath> add +scratch/main> add ⍟ I've added these definitions: @@ -153,7 +153,7 @@ preserve.someTerm _ = None Update... ```ucm -.subpath> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: @@ -164,12 +164,12 @@ Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. ```ucm -.subpath> view preserve.someTerm +scratch/main> view preserve.someTerm preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None -.subpath> view preserve.otherTerm +scratch/main> view preserve.otherTerm preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y @@ -180,25 +180,88 @@ type of `otherTerm` should remain the same. Cleaning up a bit... ```ucm -scratch/main> delete.namespace subpath + ☝️ The namespace .subpath.lib is empty. + +.subpath.lib> builtins.merge + + Done. + +``` +Now, we make two terms, where one depends on the other. + +```unison +one.someTerm : Optional foo -> Optional foo +one.someTerm x = x + +one.otherTerm : Optional baz -> Optional baz +one.otherTerm y = someTerm y +``` + +```ucm - ⚠️ + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: - The namespace subpath doesn't exist. + ⍟ These new definitions are ok to `add`: + + one.otherTerm : Optional baz -> Optional baz + one.someTerm : Optional foo -> Optional foo ``` +We'll make two copies of this namespace. ```ucm -scratch/main> delete.namespace subpath.subpath.lib> builtins.merge +.subpath> add + + ⍟ I've added these definitions: + + one.otherTerm : Optional baz -> Optional baz + one.someTerm : Optional foo -> Optional foo + +.subpath> fork one two + + Done. + ``` +Now let's edit one of the terms... +```unison +someTerm : Optional x -> Optional x +someTerm _ = None +``` -🛑 +```ucm -The transcript failed due to an error in the stanza above. The error is: + Loading changes detected in scratch.u. + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + someTerm : Optional x -> Optional x - ⚠️ +``` +... in one of the namespaces... + +```ucm +.subpath.one> update.old + + ⍟ I've updated these names to your new definition: - The namespace subpath doesn't exist. + someTerm : #nirp5os0q6 x -> #nirp5os0q6 x +``` +The other namespace should be left alone. + +```ucm +.subpath> view two.someTerm + + two.someTerm : Optional foo -> Optional foo + two.someTerm x = x + +``` From c419cd088db3c5a4e799f62747521600b913fc19 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:53:59 -0700 Subject: [PATCH 27/41] Port sum-type-update-conflicts to projects --- unison-src/transcripts/sum-type-update-conflicts.md | 6 +++--- .../transcripts/sum-type-update-conflicts.output.md | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/unison-src/transcripts/sum-type-update-conflicts.md b/unison-src/transcripts/sum-type-update-conflicts.md index 852aa66f91..1abf98f3ba 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.md +++ b/unison-src/transcripts/sum-type-update-conflicts.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/issues/2786 ```ucm:hide -scratch/main ns> builtins.merge +scratch/main> builtins.merge lib.builtins ``` First we add a sum-type to the codebase. @@ -13,7 +13,7 @@ structural type X = x ``` ```ucm -scratch/main ns> add +scratch/main> add ``` Now we update the type, changing the name of the constructors, _but_, we simultaneously @@ -32,5 +32,5 @@ This update should succeed since the conflicted constructor is removed in the same update that the new term is being added. ```ucm -scratch/main ns> update.old +scratch/main> update.old ``` diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index fc45a547bf..493a4d9407 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -19,16 +19,16 @@ structural type X = x ⍟ These new definitions are ok to `add`: structural type X - (also named builtin.Unit) + (also named lib.builtins.Unit) ``` ```ucm -.ns> add +scratch/main> add ⍟ I've added these definitions: structural type X - (also named builtin.Unit) + (also named lib.builtins.Unit) ``` Now we update the type, changing the name of the constructors, _but_, we simultaneously @@ -60,14 +60,14 @@ dependsOnX = Text.size X.x new definition: structural type X - (The old definition is also named builtin.Unit.) + (The old definition is also named lib.builtins.Unit.) ``` This update should succeed since the conflicted constructor is removed in the same update that the new term is being added. ```ucm -.ns> update.old +scratch/main> update.old ⍟ I've added these definitions: @@ -77,6 +77,6 @@ is removed in the same update that the new term is being added. ⍟ I've updated these names to your new definition: structural type X - (The old definition was also named builtin.Unit.) + (The old definition was also named lib.builtins.Unit.) ``` From bb41e55e077a7ab13a99a63e9353b4bd67ddde48 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 11:55:35 -0700 Subject: [PATCH 28/41] Port tab-completion mostly to projects --- unison-src/transcripts/tab-completion.md | 10 +++++++++- unison-src/transcripts/tab-completion.output.md | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/unison-src/transcripts/tab-completion.md b/unison-src/transcripts/tab-completion.md index 65a7861f71..c270308fa7 100644 --- a/unison-src/transcripts/tab-completion.md +++ b/unison-src/transcripts/tab-completion.md @@ -36,8 +36,16 @@ scratch/main> debug.tab-complete view subnamespace2 -- Should prefix-filter by query suffix scratch/main> debug.tab-complete view subnamespace.some scratch/main> debug.tab-complete view subnamespace.someOther +``` + +```unison:hide +absolute.term = "absolute" +``` + +```ucm +.> add -- Should tab complete absolute names -scratch/main othernamespace> debug.tab-complete view .subnamespace.some +.> debug.tab-complete view .absolute.te ``` ## Tab complete namespaces diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 3537f7e16d..c7730c17d5 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -88,12 +88,22 @@ scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName --- Should tab complete absolute names - ☝️ The namespace .othernamespace is empty. +``` +```unison +absolute.term = "absolute" +``` -.othernamespace> debug.tab-complete view .subnamespace.some +```ucm +.> add + ⍟ I've added these definitions: + absolute.term : ##Text + +-- Should tab complete absolute names +.> debug.tab-complete view .absolute.te + + * .absolute.term ``` ## Tab complete namespaces From 5a68b4df78d2c4751e9a942f0dcdc79062974531 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 12:00:40 -0700 Subject: [PATCH 29/41] Port test-command.md to projects --- unison-src/transcripts/test-command.md | 10 ++--- unison-src/transcripts/test-command.output.md | 43 +++++++++++-------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/unison-src/transcripts/test-command.md b/unison-src/transcripts/test-command.md index 39a7b9bcad..aedcb1b59d 100644 --- a/unison-src/transcripts/test-command.md +++ b/unison-src/transcripts/test-command.md @@ -31,12 +31,12 @@ scratch/main> test `test` won't descend into the `lib` namespace, but `test.all` will. ```unison -testInLib : [Result] -testInLib = [Ok "testInLib"] +lib.dep.testInLib : [Result] +lib.dep.testInLib = [Ok "testInLib"] ``` ```ucm:hide -scratch/main lib> add +scratch/main> add ``` ```ucm @@ -44,10 +44,10 @@ scratch/main> test scratch/main> test.all ``` -`test` WILL run tests within `lib` if ucm is cd'd inside. +`test` WILL run tests within `lib` if specified explicitly. ```ucm -scratch/main lib> test +scratch/main> test lib.dep ``` `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index b7c3eaa535..7e085d0d02 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -65,8 +65,8 @@ scratch/main> test `test` won't descend into the `lib` namespace, but `test.all` will. ```unison -testInLib : [Result] -testInLib = [Ok "testInLib"] +lib.dep.testInLib : [Result] +lib.dep.testInLib = [Ok "testInLib"] ``` ```ucm @@ -79,7 +79,7 @@ testInLib = [Ok "testInLib"] ⍟ These new definitions are ok to `add`: - testInLib : [Result] + lib.dep.testInLib : [Result] ``` ```ucm @@ -96,34 +96,41 @@ scratch/main> test scratch/main> test.all - Cached test results (`help testcache` to learn more) + + Cached test results (`help testcache` to learn more) + + ◉ foo.test2 test2 + ◉ test1 test1 + + ✅ 2 test(s) passing + + ✅ + - ◉ foo.test2 test2 - ◉ test1 test1 + - ✅ 2 test(s) passing + + New test results: - Tip: Use view foo.test2 to view the source of a test. + ◉ lib.dep.testInLib testInLib + + ✅ 1 test(s) passing + + Tip: Use view lib.dep.testInLib to view the source of a test. ``` `test` WILL run tests within `lib` if ucm is cd'd inside. ```ucm -.lib> test - - ✅ +scratch/main> test lib.dep + Cached test results (`help testcache` to learn more) - - - - New test results: - - ◉ testInLib testInLib + ◉ lib.dep.testInLib testInLib ✅ 1 test(s) passing - Tip: Use view testInLib to view the source of a test. + Tip: Use view lib.dep.testInLib to view the source of a test. ``` `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. From d4a08fdc0a13b73e5e515a99ad5b69c75b969346 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 12:02:55 -0700 Subject: [PATCH 30/41] Port unitnamespace to projecs --- unison-src/transcripts/unitnamespace.md | 4 +- .../transcripts/unitnamespace.output.md | 44 +++++-------------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/unison-src/transcripts/unitnamespace.md b/unison-src/transcripts/unitnamespace.md index 41884f13c4..c1f9f5fc5b 100644 --- a/unison-src/transcripts/unitnamespace.md +++ b/unison-src/transcripts/unitnamespace.md @@ -1,9 +1,9 @@ ```unison -foo = "bar" +`()`.foo = "bar" ``` ```ucm -.`()`> add +scratch/main> add scratch/main> find scratch/main> find-in `()` scratch/main> delete.namespace `()` diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 1b5ee1893b..a3d7b39568 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -1,5 +1,5 @@ ```unison -foo = "bar" +`()`.foo = "bar" ``` ```ucm @@ -12,50 +12,28 @@ foo = "bar" ⍟ These new definitions are ok to `add`: - foo : ##Text + `()`.foo : ##Text ``` ```ucm - ☝️ The namespace .`()` is empty. - -.`()`> add +scratch/main> add ⍟ I've added these definitions: - foo : ##Text + `()`.foo : ##Text scratch/main> find - ☝️ - - I couldn't find matches in this namespace, searching in - 'lib'... - - 😶 - - No results. Check your spelling, or try using tab completion - to supply command arguments. + 1. `()`.foo : ##Text - `find.global` can be used to search outside the current - namespace. - -``` - -```ucm -.`()`> addscratch/main> findscratch/main> find-in `()`scratch/main> delete.namespace `()` -``` +scratch/main> find-in `()` -🛑 + 1. foo : ##Text + -The transcript failed due to an error in the stanza above. The error is: +scratch/main> delete.namespace `()` + Done. - 😶 - - No results. Check your spelling, or try using tab completion - to supply command arguments. - - `find.global` can be used to search outside the current - namespace. - +``` From 103569a5cd040c89f6ca59bc9dc88fc30b0a59e2 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 12:04:02 -0700 Subject: [PATCH 31/41] Port update-type-add-new-record to projects --- unison-src/transcripts/update-type-add-new-record.md | 2 +- unison-src/transcripts/update-type-add-new-record.output.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unison-src/transcripts/update-type-add-new-record.md b/unison-src/transcripts/update-type-add-new-record.md index 18abd8796c..a7f82df0c8 100644 --- a/unison-src/transcripts/update-type-add-new-record.md +++ b/unison-src/transcripts/update-type-add-new-record.md @@ -1,5 +1,5 @@ ```ucm:hide -scratch/main lib> builtins.merge +scratch/main> builtins.merge lib.builtins ``` ```unison diff --git a/unison-src/transcripts/update-type-add-new-record.output.md b/unison-src/transcripts/update-type-add-new-record.output.md index bc1fb44664..321ac28ec7 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -28,6 +28,6 @@ scratch/main> update scratch/main> view Foo - type Foo = { bar : ##Nat } + type Foo = { bar : Nat } ``` From c9c3abcd527a54da9d47f519c6d98dec594cd1ca Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 12:05:09 -0700 Subject: [PATCH 32/41] Revert view.md, will port later --- unison-src/transcripts/view.md | 12 ++++----- unison-src/transcripts/view.output.md | 35 ++++++++++++--------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/unison-src/transcripts/view.md b/unison-src/transcripts/view.md index 9e6d59526b..89b81cf51f 100644 --- a/unison-src/transcripts/view.md +++ b/unison-src/transcripts/view.md @@ -1,7 +1,7 @@ # View commands ```ucm:hide -scratch/main> builtins.merge +.> builtins.merge ``` ```unison:hide @@ -10,16 +10,16 @@ b.thing = "b" ``` ```ucm:hide -scratch/main> add +.> add ``` ```ucm -- Should suffix-search and find values in sub-namespaces -scratch/main> view thing +.> view thing -- Should be local to namespace -scratch/main a> view thing +.a> view thing -- view.global should search globally and be absolutely qualified -scratch/main a> view.global thing +.a> view.global thing -- Should support absolute paths outside of current namespace -scratch/main a> view .b.thing +.a> view .b.thing ``` diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index c3777e0452..71ebf98da7 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -7,7 +7,7 @@ b.thing = "b" ```ucm -- Should suffix-search and find values in sub-namespaces -scratch/main> view thing +.> view thing a.thing : Text a.thing = "a" @@ -16,29 +16,24 @@ scratch/main> view thing b.thing = "b" -- Should be local to namespace - ☝️ The namespace .a is empty. - .a> view thing - ⚠️ - - The following names were not found in the codebase. Check your spelling. - thing - -``` + thing : ##Text + thing = "a" -```ucm --- Should suffix-search and find values in sub-namespacesscratch/main> view thing-- Should be local to namespace.a> view thing-- view.global should search globally and be absolutely qualified.a> view.global thing-- Should support absolute paths outside of current namespace.a> view .b.thing -``` +-- view.global should search globally and be absolutely qualified +.a> view.global thing + .a.thing : Text + .a.thing = "a" + + .b.thing : Text + .b.thing = "b" -🛑 - -The transcript failed due to an error in the stanza above. The error is: +-- Should support absolute paths outside of current namespace +.a> view .b.thing + .b.thing : Text + .b.thing = "b" - ⚠️ - - The following names were not found in the codebase. Check your spelling. - thing - +``` From 2cb85ae5df6633a7f4c5fe3d3fdf131227bae86d Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 12:42:58 -0700 Subject: [PATCH 33/41] Fix up transcripts which mention __projects --- .../namespace-dependencies.output.md | 25 ------------ unison-src/transcripts/add-run.md | 6 +-- unison-src/transcripts/add-run.output.md | 12 +++--- unison-src/transcripts/api-find.md | 8 ++-- unison-src/transcripts/api-find.output.md | 40 +++++++++---------- unison-src/transcripts/bug-strange-closure.md | 18 ++++----- .../transcripts/bug-strange-closure.output.md | 20 ++++------ .../fix1709.md | 0 .../fix1709.output.md | 5 +-- .../namespace-dependencies.md | 3 +- .../namespace-dependencies.output.md | 27 +++++++++++++ 11 files changed, 77 insertions(+), 87 deletions(-) delete mode 100644 unison-src/transcripts-using-base/namespace-dependencies.output.md rename unison-src/{transcripts-using-base => transcripts}/fix1709.md (100%) rename unison-src/{transcripts-using-base => transcripts}/fix1709.output.md (79%) rename unison-src/{transcripts-using-base => transcripts}/namespace-dependencies.md (65%) create mode 100644 unison-src/transcripts/namespace-dependencies.output.md diff --git a/unison-src/transcripts-using-base/namespace-dependencies.output.md b/unison-src/transcripts-using-base/namespace-dependencies.output.md deleted file mode 100644 index 783dbad848..0000000000 --- a/unison-src/transcripts-using-base/namespace-dependencies.output.md +++ /dev/null @@ -1,25 +0,0 @@ -# namespace.dependencies command - -```unison -external.mynat = 1 -mynamespace.dependsOnText = external.mynat Nat.+ 10 -``` - -```ucm -.> add - - ⍟ I've added these definitions: - - external.mynat : Nat - mynamespace.dependsOnText : Nat - -.mynamespace> namespace.dependencies - - External dependency Dependents in .mynamespace - .__projects._f873814e_abb9_4340_a9ac_dc6afc8ecb35.branches._044aa60c_f8bb_4d48_8a31_7be34331fa69.builtin.Nat 1. dependsOnText - - .__projects._f873814e_abb9_4340_a9ac_dc6afc8ecb35.branches._044aa60c_f8bb_4d48_8a31_7be34331fa69.builtin.Nat.+ 1. dependsOnText - - .external.mynat 1. dependsOnText - -``` diff --git a/unison-src/transcripts/add-run.md b/unison-src/transcripts/add-run.md index 07fe99216d..3eeea7c031 100644 --- a/unison-src/transcripts/add-run.md +++ b/unison-src/transcripts/add-run.md @@ -123,7 +123,7 @@ main = '5 ``` ```ucm -scratch/main> run main -scratch/main> add.run .an.absolute.name -scratch/main> view .an.absolute.name +.> run main +.> add.run .an.absolute.name +.> view .an.absolute.name ``` diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index a4382a4b71..53cc27b943 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -290,21 +290,19 @@ main = '5 ``` ```ucm -scratch/main> run main +.> run main 5 -scratch/main> add.run .an.absolute.name +.> add.run .an.absolute.name ⍟ I've added these definitions: .an.absolute.name : Nat -scratch/main> view .an.absolute.name +.> view .an.absolute.name - .__projects._184d2977_a0ad_4969_9ec6_6c49b9f2cb01.branches._9f1d1b83_958a_42b7_a36c_7178447a7820.an.absolute.name : - Nat - .__projects._184d2977_a0ad_4969_9ec6_6c49b9f2cb01.branches._9f1d1b83_958a_42b7_a36c_7178447a7820.an.absolute.name = - 5 + .an.absolute.name : Nat + .an.absolute.name = 5 ``` diff --git a/unison-src/transcripts/api-find.md b/unison-src/transcripts/api-find.md index cf394bd6b6..f11d98bfcb 100644 --- a/unison-src/transcripts/api-find.md +++ b/unison-src/transcripts/api-find.md @@ -13,14 +13,14 @@ scratch/main> add ```api -- Namespace segment prefix search -GET /api/non-project-code/find?query=http +GET /api/projects/scratch/branches/main/find?query=http -- Namespace segment suffix search -GET /api/non-project-code/find?query=Server +GET /api/projects/scratch/branches/main/find?query=Server -- Substring search -GET /api/non-project-code/find?query=lesys +GET /api/projects/scratch/branches/main/find?query=lesys -- Cross-segment search -GET /api/non-project-code/find?query=joey.http +GET /api/projects/scratch/branches/main/find?query=joey.http ``` diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 0c18ae91d5..d44200e7a2 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -36,14 +36,14 @@ scratch/main> add ``` ```api -- Namespace segment prefix search -GET /api/non-project-code/find?query=http +GET /api/projects/scratch/branches/main/find?query=http [ [ { "result": { "segments": [ { - "contents": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.ross.", + "contents": "ross.", "tag": "Gap" }, { @@ -56,14 +56,14 @@ GET /api/non-project-code/find?query=http } ] }, - "score": 170 + "score": 156 }, { "contents": { "bestFoundTermName": "y", "namedTerm": { "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", - "termName": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.ross.httpClient.y", + "termName": "ross.httpClient.y", "termTag": "Plain", "termType": [ { @@ -84,7 +84,7 @@ GET /api/non-project-code/find?query=http "result": { "segments": [ { - "contents": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.joey.", + "contents": "joey.", "tag": "Gap" }, { @@ -97,14 +97,14 @@ GET /api/non-project-code/find?query=http } ] }, - "score": 170 + "score": 156 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.joey.httpServer.z", + "termName": "joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -122,14 +122,14 @@ GET /api/non-project-code/find?query=http ] ] -- Namespace segment suffix search -GET /api/non-project-code/find?query=Server +GET /api/projects/scratch/branches/main/find?query=Server [ [ { "result": { "segments": [ { - "contents": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.joey.http", + "contents": "joey.http", "tag": "Gap" }, { @@ -142,14 +142,14 @@ GET /api/non-project-code/find?query=Server } ] }, - "score": 230 + "score": 223 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.joey.httpServer.z", + "termName": "joey.httpServer.z", "termTag": "Plain", "termType": [ { @@ -167,14 +167,14 @@ GET /api/non-project-code/find?query=Server ] ] -- Substring search -GET /api/non-project-code/find?query=lesys +GET /api/projects/scratch/branches/main/find?query=lesys [ [ { "result": { "segments": [ { - "contents": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.rachel.fi", + "contents": "rachel.fi", "tag": "Gap" }, { @@ -187,14 +187,14 @@ GET /api/non-project-code/find?query=lesys } ] }, - "score": 185 + "score": 175 }, { "contents": { "bestFoundTermName": "x", "namedTerm": { "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.rachel.filesystem.x", + "termName": "rachel.filesystem.x", "termTag": "Plain", "termType": [ { @@ -212,16 +212,12 @@ GET /api/non-project-code/find?query=lesys ] ] -- Cross-segment search -GET /api/non-project-code/find?query=joey.http +GET /api/projects/scratch/branches/main/find?query=joey.http [ [ { "result": { "segments": [ - { - "contents": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.", - "tag": "Gap" - }, { "contents": "joey.http", "tag": "Match" @@ -232,14 +228,14 @@ GET /api/non-project-code/find?query=joey.http } ] }, - "score": 333 + "score": 300 }, { "contents": { "bestFoundTermName": "z", "namedTerm": { "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "__projects._4fce1d94_a201_41dc_a510_587d6a61186d.branches._d229dbff_a479_40a3_82f9_17fa36448d18.joey.httpServer.z", + "termName": "joey.httpServer.z", "termTag": "Plain", "termType": [ { diff --git a/unison-src/transcripts/bug-strange-closure.md b/unison-src/transcripts/bug-strange-closure.md index bfce3c1422..f2f805d682 100644 --- a/unison-src/transcripts/bug-strange-closure.md +++ b/unison-src/transcripts/bug-strange-closure.md @@ -1,15 +1,15 @@ ```ucm:hide -scratch/main> builtins.mergeio -scratch/main> load unison-src/transcripts-using-base/doc.md.files/syntax.u +.> builtins.mergeio +.> load unison-src/transcripts-using-base/doc.md.files/syntax.u ``` We can display the guide before and after adding it to the codebase: ```ucm -scratch/main> display doc.guide -scratch/main> add -scratch/main> display doc.guide +.> display doc.guide +.> add +.> display doc.guide ``` But we can't display this due to a decompilation problem. @@ -19,10 +19,10 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```ucm -scratch/main> display rendered -scratch/main> add -scratch/main> display rendered -scratch/main> undo +.> display rendered +.> add +.> display rendered +.> undo ``` And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index 5404081977..8b9f7fa75c 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -2,7 +2,7 @@ We can display the guide before and after adding it to the codebase: ```ucm -scratch/main> display doc.guide +.> display doc.guide # Unison computable documentation @@ -200,7 +200,7 @@ scratch/main> display doc.guide rendered table. Some text More text Zounds! -scratch/main> add +.> add ⍟ I've added these definitions: @@ -213,7 +213,7 @@ scratch/main> add otherElements : Doc2 sqr : Nat -> Nat -scratch/main> display doc.guide +.> display doc.guide # Unison computable documentation @@ -432,7 +432,7 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```ucm -scratch/main> display rendered +.> display rendered # Unison computable documentation @@ -630,13 +630,13 @@ scratch/main> display rendered rendered table. Some text More text Zounds! -scratch/main> add +.> add ⍟ I've added these definitions: rendered : Annotated () (Either SpecialForm ConsoleText) -scratch/main> display rendered +.> display rendered # Unison computable documentation @@ -834,17 +834,13 @@ scratch/main> display rendered rendered table. Some text More text Zounds! -scratch/main> undo +.> undo Here are the changes I undid Added definitions: - 1. __projects._567e16f7_c03b_4435_9ed7_2845d81ba835.branches._b666e957_74dc_4635_9d58_9ed04d0d29c9.rendered : Annotated - ( ) - (Either - SpecialForm - ConsoleText) + 1. rendered : Annotated () (Either SpecialForm ConsoleText) ``` And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. diff --git a/unison-src/transcripts-using-base/fix1709.md b/unison-src/transcripts/fix1709.md similarity index 100% rename from unison-src/transcripts-using-base/fix1709.md rename to unison-src/transcripts/fix1709.md diff --git a/unison-src/transcripts-using-base/fix1709.output.md b/unison-src/transcripts/fix1709.output.md similarity index 79% rename from unison-src/transcripts-using-base/fix1709.output.md rename to unison-src/transcripts/fix1709.output.md index dd8b899c4f..8523d4e27b 100644 --- a/unison-src/transcripts-using-base/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -17,18 +17,15 @@ id2 x = ⍟ These new definitions are ok to `add`: id : x -> x - (also named - __projects._c5503e83_aeeb_41a5_a993_a5710c894730.branches._760add7e_4d96_4853_9fd0_7461aa7775ee.id) id2 : x -> x ``` ```ucm scratch/main> add - ⊡ Ignored previously added definitions: id - ⍟ I've added these definitions: + id : x -> x id2 : x -> x ``` diff --git a/unison-src/transcripts-using-base/namespace-dependencies.md b/unison-src/transcripts/namespace-dependencies.md similarity index 65% rename from unison-src/transcripts-using-base/namespace-dependencies.md rename to unison-src/transcripts/namespace-dependencies.md index d338c05432..0e8223a6cc 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.md +++ b/unison-src/transcripts/namespace-dependencies.md @@ -1,8 +1,9 @@ # namespace.dependencies command ```unison:hide +const a b = a external.mynat = 1 -mynamespace.dependsOnText = external.mynat Nat.+ 10 +mynamespace.dependsOnText = const external.mynat 10 ``` ```ucm diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md new file mode 100644 index 0000000000..0e7d298262 --- /dev/null +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -0,0 +1,27 @@ +# namespace.dependencies command + +```unison +const a b = a +external.mynat = 1 +mynamespace.dependsOnText = const external.mynat 10 +``` + +```ucm +.> add + + ⍟ I've added these definitions: + + const : a -> b -> a + external.mynat : ##Nat + mynamespace.dependsOnText : ##Nat + +.mynamespace> namespace.dependencies + + External dependency Dependents in .mynamespace + ##Nat 1. dependsOnText + + .const 1. dependsOnText + + .external.mynat 1. dependsOnText + +``` From 568fe7bfb7fc8841dd425dc735dd1ca4b2fcc42c Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 15:07:02 -0700 Subject: [PATCH 34/41] Fix reflog transcript --- unison-src/transcripts/reflog.md | 4 ---- unison-src/transcripts/reflog.output.md | 21 ++++++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/unison-src/transcripts/reflog.md b/unison-src/transcripts/reflog.md index 47f8aa598d..3ed770196a 100644 --- a/unison-src/transcripts/reflog.md +++ b/unison-src/transcripts/reflog.md @@ -1,7 +1,3 @@ -```ucm:hide -scratch/main> builtins.merge -``` - First we make two changes to the codebase, so that there's more than one line for the `reflog` command to display: diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 47ff8d79f6..c72f84eca8 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -15,7 +15,7 @@ x = 1 ⍟ These new definitions are ok to `add`: - x : Nat + x : ##Nat ``` ```ucm @@ -23,7 +23,7 @@ scratch/main> add ⍟ I've added these definitions: - x : Nat + x : ##Nat ``` ```unison @@ -40,7 +40,7 @@ y = 2 ⍟ These new definitions are ok to `add`: - y : Nat + y : ##Nat ``` ```ucm @@ -48,11 +48,11 @@ scratch/main> add ⍟ I've added these definitions: - y : Nat + y : ##Nat scratch/main> view y - y : Nat + y : ##Nat y = 2 ``` @@ -63,18 +63,17 @@ scratch/main> reflog most recent, along with the command that got us there. Try: `fork 2 .old` - `fork #g5elf6c850 .old` to make an old namespace + `fork #7fp7j6976q .old` to make an old namespace accessible again, - `reset-root #g5elf6c850` to reset the root namespace and + `reset-root #7fp7j6976q` to reset the root namespace and its history to that of the specified namespace. When Root Hash Action - 1. now #fullnsagfj add - 2. now #g5elf6c850 add - 3. now #niau58230g builtins.merge - 4. #sg60bvjo91 history starts here + 1. now #8ur19pdmaa add + 2. now #7fp7j6976q add + 3. #sg60bvjo91 history starts here Tip: Use `diff.namespace 1 7` to compare namespaces between two points in history. From a23e7d233e3019553531f30b8e76b6bf173b51a8 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 15:47:56 -0700 Subject: [PATCH 35/41] Revert round-trip main.md transcript --- unison-src/transcripts-round-trip/main.md | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/unison-src/transcripts-round-trip/main.md b/unison-src/transcripts-round-trip/main.md index a7479d758a..7287a7ddba 100644 --- a/unison-src/transcripts-round-trip/main.md +++ b/unison-src/transcripts-round-trip/main.md @@ -1,13 +1,13 @@ This transcript verifies that the pretty-printer produces code that can be successfully parsed, for a variety of examples. Terms or types that fail to round-trip can be added to either `reparses-with-same-hash.u` or `reparses.u` as regression tests. ```ucm:hide -scratch/main> builtins.mergeio +.> builtins.mergeio ``` ```ucm:hide -scratch/main> copy.namespace builtin a1.lib.builtin -scratch/main> copy.namespace builtin a2.lib.builtin -scratch/main> load unison-src/transcripts-round-trip/reparses-with-same-hash.u +.> copy.namespace builtin a1.lib.builtin +.> copy.namespace builtin a2.lib.builtin +.> load unison-src/transcripts-round-trip/reparses-with-same-hash.u .a1> add ``` @@ -41,12 +41,12 @@ So we can see the pretty-printed output: This diff should be empty if the two namespaces are equivalent. If it's nonempty, the diff will show us the hashes that differ. ```ucm:error -scratch/main> diff.namespace a1 a2 +.> diff.namespace a1 a2 ``` ```ucm:hide -scratch/main> undo -scratch/main> undo +.> undo +.> undo ``` Now check that definitions in 'reparses.u' at least parse on round trip: @@ -72,7 +72,7 @@ x = () ``` ```ucm:hide -scratch/main> move.namespace a3 a3_old +.> move.namespace a3 a3_old .a3> copy.namespace .builtin lib.builtin .a3> load .a3> add @@ -83,7 +83,7 @@ scratch/main> move.namespace a3 a3_old These are currently all expected to have different hashes on round trip. ```ucm -scratch/main> diff.namespace a3 a3_old +.> diff.namespace a3 a3_old ``` ## Other regression tests not covered by above @@ -93,8 +93,8 @@ scratch/main> diff.namespace a3 a3_old Regression test for https://github.com/unisonweb/unison/pull/3548 ```ucm:hide -scratch/main> alias.term ##Nat.+ plus -scratch/main> edit plus -scratch/main> load -scratch/main> undo +.> alias.term ##Nat.+ plus +.> edit plus +.> load +.> undo ``` From 20b5e933814fe2c92e9e10e7f633731e05270373 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 15:52:13 -0700 Subject: [PATCH 36/41] Update rewrites.md output --- .../transcripts-manual/rewrites.output.md | 26 +++++++++---------- unison-src/transcripts/reflog.output.md | 8 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 415330f135..d1ab897dc2 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -31,7 +31,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 Let's rewrite these: ```ucm -.> rewrite rule1 +scratch/main> rewrite rule1 ☝️ @@ -39,7 +39,7 @@ Let's rewrite these: The rewritten file has been added to the top of scratch.u -.> rewrite eitherToOptional +scratch/main> rewrite eitherToOptional ☝️ @@ -112,7 +112,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 After adding to the codebase, here's the rewritten source: ```ucm -.> view ex1 Either.mapRight rule1 +scratch/main> view ex1 Either.mapRight rule1 Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b Either.mapRight f = cases @@ -158,7 +158,7 @@ blah2 = 456 Let's apply the rewrite `woot1to2`: ```ucm -.> rewrite woot1to2 +scratch/main> rewrite woot1to2 ☝️ @@ -194,7 +194,7 @@ blah2 = 456 After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ```ucm -.> view wootEx +scratch/main> view wootEx wootEx : Nat ->{Woot2} Nat wootEx a = @@ -226,7 +226,7 @@ sameFileEx = After adding the rewritten form to the codebase, here's the rewritten definitions: ```ucm -.> view foo1 foo2 sameFileEx +scratch/main> view foo1 foo2 sameFileEx foo1 : Nat foo1 = @@ -267,7 +267,7 @@ sameFileEx = In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding. ```ucm -.> rewrite rule +scratch/main> rewrite rule ☝️ @@ -301,7 +301,7 @@ sameFileEx = Instead, it should be an unbound free variable, which doesn't typecheck: ```ucm -.> load +scratch/main> load Loading changes detected in scratch.u. @@ -332,7 +332,7 @@ rule a = @rewrite ``` ```ucm -.> rewrite rule +scratch/main> rewrite rule ☝️ @@ -358,7 +358,7 @@ rule a = The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error: ```ucm -.> load +scratch/main> load Loading changes detected in scratch.u. @@ -388,7 +388,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ```ucm -.> sfind findEitherEx +scratch/main> sfind findEitherEx 🔎 @@ -398,7 +398,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () Tip: Try `edit 1` to bring this into your scratch file. -.> sfind findEitherFailure +scratch/main> sfind findEitherFailure 🔎 @@ -413,7 +413,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () Tip: Try `edit 1` or `edit 1-5` to bring these into your scratch file. -.> find 1-5 +scratch/main> find 1-5 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a 2. Exception.reraise : Either Failure a ->{Exception} a diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index c72f84eca8..08d80626be 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -63,16 +63,16 @@ scratch/main> reflog most recent, along with the command that got us there. Try: `fork 2 .old` - `fork #7fp7j6976q .old` to make an old namespace + `fork #tfjr264n82 .old` to make an old namespace accessible again, - `reset-root #7fp7j6976q` to reset the root namespace and + `reset-root #tfjr264n82` to reset the root namespace and its history to that of the specified namespace. When Root Hash Action - 1. now #8ur19pdmaa add - 2. now #7fp7j6976q add + 1. now #lt901sgk5s add + 2. now #tfjr264n82 add 3. #sg60bvjo91 history starts here Tip: Use `diff.namespace 1 7` to compare namespaces between From 1c75272e9bb134606e5d9ee25f63df54ef30444b Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Wed, 26 Jun 2024 16:09:49 -0700 Subject: [PATCH 37/41] Revert reflog transcript to trunk for now --- unison-src/transcripts/reflog.md | 16 +++++++----- unison-src/transcripts/reflog.output.md | 33 +++++++++++++------------ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/unison-src/transcripts/reflog.md b/unison-src/transcripts/reflog.md index 3ed770196a..202dc50820 100644 --- a/unison-src/transcripts/reflog.md +++ b/unison-src/transcripts/reflog.md @@ -1,3 +1,7 @@ +```ucm:hide +.> builtins.merge +``` + First we make two changes to the codebase, so that there's more than one line for the `reflog` command to display: @@ -5,23 +9,23 @@ for the `reflog` command to display: x = 1 ``` ```ucm -scratch/main> add +.> add ``` ```unison y = 2 ``` ```ucm -scratch/main> add -scratch/main> view y +.> add +.> view y ``` ```ucm -scratch/main> reflog +.> reflog ``` If we `reset-root` to its previous value, `y` disappears. ```ucm -scratch/main> reset-root 2 +.> reset-root 2 ``` ```ucm:error -scratch/main> view y +.> view y ``` diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 08d80626be..96e68114ff 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -15,15 +15,15 @@ x = 1 ⍟ These new definitions are ok to `add`: - x : ##Nat + x : Nat ``` ```ucm -scratch/main> add +.> add ⍟ I've added these definitions: - x : ##Nat + x : Nat ``` ```unison @@ -40,40 +40,41 @@ y = 2 ⍟ These new definitions are ok to `add`: - y : ##Nat + y : Nat ``` ```ucm -scratch/main> add +.> add ⍟ I've added these definitions: - y : ##Nat + y : Nat -scratch/main> view y +.> view y - y : ##Nat + y : Nat y = 2 ``` ```ucm -scratch/main> reflog +.> reflog Here is a log of the root namespace hashes, starting with the most recent, along with the command that got us there. Try: `fork 2 .old` - `fork #tfjr264n82 .old` to make an old namespace + `fork #p611n6o5ve .old` to make an old namespace accessible again, - `reset-root #tfjr264n82` to reset the root namespace and + `reset-root #p611n6o5ve` to reset the root namespace and its history to that of the specified namespace. When Root Hash Action - 1. now #lt901sgk5s add - 2. now #tfjr264n82 add - 3. #sg60bvjo91 history starts here + 1. now #rmu2vgm86a add + 2. now #p611n6o5ve add + 3. now #4bigcpnl7t builtins.merge + 4. #sg60bvjo91 history starts here Tip: Use `diff.namespace 1 7` to compare namespaces between two points in history. @@ -81,13 +82,13 @@ scratch/main> reflog ``` If we `reset-root` to its previous value, `y` disappears. ```ucm -scratch/main> reset-root 2 +.> reset-root 2 Done. ``` ```ucm -scratch/main> view y +.> view y ⚠️ From 47a3a01fbe422faeabab9643814966150eb7cdc3 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 27 Jun 2024 10:17:27 -0700 Subject: [PATCH 38/41] Fix up api transcripts --- unison-src/transcripts/api-doc-rendering.md | 2 +- .../transcripts/api-doc-rendering.output.md | 795 +++++++++++++++++- .../transcripts/api-namespace-details.md | 2 +- .../api-namespace-details.output.md | 42 +- unison-src/transcripts/api-namespace-list.md | 4 +- .../transcripts/api-namespace-list.output.md | 98 ++- unison-src/transcripts/api-summaries.md | 26 +- .../transcripts/api-summaries.output.md | 26 +- 8 files changed, 951 insertions(+), 44 deletions(-) diff --git a/unison-src/transcripts/api-doc-rendering.md b/unison-src/transcripts/api-doc-rendering.md index 1ab59a53d7..eb0d956949 100644 --- a/unison-src/transcripts/api-doc-rendering.md +++ b/unison-src/transcripts/api-doc-rendering.md @@ -90,5 +90,5 @@ scratch/main> display term.doc ``` ```api -GET /api/non-project-code/getDefinition?names=term +GET /api/projects/scratch/branches/main/getDefinition?names=term ``` diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index 6c44614548..f767c14cf7 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -147,12 +147,797 @@ scratch/main> display term.doc ``` ```api -GET /api/non-project-code/getDefinition?names=term +GET /api/projects/scratch/branches/main/getDefinition?names=term { - "missingDefinitions": [ - "term" - ], - "termDefinitions": {}, + "missingDefinitions": [], + "termDefinitions": { + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { + "bestTermName": "term", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "term", + "tag": "HashQualifier" + }, + "segment": "term" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "term", + "tag": "HashQualifier" + }, + "segment": "term" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doc", + "#kjfaflbrgl89j2uq4ruubejakm6s02cp3m61ufu7rv7tkbd4nmkvcn1fciue53v0msir9t7ds111ab9er8qfa06gsa9ddfrdfgc99mo", + { + "contents": [ + { + "contents": [ + { + "contents": "Heading", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + [ + { + "contents": [ + { + "contents": [ + { + "contents": "Heading", + "tag": "Word" + }, + { + "contents": "2", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + [ + { + "contents": [ + { + "contents": "Term", + "tag": "Word" + }, + { + "contents": "Link:", + "tag": "Word" + }, + { + "contents": { + "contents": [ + { + "annotation": { + "contents": "#k5gpql9cbdfau6lf1aja24joc3sfctvjor8esu8bemn0in3l148otb0t3vebgqrt6qml302h62bbfeftg65gec1v8ouin5m6v2969d8", + "tag": "TermReference" + }, + "segment": "otherTerm" + } + ], + "tag": "Link" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Type", + "tag": "Word" + }, + { + "contents": "Link:", + "tag": "Word" + }, + { + "contents": { + "contents": [ + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Maybe" + } + ], + "tag": "Link" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Term", + "tag": "Word" + }, + { + "contents": "source:", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + { + "contents": [ + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + { + "contents": [ + [ + { + "annotation": { + "contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "tag": "TermReference" + }, + "segment": "term" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": ": " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + [ + { + "annotation": { + "contents": "term", + "tag": "HashQualifier" + }, + "segment": "term" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "term", + "tag": "HashQualifier" + }, + "segment": "term" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ] + ], + "tag": "UserObject" + } + ], + "tag": "Term" + } + ], + "tag": "Source" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Term", + "tag": "Word" + }, + { + "contents": "signature:", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + [ + { + "annotation": { + "contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "tag": "TermReference" + }, + "segment": "term" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": ": " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ] + ], + "tag": "Signature" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": [ + { + "contents": "List", + "tag": "Word" + }, + { + "contents": "item", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ], + "tag": "BulletedList" + }, + { + "contents": [ + 1, + [ + { + "contents": [ + { + "contents": "Numbered", + "tag": "Word" + }, + { + "contents": "list", + "tag": "Word" + }, + { + "contents": "item", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "tag": "NumberedList" + }, + { + "contents": [ + { + "contents": ">", + "tag": "Word" + }, + { + "contents": "Block", + "tag": "Word" + }, + { + "contents": "quote", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Code", + "tag": "Word" + }, + { + "contents": "block", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Inline", + "tag": "Word" + }, + { + "contents": "code:", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "Nat.+" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "2" + } + ], + "tag": "Example" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": "\"doesn't typecheck\" + 1", + "tag": "Word" + }, + "tag": "Code" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": [ + { + "contents": [ + { + "contents": "Link", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": { + "contents": "https://unison-lang.org", + "tag": "Word" + }, + "tag": "Group" + } + ], + "tag": "NamedLink" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png)", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + { + "contents": "Bold", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + "tag": "Bold" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + { + "contents": "Italic", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + "tag": "Bold" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + { + "contents": "Strikethrough", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + "tag": "Strikethrough" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Horizontal", + "tag": "Word" + }, + { + "contents": "rule", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "---", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Table", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Header", + "tag": "Word" + }, + { + "contents": "1", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Header", + "tag": "Word" + }, + { + "contents": "2", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "--------", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "--------", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Cell", + "tag": "Word" + }, + { + "contents": "1", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Cell", + "tag": "Word" + }, + { + "contents": "2", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Cell", + "tag": "Word" + }, + { + "contents": "3", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + }, + { + "contents": "Cell", + "tag": "Word" + }, + { + "contents": "4", + "tag": "Word" + }, + { + "contents": "|", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Video", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": { + "contents": [ + [ + { + "mediaSourceMimeType": null, + "mediaSourceUrl": "test.mp4" + } + ], + { + "poster": "test.png" + } + ], + "tag": "Video" + }, + "tag": "Special" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "Transclusion/evaluation:", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": [ + { + "contents": [ + { + "contents": "This", + "tag": "Word" + }, + { + "contents": "doc", + "tag": "Word" + }, + { + "contents": "should", + "tag": "Word" + }, + { + "contents": "be", + "tag": "Word" + }, + { + "contents": "embedded.", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + { + "contents": [ + { + "contents": "message", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ], + "tag": "UntitledSection" + } + ], + "tag": "Paragraph" + } + ] + ], + "tag": "Section" + } + ] + ], + "tag": "Section" + } + ] + ], + "termNames": [ + "term" + ] + } + }, "typeDefinitions": {} } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-namespace-details.md b/unison-src/transcripts/api-namespace-details.md index 662d2e4db6..2d50bdae93 100644 --- a/unison-src/transcripts/api-namespace-details.md +++ b/unison-src/transcripts/api-namespace-details.md @@ -19,5 +19,5 @@ scratch/main> add ```api -- Should find names by suffix -GET /api/non-project-code/namespaces/nested.names +GET /api/projects/scratch/branches/main/namespaces/nested.names ``` diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 34f8303185..0cdf2e88be 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -36,10 +36,46 @@ scratch/main> add ``` ```api -- Should find names by suffix -GET /api/non-project-code/namespaces/nested.names +GET /api/projects/scratch/branches/main/namespaces/nested.names { "fqn": "nested.names", - "hash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg", - "readme": null + "hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o", + "readme": { + "contents": [ + { + "contents": "Here's", + "tag": "Word" + }, + { + "contents": "a", + "tag": "Word" + }, + { + "contents": { + "contents": [ + { + "contents": { + "contents": [ + { + "contents": "README", + "tag": "Word" + } + ], + "tag": "Paragraph" + }, + "tag": "Bold" + }, + { + "contents": "!", + "tag": "Word" + } + ], + "tag": "Join" + }, + "tag": "Group" + } + ], + "tag": "Paragraph" + } } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-namespace-list.md b/unison-src/transcripts/api-namespace-list.md index 1c07433e86..c3dbbeed13 100644 --- a/unison-src/transcripts/api-namespace-list.md +++ b/unison-src/transcripts/api-namespace-list.md @@ -16,7 +16,7 @@ scratch/main> add ``` ```api -GET /api/non-project-code/list?namespace=nested.names +GET /api/projects/scratch/branches/main/list?namespace=nested.names -GET /api/non-project-code/list?namespace=names&relativeTo=nested +GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested ``` diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index ddd7832ce2..4219aa1916 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -33,16 +33,102 @@ scratch/main> add ``` ```api -GET /api/non-project-code/list?namespace=nested.names +GET /api/projects/scratch/branches/main/list?namespace=nested.names { - "namespaceListingChildren": [], + "namespaceListingChildren": [ + { + "contents": { + "termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o", + "termName": "readme", + "termTag": "Doc", + "termType": [ + { + "annotation": { + "contents": "#ej86si0ur1", + "tag": "HashQualifier" + }, + "segment": "#ej86si0ur1" + } + ] + }, + "tag": "TermObject" + }, + { + "contents": { + "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "termName": "x", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + }, + "tag": "TermObject" + }, + { + "contents": { + "namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0", + "namespaceName": "x", + "namespaceSize": 1 + }, + "tag": "Subnamespace" + } + ], "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg" + "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" } -GET /api/non-project-code/list?namespace=names&relativeTo=nested +GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested { - "namespaceListingChildren": [], + "namespaceListingChildren": [ + { + "contents": { + "termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o", + "termName": "readme", + "termTag": "Doc", + "termType": [ + { + "annotation": { + "contents": "#ej86si0ur1", + "tag": "HashQualifier" + }, + "segment": "#ej86si0ur1" + } + ] + }, + "tag": "TermObject" + }, + { + "contents": { + "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "termName": "x", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + }, + "tag": "TermObject" + }, + { + "contents": { + "namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0", + "namespaceName": "x", + "namespaceSize": 1 + }, + "tag": "Subnamespace" + } + ], "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg" + "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" } ``` \ No newline at end of file diff --git a/unison-src/transcripts/api-summaries.md b/unison-src/transcripts/api-summaries.md index 8a7aa8b220..6bbc793a9f 100644 --- a/unison-src/transcripts/api-summaries.md +++ b/unison-src/transcripts/api-summaries.md @@ -34,47 +34,47 @@ scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl ```api -- term -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat -- term without name uses hash -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary -- doc -GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc -- test -GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest -- function -GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func -- constructor -GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This -- Long type signature -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType -- Long type signature with render width -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType -- Builtin Term -GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl ``` ## Type Summary APIs ```api -- data -GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing -- data with type args -GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe -- ability -GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream -- builtin type -GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat ``` diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index cc5a9fcea3..e9f93e624e 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -23,7 +23,7 @@ structural ability Stream s where ```api -- term -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat { "displayName": "nat", "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", @@ -42,7 +42,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq "tag": "Plain" } -- term without name uses hash -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary { "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", @@ -61,7 +61,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq "tag": "Plain" } -- doc -GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc { "displayName": "doc", "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", @@ -80,7 +80,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bl "tag": "Doc" } -- test -GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest { "displayName": "mytest", "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", @@ -111,7 +111,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccd "tag": "Test" } -- function -GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func { "displayName": "func", "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", @@ -151,7 +151,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3o "tag": "Plain" } -- constructor -GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This { "displayName": "Thing.This", "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", @@ -191,7 +191,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5ad "tag": "DataConstructor" } -- Long type signature -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType { "displayName": "funcWithLongType", "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", @@ -378,7 +378,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton "tag": "Plain" } -- Long type signature with render width -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType { "displayName": "funcWithLongType", "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", @@ -565,7 +565,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton "tag": "Plain" } -- Builtin Term -GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl { "displayName": "putBytesImpl", "hash": "##IO.putBytes.impl.v3", @@ -671,7 +671,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summar ```api -- data -GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing { "displayName": "Thing", "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", @@ -710,7 +710,7 @@ GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5ad "tag": "Data" } -- data with type args -GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe { "displayName": "Maybe", "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", @@ -759,7 +759,7 @@ GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6 "tag": "Data" } -- ability -GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream { "displayName": "Stream", "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", @@ -808,7 +808,7 @@ GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aa "tag": "Ability" } -- builtin type -GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat { "displayName": "Nat", "hash": "##Nat", From 384083e190a8e1896c113e81212d2e623413e5f8 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 27 Jun 2024 10:25:16 -0700 Subject: [PATCH 39/41] Revive strangely deleted bits of merge.md --- unison-src/transcripts/merge.md | 137 ++++++++++++++++++ unison-src/transcripts/merge.output.md | 188 +++++++++++++++++++++++++ 2 files changed, 325 insertions(+) diff --git a/unison-src/transcripts/merge.md b/unison-src/transcripts/merge.md index c2c632c034..66f2497e82 100644 --- a/unison-src/transcripts/merge.md +++ b/unison-src/transcripts/merge.md @@ -928,6 +928,143 @@ We will resolve this situation automatically in a future version. project/main> builtins.mergeio lib.builtins ``` +```ucm:hide +project/main> branch alice +``` + +Alice's additions: +```unison:hide +unique type Foo = Bar + +alice : Foo -> Nat +alice _ = 18 +``` + +```ucm:hide +project/alice> add +project/main> branch bob +``` + +Bob's additions: +```unison:hide +unique type Foo = Bar + +bob : Foo -> Nat +bob _ = 19 +``` + +```ucm:hide +project/bob> add +``` + +```ucm:error +project/alice> merge bob +``` + +```ucm:hide +.> project.delete project +``` + +## `merge.commit` example (success) + +After merge conflicts are resolved, you can use `merge.commit` rather than `switch` + `merge` + `branch.delete` to +"commit" your changes. + +```ucm:hide +.> project.create-empty project +project/main> builtins.mergeio lib.builtins +``` + +Original branch: +```unison:hide +foo : Text +foo = "old foo" +``` + +```ucm:hide +project/main> add +project/main> branch alice +``` + +Alice's changes: +```unison:hide +foo : Text +foo = "alices foo" +``` + +```ucm:hide +project/alice> update +project/main> branch bob +``` + +Bob's changes: + +```unison:hide +foo : Text +foo = "bobs foo" +``` + +Attempt to merge: + +```ucm:hide +project/bob> update +``` +```ucm:error +project/alice> merge /bob +``` + +Resolve conflicts and commit: + +```unison +foo : Text +foo = "alice and bobs foo" +``` + +```ucm +project/merge-bob-into-alice> update +project/merge-bob-into-alice> merge.commit +project/alice> view foo +project/alice> branches +``` + +```ucm:hide +.> project.delete project +``` + +## `merge.commit` example (failure) + +`merge.commit` can only be run on a "merge branch". + +```ucm:hide +.> project.create-empty project +project/main> builtins.mergeio lib.builtins +``` + +```ucm +project/main> branch topic +``` + +```ucm:error +project/topic> merge.commit +``` + +```ucm:hide +.> project.delete project +``` + + +## Precondition violations + +There are a number of conditions under which we can't perform a merge, and the user will have to fix up the namespace(s) manually before attempting to merge again. + +### Conflicted aliases + +If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice's branch, then we don't know whether to update Bob's dependents to Alice's `foo` or Alice's `bar` (and vice-versa). + +```ucm:hide +project/main> builtins.mergeio lib.builtins +``` + Original branch: ```unison:hide foo : Nat diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 1207a123cf..258413502d 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -1030,6 +1030,194 @@ which is a parse error. We will resolve this situation automatically in a future version. +Alice's additions: +```unison +unique type Foo = Bar + +alice : Foo -> Nat +alice _ = 18 +``` + +Bob's additions: +```unison +unique type Foo = Bar + +bob : Foo -> Nat +bob _ = 19 +``` + +```ucm +project/alice> merge bob + + I couldn't automatically merge project/bob into project/alice. + However, I've added the definitions that need attention to the + top of scratch.u. + + When you're done, you can run + + merge.commit + + to merge your changes back into alice and delete the temporary + branch. Or, if you decide to cancel the merge instead, you can + run + + delete.branch /merge-bob-into-alice + + to delete the temporary branch and switch back to alice. + +``` +```unison:added-by-ucm scratch.u +-- project/alice +type Foo + = Bar + +-- project/bob +type Foo + = Bar + +-- The definitions below are not conflicted, but they each depend on one or more +-- conflicted definitions above. + +alice : Foo -> Nat +alice _ = 18 + +bob : Foo -> Nat +bob _ = 19 + + +``` + +## `merge.commit` example (success) + +After merge conflicts are resolved, you can use `merge.commit` rather than `switch` + `merge` + `branch.delete` to +"commit" your changes. + +Original branch: +```unison +foo : Text +foo = "old foo" +``` + +Alice's changes: +```unison +foo : Text +foo = "alices foo" +``` + +Bob's changes: + +```unison +foo : Text +foo = "bobs foo" +``` + +Attempt to merge: + +```ucm +project/alice> merge /bob + + I couldn't automatically merge project/bob into project/alice. + However, I've added the definitions that need attention to the + top of scratch.u. + + When you're done, you can run + + merge.commit + + to merge your changes back into alice and delete the temporary + branch. Or, if you decide to cancel the merge instead, you can + run + + delete.branch /merge-bob-into-alice + + to delete the temporary branch and switch back to alice. + +``` +```unison:added-by-ucm scratch.u +-- project/alice +foo : Text +foo = "alices foo" + +-- project/bob +foo : Text +foo = "bobs foo" + + +``` + +Resolve conflicts and commit: + +```unison +foo : Text +foo = "alice and bobs foo" +``` + +```ucm + + Loading changes detected in scratch.u. + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⍟ These new definitions are ok to `add`: + + foo : Text + +``` +```ucm +project/merge-bob-into-alice> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. + +project/merge-bob-into-alice> merge.commit + + I fast-forward merged project/merge-bob-into-alice into + project/alice. + +project/alice> view foo + + foo : Text + foo = "alice and bobs foo" + +project/alice> branches + + Branch Remote branch + 1. alice + 2. bob + 3. main + +``` +## `merge.commit` example (failure) + +`merge.commit` can only be run on a "merge branch". + +```ucm +project/main> branch topic + + Done. I've created the topic branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic`. + +``` +```ucm +project/topic> merge.commit + + It doesn't look like there's a merge in progress. + +``` +## Precondition violations + +There are a number of conditions under which we can't perform a merge, and the user will have to fix up the namespace(s) manually before attempting to merge again. + +### Conflicted aliases + +If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice's branch, then we don't know whether to update Bob's dependents to Alice's `foo` or Alice's `bar` (and vice-versa). + Original branch: ```unison foo : Nat From 4b7cf99df6f30a82cd18e5924bfbfcabff71a8c3 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 27 Jun 2024 10:55:45 -0700 Subject: [PATCH 40/41] Fix fix5080 pulling over the network --- unison-src/transcripts/fix5080.md | 16 ++++---- unison-src/transcripts/fix5080.output.md | 49 +++++++----------------- 2 files changed, 21 insertions(+), 44 deletions(-) diff --git a/unison-src/transcripts/fix5080.md b/unison-src/transcripts/fix5080.md index 4c80c07602..5c343603de 100644 --- a/unison-src/transcripts/fix5080.md +++ b/unison-src/transcripts/fix5080.md @@ -1,18 +1,18 @@ -```ucm -.> project.create test-5080 +```ucm:hide +scratch/main> builtins.merge lib.builtins ``` ```unison -test> fix5080.tests.success = check (6 Nat.== 6) -test> fix5080.tests.failure = check (2 Nat.== 4) +test> fix5080.tests.success = [Ok "success"] +test> fix5080.tests.failure = [Fail "fail"] ``` ```ucm:error -test-5080/main> add -test-5080/main> test +scratch/main> add +scratch/main> test ``` ```ucm -test-5080/main> delete.term 2 -test-5080/main> test +scratch/main> delete.term 2 +scratch/main> test ``` diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index cccf11a8f2..c9d0b7c0ce 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -1,29 +1,6 @@ -```ucm -.> project.create test-5080 - - 🎉 I've created the project test-5080. - - I'll now fetch the latest version of the base Unison - library... - - Downloaded 14067 entities. - - 🎨 Type `ui` to explore this project's code in your browser. - 🔭 Discover libraries at https://share.unison-lang.org - 📖 Use `help-topic projects` to learn more about projects. - - Write your first Unison code with UCM: - - 1. Open scratch.u. - 2. Write some Unison code and save the file. - 3. In UCM, type `add` to save it to your new project. - - 🎉 🥳 Happy coding! - -``` ```unison -test> fix5080.tests.success = check (6 Nat.== 6) -test> fix5080.tests.failure = check (2 Nat.== 4) +test> fix5080.tests.success = [Ok "success"] +test> fix5080.tests.failure = [Fail "fail"] ``` ```ucm @@ -42,30 +19,30 @@ test> fix5080.tests.failure = check (2 Nat.== 4) Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. - 1 | test> fix5080.tests.success = check (6 Nat.== 6) + 1 | test> fix5080.tests.success = [Ok "success"] - ✅ Passed Passed + ✅ Passed success - 2 | test> fix5080.tests.failure = check (2 Nat.== 4) + 2 | test> fix5080.tests.failure = [Fail "fail"] - 🚫 FAILED Failed + 🚫 FAILED fail ``` ```ucm -test-5080/main> add +scratch/main> add ⍟ I've added these definitions: fix5080.tests.failure : [Result] fix5080.tests.success : [Result] -test-5080/main> test +scratch/main> test Cached test results (`help testcache` to learn more) - 1. fix5080.tests.success ◉ Passed + 1. fix5080.tests.success ◉ success - 2. fix5080.tests.failure ✗ Failed + 2. fix5080.tests.failure ✗ fail 🚫 1 test(s) failing, ✅ 1 test(s) passing @@ -73,15 +50,15 @@ test-5080/main> test ``` ```ucm -test-5080/main> delete.term 2 +scratch/main> delete.term 2 Done. -test-5080/main> test +scratch/main> test Cached test results (`help testcache` to learn more) - 1. fix5080.tests.success ◉ Passed + 1. fix5080.tests.success ◉ success ✅ 1 test(s) passing From 937ac50e0af4919903e78e3b610ccd82efe36e89 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Thu, 27 Jun 2024 11:08:05 -0700 Subject: [PATCH 41/41] Don't pull base in docs.to-html --- unison-src/transcripts-manual/docs.to-html.md | 3 +- .../transcripts-manual/docs.to-html.output.md | 39 ++++--------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/unison-src/transcripts-manual/docs.to-html.md b/unison-src/transcripts-manual/docs.to-html.md index 528d038e49..282de4e5e5 100644 --- a/unison-src/transcripts-manual/docs.to-html.md +++ b/unison-src/transcripts-manual/docs.to-html.md @@ -1,6 +1,5 @@ ```ucm -.> project.create test-html-docs -test-html-docs/main> builtins.merge +test-html-docs/main> builtins.mergeio lib.builtins ``` ```unison diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index d0ff08ce86..7755e2e2de 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -1,26 +1,5 @@ ```ucm -.> project.create test-html-docs - - 🎉 I've created the project test-html-docs. - - I'll now fetch the latest version of the base Unison - library... - - Downloaded 14067 entities. - - 🎨 Type `ui` to explore this project's code in your browser. - 🔭 Discover libraries at https://share.unison-lang.org - 📖 Use `help-topic projects` to learn more about projects. - - Write your first Unison code with UCM: - - 1. Open scratch.u. - 2. Write some Unison code and save the file. - 3. In UCM, type `add` to save it to your new project. - - 🎉 🥳 Happy coding! - -test-html-docs/main> builtins.merge +test-html-docs/main> builtins.mergeio lib.builtins Done. @@ -47,13 +26,11 @@ some.outside = 3 ⍟ These new definitions are ok to `add`: some.ns.direct : Nat - some.ns.direct.doc : Doc + some.ns.direct.doc : Doc2 some.ns.pretty.deeply.nested : Nat - (also named lib.base.data.Map.internal.ratio) - some.ns.pretty.deeply.nested.doc : Doc + some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat - (also named lib.base.data.Map.internal.delta) - some.outside.doc : Doc + some.outside.doc : Doc2 ``` ```ucm @@ -62,13 +39,11 @@ test-html-docs/main> add ⍟ I've added these definitions: some.ns.direct : Nat - some.ns.direct.doc : Doc + some.ns.direct.doc : Doc2 some.ns.pretty.deeply.nested : Nat - (also named lib.base.data.Map.internal.ratio) - some.ns.pretty.deeply.nested.doc : Doc + some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat - (also named lib.base.data.Map.internal.delta) - some.outside.doc : Doc + some.outside.doc : Doc2 test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html