From 92721fdf5d1e678c571b97704d43ada591b33ef4 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 1 Oct 2024 14:22:56 -0600 Subject: [PATCH 01/15] Make transcript output valid Markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All serialization is now down via CMark (previously, all `api` and `ucm` blocks in the output were still being serialized directly, because of the interleaving of the input text and command/request output). This causes a few changes to the existing transcript outputs: - there is now always a blank line between Markdown block elements, - leading blank lines in UCM blocks are gone, - blank lines at the end of transcripts are gone (they still end with a final POSIX newline), and - some `ucm` blocks now have 4-backtick fences (because they contain triple-backticks). Transcript failures are now also handled as Markdown, rather than just being text appended to the document. This mostly doesn’t change the serialization, except that the failure message is now fenced, since they often contain newlines and indentation that is mangled otherwise. --- parser-typechecker/src/Unison/Util/TQueue.hs | 5 +- .../IntegrationTests/transcript.output.md | 2 +- unison-cli/src/Unison/Codebase/Transcript.hs | 5 + .../src/Unison/Codebase/Transcript/Parser.hs | 18 +- .../src/Unison/Codebase/Transcript/Runner.hs | 453 +++++++++--------- unison-cli/src/Unison/Main.hs | 7 +- unison-cli/tests/Unison/Test/Ucm.hs | 7 +- unison-cli/transcripts/Transcripts.hs | 63 ++- .../transcripts-manual/docs.to-html.output.md | 3 +- .../transcripts-manual/rewrites.output.md | 9 + .../transcripts-round-trip/main.output.md | 8 +- .../transcripts-using-base/_base.output.md | 2 +- .../binary-encoding-nats.output.md | 2 +- .../transcripts-using-base/codeops.output.md | 11 +- .../transcripts-using-base/doc.output.md | 15 +- .../failure-tests.output.md | 4 +- .../transcripts-using-base/fix2049.output.md | 1 + .../fix2158-1.output.md | 3 +- .../transcripts-using-base/fix2297.output.md | 1 - .../transcripts-using-base/fix2358.output.md | 2 +- .../transcripts-using-base/fix3166.output.md | 5 +- .../transcripts-using-base/fix3542.output.md | 1 - .../transcripts-using-base/fix3939.output.md | 2 +- .../transcripts-using-base/fix4746.output.md | 1 - .../transcripts-using-base/fix5129.output.md | 3 +- .../transcripts-using-base/hashing.output.md | 11 +- .../transcripts-using-base/mvar.output.md | 2 +- .../nat-coersion.output.md | 2 +- .../transcripts-using-base/net.output.md | 5 +- .../random-deserial.output.md | 2 +- .../ref-promise.output.md | 14 +- .../serial-test-00.output.md | 2 +- .../serial-test-01.output.md | 2 +- .../serial-test-02.output.md | 2 +- .../serial-test-03.output.md | 2 +- .../serial-test-04.output.md | 2 +- .../transcripts-using-base/stm.output.md | 5 +- .../test-watch-dependencies.output.md | 5 +- .../transcripts-using-base/thread.output.md | 7 +- .../transcripts-using-base/tls.output.md | 5 +- .../transcripts-using-base/utf8.output.md | 8 +- unison-src/transcripts/abilities.output.md | 2 +- ...ability-order-doesnt-affect-hash.output.md | 2 +- ...ability-term-conflicts-on-update.output.md | 15 +- unison-src/transcripts/add-run.output.md | 27 +- .../transcripts/addupdatemessages.output.md | 11 +- unison-src/transcripts/alias-many.output.md | 2 +- unison-src/transcripts/alias-term.output.md | 3 + unison-src/transcripts/alias-type.output.md | 3 + unison-src/transcripts/anf-tests.output.md | 2 +- unison-src/transcripts/any-extract.output.md | 2 +- .../transcripts/api-doc-rendering.output.md | 2 +- unison-src/transcripts/api-find.output.md | 4 +- .../transcripts/api-getDefinition.output.md | 1 - .../api-list-projects-branches.output.md | 1 - .../api-namespace-details.output.md | 4 +- .../transcripts/api-namespace-list.output.md | 4 +- .../transcripts/api-summaries.output.md | 1 - .../block-on-required-update.output.md | 5 +- unison-src/transcripts/blocks.output.md | 25 +- .../boolean-op-pretty-print-2819.output.md | 2 +- .../transcripts/branch-command.output.md | 3 + .../branch-relative-path.output.md | 5 +- unison-src/transcripts/bug-fix-4354.output.md | 1 - .../transcripts/bug-strange-closure.output.md | 17 +- unison-src/transcripts/builtins.output.md | 9 +- .../transcripts/bytesFromList.output.md | 1 - unison-src/transcripts/check763.output.md | 2 +- unison-src/transcripts/check873.output.md | 4 +- .../constructor-applied-to-unit.output.md | 1 - .../transcripts/contrabilities.output.md | 1 - .../transcripts/cycle-update-1.output.md | 5 +- .../transcripts/cycle-update-2.output.md | 5 +- .../transcripts/cycle-update-3.output.md | 5 +- .../transcripts/cycle-update-4.output.md | 5 +- .../transcripts/debug-name-diffs.output.md | 2 +- unison-src/transcripts/deep-names.output.md | 3 + .../transcripts/definition-diff-api.output.md | 8 +- ...elete-namespace-dependents-check.output.md | 2 +- .../transcripts/delete-namespace.output.md | 5 + .../delete-project-branch.output.md | 5 + .../transcripts/delete-silent.output.md | 1 + unison-src/transcripts/delete.output.md | 13 + ...ependents-dependencies-debugfile.output.md | 3 +- .../transcripts/destructuring-binds.output.md | 10 +- .../transcripts/diff-namespace.output.md | 20 +- .../transcripts/doc-formatting.output.md | 39 +- unison-src/transcripts/doc1.output.md | 10 +- unison-src/transcripts/doc2.output.md | 2 +- unison-src/transcripts/doc2markdown.output.md | 6 +- ...t-upgrade-refs-that-exist-in-old.output.md | 2 +- .../transcripts/duplicate-names.output.md | 10 +- .../duplicate-term-detection.output.md | 7 +- unison-src/transcripts/ed25519.output.md | 1 - unison-src/transcripts/edit-command.output.md | 4 +- .../transcripts/edit-namespace.output.md | 6 +- .../transcripts/empty-namespaces.output.md | 6 + .../transcripts/emptyCodebase.output.md | 4 +- .../transcripts/error-messages.output.md | 41 +- .../errors/missing-result-typed.output.md | 6 +- .../errors/missing-result.output.md | 6 +- .../errors/ucm-hide-all-error.output.md | 2 - .../transcripts/errors/ucm-hide-all.output.md | 6 +- .../errors/ucm-hide-error.output.md | 2 - .../transcripts/errors/ucm-hide.output.md | 6 +- .../errors/unison-hide-all-error.output.md | 2 - .../errors/unison-hide-all.output.md | 6 +- .../errors/unison-hide-error.output.md | 2 - .../transcripts/errors/unison-hide.output.md | 6 +- .../transcripts/escape-sequences.output.md | 1 - unison-src/transcripts/find-by-type.output.md | 1 + unison-src/transcripts/find-command.output.md | 3 + .../fix-1381-excess-propagate.output.md | 3 + .../fix-2258-if-as-list-element.output.md | 1 - unison-src/transcripts/fix-5267.output.md | 5 +- unison-src/transcripts/fix-5301.output.md | 4 +- unison-src/transcripts/fix-5312.output.md | 6 +- unison-src/transcripts/fix-5320.output.md | 2 +- unison-src/transcripts/fix-5323.output.md | 4 +- unison-src/transcripts/fix-5326.output.md | 19 +- unison-src/transcripts/fix-5340.output.md | 6 +- unison-src/transcripts/fix-5357.output.md | 7 +- unison-src/transcripts/fix-5369.output.md | 5 +- unison-src/transcripts/fix-5374.output.md | 5 +- unison-src/transcripts/fix-5380.output.md | 3 +- unison-src/transcripts/fix-5402.output.md | 3 +- .../transcripts/fix-big-list-crash.output.md | 1 - unison-src/transcripts/fix-ls.output.md | 3 +- unison-src/transcripts/fix1063.output.md | 2 +- unison-src/transcripts/fix1327.output.md | 2 +- unison-src/transcripts/fix1390.output.md | 5 +- unison-src/transcripts/fix1421.output.md | 2 +- unison-src/transcripts/fix1532.output.md | 7 +- unison-src/transcripts/fix1696.output.md | 1 - unison-src/transcripts/fix1709.output.md | 4 +- unison-src/transcripts/fix1731.output.md | 1 - unison-src/transcripts/fix1800.output.md | 3 + unison-src/transcripts/fix1844.output.md | 1 - unison-src/transcripts/fix1926.output.md | 4 +- unison-src/transcripts/fix2026.output.md | 2 +- unison-src/transcripts/fix2027.output.md | 2 +- unison-src/transcripts/fix2049.output.md | 4 +- unison-src/transcripts/fix2156.output.md | 1 - unison-src/transcripts/fix2167.output.md | 3 +- unison-src/transcripts/fix2187.output.md | 1 - unison-src/transcripts/fix2231.output.md | 2 +- unison-src/transcripts/fix2238.output.md | 2 +- unison-src/transcripts/fix2254.output.md | 7 +- unison-src/transcripts/fix2268.output.md | 1 - unison-src/transcripts/fix2334.output.md | 1 - unison-src/transcripts/fix2344.output.md | 1 - unison-src/transcripts/fix2350.output.md | 1 - unison-src/transcripts/fix2353.output.md | 1 - unison-src/transcripts/fix2354.output.md | 1 - unison-src/transcripts/fix2355.output.md | 1 - unison-src/transcripts/fix2378.output.md | 1 - unison-src/transcripts/fix2423.output.md | 1 - unison-src/transcripts/fix2474.output.md | 2 +- unison-src/transcripts/fix2663.output.md | 1 - unison-src/transcripts/fix2693.output.md | 6 +- unison-src/transcripts/fix2712.output.md | 4 +- unison-src/transcripts/fix2822.output.md | 11 +- unison-src/transcripts/fix2826.output.md | 5 +- unison-src/transcripts/fix2840.output.md | 3 +- unison-src/transcripts/fix2970.output.md | 2 +- unison-src/transcripts/fix3037.output.md | 3 +- unison-src/transcripts/fix3171.output.md | 1 - unison-src/transcripts/fix3196.output.md | 1 - unison-src/transcripts/fix3215.output.md | 1 - unison-src/transcripts/fix3244.output.md | 1 - unison-src/transcripts/fix3265.output.md | 3 +- unison-src/transcripts/fix3424.output.md | 4 +- unison-src/transcripts/fix3634.output.md | 2 +- unison-src/transcripts/fix3678.output.md | 1 - unison-src/transcripts/fix3752.output.md | 1 - unison-src/transcripts/fix3773.output.md | 1 - unison-src/transcripts/fix3977.output.md | 2 +- unison-src/transcripts/fix4172.output.md | 5 +- unison-src/transcripts/fix4280.output.md | 1 - unison-src/transcripts/fix4397.output.md | 1 - unison-src/transcripts/fix4415.output.md | 1 - unison-src/transcripts/fix4424.output.md | 1 + unison-src/transcripts/fix4482.output.md | 4 +- unison-src/transcripts/fix4498.output.md | 2 +- unison-src/transcripts/fix4515.output.md | 5 +- unison-src/transcripts/fix4528.output.md | 2 +- unison-src/transcripts/fix4556.output.md | 5 +- unison-src/transcripts/fix4592.output.md | 1 - unison-src/transcripts/fix4618.output.md | 5 +- unison-src/transcripts/fix4711.output.md | 4 +- unison-src/transcripts/fix4722.output.md | 1 - unison-src/transcripts/fix4731.output.md | 10 +- unison-src/transcripts/fix4780.output.md | 1 - unison-src/transcripts/fix4898.output.md | 3 +- unison-src/transcripts/fix5055.output.md | 3 +- unison-src/transcripts/fix5076.output.md | 1 - unison-src/transcripts/fix5080.output.md | 3 +- unison-src/transcripts/fix5141.output.md | 1 - unison-src/transcripts/fix5168.output.md | 1 - unison-src/transcripts/fix5349.output.md | 5 +- unison-src/transcripts/fix614.output.md | 9 +- unison-src/transcripts/fix689.output.md | 1 - unison-src/transcripts/fix693.output.md | 10 +- unison-src/transcripts/fix845.output.md | 9 +- unison-src/transcripts/fix849.output.md | 1 - unison-src/transcripts/fix942.output.md | 8 +- unison-src/transcripts/fix987.output.md | 7 +- unison-src/transcripts/formatter.output.md | 3 +- .../transcripts/fuzzy-options.output.md | 6 +- .../generic-parse-errors.output.md | 11 +- unison-src/transcripts/hello.output.md | 4 +- unison-src/transcripts/help.output.md | 2 +- unison-src/transcripts/higher-rank.output.md | 8 +- .../transcripts/input-parse-errors.output.md | 5 +- .../transcripts/io-test-command.output.md | 2 + unison-src/transcripts/io.output.md | 25 +- .../transcripts/keyword-identifiers.output.md | 1 - .../transcripts/kind-inference.output.md | 35 +- unison-src/transcripts/lambdacase.output.md | 15 +- .../transcripts/lsp-name-completion.output.md | 1 + unison-src/transcripts/merge.output.md | 132 ++++- unison-src/transcripts/move-all.output.md | 13 +- .../transcripts/move-namespace.output.md | 23 +- .../transcripts/name-resolution.output.md | 48 +- .../transcripts/name-segment-escape.output.md | 1 + .../transcripts/name-selection.output.md | 8 +- unison-src/transcripts/names.output.md | 5 +- .../namespace-dependencies.output.md | 1 + .../transcripts/namespace-directive.output.md | 11 +- .../no-hash-in-term-declaration.output.md | 1 - .../transcripts/numbered-args.output.md | 7 +- .../transcripts/old-fold-right.output.md | 1 - .../pattern-match-coverage.output.md | 108 +++-- .../pattern-pretty-print-2345.output.md | 2 +- .../transcripts/patternMatchTls.output.md | 2 +- unison-src/transcripts/patterns.output.md | 1 - unison-src/transcripts/propagate.output.md | 13 +- unison-src/transcripts/pull-errors.output.md | 2 - unison-src/transcripts/records.output.md | 7 +- unison-src/transcripts/reflog.output.md | 8 +- .../release-draft-command.output.md | 4 +- unison-src/transcripts/reset.output.md | 6 +- .../transcripts/resolution-failures.output.md | 7 +- unison-src/transcripts/rsa.output.md | 1 - unison-src/transcripts/scope-ref.output.md | 1 - unison-src/transcripts/suffixes.output.md | 11 +- .../sum-type-update-conflicts.output.md | 5 +- .../transcripts/switch-command.output.md | 7 +- .../transcripts/tab-completion.output.md | 12 +- unison-src/transcripts/tdnr.output.md | 101 ++-- unison-src/transcripts/test-command.output.md | 8 +- .../transcripts/text-literals.output.md | 2 +- unison-src/transcripts/textfind.output.md | 7 +- .../transcripts/todo-bug-builtins.output.md | 7 +- unison-src/transcripts/todo.output.md | 24 +- .../top-level-exceptions.output.md | 6 +- .../transcript-parser-commands.output.md | 6 +- unison-src/transcripts/type-deps.output.md | 2 +- .../type-modifier-are-optional.output.md | 1 - unison-src/transcripts/undo.output.md | 2 + .../transcripts/unique-type-churn.output.md | 11 +- .../transcripts/unitnamespace.output.md | 2 +- .../transcripts/universal-cmp.output.md | 4 +- .../transcripts/unsafe-coerce.output.md | 2 +- .../update-ignores-lib-namespace.output.md | 5 +- .../transcripts/update-on-conflict.output.md | 5 +- .../update-suffixifies-properly.output.md | 7 +- ...e-term-aliases-in-different-ways.output.md | 6 +- .../update-term-to-different-type.output.md | 6 +- .../update-term-with-alias.output.md | 6 +- ...with-dependent-to-different-type.output.md | 8 +- .../update-term-with-dependent.output.md | 6 +- unison-src/transcripts/update-term.output.md | 6 +- .../update-test-to-non-test.output.md | 6 +- .../update-test-watch-roundtrip.output.md | 5 +- .../update-type-add-constructor.output.md | 5 +- .../update-type-add-field.output.md | 5 +- .../update-type-add-new-record.output.md | 2 +- .../update-type-add-record-field.output.md | 5 +- .../update-type-constructor-alias.output.md | 5 +- ...elete-constructor-with-dependent.output.md | 7 +- .../update-type-delete-constructor.output.md | 5 +- .../update-type-delete-record-field.output.md | 7 +- .../update-type-missing-constructor.output.md | 5 +- .../update-type-nested-decl-aliases.output.md | 5 +- .../update-type-no-op-record.output.md | 3 +- ...ate-type-stray-constructor-alias.output.md | 5 +- .../update-type-stray-constructor.output.md | 5 +- ...nstructor-into-smart-constructor.output.md | 5 +- ...type-turn-non-record-into-record.output.md | 5 +- .../update-type-with-dependent-term.output.md | 7 +- ...dependent-type-to-different-kind.output.md | 7 +- .../update-type-with-dependent-type.output.md | 5 +- unison-src/transcripts/update-watch.output.md | 2 +- .../transcripts/upgrade-happy-path.output.md | 4 +- .../transcripts/upgrade-sad-path.output.md | 6 +- .../upgrade-suffixifies-properly.output.md | 5 +- .../upgrade-with-old-alias.output.md | 2 +- unison-src/transcripts/view.output.md | 2 +- .../transcripts/watch-expressions.output.md | 8 +- 300 files changed, 1395 insertions(+), 1002 deletions(-) diff --git a/parser-typechecker/src/Unison/Util/TQueue.hs b/parser-typechecker/src/Unison/Util/TQueue.hs index 23ebfa6791..a6109f9a7d 100644 --- a/parser-typechecker/src/Unison/Util/TQueue.hs +++ b/parser-typechecker/src/Unison/Util/TQueue.hs @@ -8,8 +8,11 @@ import UnliftIO.STM hiding (TQueue) data TQueue a = TQueue (TVar (Seq a)) (TVar Word64) +prepopulatedIO :: forall a m. (MonadIO m) => Seq a -> m (TQueue a) +prepopulatedIO as = TQueue <$> newTVarIO as <*> newTVarIO (fromIntegral $ length as) + newIO :: forall a m. (MonadIO m) => m (TQueue a) -newIO = TQueue <$> newTVarIO mempty <*> newTVarIO 0 +newIO = prepopulatedIO mempty size :: TQueue a -> STM Int size (TQueue q _) = S.length <$> readTVar q diff --git a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md index 92a636f2c1..d36ed5460f 100644 --- a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md +++ b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md @@ -28,7 +28,6 @@ main = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -43,6 +42,7 @@ main = do resume : Request {g, Break} x -> x ``` + ``` ucm scratch/main> add diff --git a/unison-cli/src/Unison/Codebase/Transcript.hs b/unison-cli/src/Unison/Codebase/Transcript.hs index bd5bbd058f..b777620426 100644 --- a/unison-cli/src/Unison/Codebase/Transcript.hs +++ b/unison-cli/src/Unison/Codebase/Transcript.hs @@ -11,6 +11,7 @@ module Unison.Codebase.Transcript pattern CMarkCodeBlock, Stanza, ProcessedBlock (..), + CMark.Node, ) where @@ -30,14 +31,17 @@ data UcmLine = UcmCommand UcmContext Text | -- | Text does not include the '--' prefix. UcmComment Text + deriving (Eq, Show) -- | Where a command is run: a project branch (myproject/mybranch>). data UcmContext = UcmContextProject (ProjectAndBranch ProjectName ProjectBranchName) + deriving (Eq, Show) data APIRequest = GetRequest Text | APIComment Text + deriving (Eq, Show) pattern CMarkCodeBlock :: (Maybe CMark.PosInfo) -> Text -> Text -> CMark.Node pattern CMarkCodeBlock pos info body = CMark.Node pos (CMark.CODE_BLOCK info body) [] @@ -48,3 +52,4 @@ data ProcessedBlock = Ucm Hidden ExpectingError [UcmLine] | Unison Hidden ExpectingError (Maybe ScratchFileName) Text | API [APIRequest] + deriving (Eq, Show) diff --git a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs index bc37de4bad..967327c27b 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs @@ -3,12 +3,7 @@ module Unison.Codebase.Transcript.Parser ( -- * printing formatAPIRequest, formatUcmLine, - formatStanza, - formatNode, - formatProcessedBlock, - - -- * conversion - processedBlockToNode, + formatStanzas, -- * parsing stanzas, @@ -41,14 +36,9 @@ formatUcmLine = \case where formatContext (UcmContextProject projectAndBranch) = into @Text projectAndBranch -formatStanza :: Stanza -> Text -formatStanza = either formatNode formatProcessedBlock - -formatNode :: CMark.Node -> Text -formatNode = (<> "\n") . CMark.nodeToCommonmark [] Nothing - -formatProcessedBlock :: ProcessedBlock -> Text -formatProcessedBlock = formatNode . processedBlockToNode +formatStanzas :: [Stanza] -> Text +formatStanzas = + CMark.nodeToCommonmark [] Nothing . CMark.Node Nothing CMark.DOCUMENT . fmap (either id processedBlockToNode) processedBlockToNode :: ProcessedBlock -> CMark.Node processedBlockToNode = \case diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index 95e7c4af7f..61a73e2b68 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -8,15 +8,16 @@ module Unison.Codebase.Transcript.Runner ) where +import CMark qualified import Control.Lens (use, (?~)) import Crypto.Random qualified as Random import Data.Aeson qualified as Aeson import Data.Aeson.Encode.Pretty qualified as Aeson import Data.ByteString.Lazy.Char8 qualified as BL import Data.IORef -import Data.List (isSubsequenceOf) import Data.List.NonEmpty qualified as NonEmpty import Data.Map qualified as Map +import Data.Sequence qualified as Seq import Data.Text qualified as Text import Data.These (These (..)) import Data.UUID.V4 qualified as UUID @@ -82,7 +83,7 @@ type Runner = String -> Text -> (FilePath, Codebase IO Symbol Ann) -> - IO (Either Error Text) + IO (Either Error (Seq Stanza)) withRunner :: forall m r. @@ -94,42 +95,44 @@ withRunner :: FilePath -> (Runner -> m r) -> m r -withRunner isTest verbosity ucmVersion nrtp action = do - withRuntimes nrtp \runtime sbRuntime nRuntime -> do - action \transcriptName transcriptSrc (codebaseDir, codebase) -> do - Server.startServer (Backend.BackendEnv {Backend.useNamesIndex = False}) Server.defaultCodebaseServerOpts runtime codebase \baseUrl -> do - let parsed = Transcript.stanzas transcriptName transcriptSrc - result <- for parsed \stanzas -> do - liftIO $ run isTest verbosity codebaseDir stanzas codebase runtime sbRuntime nRuntime ucmVersion (tShow baseUrl) - pure . join $ first ParseError result +withRunner isTest verbosity ucmVersion nrtp action = + withRuntimes nrtp \runtime sbRuntime nRuntime -> + action \transcriptName transcriptSrc (codebaseDir, codebase) -> + Server.startServer + Backend.BackendEnv {Backend.useNamesIndex = False} + Server.defaultCodebaseServerOpts + runtime + codebase + \baseUrl -> + either + (pure . Left . ParseError) + (run isTest verbosity codebaseDir codebase runtime sbRuntime nRuntime ucmVersion $ tShow baseUrl) + $ Transcript.stanzas transcriptName transcriptSrc where withRuntimes :: FilePath -> (Runtime.Runtime Symbol -> Runtime.Runtime Symbol -> Runtime.Runtime Symbol -> m a) -> m a withRuntimes nrtp action = - RTI.withRuntime False RTI.Persistent ucmVersion \runtime -> do - RTI.withRuntime True RTI.Persistent ucmVersion \sbRuntime -> do - action runtime sbRuntime - =<< liftIO (RTI.startNativeRuntime ucmVersion nrtp) + RTI.withRuntime False RTI.Persistent ucmVersion \runtime -> + RTI.withRuntime True RTI.Persistent ucmVersion \sbRuntime -> + action runtime sbRuntime =<< liftIO (RTI.startNativeRuntime ucmVersion nrtp) run :: -- | Whether to treat this transcript run as a transcript test, which will try to make output deterministic Bool -> Verbosity -> FilePath -> - [Stanza] -> Codebase IO Symbol Ann -> Runtime.Runtime Symbol -> Runtime.Runtime Symbol -> Runtime.Runtime Symbol -> UCMVersion -> Text -> - IO (Either Error Text) -run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion baseURL = UnliftIO.try do + [Stanza] -> + IO (Either Error (Seq Stanza)) +run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL stanzas = UnliftIO.try do httpManager <- HTTP.newManager HTTP.defaultManagerSettings - (initialPP, emptyCausalHashId) <- Codebase.runTransaction codebase do - (_, emptyCausalHashId) <- Codebase.emptyCausalHash - initialPP <- Codebase.expectCurrentProjectPath - pure (initialPP, emptyCausalHashId) + (initialPP, emptyCausalHashId) <- + Codebase.runTransaction codebase . liftA2 (,) Codebase.expectCurrentProjectPath $ snd <$> Codebase.emptyCausalHash unless (isSilent verbosity) . putPrettyLn $ Pretty.lines @@ -142,229 +145,224 @@ run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion credMan <- AuthN.newCredentialManager let tokenProvider :: AuthN.TokenProvider tokenProvider = - case mayShareAccessToken of - Nothing -> do - AuthN.newTokenProvider credMan - Just accessToken -> - \_codeserverID -> pure $ Right accessToken - seedRef <- newIORef (0 :: Int) + maybe + (AuthN.newTokenProvider credMan) + (\accessToken _codeserverID -> pure $ Right accessToken) + mayShareAccessToken -- Queue of Stanzas and Just index, or Nothing if the stanza was programmatically generated -- e.g. a unison-file update by a command like 'edit' - inputQueue <- Q.newIO @(Stanza, Maybe Int) + inputQueue <- Q.prepopulatedIO . Seq.fromList $ stanzas `zip` (Just <$> [1 :: Int ..]) -- Queue of UCM commands to run. -- Nothing indicates the end of a ucm block. cmdQueue <- Q.newIO @(Maybe UcmLine) -- Queue of scratch file updates triggered by UCM itself, e.g. via `edit`, `update`, etc. ucmScratchFileUpdatesQueue <- Q.newIO @(ScratchFileName, Text) + ucmOutput <- newIORef mempty unisonFiles <- newIORef Map.empty out <- newIORef mempty hidden <- newIORef Shown allowErrors <- newIORef False hasErrors <- newIORef False - mStanza <- newIORef Nothing - traverse_ (atomically . Q.enqueue inputQueue) (stanzas `zip` (Just <$> [1 :: Int ..])) - let patternMap = - Map.fromList $ - validInputs - >>= (\p -> (patternName p, p) : ((,p) <$> aliases p)) - let output' :: Bool -> String -> IO () + mBlock <- newIORef Nothing + let patternMap = Map.fromList $ (\p -> (patternName p, p) : ((,p) <$> aliases p)) =<< validInputs + let output' :: Bool -> Stanza -> IO () output' inputEcho msg = do hide <- readIORef hidden - unless (hideOutput inputEcho hide) $ modifyIORef' out (\acc -> acc <> pure msg) + unless (hideOutput inputEcho hide) $ modifyIORef' out (<> pure msg) hideOutput :: Bool -> Hidden -> Bool hideOutput inputEcho = \case Shown -> False - HideOutput -> True && (not inputEcho) + HideOutput -> not inputEcho HideAll -> True - output, outputEcho :: String -> IO () + output, outputEcho :: Stanza -> IO () output = output' False outputEcho = output' True - apiRequest :: APIRequest -> IO () - apiRequest req = do - output . Text.unpack $ Transcript.formatAPIRequest req <> "\n" - case req of - APIComment {} -> pure () - GetRequest path -> do - req <- case HTTP.parseRequest (Text.unpack $ baseURL <> path) of - Left err -> dieWithMsg (show err) - Right req -> pure req - respBytes <- HTTP.httpLbs req httpManager - case Aeson.eitherDecode (HTTP.responseBody respBytes) of - Right (v :: Aeson.Value) -> do - let prettyBytes = Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v - output . (<> "\n") . BL.unpack $ prettyBytes - Left err -> dieWithMsg ("Error decoding response from " <> Text.unpack path <> ": " <> err) + outputUcm :: Text -> IO () + outputUcm line = modifyIORef' ucmOutput (<> pure line) - awaitInput :: Cli (Either Event Input) - awaitInput = do - cmd <- atomically (Q.tryDequeue cmdQueue) - case cmd of - -- end of ucm block - Just Nothing -> do - liftIO (output "\n```\n") - liftIO dieUnexpectedSuccess - atomically $ void $ do - scratchFileUpdates <- Q.flush ucmScratchFileUpdatesQueue - -- Push them onto the front stanza queue in the correct order. - for (reverse scratchFileUpdates) \(fp, contents) -> do - let fenceDescription = "unison :added-by-ucm " <> fp - -- Output blocks for any scratch file updates the ucm block triggered. - Q.undequeue inputQueue (Left $ CMarkCodeBlock Nothing fenceDescription contents, Nothing) + apiRequest :: APIRequest -> IO [Text] + apiRequest req = + let input = Transcript.formatAPIRequest req + in case req of + APIComment {} -> pure $ pure input + GetRequest path -> do + req <- either (dieWithMsg . show) pure $ HTTP.parseRequest (Text.unpack $ baseURL <> path) + respBytes <- HTTP.httpLbs req httpManager + case Aeson.eitherDecode (HTTP.responseBody respBytes) of + Right (v :: Aeson.Value) -> + pure + [ input, + Text.pack . BL.unpack $ Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v + ] + Left err -> dieWithMsg ("Error decoding response from " <> Text.unpack path <> ": " <> err) + + endUcmBlock = do + liftIO $ do + -- NB: This uses a `CMarkCodeBlock` instead of `Ucm`, because `Ucm` can’t yet contain command output. This + -- should change with #5199. + output . Left . CMarkCodeBlock Nothing "ucm" . Text.unlines =<< readIORef ucmOutput + writeIORef ucmOutput [] + dieUnexpectedSuccess + atomically $ void $ do + scratchFileUpdates <- Q.flush ucmScratchFileUpdatesQueue + -- Push them onto the front stanza queue in the correct order. + for (reverse scratchFileUpdates) \(fp, contents) -> + -- Output blocks for any scratch file updates the ucm block triggered. + -- + -- NB: This uses a `CMarkCodeBlock` instead of `Unison`, because `Unison` doesn’t yet support the + -- `:added-by-ucm` token. This should change with #5199. + Q.undequeue inputQueue (Left $ CMarkCodeBlock Nothing ("unison :added-by-ucm " <> fp) contents, Nothing) + awaitInput + + processUcmLine p = + case p of + UcmComment {} -> do + liftIO . outputUcm $ Transcript.formatUcmLine p awaitInput - -- ucm command to run - Just (Just ucmLine) -> do - case ucmLine of - p@(UcmComment {}) -> do - liftIO . output . Text.unpack $ "\n" <> Transcript.formatUcmLine p - awaitInput - p@(UcmCommand context lineTxt) -> do - curPath <- Cli.getCurrentProjectPath - -- We're either going to run the command now (because we're in the right context), else we'll switch to - -- the right context first, then run the command next. - maybeSwitchCommand <- - case context of - UcmContextProject (ProjectAndBranch projectName branchName) -> Cli.runTransaction do - Project {projectId, name = projectName} <- - Q.loadProjectByName projectName - >>= \case - Nothing -> do - projectId <- Sqlite.unsafeIO (Db.ProjectId <$> UUID.nextRandom) - Q.insertProject projectId projectName - pure $ Project {projectId, name = projectName} - Just project -> pure project - projectBranch <- - Q.loadProjectBranchByName projectId branchName >>= \case - Nothing -> do - branchId <- Sqlite.unsafeIO (Db.ProjectBranchId <$> UUID.nextRandom) - let projectBranch = ProjectBranch {projectId, parentBranchId = Nothing, branchId, name = branchName} - Q.insertProjectBranch "Branch Created" emptyCausalHashId projectBranch - pure projectBranch - Just projBranch -> pure projBranch - let projectAndBranchIds = ProjectAndBranch projectBranch.projectId projectBranch.branchId - pure - if (PP.toProjectAndBranch . PP.toIds $ curPath) == projectAndBranchIds - then Nothing - else Just (ProjectSwitchI (ProjectAndBranchNames'Unambiguous (These projectName branchName))) - case maybeSwitchCommand of - Just switchCommand -> do - atomically $ Q.undequeue cmdQueue (Just p) - pure (Right switchCommand) - Nothing -> do - case words . Text.unpack $ lineTxt of - [] -> awaitInput - args -> do - liftIO . output . Text.unpack $ "\n" <> Transcript.formatUcmLine p <> "\n" - numberedArgs <- use #numberedArgs - PP.ProjectAndBranch projId branchId <- PP.toProjectAndBranch . NonEmpty.head <$> use #projectPathStack - let getProjectRoot = liftIO $ Codebase.expectProjectBranchRoot codebase projId branchId - liftIO (parseInput codebase curPath getProjectRoot numberedArgs patternMap args) >>= \case - -- invalid command is treated as a failure - Left msg -> do + UcmCommand context lineTxt -> do + curPath <- Cli.getCurrentProjectPath + -- We're either going to run the command now (because we're in the right context), else we'll switch to + -- the right context first, then run the command next. + maybeSwitchCommand <- case context of + UcmContextProject (ProjectAndBranch projectName branchName) -> Cli.runTransaction do + Project {projectId, name = projectName} <- + Q.loadProjectByName projectName + >>= \case + Nothing -> do + projectId <- Sqlite.unsafeIO (Db.ProjectId <$> UUID.nextRandom) + Q.insertProject projectId projectName + pure $ Project {projectId, name = projectName} + Just project -> pure project + projectBranch <- + Q.loadProjectBranchByName projectId branchName >>= \case + Nothing -> do + branchId <- Sqlite.unsafeIO (Db.ProjectBranchId <$> UUID.nextRandom) + let projectBranch = + ProjectBranch {projectId, parentBranchId = Nothing, branchId, name = branchName} + Q.insertProjectBranch "Branch Created" emptyCausalHashId projectBranch + pure projectBranch + Just projBranch -> pure projBranch + let projectAndBranchIds = ProjectAndBranch projectBranch.projectId projectBranch.branchId + pure + if (PP.toProjectAndBranch . PP.toIds $ curPath) == projectAndBranchIds + then Nothing + else Just (ProjectSwitchI (ProjectAndBranchNames'Unambiguous (These projectName branchName))) + case maybeSwitchCommand of + Just switchCommand -> do + atomically . Q.undequeue cmdQueue $ Just p + pure $ Right switchCommand + Nothing -> do + case words . Text.unpack $ lineTxt of + [] -> awaitInput + args -> do + liftIO . outputUcm $ Transcript.formatUcmLine p <> "\n" + numberedArgs <- use #numberedArgs + PP.ProjectAndBranch projId branchId <- + PP.toProjectAndBranch . NonEmpty.head <$> use #projectPathStack + let getProjectRoot = liftIO $ Codebase.expectProjectBranchRoot codebase projId branchId + liftIO (parseInput codebase curPath getProjectRoot numberedArgs patternMap args) + >>= either + -- invalid command is treated as a failure + ( \msg -> do liftIO $ writeIORef hasErrors True liftIO (readIORef allowErrors) >>= \case True -> do - liftIO (output . Pretty.toPlain terminalWidth $ ("\n" <> msg <> "\n")) + liftIO . outputUcm . Text.pack $ Pretty.toPlain terminalWidth msg awaitInput - False -> do - liftIO (dieWithMsg $ Pretty.toPlain terminalWidth msg) - -- No input received from this line, try again. - Right Nothing -> awaitInput - Right (Just (_expandedArgs, input)) -> pure $ Right input - Nothing -> do - liftIO (dieUnexpectedSuccess) - liftIO (writeIORef hidden Shown) - liftIO (writeIORef allowErrors False) - maybeStanza <- atomically (Q.tryDequeue inputQueue) - _ <- liftIO (writeIORef mStanza maybeStanza) - case maybeStanza of - Nothing -> liftIO do - clearCurrentLine - putStrLn "\r✔️ Completed transcript." - pure $ Right QuitI - Just (s, midx) -> do - unless (Verbosity.isSilent verbosity) . liftIO $ do - clearCurrentLine - putStr $ - maybe - "\r⏩ Skipping non-executable Markdown block." - ( \idx -> - "\r⚙️ Processing stanza " - ++ show idx - ++ " of " - ++ show (length stanzas) - ++ "." - ) - midx - IO.hFlush IO.stdout - either - ( \node -> do - liftIO . output . Text.unpack $ Transcript.formatNode node - awaitInput - ) - ( \block -> case block of - Unison hide errOk filename txt -> do - liftIO (writeIORef hidden hide) - liftIO . outputEcho . Text.unpack $ Transcript.formatProcessedBlock block - liftIO (writeIORef allowErrors errOk) - -- Open a ucm block which will contain the output from UCM - -- after processing the UnisonFileChanged event. - liftIO (output "``` ucm\n") - -- Close the ucm block after processing the UnisonFileChanged event. - atomically . Q.enqueue cmdQueue $ Nothing - let sourceName = fromMaybe "scratch.u" filename - liftIO $ updateVirtualFile sourceName txt - pure $ Left (UnisonFileChanged sourceName txt) - API apiRequests -> do - liftIO (output "``` api\n") - liftIO (for_ apiRequests apiRequest) - liftIO (output "```\n\n") - awaitInput - Ucm hide errOk cmds -> do - liftIO (writeIORef hidden hide) - liftIO (writeIORef allowErrors errOk) - liftIO (writeIORef hasErrors False) - liftIO (output "``` ucm") - traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds - atomically . Q.enqueue cmdQueue $ Nothing - awaitInput - ) - s - - loadPreviousUnisonBlock name = do - ufs <- readIORef unisonFiles - case Map.lookup name ufs of - Just uf -> - return (Cli.LoadSuccess uf) - Nothing -> - -- This lets transcripts use the `load` command, as in: - -- - -- .> load someFile.u - -- - -- Important for Unison syntax that can't be embedded in - -- transcripts (like docs, which use ``` in their syntax). - let f = Cli.LoadSuccess <$> readUtf8 (Text.unpack name) - in f <|> pure Cli.InvalidSourceNameError + False -> liftIO . dieWithMsg $ Pretty.toPlain terminalWidth msg + ) + -- No input received from this line, try again. + (maybe awaitInput $ pure . Right . snd) + + startProcessedBlock block = case block of + Unison hide errOk filename txt -> do + liftIO (writeIORef hidden hide) + liftIO . outputEcho $ pure block + liftIO (writeIORef allowErrors errOk) + -- Open a ucm block which will contain the output from UCM after processing the `UnisonFileChanged` event. + -- Close the ucm block after processing the UnisonFileChanged event. + atomically . Q.enqueue cmdQueue $ Nothing + let sourceName = fromMaybe "scratch.u" filename + liftIO $ updateVirtualFile sourceName txt + pure $ Left (UnisonFileChanged sourceName txt) + API apiRequests -> do + liftIO $ do + contents <- traverse apiRequest apiRequests + -- NB: This uses a `CMarkCodeBlock` instead of `API`, because `API` can’t yet contain API responses. This + -- should change with #5199. + output . Left . CMarkCodeBlock Nothing "api" . Text.unlines $ fold contents + awaitInput + Ucm hide errOk cmds -> do + liftIO (writeIORef hidden hide) + liftIO (writeIORef allowErrors errOk) + liftIO (writeIORef hasErrors False) + traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds + atomically . Q.enqueue cmdQueue $ Nothing + awaitInput + + showStatus alwaysShow indicator msg = unless (not alwaysShow && Verbosity.isSilent verbosity) do + clearCurrentLine + putStr $ "\r" <> indicator <> " " <> msg + IO.hFlush IO.stdout + + finishTranscript = do + showStatus True "✔️" "Completed transcript.\n" + pure $ Right QuitI + + processStanza stanza midx = do + liftIO . showStatus False "⚙️" $ + maybe + "Processing UCM-generated stanza." + (\idx -> "Processing stanza " <> show idx <> " of " <> show (length stanzas) <> ".") + midx + either + ( \node -> do + liftIO . output $ Left node + awaitInput + ) + ( \block -> do + liftIO . writeIORef mBlock $ pure block + startProcessedBlock block + ) + stanza + + whatsNext = do + liftIO (dieUnexpectedSuccess) + liftIO (writeIORef hidden Shown) + liftIO (writeIORef allowErrors False) + maybe (liftIO finishTranscript) (uncurry processStanza) =<< atomically (Q.tryDequeue inputQueue) + + awaitInput :: Cli (Either Event Input) + awaitInput = maybe whatsNext (maybe endUcmBlock processUcmLine) =<< atomically (Q.tryDequeue cmdQueue) + + loadPreviousUnisonBlock name = + maybe + -- This lets transcripts use the `load` command, as in: + -- + -- .> load someFile.u + (fmap Cli.LoadSuccess (readUtf8 $ Text.unpack name) <|> pure Cli.InvalidSourceNameError) + (pure . Cli.LoadSuccess) + . Map.lookup name + =<< readIORef unisonFiles writeSourceFile :: ScratchFileName -> Text -> IO () writeSourceFile fp contents = do shouldShowSourceChanges <- (== Shown) <$> readIORef hidden - when shouldShowSourceChanges $ do - atomically (Q.enqueue ucmScratchFileUpdatesQueue (fp, contents)) + when shouldShowSourceChanges . atomically $ Q.enqueue ucmScratchFileUpdatesQueue (fp, contents) updateVirtualFile fp contents updateVirtualFile :: ScratchFileName -> Text -> IO () - updateVirtualFile fp contents = do - liftIO (modifyIORef' unisonFiles (Map.insert fp contents)) + updateVirtualFile fp = modifyIORef' unisonFiles . Map.insert fp print :: Output.Output -> IO () print o = do msg <- notifyUser dir o errOk <- readIORef allowErrors - let rendered = Pretty.toPlain terminalWidth (Pretty.border 2 msg) - output rendered + let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" + outputUcm $ Text.pack rendered when (Output.isFailure o) $ if errOk then writeIORef hasErrors True @@ -374,8 +372,8 @@ run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion printNumbered o = do let (msg, numberedArgs) = notifyNumbered o errOk <- readIORef allowErrors - let rendered = Pretty.toPlain terminalWidth (Pretty.border 2 msg) - output rendered + let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" + outputUcm $ Text.pack rendered when (Output.isNumberedFailure o) $ if errOk then writeIORef hasErrors True @@ -386,31 +384,34 @@ run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion -- output so far. Appends it if not. appendFailingStanza :: IO () appendFailingStanza = do - stanzaOpt <- readIORef mStanza + blockOpt <- readIORef mBlock currentOut <- readIORef out - let stnz = maybe "" (Text.unpack . Transcript.formatStanza . fst) stanzaOpt - unless (stnz `isSubsequenceOf` concat currentOut) $ - modifyIORef' out (\acc -> acc <> pure stnz) + maybe + (pure ()) + (\block -> unless (elem (pure block) currentOut) $ modifyIORef' out (<> pure (pure block))) + blockOpt - -- output ``` and new lines then call transcriptFailure dieWithMsg :: forall a. String -> IO a dieWithMsg msg = do - output "\n```\n\n" appendFailingStanza - transcriptFailure out $ - "The transcript failed due to an error in the stanza above. The error is:\n\n" <> Text.pack msg + transcriptFailure out "The transcript failed due to an error in the stanza above. The error is:" . pure $ + Text.pack msg dieUnexpectedSuccess :: IO () dieUnexpectedSuccess = do errOk <- readIORef allowErrors hasErr <- readIORef hasErrors when (errOk && not hasErr) $ do - output "\n```\n\n" appendFailingStanza - transcriptFailure out "The transcript was expecting an error in the stanza above, but did not encounter one." + transcriptFailure + out + "The transcript was expecting an error in the stanza above, but did not encounter one." + Nothing authenticatedHTTPClient <- AuthN.newAuthenticatedHTTPClient tokenProvider ucmVersion + seedRef <- newIORef (0 :: Int) + let env = Cli.Env { authHTTPClient = authenticatedHTTPClient, @@ -431,7 +432,7 @@ run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion isTranscriptTest = isTest } - let loop :: Cli.LoopState -> IO Text + let loop :: Cli.LoopState -> IO (Seq Stanza) loop s0 = do Cli.runCli env s0 awaitInput >>= \case (Cli.Success input, s1) -> do @@ -446,19 +447,25 @@ run isTest verbosity dir stanzas codebase runtime sbRuntime nRuntime ucmVersion (Cli.Continue, s1) -> loop s1 (Cli.HaltRepl, _) -> onHalt where - onHalt = do - texts <- readIORef out - pure $ Text.concat (Text.pack <$> toList (texts :: Seq String)) + onHalt = readIORef out loop (Cli.loopState0 (PP.toIds initialPP)) -transcriptFailure :: IORef (Seq String) -> Text -> IO b -transcriptFailure out msg = do +transcriptFailure :: IORef (Seq Stanza) -> Text -> Maybe Text -> IO b +transcriptFailure out heading mbody = do texts <- readIORef out - UnliftIO.throwIO . RunFailure $ mconcat (Text.pack <$> toList texts) <> "\n\n\128721\n\n" <> msg <> "\n" + UnliftIO.throwIO . RunFailure $ + texts + <> Seq.fromList + ( Left + <$> [ CMark.Node Nothing CMark.PARAGRAPH [CMark.Node Nothing (CMark.TEXT "🛑") []], + CMark.Node Nothing CMark.PARAGRAPH [CMark.Node Nothing (CMark.TEXT heading) []] + ] + <> foldr ((:) . CMarkCodeBlock Nothing "") [] mbody + ) data Error = ParseError (P.ParseErrorBundle Text Void) - | RunFailure Text + | RunFailure (Seq Stanza) deriving stock (Show) deriving anyclass (Exception) diff --git a/unison-cli/src/Unison/Main.hs b/unison-cli/src/Unison/Main.hs index 8dcbf1fa8f..3624a50675 100644 --- a/unison-cli/src/Unison/Main.hs +++ b/unison-cli/src/Unison/Main.hs @@ -72,6 +72,7 @@ import Unison.Codebase.Path qualified as Path import Unison.Codebase.ProjectPath qualified as PP import Unison.Codebase.Runtime qualified as Rt import Unison.Codebase.SqliteCodebase qualified as SC +import Unison.Codebase.Transcript.Parser qualified as Transcript import Unison.Codebase.Transcript.Runner qualified as Transcript import Unison.Codebase.Verbosity qualified as Verbosity import Unison.CommandLine.Helpers (plural') @@ -435,7 +436,7 @@ runTranscripts' version progName nativeRtp transcriptDir markdownFiles = do Transcript.RunFailure msg -> ( [ P.indentN 2 $ "An error occurred while running the following file: " <> P.string fileName, "", - P.indentN 2 (P.text msg), + P.indentN 2 (P.text . Transcript.formatStanzas $ toList msg), P.string $ "Run `" <> progName @@ -444,10 +445,10 @@ runTranscripts' version progName nativeRtp transcriptDir markdownFiles = do <> "` " <> "to do more work with it." ], - msg + Transcript.formatStanzas $ toList msg ) ) - pure + (pure . Transcript.formatStanzas . toList) result writeUtf8 outputFile output putStrLn $ "💾 Wrote " <> outputFile diff --git a/unison-cli/tests/Unison/Test/Ucm.hs b/unison-cli/tests/Unison/Test/Ucm.hs index c0d2cb0977..9b2019c71b 100644 --- a/unison-cli/tests/Unison/Test/Ucm.hs +++ b/unison-cli/tests/Unison/Test/Ucm.hs @@ -24,10 +24,11 @@ import Unison.Codebase qualified as Codebase import Unison.Codebase.Init qualified as Codebase.Init import Unison.Codebase.Init.CreateCodebaseError (CreateCodebaseError (..)) import Unison.Codebase.SqliteCodebase qualified as SC +import Unison.Codebase.Transcript.Parser qualified as Transcript import Unison.Codebase.Transcript.Runner qualified as Transcript import Unison.Codebase.Verbosity qualified as Verbosity import Unison.Parser.Ann (Ann) -import Unison.Prelude (traceM) +import Unison.Prelude (toList, traceM) import Unison.PrettyTerminal qualified as PT import Unison.Symbol (Symbol) import Unison.Util.Pretty qualified as P @@ -72,7 +73,9 @@ runTranscript (Codebase codebasePath fmt) transcript = do result <- Codebase.Init.withOpenCodebase cbInit "transcript" codebasePath SC.DoLock SC.DontMigrate \codebase -> do Codebase.runTransaction codebase (Codebase.installUcmDependencies codebase) let transcriptSrc = stripMargin . Text.pack $ unTranscript transcript - output <- either err Text.unpack <$> runner "transcript" transcriptSrc (codebasePath, codebase) + output <- + either err (Text.unpack . Transcript.formatStanzas . toList) + <$> runner "transcript" transcriptSrc (codebasePath, codebase) when debugTranscriptOutput $ traceM output pure output either (fail . P.toANSI 80 . P.shown) pure result diff --git a/unison-cli/transcripts/Transcripts.hs b/unison-cli/transcripts/Transcripts.hs index 7503c5b063..c1cc899799 100644 --- a/unison-cli/transcripts/Transcripts.hs +++ b/unison-cli/transcripts/Transcripts.hs @@ -25,6 +25,7 @@ import System.IO.Silently (silence) import Text.Megaparsec qualified as MP import Unison.Codebase.Init (withTemporaryUcmCodebase) import Unison.Codebase.SqliteCodebase qualified as SC +import Unison.Codebase.Transcript.Parser as Transcript import Unison.Codebase.Transcript.Runner as Transcript import Unison.Codebase.Verbosity qualified as Verbosity import Unison.Prelude @@ -47,13 +48,13 @@ testBuilder :: String -> Test () testBuilder expectFailure recordFailure runtimePath dir prelude transcript = scope transcript $ do - outputs <- io . withTemporaryUcmCodebase SC.init Verbosity.Silent "transcript" SC.DoLock $ \(codebasePath, codebase) -> do + outputs <- io . withTemporaryUcmCodebase SC.init Verbosity.Silent "transcript" SC.DoLock $ \(codebasePath, codebase) -> let isTest = True - Transcript.withRunner isTest Verbosity.Silent "TODO: pass version here" runtimePath \runTranscript -> do - for files \filePath -> do - transcriptSrc <- readUtf8 filePath - out <- silence $ runTranscript filePath transcriptSrc (codebasePath, codebase) - pure (filePath, out) + in Transcript.withRunner isTest Verbosity.Silent "TODO: pass version here" runtimePath \runTranscript -> + for files \filePath -> do + transcriptSrc <- readUtf8 filePath + out <- silence $ runTranscript filePath transcriptSrc (codebasePath, codebase) + pure (filePath, out) for_ outputs \case (filePath, Left err) -> do let outputFile = outputFileForTranscript filePath @@ -67,14 +68,15 @@ testBuilder expectFailure recordFailure runtimePath dir prelude transcript = sco io $ recordFailure (filePath, Text.pack errMsg) crash errMsg Transcript.RunFailure errOutput -> do - io $ writeUtf8 outputFile errOutput + let errText = Transcript.formatStanzas $ toList errOutput + io $ writeUtf8 outputFile errText when (not expectFailure) $ do - io $ Text.putStrLn errOutput - io $ recordFailure (filePath, errOutput) + io $ Text.putStrLn errText + io $ recordFailure (filePath, errText) crash $ "Failure in " <> filePath (filePath, Right out) -> do let outputFile = outputFileForTranscript filePath - io $ writeUtf8 outputFile out + io . writeUtf8 outputFile . Transcript.formatStanzas $ toList out when expectFailure $ do let errMsg = "Expected a failure, but transcript was successful." io $ recordFailure (filePath, Text.pack errMsg) @@ -89,19 +91,17 @@ outputFileForTranscript filePath = buildTests :: TestConfig -> TestBuilder -> FilePath -> Test () buildTests TestConfig {..} testBuilder dir = do - io - . putStrLn - . unlines - $ [ "", - "Searching for transcripts to run in: " ++ dir - ] + io . putStrLn . unlines $ + [ "", + "Searching for transcripts to run in: " ++ dir + ] files <- io $ listDirectory dir -- Any files that start with _ are treated as prelude let (prelude, transcripts) = files & sort & filter (\f -> takeExtensions f == ".md") - & partition ((isPrefixOf "_") . snd . splitFileName) + & partition (isPrefixOf "_" . snd . splitFileName) -- if there is a matchPrefix set, filter non-prelude files by that prefix - or return True & second (filter (\f -> maybe True (`isPrefixOf` f) matchPrefix)) @@ -125,13 +125,11 @@ cleanup = do unless (null dirs) $ do io $ createDirectoryIfMissing True "test-output" io $ for_ dirs (\d -> renameDirectory d ("test-output" d)) - io - . putStrLn - . unlines - $ [ "", - "NOTE: All transcript codebases have been moved into", - "the `test-output` directory. Feel free to delete it." - ] + io . putStrLn . unlines $ + [ "", + "NOTE: All transcript codebases have been moved into", + "the `test-output` directory. Feel free to delete it." + ] test :: TestConfig -> Test () test config = do @@ -139,12 +137,9 @@ test config = do -- what went wrong in CI failuresVar <- io $ STM.newTVarIO [] let recordFailure failure = STM.atomically $ STM.modifyTVar' failuresVar (failure :) - buildTests config (testBuilder False recordFailure) $ - "unison-src" "transcripts" - buildTests config (testBuilder False recordFailure) $ - "unison-src" "transcripts-using-base" - buildTests config (testBuilder True recordFailure) $ - "unison-src" "transcripts" "errors" + buildTests config (testBuilder False recordFailure) $ "unison-src" "transcripts" + buildTests config (testBuilder False recordFailure) $ "unison-src" "transcripts-using-base" + buildTests config (testBuilder True recordFailure) $ "unison-src" "transcripts" "errors" failures <- io $ STM.readTVarIO failuresVar -- Print all aggregated failures when (not $ null failures) . io $ Text.putStrLn $ "Failures:" @@ -155,8 +150,7 @@ test config = do cleanup handleArgs :: TestConfig -> [String] -> TestConfig -handleArgs acc ("--runtime-path" : p : rest) = - handleArgs (acc {runtimePath = p}) rest +handleArgs acc ("--runtime-path" : p : rest) = handleArgs (acc {runtimePath = p}) rest handleArgs acc [prefix] = acc {matchPrefix = Just prefix} handleArgs acc _ = acc @@ -168,7 +162,4 @@ defaultConfig = TestConfig Nothing <$> defaultRTP pure (takeDirectory ucm "runtime" "unison-runtime" <.> exeExtension) main :: IO () -main = withCP65001 do - dcfg <- defaultConfig - testConfig <- handleArgs dcfg <$> getArgs - run (test testConfig) +main = withCP65001 $ run . test =<< handleArgs <$> defaultConfig <*> getArgs diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index 5c938806be..79a2cf133b 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -4,6 +4,7 @@ test-html-docs/main> builtins.mergeio lib.builtins Done. ``` + ``` unison {{A doc directly in the namespace.}} some.ns.direct = 1 @@ -16,7 +17,6 @@ some.outside = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,6 +33,7 @@ some.outside = 3 some.outside.doc : Doc2 ``` + ``` ucm test-html-docs/main> add diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 87742e4ff2..d58261c507 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -48,6 +48,7 @@ scratch/main> rewrite eitherToOptional The rewritten file has been added to the top of scratch.u ``` + ``` unison :added-by-ucm scratch.u -- | Rewrote using: -- | Modified definition(s): ex1 @@ -134,6 +135,7 @@ scratch/main> view ex1 Either.mapRight rule1 term a -> f a ==> f ``` + Another example, showing that we can rewrite to definitions that only exist in the file: ``` unison @@ -166,6 +168,7 @@ scratch/main> rewrite woot1to2 The rewritten file has been added to the top of scratch.u ``` + ``` unison :added-by-ucm scratch.u -- | Rewrote using: -- | Modified definition(s): wootEx @@ -201,6 +204,7 @@ scratch/main> view wootEx blah2 ``` + This example shows that rewrite rules can to refer to term definitions that only exist in the file: ``` unison @@ -243,6 +247,7 @@ scratch/main> view foo1 foo2 sameFileEx foo2 ``` + ## Capture avoidance ``` unison @@ -275,6 +280,7 @@ scratch/main> rewrite rule The rewritten file has been added to the top of scratch.u ``` + ``` unison :added-by-ucm scratch.u -- | Rewrote using: -- | Modified definition(s): sameFileEx @@ -318,6 +324,7 @@ scratch/main> load * You have a typo in the name ``` + 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: ``` unison @@ -340,6 +347,7 @@ scratch/main> rewrite rule The rewritten file has been added to the top of scratch.u ``` + ``` unison :added-by-ucm scratch.u -- | Rewrote using: -- | Modified definition(s): bar2 @@ -375,6 +383,7 @@ scratch/main> load * You have a typo in the name ``` + ## Structural find ``` unison diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index acca30ca30..f8b6bec34e 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -5,7 +5,6 @@ x = () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ x = () x : () ``` + So we can see the pretty-printed output: ``` ucm @@ -30,6 +30,7 @@ scratch/a1> edit 1-1000 definitions currently in this namespace. ``` + ````` unison :added-by-ucm scratch.u structural ability Abort where abort : {Abort} a @@ -816,6 +817,7 @@ scratch/main> diff.namespace /a1: /a2: The namespaces are identical. ``` + Now check that definitions in 'reparses.u' at least parse on round trip: This just makes 'roundtrip.u' the latest scratch file. @@ -835,6 +837,7 @@ scratch/a3> edit 1-5000 definitions currently in this namespace. ``` + ```` unison :added-by-ucm scratch.u explanationOfThisFile : Text explanationOfThisFile = @@ -869,6 +872,7 @@ scratch/main> diff.namespace /a3_new: /a3: 2. sloppyDocEval : Doc2 ``` + ## Other regression tests not covered by above ### Builtins should appear commented out in the edit command @@ -896,7 +900,7 @@ scratch/regressions> load I loaded scratch.u and didn't find anything. ``` + ``` unison :added-by-ucm scratch.u -- builtin plus : ##Nat -> ##Nat -> ##Nat ``` - diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index eaad4fb38e..0fff21404a 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -40,7 +40,6 @@ testAutoClean _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,6 +51,7 @@ testAutoClean _ = testAutoClean : '{IO} [Result] ``` + ``` ucm scratch/main> add 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 da9bc7a95a..29e096766f 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -54,7 +54,6 @@ testABunchOfNats _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -75,6 +74,7 @@ testABunchOfNats _ = testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index 6e51f371d1..beaf8b6cf8 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -152,7 +152,6 @@ swapped name link = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -198,6 +197,7 @@ swapped name link = ->{Throw Text} () ``` + ``` ucm scratch/main> add @@ -240,6 +240,7 @@ scratch/main> add ->{Throw Text} () ``` + ``` unison structural ability Zap where zap : Three Nat Nat Nat @@ -316,7 +317,6 @@ badLoad _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -338,6 +338,7 @@ badLoad _ = zapper : Three Nat Nat Nat -> Request {Zap} r -> r ``` + This simply runs some functions to make sure there isn't a crash. Once we gain the ability to capture output in a transcript, it can be modified to actual show that the serialization works. @@ -392,6 +393,7 @@ scratch/main> io.test badLoad Tip: Use view 1 to view the source of a test. ``` + ``` unison codeTests : '{io2.IO} [Result] codeTests = @@ -429,7 +431,6 @@ codeTests = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -441,6 +442,7 @@ codeTests = codeTests : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -488,6 +490,7 @@ scratch/main> io.test codeTests Tip: Use view 1 to view the source of a test. ``` + ``` unison validateTest : Link.Term ->{IO} Result validateTest l = match Code.lookup l with @@ -515,7 +518,6 @@ vtests _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -528,6 +530,7 @@ vtests _ = vtests : '{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index 850929abab..ce59f07202 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -29,7 +29,6 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,6 +45,7 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat time.DayOfWeek.doc : Doc2 ``` + Notice that an anonymous documentation block `{{ ... }}` before a definition `ImportantConstant` is just syntax sugar for `ImportantConstant.doc = {{ ... }}`. You can preview what docs will look like when rendered to the console using the `display` or `docs` commands: @@ -66,6 +66,7 @@ scratch/main> docs DayOfWeek type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` + 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. ## Syntax guide @@ -95,11 +96,12 @@ scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u sqr : Nat -> Nat ``` + Now we can review different portions of the guide. we'll show both the pretty-printed source using `view` and the rendered output using `display`: -``` ucm +```` ucm scratch/main> view basicFormatting basicFormatting : Doc2 @@ -545,10 +547,11 @@ scratch/main> display otherElements rendered table. Some text More text Zounds! -``` +```` + Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: -``` ucm +```` ucm scratch/main> view doc.guide doc.guide : Doc2 @@ -767,6 +770,6 @@ scratch/main> display doc.guide rendered table. Some text More text Zounds! -``` -🌻 THE END +```` +🌻 THE END diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index 0efdd87b38..6309e170eb 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -19,7 +19,6 @@ test2 = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +31,7 @@ test2 = do test2 : '{IO, Exception} [Result] ``` + ``` ucm scratch/main> add @@ -41,6 +41,7 @@ scratch/main> add test2 : '{IO, Exception} [Result] ``` + ``` ucm scratch/main> io.test test1 @@ -57,6 +58,7 @@ scratch/main> io.test test1 ##raise ``` + ``` ucm scratch/main> io.test test2 diff --git a/unison-src/transcripts-using-base/fix2049.output.md b/unison-src/transcripts-using-base/fix2049.output.md index e69de29bb2..8b13789179 100644 --- a/unison-src/transcripts-using-base/fix2049.output.md +++ b/unison-src/transcripts-using-base/fix2049.output.md @@ -0,0 +1 @@ + diff --git a/unison-src/transcripts-using-base/fix2158-1.output.md b/unison-src/transcripts-using-base/fix2158-1.output.md index b681368cf8..50c22139c4 100644 --- a/unison-src/transcripts-using-base/fix2158-1.output.md +++ b/unison-src/transcripts-using-base/fix2158-1.output.md @@ -12,7 +12,6 @@ Async.parMap f as = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +26,7 @@ Async.parMap f as = ->{Async t g} [b] ``` + The issue was that certain ability processing was happing in less optimal order. `g` appears both as an ability used and as a parameter to `Async`. However, the latter occurrence is more strict. Unifying @@ -39,4 +39,3 @@ order they occurred, and during inference it happened that `g` occurred in the row before `Async t g`. Processing the stricter parts first is better, becauase it can solve things more precisely and avoid ambiguities relating to subtyping. - diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index 949cdd89e9..4866353362 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -25,7 +25,6 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti ``` ``` ucm - Loading changes detected in scratch.u. The expression in red needs the {IO} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index 7e71541b74..e2d47acc32 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -9,7 +9,6 @@ timingApp2 _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ timingApp2 _ = timingApp2 : '{IO, Exception} () ``` + ``` ucm scratch/main> run timingApp2 diff --git a/unison-src/transcripts-using-base/fix3166.output.md b/unison-src/transcripts-using-base/fix3166.output.md index 9e33e14563..1b7351b9cb 100644 --- a/unison-src/transcripts-using-base/fix3166.output.md +++ b/unison-src/transcripts-using-base/fix3166.output.md @@ -32,7 +32,6 @@ increment n = 1 + n ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -62,6 +61,7 @@ increment n = 1 + n [100, 200, 300, 400] ``` + ``` unison structural ability E where eff : () -> () @@ -83,7 +83,6 @@ foo _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -105,6 +104,7 @@ foo _ = 7 ``` + ``` unison structural ability Over where over : Nat ->{Over} (Nat -> Nat) @@ -127,7 +127,6 @@ hmm = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3542.output.md b/unison-src/transcripts-using-base/fix3542.output.md index 976f1c0636..4a6ca9e644 100644 --- a/unison-src/transcripts-using-base/fix3542.output.md +++ b/unison-src/transcripts-using-base/fix3542.output.md @@ -14,7 +14,6 @@ arrayList v n = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 9240c712f9..35ae1a7c89 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -6,7 +6,6 @@ meh = 9 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ meh = 9 meh.doc : Doc2 ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/fix4746.output.md b/unison-src/transcripts-using-base/fix4746.output.md index 8887e34743..48afbecdfd 100644 --- a/unison-src/transcripts-using-base/fix4746.output.md +++ b/unison-src/transcripts-using-base/fix4746.output.md @@ -36,7 +36,6 @@ run s = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index 3d07942a78..3bb62257d9 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -23,7 +23,6 @@ go = do ``` ``` ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the application @@ -38,6 +37,7 @@ go = do ``` + This comes from issue \#3513 ``` unison @@ -57,7 +57,6 @@ fancyTryEval = reraise << catchAll.impl ``` ``` ucm - Loading changes detected in scratch.u. The expression in red diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index 3bede2577e..2363a6ca87 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -39,6 +39,7 @@ scratch/main> ls builtin.Bytes 32. zlib/ (2 terms) ``` + Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`. ## API overview @@ -75,7 +76,6 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -117,6 +117,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex "abd0e845a5544ced19b1c05df18a05c10b252a355957b18b99b33970d5217de6" ``` + And here's the full API: ``` ucm @@ -153,6 +154,7 @@ scratch/main> find-in builtin.crypto ``` + Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime: ``` unison @@ -160,7 +162,6 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -175,6 +176,7 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente 0xs1259de8ec2c8b925dce24f591ed5cc1d1a5dc01cf88cf8f2343fc9728e124af4 ``` + ## Hashing tests Here are some test vectors (taken from [here](https://www.di-mgt.com.au/sha_testvectors.html) and [here](https://en.wikipedia.org/wiki/BLAKE_\(hash_function\))) for the various hashing algorithms: @@ -347,6 +349,7 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + ## HMAC tests These test vectors are taken from [RFC 4231](https://tools.ietf.org/html/rfc4231#section-4.3). @@ -379,7 +382,6 @@ test> hmac_sha2_512.tests.ex2 = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -418,6 +420,7 @@ test> hmac_sha2_512.tests.ex2 = ✅ Passed Passed ``` + ## MD5 tests Test vectors here pulled from [Wikipedia's writeup](https://en.wikipedia.org/wiki/MD5). @@ -442,7 +445,6 @@ test> md5.tests.ex3 = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -473,6 +475,7 @@ test> md5.tests.ex3 = ✅ Passed Passed ``` + ``` ucm scratch/main> test diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index c0bfdac99c..d93f41a0b5 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -51,7 +51,6 @@ testMvars _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -64,6 +63,7 @@ testMvars _ = testMvars : '{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index 9d0c1571d1..839166f3fe 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -33,7 +33,6 @@ test = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,6 +48,7 @@ test = 'let ->{Stream Result} () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 2882064985..028e5a0ca1 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -93,7 +93,6 @@ testDefaultPort _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -107,6 +106,7 @@ testDefaultPort _ = testExplicitHost : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -129,6 +129,7 @@ scratch/main> io.test testDefaultPort Tip: Use view 1 to view the source of a test. ``` + 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. ``` unison @@ -181,7 +182,6 @@ testTcpConnect = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -195,6 +195,7 @@ testTcpConnect = 'let testTcpConnect : '{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 316132ed4d..bf517aeade 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -63,7 +63,6 @@ serialTests = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -80,6 +79,7 @@ serialTests = do shuffle : Nat -> [a] -> [a] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index 6ac7b7720b..5f297f4e74 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -19,7 +19,6 @@ casTest = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,6 +30,7 @@ casTest = do casTest : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -50,6 +50,7 @@ scratch/main> io.test casTest Tip: Use view 1 to view the source of a test. ``` + Promise is a simple one-shot awaitable condition. ``` unison @@ -81,7 +82,6 @@ promiseConcurrentTest = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -94,6 +94,7 @@ promiseConcurrentTest = do promiseSequentialTest : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -124,6 +125,7 @@ scratch/main> io.test promiseConcurrentTest Tip: Use view 1 to view the source of a test. ``` + CAS can be used to write an atomic update function. ``` unison @@ -135,7 +137,6 @@ atomicUpdate ref f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -147,6 +148,7 @@ atomicUpdate ref f = atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () ``` + ``` ucm scratch/main> add @@ -155,6 +157,7 @@ scratch/main> add atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () ``` + Promise can be used to write an operation that spawns N concurrent tasks and collects their results @@ -174,7 +177,6 @@ spawnN n fa = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -186,6 +188,7 @@ spawnN n fa = spawnN : Nat -> '{IO} a ->{IO} [a] ``` + ``` ucm scratch/main> add @@ -194,6 +197,7 @@ scratch/main> add spawnN : Nat -> '{IO} a ->{IO} [a] ``` + We can use these primitives to write a more interesting example, where multiple threads repeatedly update an atomic counter, we check that the value of the counter is correct after all threads are done. @@ -223,7 +227,6 @@ fullTest = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -235,6 +238,7 @@ fullTest = do fullTest : '{IO} [Result] ``` + ``` ucm scratch/main> add 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 4483682980..4209bc6b4d 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -68,7 +68,6 @@ mkTestCase = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -94,6 +93,7 @@ mkTestCase = do tree3 : Tree Text ``` + ``` ucm scratch/main> add 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 f2734eb118..4413dbdbc2 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -16,7 +16,6 @@ mkTestCase = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +31,7 @@ mkTestCase = do mkTestCase : '{IO, Exception} () ``` + ``` ucm scratch/main> add 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 08339ffd0f..d611fdee11 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -30,7 +30,6 @@ mkTestCase = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,6 +47,7 @@ mkTestCase = do products : ([Nat], [Nat], [Nat]) -> Text ``` + ``` ucm scratch/main> add 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 824cab1a39..3dab5f2b94 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -44,7 +44,6 @@ mkTestCase = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +66,7 @@ mkTestCase = do suspSum : [Nat] -> Delayed Nat ``` + ``` ucm scratch/main> add 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 bb6a6c5fa0..0206d434df 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -14,7 +14,6 @@ mkTestCase = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +27,7 @@ mkTestCase = do mutual1 : Nat -> Text ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index 2e7724f9e3..9b0f0a3ae2 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -29,7 +29,6 @@ body k out v = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +43,7 @@ body k out v = loop : '{IO} Nat -> Nat -> Nat ->{IO} Nat ``` + ``` ucm scratch/main> add @@ -55,6 +55,7 @@ scratch/main> add loop : '{IO} Nat -> Nat -> Nat ->{IO} Nat ``` + Test case. ``` unison @@ -91,7 +92,6 @@ tests = '(map spawn nats) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -106,6 +106,7 @@ tests = '(map spawn nats) tests : '{IO} [Result] ``` + ``` ucm scratch/main> add 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 a321643568..7d3ddebaf7 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -16,7 +16,6 @@ test> mytest = checks [x + 1 == 1001] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,6 +39,7 @@ test> mytest = checks [x + 1 == 1001] ✅ Passed Passed ``` + We expect this 'add' to fail because the test is blocked by the update to `x`. ``` ucm @@ -54,6 +54,7 @@ scratch/main> add Tip: Use `help filestatus` to learn more. ``` + ----- ``` unison @@ -62,7 +63,6 @@ test> useY = checks [y + 1 == 43] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,6 +82,7 @@ test> useY = checks [y + 1 == 43] ✅ Passed Passed ``` + This should correctly identify `y` as a dependency and add that too. ``` ucm diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index 863d749698..5912bb12bb 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -17,7 +17,6 @@ testBasicFork = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +29,7 @@ testBasicFork = 'let testBasicFork : '{IO} [Result] ``` + See if we can get another thread to stuff a value into a MVar ``` unison @@ -57,7 +57,6 @@ testBasicMultiThreadMVar = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -70,6 +69,7 @@ testBasicMultiThreadMVar = 'let thread1 : Nat -> MVar Nat -> '{IO} () ``` + ``` ucm scratch/main> add @@ -89,6 +89,7 @@ scratch/main> io.test testBasicMultiThreadMVar Tip: Use view 1 to view the source of a test. ``` + ``` unison sendingThread: Nat -> MVar Nat -> '{io2.IO}() sendingThread toSend mv = 'let @@ -128,7 +129,6 @@ testTwoThreads = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -143,6 +143,7 @@ testTwoThreads = 'let testTwoThreads : '{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 76b9be2782..17c19ab945 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -28,7 +28,6 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,6 +41,7 @@ what_should_work _ = this_should_work ++ this_should_not_work what_should_work : ∀ _. _ -> [Result] ``` + ``` ucm scratch/main> add @@ -63,6 +63,7 @@ scratch/main> io.test what_should_work Tip: Use view 1 to view the source of a test. ``` + Test handshaking a client/server a local TCP connection using our self-signed cert. @@ -218,7 +219,6 @@ testCNReject _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -237,6 +237,7 @@ testCNReject _ = testConnectSelfSigned : '{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index f5bf210754..96f132593d 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -11,6 +11,7 @@ scratch/main> find Utf8 ``` + ascii characters are encoded as single bytes (in the range 0-127). ``` unison @@ -22,7 +23,6 @@ ascii = "ABCDE" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,6 +42,7 @@ ascii = "ABCDE" 0xs4142434445 ``` + non-ascii characters are encoded as multiple bytes. ``` unison @@ -52,7 +53,6 @@ greek = "ΑΒΓΔΕ" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -71,6 +71,7 @@ greek = "ΑΒΓΔΕ" 0xsce91ce92ce93ce94ce95 ``` + We can check that encoding and then decoding should give us back the same `Text` we started with ``` unison @@ -87,7 +88,6 @@ test> greekTest = checkRoundTrip greek ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -108,6 +108,7 @@ test> greekTest = checkRoundTrip greek ✅ Passed Passed ``` + If we try to decode an invalid set of bytes, we get back `Text` explaining the decoding error: ``` unison @@ -122,7 +123,6 @@ greek_bytes = Bytes.fromList [206, 145, 206, 146, 206, 147, 206, 148, 206] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index f11bf9c2a0..a8b1057dd9 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -18,7 +18,6 @@ ha = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,6 +30,7 @@ ha = cases ha : Request {A} r -> r ``` + ``` ucm scratch/main> add 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 d897322a99..431fe74112 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -15,7 +15,6 @@ term2 _ = () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +29,7 @@ term2 _ = () term2 : '{Bar, Foo} () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md index f5580e7b80..62a34bbe0b 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -11,7 +11,6 @@ unique ability Channels where ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ unique ability Channels where ability Channels ``` + ``` ucm scratch/main> add @@ -31,6 +31,7 @@ scratch/main> add ability Channels ``` + Now we update the ability, changing the name of the constructor, *but*, we simultaneously add a new top-level term with the same name as the constructor which is being removed from Channels. @@ -47,7 +48,6 @@ thing _ = send 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +65,7 @@ thing _ = send 1 ability Channels ``` + These should fail with a term/ctor conflict since we exclude the ability from the update. ``` ucm @@ -89,6 +90,7 @@ scratch/main> update.old patch thing ability Channels ``` + If however, `Channels.send` and `thing` *depend* on `Channels`, updating them should succeed since it pulls in the ability as a dependency. ``` unison @@ -103,7 +105,6 @@ thing _ = send 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -119,6 +120,7 @@ thing _ = send 1 thing : '{Channels} () ``` + These updates should succeed since `Channels` is a dependency. ``` ucm @@ -150,6 +152,7 @@ scratch/main> update.old.preview patch thing thing : '{Channels} () ``` + We should also be able to successfully update the whole thing. ``` ucm @@ -163,6 +166,7 @@ scratch/main> update.old thing : '{Channels} () ``` + # Constructor-term conflict ``` unison @@ -170,7 +174,6 @@ X.x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -182,6 +185,7 @@ X.x = 1 X.x : Nat ``` + ``` ucm scratch/main2> add @@ -190,13 +194,13 @@ scratch/main2> add X.x : Nat ``` + ``` unison structural ability X where x : () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -212,6 +216,7 @@ structural ability X where Tip: Use `help filestatus` to learn more. ``` + This should fail with a ctor/term conflict. ``` ucm diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index 76e52470c4..897fc3c1aa 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -14,7 +14,6 @@ is2even = '(even 2) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +27,7 @@ is2even = '(even 2) odd : Nat -> Boolean ``` + it errors if there isn't a previous run ``` ucm @@ -39,12 +39,14 @@ scratch/main> add.run foo something before attempting to save it. ``` + ``` ucm scratch/main> run is2even true ``` + it errors if the desired result name conflicts with a name in the unison file @@ -57,6 +59,7 @@ scratch/main> add.run is2even name conflicts with a name in the scratch file. ``` + otherwise, the result is successfully persisted ``` ucm @@ -67,6 +70,7 @@ scratch/main> add.run foo.bar.baz foo.bar.baz : Boolean ``` + ``` ucm scratch/main> view foo.bar.baz @@ -74,6 +78,7 @@ scratch/main> view foo.bar.baz foo.bar.baz = true ``` + ## It resolves references within the unison file ``` unison @@ -88,7 +93,6 @@ main _ = y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -102,6 +106,7 @@ main _ = y z : Nat -> Nat ``` + ``` ucm scratch/main> run main @@ -115,6 +120,7 @@ scratch/main> add.run result z : Nat -> Nat ``` + ## It resolves references within the codebase ``` unison @@ -123,7 +129,6 @@ inc x = x + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -135,6 +140,7 @@ inc x = x + 1 inc : Nat -> Nat ``` + ``` ucm scratch/main> add inc @@ -143,13 +149,13 @@ scratch/main> add inc inc : Nat -> Nat ``` + ``` unison main : '(Nat -> Nat) main _ x = inc x ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -161,6 +167,7 @@ main _ x = inc x main : '(Nat -> Nat) ``` + ``` ucm scratch/main> run main @@ -178,6 +185,7 @@ scratch/main> view natfoo natfoo = inc ``` + ## It captures scratch file dependencies at run time ``` unison @@ -187,7 +195,6 @@ main = 'y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -201,18 +208,19 @@ main = 'y y : Nat ``` + ``` ucm scratch/main> run main 2 ``` + ``` unison x = 50 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -224,6 +232,7 @@ x = 50 x : Nat ``` + this saves 2 to xres, rather than 100 ``` ucm @@ -239,6 +248,7 @@ scratch/main> view xres xres = 2 ``` + ## It fails with a message if add cannot complete cleanly ``` unison @@ -246,7 +256,6 @@ main = '5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -258,6 +267,7 @@ main = '5 main : 'Nat ``` + ``` ucm scratch/main> run main @@ -273,6 +283,7 @@ scratch/main> add.run xres Tip: Use `help filestatus` to learn more. ``` + ## It works with absolute names ``` unison @@ -280,7 +291,6 @@ main = '5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -292,6 +302,7 @@ main = '5 main : 'Nat ``` + ``` ucm scratch/main> run main diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index cbf0552713..366cfc8fc1 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -11,7 +11,6 @@ structural type Y = Two Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +25,7 @@ structural type Y = Two Nat Nat y : Nat ``` + Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ``` ucm @@ -39,6 +39,7 @@ scratch/main> add y : Nat ``` + Let's add an alias for `1` and `One`: ``` unison @@ -48,7 +49,6 @@ structural type Z = One Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -63,6 +63,7 @@ structural type Z = One Nat (also named x) ``` + Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. @@ -77,6 +78,7 @@ scratch/main> add (also named x) ``` + Let's update something that has an alias (to a value that doesn't have a name already): ``` unison @@ -85,7 +87,6 @@ structural type X = Three Nat Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -101,6 +102,7 @@ structural type X = Three Nat Nat Nat (The old definition is also named z.) ``` + 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 @@ -116,6 +118,7 @@ scratch/main> update Done. ``` + Update it to something that already exists with a different name: ``` unison @@ -124,7 +127,6 @@ structural type X = Two Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -140,6 +142,7 @@ structural type X = Two Nat Nat (also named y) ``` + 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 diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index 4924cee59c..eb15536180 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -62,5 +62,5 @@ scratch/main> find-in mylib ``` -Thanks, `alias.many`\! +Thanks, `alias.many`\! diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md index 2c120239e2..17c5f43390 100644 --- a/unison-src/transcripts/alias-term.output.md +++ b/unison-src/transcripts/alias-term.output.md @@ -11,6 +11,7 @@ project/main> ls 2. lib/ (643 terms, 92 types) ``` + It won't create a conflicted name, though. ``` ucm @@ -21,6 +22,7 @@ project/main> alias.term lib.builtins.todo foo A term by that name already exists. ``` + ``` ucm project/main> ls @@ -28,6 +30,7 @@ project/main> ls 2. lib/ (643 terms, 92 types) ``` + You can use `debug.alias.term.force` for that. ``` ucm diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md index 79a2fbcd7a..839d7e415d 100644 --- a/unison-src/transcripts/alias-type.output.md +++ b/unison-src/transcripts/alias-type.output.md @@ -11,6 +11,7 @@ project/main> ls 2. lib/ (643 terms, 92 types) ``` + It won't create a conflicted name, though. ``` ucm @@ -21,6 +22,7 @@ project/main> alias.type lib.builtins.Int Foo A type by that name already exists. ``` + ``` ucm project/main> ls @@ -28,6 +30,7 @@ project/main> ls 2. lib/ (643 terms, 92 types) ``` + You can use `debug.alias.type.force` for that. ``` ucm diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index f58ad3bc0d..45218c14b2 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -26,7 +26,6 @@ foo _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,6 +44,7 @@ foo _ = 5 ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index bda48a005e..6e8adfb698 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -13,7 +13,6 @@ test> Any.unsafeExtract.works = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +31,7 @@ test> Any.unsafeExtract.works = ✅ Passed Passed ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index 1ecf4f86a3..aaa97d446a 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -146,6 +146,7 @@ scratch/main> display term.doc message ``` + ``` api GET /api/projects/scratch/branches/main/getDefinition?names=term { @@ -941,4 +942,3 @@ GET /api/projects/scratch/branches/main/getDefinition?names=term "typeDefinitions": {} } ``` - diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 2d062550b9..036af4aaed 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -8,7 +8,6 @@ joey.yaml.zz = 45 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ joey.yaml.zz = 45 ross.httpClient.y : ##Nat ``` + ``` ucm scratch/main> add @@ -34,6 +34,7 @@ scratch/main> add ross.httpClient.y : ##Nat ``` + ``` api -- Namespace segment prefix search GET /api/projects/scratch/branches/main/find?query=http @@ -253,4 +254,3 @@ GET /api/projects/scratch/branches/main/find?query=joey.http ] ] ``` - diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index edf49323c5..768b6abe37 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -512,4 +512,3 @@ GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo "typeDefinitions": {} } ``` - diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 0971ab5fc5..52a3fac22f 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -54,4 +54,3 @@ GET /api/projects/project-one/branches?prefix=branch-t } ] ``` - diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 3ba09740f7..6952a0cd32 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -10,7 +10,6 @@ Here's a *README*! ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ Here's a *README*! nested.names.x.doc : Doc2 ``` + ``` ucm scratch/main> add @@ -34,6 +34,7 @@ scratch/main> add nested.names.x.doc : Doc2 ``` + ``` api -- Should find names by suffix GET /api/projects/scratch/branches/main/namespaces/nested.names @@ -79,4 +80,3 @@ GET /api/projects/scratch/branches/main/namespaces/nested.names } } ``` - diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index 56a6e09498..5d65eaae4b 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -8,7 +8,6 @@ nested.names.readme = {{ I'm a readme! }} ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ nested.names.readme = {{ I'm a readme! }} nested.names.x.doc : Doc2 ``` + ``` ucm scratch/main> add @@ -32,6 +32,7 @@ scratch/main> add nested.names.x.doc : Doc2 ``` + ``` api GET /api/projects/scratch/branches/main/list?namespace=nested.names { @@ -132,4 +133,3 @@ GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" } ``` - diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index 7ea0a5d197..314196777c 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -826,4 +826,3 @@ GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary? "tag": "Data" } ``` - diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 20560c94c4..7e06b01c90 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -7,7 +7,6 @@ x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ x = 1 x : Nat ``` + ``` ucm scratch/main> add @@ -27,6 +27,7 @@ scratch/main> add x : Nat ``` + Update `x`, and add a new `y` which depends on the update ``` unison @@ -35,7 +36,6 @@ y = x + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,6 +52,7 @@ y = x + 1 x : Nat ``` + Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. ``` ucm diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md index f52ca4f259..7a032269a4 100644 --- a/unison-src/transcripts/blocks.output.md +++ b/unison-src/transcripts/blocks.output.md @@ -16,7 +16,6 @@ ex thing = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,6 +34,7 @@ ex thing = 43 ``` + ### Whether a block shadows outer names doesn't depend on the order of bindings in the block The `thing` reference in `bar` refers to the one declared locally in the block that `bar` is part of. This is true even if the declaration which shadows the outer name appears later in the block, for instance: @@ -49,7 +49,6 @@ ex thing = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,6 +67,7 @@ ex thing = 43 ``` + ### Blocks use lexical scoping and can only reference definitions in parent scopes or in the same block This is just the normal lexical scoping behavior. For example: @@ -84,7 +84,6 @@ ex thing = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -103,6 +102,7 @@ ex thing = 4201 ``` + Here's another example, showing that bindings cannot reference bindings declared in blocks nested in the *body* (the final expression) of a block: ``` unison @@ -116,7 +116,6 @@ ex thing = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -135,6 +134,7 @@ ex thing = 4201 ``` + ### Blocks can define one or more functions which are recursive or mutually recursive We call these groups of definitions that reference each other in a block *cycles*. For instance: @@ -155,7 +155,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -168,6 +167,7 @@ ex n = sumTo : Nat -> Nat ``` + The `go` function is a one-element cycle (it reference itself), and `ping` and `pong` form a two-element cycle. ### Cyclic references or forward reference must be guarded @@ -182,7 +182,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -194,6 +193,7 @@ ex n = ex : n -> Nat ``` + Since the forward reference to `pong` appears inside `ping`. This, however, will not compile: @@ -206,7 +206,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 @@ -215,6 +214,7 @@ ex n = ``` + This also won't compile; it's a cyclic reference that isn't guarded: ``` unison @@ -224,7 +224,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 @@ -232,6 +231,7 @@ ex n = ``` + This, however, will compile. This also shows that `'expr` is another way of guarding a definition. ``` unison @@ -241,7 +241,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -253,6 +252,7 @@ ex n = ex : n -> r ``` + Just don't try to run it as it's an infinite loop\! ### Cyclic definitions in a block don't have access to any abilities @@ -270,7 +270,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. @@ -279,6 +278,7 @@ ex n = ``` + ### The *body* of recursive functions can certainly access abilities For instance, this works fine: @@ -294,7 +294,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -307,6 +306,7 @@ ex n = ex : n ->{SpaceAttack} Nat ``` + ### Unrelated definitions not part of a cycle and are moved after the cycle For instance, `zap` here isn't considered part of the cycle (it doesn't reference `ping` or `pong`), so this typechecks fine: @@ -323,7 +323,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -336,6 +335,7 @@ ex n = ex : n ->{SpaceAttack} r ``` + This is actually parsed as if you moved `zap` after the cycle it find itself a part of: ``` unison @@ -350,7 +350,6 @@ ex n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you 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 1609f89a39..f12f51e270 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -8,7 +8,6 @@ hangExample = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,6 +19,7 @@ hangExample = hangExample : Boolean ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index 6a78b8e723..39522b339d 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -18,6 +18,7 @@ scratch/main> add someterm : Nat ``` + Now, the `branch` demo: `branch` can create a branch from a different branch in the same project, from a different branch in a different @@ -149,6 +150,7 @@ scratch/main> branch.empty foo/empty4 Tip: Use `merge /somebranch` to initialize this branch. ``` + The `branch` command can create branches named `releases/drafts/*` (because why not). ``` ucm @@ -163,6 +165,7 @@ foo/main> branch releases/drafts/1.2.3 foo/main> switch /releases/drafts/1.2.3 ``` + The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. ``` ucm diff --git a/unison-src/transcripts/branch-relative-path.output.md b/unison-src/transcripts/branch-relative-path.output.md index e9e33b5ad9..59154da629 100644 --- a/unison-src/transcripts/branch-relative-path.output.md +++ b/unison-src/transcripts/branch-relative-path.output.md @@ -4,7 +4,6 @@ foo.bar = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ foo.bar = 1 foo.bar : ##Nat ``` + ``` ucm p0/main> add @@ -26,13 +26,13 @@ p0/main> add foo.bar : ##Nat ``` + ``` unison bonk = 5 donk.bonk = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,6 +47,7 @@ donk.bonk = 1 (also named foo.bar) ``` + ``` ucm p1/main> add diff --git a/unison-src/transcripts/bug-fix-4354.output.md b/unison-src/transcripts/bug-fix-4354.output.md index 110aca0022..7fcba60d94 100644 --- a/unison-src/transcripts/bug-fix-4354.output.md +++ b/unison-src/transcripts/bug-fix-4354.output.md @@ -9,7 +9,6 @@ bonk x = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index d2f825c3cd..b3aae7236f 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -1,6 +1,6 @@ We can display the guide before and after adding it to the codebase: -``` ucm +```` ucm scratch/main> display doc.guide # Unison computable documentation @@ -410,7 +410,8 @@ scratch/main> display doc.guide rendered table. Some text More text Zounds! -``` +```` + But we can't display this due to a decompilation problem. ``` unison @@ -418,7 +419,6 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -430,7 +430,8 @@ rendered = Pretty.get (docFormatConsole doc.guide) rendered : Annotated () (Either SpecialForm ConsoleText) ``` -``` ucm + +```` ucm scratch/main> display rendered # Unison computable documentation @@ -841,7 +842,8 @@ scratch/main> undo 1. rendered : Annotated () (Either SpecialForm ConsoleText) -``` +```` + And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. ``` unison @@ -850,8 +852,7 @@ rendered = Pretty.get (docFormatConsole doc.guide) > rendered ``` -``` ucm - +```` ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -4520,4 +4521,4 @@ rendered = Pretty.get (docFormatConsole doc.guide) ])))) ]) -``` +```` diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index efa1f53afa..81b53c7a17 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -364,7 +364,6 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -392,6 +391,7 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ✅ Passed Passed ``` + ## Sandboxing functions ``` unison @@ -416,7 +416,6 @@ openFile] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -455,6 +454,7 @@ openFile] ✅ Passed Passed ``` + ``` unison openFilesIO = do checks @@ -469,7 +469,6 @@ openFilesIO = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -481,6 +480,7 @@ openFilesIO = do openFilesIO : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -499,6 +499,7 @@ scratch/main> io.test openFilesIO Tip: Use view 1 to view the source of a test. ``` + ## Universal hash functions Just exercises the function @@ -509,7 +510,6 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -532,6 +532,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ✅ Passed Passed ``` + ## Run the tests 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. diff --git a/unison-src/transcripts/bytesFromList.output.md b/unison-src/transcripts/bytesFromList.output.md index b4a9782215..2351e4e192 100644 --- a/unison-src/transcripts/bytesFromList.output.md +++ b/unison-src/transcripts/bytesFromList.output.md @@ -5,7 +5,6 @@ This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2 ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md index 7975553f1d..fc2a48001e 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -6,7 +6,6 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,6 +17,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763 +-+ : Nat -> Nat -> Nat ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index fa6f046e80..39f9435a9f 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -5,7 +5,6 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei - : Nat -> Nat -> Int ``` + ``` ucm scratch/main> add @@ -25,12 +25,12 @@ scratch/main> add - : Nat -> Nat -> Int ``` + ``` unison baz x = x - 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/constructor-applied-to-unit.output.md b/unison-src/transcripts/constructor-applied-to-unit.output.md index e12d3f1d43..3e410800b8 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.output.md +++ b/unison-src/transcripts/constructor-applied-to-unit.output.md @@ -6,7 +6,6 @@ structural type Zoink a b c = Zoink a b c ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/contrabilities.output.md b/unison-src/transcripts/contrabilities.output.md index ef0f98dffa..d3d0cfd6f2 100644 --- a/unison-src/transcripts/contrabilities.output.md +++ b/unison-src/transcripts/contrabilities.output.md @@ -4,7 +4,6 @@ f x = 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index b5dd6e69aa..c885dd236d 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -9,7 +9,6 @@ pong _ = !ping + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ pong _ = !ping + 2 pong : 'Nat ``` + ``` ucm scratch/main> add @@ -31,13 +31,13 @@ scratch/main> add pong : 'Nat ``` + ``` unison ping : 'Nat ping _ = !pong + 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ ping _ = !pong + 3 ping : 'Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index b9bdc363fd..20be4fd088 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -9,7 +9,6 @@ pong _ = !ping + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ pong _ = !ping + 2 pong : 'Nat ``` + ``` ucm scratch/main> add @@ -31,13 +31,13 @@ scratch/main> add pong : 'Nat ``` + ``` unison ping : 'Nat ping _ = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ ping _ = 3 ping : 'Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index 15b0e26624..8f9c750346 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -9,7 +9,6 @@ pong _ = !ping + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ pong _ = !ping + 2 pong : 'Nat ``` + ``` ucm scratch/main> add @@ -31,13 +31,13 @@ scratch/main> add pong : 'Nat ``` + ``` unison ping : Nat ping = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ ping = 3 ping : Nat ``` + ``` ucm scratch/main> update.old diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index 2fec74ba80..5d884c8d14 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -9,7 +9,6 @@ pong _ = !ping + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ pong _ = !ping + 2 pong : 'Nat ``` + ``` ucm scratch/main> add @@ -31,6 +31,7 @@ scratch/main> add pong : 'Nat ``` + ``` unison ping : 'Nat ping _ = !clang + 1 @@ -40,7 +41,6 @@ clang _ = !pong + 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -57,6 +57,7 @@ clang _ = !pong + 3 ping : 'Nat ``` + ``` ucm scratch/main> update.old ping diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index b9b0742e53..b338836d66 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -10,7 +10,6 @@ structural type a.b.Baz = Boo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +26,7 @@ structural type a.b.Baz = Boo a.x.three : ##Nat ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 9756abc509..a325d5421c 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -40,6 +40,7 @@ scratch/app1> delete.namespace http Done. ``` + As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ``` ucm @@ -56,6 +57,7 @@ scratch/app1> names x Names: lib.http_v3.x lib.http_v4.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` @@ -89,6 +91,7 @@ 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. diff --git a/unison-src/transcripts/definition-diff-api.output.md b/unison-src/transcripts/definition-diff-api.output.md index 8934749d03..d33aafa5f1 100644 --- a/unison-src/transcripts/definition-diff-api.output.md +++ b/unison-src/transcripts/definition-diff-api.output.md @@ -12,6 +12,7 @@ diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- Done. ``` + ``` unison term = _ = "Here's some text" @@ -35,7 +36,6 @@ take n s = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ take n s = term : Nat ``` + ``` ucm diffs/main> add @@ -68,6 +69,7 @@ diffs/main> branch.create new `switch /main` then `merge /new`. ``` + ``` unison term = _ = "Here's some different text" @@ -93,7 +95,6 @@ take n s = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -110,6 +111,7 @@ take n s = term : Nat ``` + ``` ucm diffs/new> update @@ -119,6 +121,7 @@ diffs/new> update Done. ``` + Diff terms ``` api @@ -3599,4 +3602,3 @@ GET /api/projects/diffs/diff/types?oldBranchRef=main&newBranchRef=new&oldType=Ty "project": "diffs" } ``` - diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md index 1343731033..428027ec8b 100644 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ b/unison-src/transcripts/delete-namespace-dependents-check.output.md @@ -11,7 +11,6 @@ dependent = dependency + 99 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ dependent = dependency + 99 sub.dependency : Nat ``` + ``` ucm myproject/main> add diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index ef7c2a5307..43018b571a 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -18,6 +18,7 @@ scratch/main> delete.namespace no_dependencies Done. ``` + Deleting a namespace with external dependencies should fail and list all dependents. ``` ucm @@ -39,6 +40,7 @@ scratch/main> delete.namespace dependencies without names, use delete.namespace.force ``` + Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ``` ucm @@ -59,6 +61,7 @@ scratch/main> delete.namespace.force dependencies 4. dependents.usage2 ``` + I should be able to view an affected dependency by number ``` ucm @@ -70,6 +73,7 @@ scratch/main> view 2 #gjmq673r1v * #dcgdua2lj6 ``` + Deleting the root namespace should require confirmation if not forced. ``` ucm @@ -98,6 +102,7 @@ scratch/main> history . □ 1. #sg60bvjo91 (start of history) ``` + Deleting the root namespace shouldn't require confirmation if forced. ``` ucm diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index 9423a7ed2c..3724341733 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -12,6 +12,7 @@ foo/main> branch topic foo/topic> delete.branch /topic ``` + A branch need not be preceded by a forward slash. ``` ucm @@ -25,6 +26,7 @@ foo/main> branch topic foo/topic> delete.branch topic ``` + You can precede the branch name by a project name. ``` ucm @@ -38,12 +40,14 @@ foo/main> branch topic scratch/main> delete.branch foo/topic ``` + You can delete the only branch in a project. ``` ucm foo/main> delete.branch /main ``` + You can delete the last branch in the project, a new one will be created. ``` ucm @@ -56,6 +60,7 @@ scratch/main> branches 2. main2 ``` + If the the last branch isn't /main, then /main will be created. ``` ucm diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index 49c5a0860d..a6e42ffee7 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -7,6 +7,7 @@ scratch/main> delete foo foo ``` + ``` unison foo = 1 structural type Foo = Foo () diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index 0a9139a6cf..c74ad3e46e 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -14,6 +14,7 @@ scratch/main> delete.verbose foo foo ``` + Now for some easy cases. Deleting an unambiguous term, then deleting an unambiguous type. @@ -58,6 +59,7 @@ scratch/main> delete.verbose Foo.Foo this change. ``` + How about an ambiguous term? ``` unison @@ -78,6 +80,7 @@ scratch/main> debug.alias.term.force a.bar a.foo Done. ``` + A delete should remove both versions of the term. ``` ucm @@ -101,6 +104,7 @@ scratch/main> ls a 1. bar (Nat) ``` + Let's repeat all that on a type, for completeness. ``` unison @@ -147,6 +151,7 @@ scratch/main> delete.verbose a.Foo.Foo this change. ``` + Finally, let's try to delete a term and a type with the same name. ``` unison @@ -173,6 +178,7 @@ scratch/main> delete.verbose foo this change. ``` + We want to be able to delete multiple terms at once ``` unison @@ -202,6 +208,7 @@ scratch/main> delete.verbose a b c this change. ``` + We can delete terms and types in the same invocation of delete ``` unison @@ -245,6 +252,7 @@ scratch/main> delete.verbose Foo.Foo this change. ``` + We can delete a type and its constructors ``` unison @@ -274,6 +282,7 @@ scratch/main> delete.verbose Foo Foo.Foo this change. ``` + You should not be able to delete terms which are referenced by other terms ``` unison @@ -307,6 +316,7 @@ scratch/main> delete.verbose a b c a 2. d ``` + But you should be able to delete all terms which reference each other in a single command ``` unison @@ -339,6 +349,7 @@ scratch/main> delete.verbose e f g h this change. ``` + You should be able to delete a type and all the functions that reference it in a single command ``` unison @@ -369,6 +380,7 @@ scratch/main> delete.verbose Foo Foo.Foo incrementFoo this change. ``` + If you mess up on one of the names of your command, delete short circuits ``` unison @@ -396,6 +408,7 @@ scratch/main> delete.verbose e f gg gg ``` + Cyclical terms which are guarded by a lambda are allowed to be deleted ``` unison diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index f7398fd480..900537ad70 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -29,6 +29,7 @@ scratch/main> debug.file outside.d#ukd7tu6kds ``` + This will help me make progress in some situations when UCM is being deficient or broken. ### `dependents` / `dependencies` @@ -113,5 +114,5 @@ scratch/main> dependents d the above list. ``` -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. +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/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index 371864ee95..51e78f339f 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -15,7 +15,6 @@ ex1 tup = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +27,7 @@ ex1 tup = ex1 : (a, b, (Nat, Nat)) -> Nat ``` + ``` ucm scratch/main> add @@ -48,6 +48,7 @@ scratch/main> view ex0 ex1 ex1 = cases (a, b, (c, d)) -> c Nat.+ d ``` + 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`. A destructuring bind is just syntax for a single branch pattern match. Notice that Unison detects this function as an alias of `ex1`: @@ -59,7 +60,6 @@ ex2 tup = match tup with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -72,6 +72,7 @@ ex2 tup = match tup with (also named ex1) ``` + ## Corner cases Destructuring binds can't be recursive: the left-hand side bound variables aren't available on the right hand side. For instance, this doesn't typecheck: @@ -83,7 +84,6 @@ ex4 = ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what a refers to here: @@ -102,6 +102,7 @@ ex4 = * You have a typo in the name ``` + Even though the parser accepts any pattern on the LHS of a bind, it looks pretty weird to see things like `12 = x`, so we avoid showing a destructuring bind when the LHS is a "literal" pattern (like `42` or "hi"). Again these examples wouldn't compile with coverage checking. ``` unison @@ -117,7 +118,6 @@ ex5a _ = match (99 + 1, "hi") with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -130,6 +130,7 @@ ex5a _ = match (99 + 1, "hi") with ex5a : 'Text ``` + ``` ucm scratch/main> add @@ -151,6 +152,7 @@ scratch/main> view ex5 ex5a _ -> "impossible" ``` + Notice how it prints both an ordinary match. Also, for clarity, the pretty-printer shows a single-branch match if the match shadows free variables of the scrutinee, for example: diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index d26daa5323..93611f1c53 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -12,6 +12,7 @@ scratch/b1> add x : Nat ``` + ``` unison x = 23 fslkdjflskdjflksjdf = 23 @@ -32,6 +33,7 @@ scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf Done. ``` + ``` ucm scratch/main> diff.namespace /b1: /b2: @@ -50,6 +52,7 @@ scratch/main> diff.namespace /b1: /b2: 8. fslkdjflskdjflksjdf#u520d1t9kc (removed) ``` + Things we want to test: - Diffing identical namespaces @@ -101,6 +104,7 @@ scratch/ns1> branch /ns2 `switch /ns1` then `merge /ns2`. ``` + Here's what we've done so far: ``` ucm @@ -111,12 +115,14 @@ scratch/main> diff.namespace .nothing /ns1: The namespace scratch/main:.nothing is empty. Was there a typo? ``` + ``` ucm scratch/main> diff.namespace /ns1: /ns2: The namespaces are identical. ``` + ``` unison junk = "asldkfjasldkfj" ``` @@ -137,6 +143,7 @@ scratch/ns1> delete.term junk Done. ``` + ``` unison fromJust = 99 b = 999999999 @@ -300,6 +307,7 @@ scratch/main> diff.namespace /ns3: /ns2: 3. fromJust' (removed) ``` + ``` unison bdependent = "banana" ``` @@ -327,6 +335,7 @@ scratch/main> diff.namespace /ns2: /ns3: 5. yoohoo (removed) ``` + ## Two different auto-propagated changes creating a name conflict Currently, the auto-propagated name-conflicted definitions are not explicitly @@ -363,6 +372,7 @@ scratch/nsx> branch /nsz `switch /nsx` then `merge /nsz`. ``` + ``` unison a = 444 ``` @@ -380,6 +390,7 @@ scratch/nsy> update Done. ``` + ``` unison a = 555 ``` @@ -412,6 +423,7 @@ scratch/nsw> debug.alias.term.force .forconflicts .b Done. ``` + ``` ucm scratch/main> diff.namespace /nsx: /nsw: @@ -452,6 +464,7 @@ scratch/nsw> view b a#mdl4vqtu00 + 1 ``` + ## Should be able to diff a namespace hash from history. ``` unison @@ -459,7 +472,6 @@ x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -471,6 +483,7 @@ x = 1 x : Nat ``` + ``` ucm scratch/hashdiff> add @@ -479,12 +492,12 @@ scratch/hashdiff> add x : ##Nat ``` + ``` unison y = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -496,6 +509,7 @@ y = 2 y : ##Nat ``` + ``` ucm scratch/hashdiff> add @@ -523,6 +537,7 @@ scratch/hashdiff> diff.namespace 2 1 1. y : ##Nat ``` + ## Updates: -- 1 to 1 @@ -569,4 +584,3 @@ Resolved name conflicts: -- updates where LHS had multiple hashes and RHS has on - \[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.output.md b/unison-src/transcripts/doc-formatting.output.md index 9a8d60c8bd..210299b64d 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -10,7 +10,6 @@ foo n = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ foo n = foo : Nat -> Nat ``` + ``` ucm scratch/main> view foo @@ -32,6 +32,7 @@ scratch/main> view foo n + 1 ``` + Note that `@` and `:]` must be escaped within docs. ``` unison @@ -39,7 +40,6 @@ escaping = [: Docs look [: like \@this \:] :] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +51,7 @@ escaping = [: Docs look [: like \@this \:] :] escaping : Doc ``` + ``` ucm scratch/main> view escaping @@ -58,6 +59,7 @@ scratch/main> view escaping escaping = [: Docs look [: like \@this \:] :] ``` + (Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) ``` unison @@ -71,7 +73,6 @@ commented = [: ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,6 +84,7 @@ commented = [: commented : Doc ``` + ``` ucm scratch/main> view commented @@ -94,6 +96,7 @@ scratch/main> view commented :] ``` + ### Indenting, and paragraph reflow Handling of indenting in docs between the parser and pretty-printer is a bit fiddly. @@ -106,7 +109,6 @@ doc1 = [: hi :] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -118,6 +120,7 @@ doc1 = [: hi :] doc1 : Doc ``` + ``` ucm scratch/main> view doc1 @@ -125,6 +128,7 @@ scratch/main> view doc1 doc1 = [: hi :] ``` + ``` unison -- Lines (apart from the first line, i.e. the bit between the [: and the -- first newline) are unindented until at least one of @@ -138,7 +142,6 @@ doc2 = [: hello ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -150,6 +153,7 @@ doc2 = [: hello doc2 : Doc ``` + ``` ucm scratch/main> view doc2 @@ -161,6 +165,7 @@ scratch/main> view doc2 and the rest. :] ``` + ``` unison doc3 = [: When Unison identifies a paragraph, it removes any newlines from it before storing it, and then reflows the paragraph text to fit the display window on display/view/edit. @@ -177,7 +182,6 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -189,6 +193,7 @@ Note that because of the special treatment of the first line mentioned above, wh doc3 : Doc ``` + ``` ucm scratch/main> view doc3 @@ -215,6 +220,7 @@ scratch/main> view doc3 :] ``` + ``` unison doc4 = [: Here's another example of some paragraphs. @@ -224,7 +230,6 @@ doc4 = [: Here's another example of some paragraphs. ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -236,6 +241,7 @@ doc4 = [: Here's another example of some paragraphs. doc4 : Doc ``` + ``` ucm scratch/main> view doc4 @@ -248,6 +254,7 @@ scratch/main> view doc4 - Apart from this one. :] ``` + ``` unison -- The special treatment of the first line does mean that the following -- is pretty-printed not so prettily. To fix that we'd need to get the @@ -259,7 +266,6 @@ doc5 = [: - foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -271,6 +277,7 @@ doc5 = [: - foo doc5 : Doc ``` + ``` ucm scratch/main> view doc5 @@ -281,6 +288,7 @@ scratch/main> view doc5 and the rest. :] ``` + ``` unison -- You can do the following to avoid that problem. doc6 = [: @@ -291,7 +299,6 @@ doc6 = [: ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -303,6 +310,7 @@ doc6 = [: doc6 : Doc ``` + ``` ucm scratch/main> view doc6 @@ -314,6 +322,7 @@ scratch/main> view doc6 :] ``` + ### More testing ``` unison @@ -324,7 +333,6 @@ expr = foo 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -337,6 +345,7 @@ expr = foo 1 expr : Nat ``` + ``` ucm scratch/main> view empty @@ -344,6 +353,7 @@ scratch/main> view empty empty = [: :] ``` + ``` unison test1 = [: The internal logic starts to get hairy when you use the \@ features, for example referencing a name like @List.take. Internally, the text between each such usage is its own blob (blob ends here --> @List.take), so paragraph reflow has to be aware of multiple blobs to do paragraph reflow (or, more accurately, to do the normalization step where newlines with a paragraph are removed.) @@ -385,7 +395,6 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -397,6 +406,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo test1 : Doc ``` + ``` ucm scratch/main> view test1 @@ -460,6 +470,7 @@ scratch/main> view test1 :] ``` + ``` unison -- Regression test for #1363 - preservation of spaces after @ directives in first line when unindenting reg1363 = [: `@List.take foo` bar @@ -467,7 +478,6 @@ reg1363 = [: `@List.take foo` bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -479,6 +489,7 @@ reg1363 = [: `@List.take foo` bar reg1363 : Doc ``` + ``` ucm scratch/main> view reg1363 @@ -486,6 +497,7 @@ scratch/main> view reg1363 reg1363 = [: `@List.take foo` bar baz :] ``` + ``` unison -- Demonstrate doc display when whitespace follows a @[source] or @[evaluate] -- whose output spans multiple lines. @@ -497,7 +509,6 @@ test2 = [: ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -509,6 +520,7 @@ test2 = [: test2 : Doc ``` + View is fine. ``` ucm @@ -521,6 +533,7 @@ 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 diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 3c15677bab..9c99704ef9 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -14,6 +14,7 @@ scratch/main> view lib.builtins.Doc | 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 @@ -27,7 +28,6 @@ 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 @@ -39,6 +39,7 @@ Can link to definitions like @List.drop or @List doc1 : Doc ``` + Syntax: `[:` starts a documentation block; `:]` finishes it. Within the block: @@ -59,7 +60,6 @@ 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 @@ -72,6 +72,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] List.take.ex2 : [Nat] ``` + ``` ucm scratch/main> add @@ -81,6 +82,7 @@ scratch/main> add List.take.ex2 : [Nat] ``` + And now let's write our docs and reference these examples: ``` unison @@ -101,7 +103,6 @@ List.take.doc = [: ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -113,6 +114,7 @@ List.take.doc = [: List.take.doc : Doc ``` + Let's add it to the codebase. ``` ucm @@ -123,6 +125,7 @@ scratch/main> add List.take.doc : Doc ``` + We can view it with `docs`, which shows the `Doc` value that is associated with a definition. ``` ucm @@ -148,6 +151,7 @@ scratch/main> docs List.take ``` + Note that if we view the source of the documentation, the various references are *not* expanded. ``` ucm diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index 9398b97ee5..1ef8493130 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -113,6 +113,7 @@ Format it to check that everything pretty-prints in a valid way. scratch/main> debug.format ``` + ``` unison :added-by-ucm scratch.u otherDoc : a -> Doc2 otherDoc _ = {{ yo }} @@ -214,4 +215,3 @@ fulldoc = sentence. }} ``` - diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index f57dfdedd3..e7ca39527f 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -81,7 +81,7 @@ Table }} ``` -``` ucm +```` ucm scratch/main> debug.doc-to-markdown fulldoc Heres some text with a soft line break @@ -156,7 +156,8 @@ 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: ``` unison @@ -175,7 +176,6 @@ structural type MyStructuralType = MyStructuralType ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md index 9e369c57ca..c0515cf3be 100644 --- a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md +++ b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md @@ -9,7 +9,6 @@ mything = lib.old.foo + lib.old.foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ mything = lib.old.foo + lib.old.foo mything : Nat ``` + ``` ucm foo/main> add diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 461403dada..19d1db9634 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -11,7 +11,6 @@ Stream.send _ = () ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -24,6 +23,7 @@ Stream.send _ = () ``` + Term and type constructor collisions should cause a parse error. ``` unison @@ -34,7 +34,6 @@ X.x _ = () ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -47,6 +46,7 @@ X.x _ = () ``` + Ability and type constructor collisions should cause a parse error. ``` unison @@ -56,7 +56,6 @@ structural ability X where ``` ``` ucm - Loading changes detected in scratch.u. I found two types called X: @@ -67,6 +66,7 @@ structural ability X where ``` + Field accessors and terms with the same name should cause a parse error. ``` unison @@ -77,7 +77,6 @@ X.x = () ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -101,6 +100,7 @@ X.x = () ``` + Types and terms with the same name are allowed. ``` unison @@ -110,7 +110,6 @@ X = () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -124,6 +123,7 @@ X = () X : () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md index b726a6a94d..ee44b378a8 100644 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ b/unison-src/transcripts/duplicate-term-detection.output.md @@ -8,7 +8,6 @@ x = 2 ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -19,6 +18,7 @@ x = 2 ``` + Equivalent duplicate terms should be detected: ``` unison @@ -27,7 +27,6 @@ x = 1 ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -38,6 +37,7 @@ x = 1 ``` + Duplicates from record accessors/setters should be detected ``` unison @@ -48,7 +48,6 @@ Record.x.modify = 2 ``` ``` ucm - Loading changes detected in scratch.u. ❗️ @@ -72,6 +71,7 @@ Record.x.modify = 2 ``` + Duplicate terms and constructors should be detected: ``` unison @@ -86,7 +86,6 @@ AnAbility.thing = 2 ``` ``` ucm - Loading changes detected in scratch.u. ❗️ diff --git a/unison-src/transcripts/ed25519.output.md b/unison-src/transcripts/ed25519.output.md index 9ed215c55a..e0827e510a 100644 --- a/unison-src/transcripts/ed25519.output.md +++ b/unison-src/transcripts/ed25519.output.md @@ -21,7 +21,6 @@ sigOkay = match signature with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index 1dfd0382d1..f451d67517 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison --- title: /private/tmp/scratch.u @@ -17,7 +18,6 @@ mytest = [Ok "ok"] ``` ``` ucm - Loading changes detected in /private/tmp/scratch.u. I found and typechecked these definitions in @@ -31,6 +31,7 @@ mytest = [Ok "ok"] mytest : [Result] ``` + ``` ucm scratch/main> add @@ -59,6 +60,7 @@ scratch/main> edit mytest definitions currently in this namespace. ``` + ``` unison :added-by-ucm /private/tmp/scratch.u bar : Nat bar = 456 diff --git a/unison-src/transcripts/edit-namespace.output.md b/unison-src/transcripts/edit-namespace.output.md index 9af2ce23f7..e766cd12c3 100644 --- a/unison-src/transcripts/edit-namespace.output.md +++ b/unison-src/transcripts/edit-namespace.output.md @@ -18,7 +18,6 @@ unique type Foo = { bar : Nat, baz : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +43,7 @@ unique type Foo = { bar : Nat, baz : Nat } toplevel : Text ``` + ``` ucm project/main> add @@ -66,6 +66,7 @@ project/main> add toplevel : Text ``` + `edit.namespace` edits the whole namespace (minus the top-level `lib`). ``` ucm @@ -79,6 +80,7 @@ project/main> edit.namespace definitions currently in this namespace. ``` + ``` unison :added-by-ucm scratch.u type Foo = { bar : Nat, baz : Nat } @@ -121,6 +123,7 @@ project/main> edit.namespace nested simple definitions currently in this namespace. ``` + ``` unison :added-by-ucm scratch.u nested.cycle.ping : Nat -> Nat nested.cycle.ping n = @@ -144,4 +147,3 @@ simple.x = 10 simple.y : Nat simple.y = 20 ``` - diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index b1b647ecda..6e62cd937c 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -12,6 +12,7 @@ scratch/main> ls nothing to show ``` + ``` ucm scratch/main> find.verbose @@ -29,6 +30,7 @@ scratch/main> find.verbose namespace. ``` + ``` ucm scratch/main> find mynamespace @@ -46,6 +48,7 @@ scratch/main> find mynamespace namespace. ``` + ## history The history of the namespace should be empty. @@ -61,6 +64,7 @@ scratch/main> history mynamespace □ 1. #sg60bvjo91 (start of history) ``` + Add and then delete a term to add some history to a deleted namespace. ``` unison @@ -78,6 +82,7 @@ scratch/main> fork stuff deleted Done. ``` + The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ``` ucm @@ -100,6 +105,7 @@ scratch/main> history deleted □ 1. #q2dq4tsno1 (start of history) ``` + ## move.namespace ``` unison diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index 86c4b63ff2..f5b7cdc046 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -12,6 +12,7 @@ scratch/main> ls nothing to show ``` + Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ``` ucm @@ -24,6 +25,7 @@ scratch/main> ls lib 1. builtins/ (469 terms, 74 types) ``` + And for a limited time, you can get even more builtin goodies: ``` ucm @@ -37,5 +39,5 @@ scratch/main> ls lib 2. builtinsio/ (643 terms, 92 types) ``` -More typically, you'd start out by pulling `base`. +More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md index ebcce29e97..478cb06f59 100644 --- a/unison-src/transcripts/error-messages.output.md +++ b/unison-src/transcripts/error-messages.output.md @@ -11,7 +11,6 @@ x = 1. -- missing some digits after the decimal ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -22,12 +21,12 @@ x = 1. -- missing some digits after the decimal or `1.1e37`. ``` + ``` unison x = 1e -- missing an exponent ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -38,12 +37,12 @@ x = 1e -- missing an exponent `1e37`. ``` + ``` unison x = 1e- -- missing an exponent ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -54,12 +53,12 @@ x = 1e- -- missing an exponent `1e-37`. ``` + ``` unison x = 1E+ -- missing an exponent ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -70,6 +69,7 @@ x = 1E+ -- missing an exponent `1e+37`. ``` + ### Hex, octal, binary, and bytes literals ``` unison @@ -77,7 +77,6 @@ x = 0xoogabooga -- invalid hex chars ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -88,12 +87,12 @@ x = 0xoogabooga -- invalid hex chars 0123456789abcdefABCDEF) after the 0x. ``` + ``` unison x = 0o987654321 -- 9 and 8 are not valid octal char ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -104,12 +103,12 @@ x = 0o987654321 -- 9 and 8 are not valid octal char the 0o. ``` + ``` unison x = 0b3201 -- 3 and 2 are not valid binary chars ``` ``` ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -120,12 +119,12 @@ x = 0b3201 -- 3 and 2 are not valid binary chars 0b. ``` + ``` unison x = 0xsf -- odd number of hex chars in a bytes literal ``` ``` ucm - Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsf @@ -136,12 +135,12 @@ x = 0xsf -- odd number of hex chars in a bytes literal of 0123456789abcdefABCDEF) after the 0xs. ``` + ``` unison x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` ``` ucm - Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsnotvalidhexchars @@ -152,6 +151,7 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal of 0123456789abcdefABCDEF) after the 0xs. ``` + ### Layout errors ``` unison @@ -159,7 +159,6 @@ foo = else -- not matching if ``` ``` ucm - Loading changes detected in scratch.u. I found a closing 'else' here without a matching 'then'. @@ -168,12 +167,12 @@ foo = else -- not matching if ``` + ``` unison foo = then -- unclosed ``` ``` ucm - Loading changes detected in scratch.u. I found a closing 'then' here without a matching 'if'. @@ -182,12 +181,12 @@ foo = then -- unclosed ``` + ``` unison foo = with -- unclosed ``` ``` ucm - Loading changes detected in scratch.u. I found a closing 'with' here without a matching 'handle' or 'match'. @@ -196,6 +195,7 @@ foo = with -- unclosed ``` + ### Matching ``` unison @@ -204,7 +204,6 @@ foo = match 1 with ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -215,13 +214,13 @@ foo = match 1 with * _ ``` + ``` unison foo = match 1 with 2 -- no right-hand-side ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -236,6 +235,7 @@ foo = match 1 with * pattern guard ``` + ``` unison -- Mismatched arities foo = cases @@ -244,7 +244,6 @@ foo = cases ``` ``` ucm - Loading changes detected in scratch.u. 😶 @@ -257,6 +256,7 @@ foo = cases ``` + ``` unison -- Missing a '->' x = match Some a with @@ -267,7 +267,6 @@ x = match Some a with ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -285,6 +284,7 @@ x = match Some a with * true ``` + ``` unison -- Missing patterns x = match Some a with @@ -294,7 +294,6 @@ x = match Some a with ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -309,6 +308,7 @@ x = match Some a with * newline or semicolon ``` + ``` unison -- Guards following an unguarded case x = match Some a with @@ -317,7 +317,6 @@ x = match Some a with ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -332,6 +331,7 @@ x = match Some a with * newline or semicolon ``` + ### Watches ``` unison @@ -340,7 +340,6 @@ x = match Some a with ``` ``` ucm - Loading changes detected in scratch.u. I expected a non-empty watch expression and not just ">" @@ -349,6 +348,7 @@ x = match Some a with ``` + ### Keywords ``` unison @@ -356,7 +356,6 @@ use.keyword.in.namespace = 1 ``` ``` ucm - Loading changes detected in scratch.u. The identifier `namespace` used here is a reserved keyword: @@ -367,13 +366,13 @@ use.keyword.in.namespace = 1 or wrapping it in backticks (like `namespace` ). ``` + ``` unison -- reserved operator a ! b = 1 ``` ``` ucm - Loading changes detected in scratch.u. This looks like the start of an expression here diff --git a/unison-src/transcripts/errors/missing-result-typed.output.md b/unison-src/transcripts/errors/missing-result-typed.output.md index d33bc82c3c..fb4c6783bb 100644 --- a/unison-src/transcripts/errors/missing-result-typed.output.md +++ b/unison-src/transcripts/errors/missing-result-typed.output.md @@ -10,13 +10,11 @@ a = b = 24 ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` The last element of a block must be an expression, but this is a definition: @@ -24,4 +22,4 @@ The transcript failed due to an error in the stanza above. The error is: Try adding an expression at the end of the block. It should be of type Nat. - +``` diff --git a/unison-src/transcripts/errors/missing-result.output.md b/unison-src/transcripts/errors/missing-result.output.md index b6526abb7f..c51a5c70b9 100644 --- a/unison-src/transcripts/errors/missing-result.output.md +++ b/unison-src/transcripts/errors/missing-result.output.md @@ -9,17 +9,15 @@ x = y = 24 ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` The last element of a block must be an expression, but this is a definition: 2 | y = 24 Try adding an expression at the end of the block. - +``` 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 62008b6e57..a9fca37adf 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.output.md @@ -10,8 +10,6 @@ and surface a helpful message. scratch/main> history ``` - - 🛑 The transcript was expecting an error in the stanza above, but did not encounter one. diff --git a/unison-src/transcripts/errors/ucm-hide-all.output.md b/unison-src/transcripts/errors/ucm-hide-all.output.md index 92e6dbaf81..8a3f4b3655 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all.output.md @@ -10,14 +10,12 @@ and surface a helpful message. scratch/main> move.namespace foo bar ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` ⚠️ The namespace foo doesn't exist. - +``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index 15f996c881..41c15c48f4 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -10,8 +10,6 @@ and surface a helpful message. scratch/main> history ``` - - 🛑 The transcript was expecting an error in the stanza above, but did not encounter one. diff --git a/unison-src/transcripts/errors/ucm-hide.output.md b/unison-src/transcripts/errors/ucm-hide.output.md index 8e180f76c7..42f9e0a3e0 100644 --- a/unison-src/transcripts/errors/ucm-hide.output.md +++ b/unison-src/transcripts/errors/ucm-hide.output.md @@ -10,14 +10,12 @@ and surface a helpful message. scratch/main> move.namespace foo bar ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` ⚠️ The namespace foo doesn't exist. - +``` diff --git a/unison-src/transcripts/errors/unison-hide-all-error.output.md b/unison-src/transcripts/errors/unison-hide-all-error.output.md index 05d3cccc05..b73f494ea8 100644 --- a/unison-src/transcripts/errors/unison-hide-all-error.output.md +++ b/unison-src/transcripts/errors/unison-hide-all-error.output.md @@ -8,8 +8,6 @@ and surface a helpful message. myVal = 3 ``` - - 🛑 The transcript was expecting an error in the stanza above, but did not encounter one. diff --git a/unison-src/transcripts/errors/unison-hide-all.output.md b/unison-src/transcripts/errors/unison-hide-all.output.md index ee5bf906ec..cde7bbc2c5 100644 --- a/unison-src/transcripts/errors/unison-hide-all.output.md +++ b/unison-src/transcripts/errors/unison-hide-all.output.md @@ -8,13 +8,11 @@ and surface a helpful message. g 3 ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` This looks like the start of an expression here 1 | g 3 @@ -28,4 +26,4 @@ The transcript failed due to an error in the stanza above. The error is: - An `ability` declaration, like unique ability Foo where ... - A `type` declaration, like structural type Optional a = None | Some a - +``` diff --git a/unison-src/transcripts/errors/unison-hide-error.output.md b/unison-src/transcripts/errors/unison-hide-error.output.md index aa6c4449ca..171813e042 100644 --- a/unison-src/transcripts/errors/unison-hide-error.output.md +++ b/unison-src/transcripts/errors/unison-hide-error.output.md @@ -8,8 +8,6 @@ and surface a helpful message. myVal = 3 ``` - - 🛑 The transcript was expecting an error in the stanza above, but did not encounter one. diff --git a/unison-src/transcripts/errors/unison-hide.output.md b/unison-src/transcripts/errors/unison-hide.output.md index e6f82045bc..3e819920e0 100644 --- a/unison-src/transcripts/errors/unison-hide.output.md +++ b/unison-src/transcripts/errors/unison-hide.output.md @@ -8,13 +8,11 @@ and surface a helpful message. g 3 ``` - - 🛑 The transcript failed due to an error in the stanza above. The error is: - +``` This looks like the start of an expression here 1 | g 3 @@ -28,4 +26,4 @@ The transcript failed due to an error in the stanza above. The error is: - An `ability` declaration, like unique ability Foo where ... - A `type` declaration, like structural type Optional a = None | Some a - +``` diff --git a/unison-src/transcripts/escape-sequences.output.md b/unison-src/transcripts/escape-sequences.output.md index 955b6e8fe6..c401add1c3 100644 --- a/unison-src/transcripts/escape-sequences.output.md +++ b/unison-src/transcripts/escape-sequences.output.md @@ -5,7 +5,6 @@ ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index c45fcd6a88..0542ea4740 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -39,6 +39,7 @@ scratch/main> find : A ``` + ``` ucm scratch/main> find : Text diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index 4d3af86ad6..a5f10e2b7f 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -34,6 +34,7 @@ scratch/main> view 1 cat.foo = 4 ``` + ``` ucm scratch/main> find-in cat foo @@ -57,6 +58,7 @@ scratch/main> view 1 cat.lib.foo = 5 ``` + Finding within a namespace ``` ucm @@ -80,6 +82,7 @@ scratch/main> find-in somewhere bar ``` + ``` ucm scratch/main> find baz diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index edc30e9f25..f5f7bad73c 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -16,6 +16,7 @@ scratch/main> add a : ##Text ``` + Here is an update which should not affect `X`: ``` unison @@ -31,6 +32,7 @@ scratch/main> update Done. ``` + As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; ``` ucm @@ -44,6 +46,7 @@ scratch/main> history X □ 1. #das1se4g2i (start of history) ``` + however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: ``` ucm diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md index 0e136a6bee..904ee3cf4f 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.output.md @@ -59,4 +59,3 @@ fst = cases (x,_) -> x cases x, y -> x Nat.+ y ] ``` - diff --git a/unison-src/transcripts/fix-5267.output.md b/unison-src/transcripts/fix-5267.output.md index 0b9c07dbd8..fab5b2ae34 100644 --- a/unison-src/transcripts/fix-5267.output.md +++ b/unison-src/transcripts/fix-5267.output.md @@ -7,7 +7,6 @@ bar = direct.foo + direct.foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ bar = direct.foo + direct.foo lib.direct.lib.indirect.foo : Nat ``` + Here, `bar` renders as `foo + foo`, even though there are two names with suffix `foo` in scope, because one is an indirect dependency. It used to render as `direct.foo + direct.foo`. @@ -41,6 +41,7 @@ scratch/main> view bar foo + foo ``` + Same test, but for types. ``` unison @@ -51,7 +52,6 @@ type Bar = MkBar direct.Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +65,7 @@ type Bar = MkBar direct.Foo type lib.direct.lib.indirect.Foo ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md index 9e32c6c16d..367767a970 100644 --- a/unison-src/transcripts/fix-5301.output.md +++ b/unison-src/transcripts/fix-5301.output.md @@ -7,6 +7,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison type Foo = Bar Nat @@ -16,7 +17,6 @@ foo = cases ``` ``` ucm - Loading changes detected in scratch.u. @@ -33,6 +33,7 @@ foo = cases ``` + ``` unison type Foo = Bar A type A = X @@ -44,7 +45,6 @@ foo = cases ``` ``` ucm - Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/fix-5312.output.md b/unison-src/transcripts/fix-5312.output.md index 56e84c90eb..9ca04f0ec6 100644 --- a/unison-src/transcripts/fix-5312.output.md +++ b/unison-src/transcripts/fix-5312.output.md @@ -7,6 +7,7 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison x = 17 @@ -17,7 +18,6 @@ c = b.y + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +32,7 @@ c = b.y + 1 x : Nat ``` + ``` ucm scratch/main> add @@ -43,12 +44,12 @@ scratch/main> add x : Nat ``` + ``` unison x = 100 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -61,6 +62,7 @@ x = 100 x : Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md index 03b20aa611..2c2a278043 100644 --- a/unison-src/transcripts/fix-5320.output.md +++ b/unison-src/transcripts/fix-5320.output.md @@ -4,13 +4,13 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison foo = cases bar.Baz -> 5 ``` ``` ucm - Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/fix-5323.output.md b/unison-src/transcripts/fix-5323.output.md index d1734e0423..6eac65c4b2 100644 --- a/unison-src/transcripts/fix-5323.output.md +++ b/unison-src/transcripts/fix-5323.output.md @@ -7,6 +7,7 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison lib.old.x = 17 lib.new.x = 100 @@ -18,7 +19,6 @@ c = b.y + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +34,7 @@ c = b.y + 1 lib.old.x : Nat ``` + ``` ucm scratch/main> add @@ -46,6 +47,7 @@ scratch/main> add lib.old.x : Nat ``` + ``` ucm scratch/main> upgrade old new diff --git a/unison-src/transcripts/fix-5326.output.md b/unison-src/transcripts/fix-5326.output.md index bdddcbb6f0..e97b5ecfe7 100644 --- a/unison-src/transcripts/fix-5326.output.md +++ b/unison-src/transcripts/fix-5326.output.md @@ -4,12 +4,12 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +21,7 @@ x = 1 x : Nat ``` + ``` ucm scratch/main> update @@ -37,6 +38,7 @@ scratch/main> branch foo `switch /main` then `merge /foo`. ``` + ``` main, foo | @@ -48,7 +50,6 @@ x = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -61,6 +62,7 @@ x = 2 x : Nat ``` + ``` ucm scratch/main> update @@ -77,6 +79,7 @@ scratch/main> branch bar `switch /main` then `merge /bar`. ``` + ``` main, bar | @@ -90,7 +93,6 @@ x = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -103,6 +105,7 @@ x = 3 x : Nat ``` + ``` ucm scratch/main> update @@ -112,6 +115,7 @@ scratch/main> update Done. ``` + ``` main | @@ -125,7 +129,6 @@ x = 4 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -138,6 +141,7 @@ x = 4 x : Nat ``` + ``` ucm scratch/main> update @@ -147,6 +151,7 @@ scratch/main> update Done. ``` + ``` main | @@ -160,7 +165,6 @@ y = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -172,6 +176,7 @@ y = 5 y : Nat ``` + ``` ucm scratch/foo> update @@ -181,6 +186,7 @@ scratch/foo> update Done. ``` + ``` main | @@ -199,6 +205,7 @@ scratch/main> merge /foo I merged scratch/foo into scratch/main. ``` + ``` main | @@ -219,6 +226,7 @@ scratch/main> merge /bar scratch/main was already up-to-date with scratch/bar. ``` + This should be a fast-forward, but we used to get this shape instead (which fails due to conflicts), because we incorrectly computed `LCA(main, bar)` as `A`, not `B`. @@ -233,4 +241,3 @@ G - F - D - C - B - A | foo ``` - diff --git a/unison-src/transcripts/fix-5340.output.md b/unison-src/transcripts/fix-5340.output.md index d9f3dba782..63cfc0cba1 100644 --- a/unison-src/transcripts/fix-5340.output.md +++ b/unison-src/transcripts/fix-5340.output.md @@ -7,7 +7,6 @@ lib.dep.lib.dep.foo = 18 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ lib.dep.lib.dep.foo = 18 my.foo : Nat ``` + ``` ucm scratch/main> add @@ -33,6 +33,7 @@ scratch/main> add my.foo : Nat ``` + These references to type `Foo` and term `foo` are unambiguous (resolving to the `my.Foo` and `my.foo` in the file), even though indirect dependencies `lib.dep.lib.dep.Foo` and `lib.dep.lib.dep.foo` match by suffix. @@ -42,7 +43,6 @@ type Bar = MkBar Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,13 +56,13 @@ type Bar = MkBar Foo type Bar ``` + ``` unison my.foo = 17 bar = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-5357.output.md b/unison-src/transcripts/fix-5357.output.md index c7e1f79223..271ca2b6eb 100644 --- a/unison-src/transcripts/fix-5357.output.md +++ b/unison-src/transcripts/fix-5357.output.md @@ -9,7 +9,6 @@ foo = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ foo = util.ignore : a -> () ``` + ``` ucm scratch/main> add @@ -31,13 +31,13 @@ scratch/main> add util.ignore : a -> () ``` + ``` unison lib.base.ignore : a -> () lib.base.ignore _ = () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ lib.base.ignore _ = () (also named util.ignore) ``` + ``` ucm scratch/main> add @@ -75,6 +76,7 @@ scratch/main> load file has been previously added to the codebase. ``` + ``` unison :added-by-ucm scratch.u foo : () foo = @@ -85,4 +87,3 @@ foo = util.ignore : a -> () util.ignore _ = () ``` - diff --git a/unison-src/transcripts/fix-5369.output.md b/unison-src/transcripts/fix-5369.output.md index 2414ed2313..687bace774 100644 --- a/unison-src/transcripts/fix-5369.output.md +++ b/unison-src/transcripts/fix-5369.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison one.foo : Nat one.foo = 17 @@ -13,7 +14,6 @@ two.foo = "blah" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ two.foo = "blah" two.foo : Text ``` + ``` ucm scratch/main> add @@ -35,6 +36,7 @@ scratch/main> add two.foo : Text ``` + ``` unison one.foo : Nat one.foo = 18 @@ -44,7 +46,6 @@ bar = foo + foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-5374.output.md b/unison-src/transcripts/fix-5374.output.md index 6d1561b10e..80253cb086 100644 --- a/unison-src/transcripts/fix-5374.output.md +++ b/unison-src/transcripts/fix-5374.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison lib.direct.foo = 17 lib.direct.lib.indirect.foo = 18 @@ -12,7 +13,6 @@ thing = indirect.foo + indirect.foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ thing = indirect.foo + indirect.foo thing : Nat ``` + ``` ucm scratch/main> add @@ -53,6 +54,7 @@ scratch/main> edit thing definitions currently in this namespace. ``` + ``` unison :added-by-ucm scratch.u thing : Nat thing = @@ -60,4 +62,3 @@ thing = use indirect foo foo + foo ``` - diff --git a/unison-src/transcripts/fix-5380.output.md b/unison-src/transcripts/fix-5380.output.md index 16dcfbb9ef..ec62264519 100644 --- a/unison-src/transcripts/fix-5380.output.md +++ b/unison-src/transcripts/fix-5380.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge lib.builtin Done. ``` + ``` unison foo : Nat foo = 17 @@ -16,7 +17,6 @@ bar = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,6 +29,7 @@ bar = foo : Nat ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix-5402.output.md b/unison-src/transcripts/fix-5402.output.md index e4b125ab4c..939c0b73ff 100644 --- a/unison-src/transcripts/fix-5402.output.md +++ b/unison-src/transcripts/fix-5402.output.md @@ -7,7 +7,6 @@ x = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ x = 10 foo.x : ##Nat ``` + ``` unison use bar baz namespace foo @@ -26,7 +26,6 @@ x = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md index f6db0fb0bb..d2b6e59fc2 100644 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ b/unison-src/transcripts/fix-big-list-crash.output.md @@ -9,7 +9,6 @@ x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-ls.output.md b/unison-src/transcripts/fix-ls.output.md index b99f0f5877..d691f9ee2b 100644 --- a/unison-src/transcripts/fix-ls.output.md +++ b/unison-src/transcripts/fix-ls.output.md @@ -4,6 +4,7 @@ test-ls/main> builtins.merge Done. ``` + ``` unison foo.bar.add x y = x Int.+ y @@ -11,7 +12,6 @@ foo.bar.subtract x y = x Int.- y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +24,7 @@ foo.bar.subtract x y = x Int.- y foo.bar.subtract : Int -> Int -> Int ``` + ``` ucm test-ls/main> add diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index 57ab0b23d8..e32f23e1f7 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -9,7 +9,6 @@ noop = not `.` not ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ noop = not `.` not noop : Boolean -> Boolean ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md index 9e0234725a..d40448037c 100644 --- a/unison-src/transcripts/fix1327.output.md +++ b/unison-src/transcripts/fix1327.output.md @@ -5,7 +5,6 @@ bar = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,6 +17,7 @@ bar = 5 foo : ##Nat ``` + `alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones. Now `ls` returns a pair of the absolute search directory and the result relative to that search directory, so it can be used in both absolute and relative contexts. diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index 340a34e2ca..1b142e7eeb 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison -- List.map : (a -> b) -> [a] -> [b] List.map f = @@ -14,7 +15,6 @@ List.map f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ List.map f = List.map : (i ->{g} o) -> [i] ->{g} [o] ``` + ``` ucm scratch/main> add @@ -43,6 +44,7 @@ scratch/main> view List.map go [] ``` + ``` unison List.map2 : (g -> g2) -> [g] -> [g2] List.map2 f = @@ -54,7 +56,6 @@ List.map2 f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1421.output.md b/unison-src/transcripts/fix1421.output.md index 0f52e9a36e..10368900b4 100644 --- a/unison-src/transcripts/fix1421.output.md +++ b/unison-src/transcripts/fix1421.output.md @@ -8,13 +8,13 @@ scratch/main> alias.term ##Nat.+ Nat.+ Done. ``` + ``` unison unique type A = A Nat unique type B = B Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index 0412312d87..b924efa5e2 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + First, lets create two namespaces. `foo` and `bar`, and add some definitions. ``` unison @@ -13,7 +14,6 @@ bar.z = x + y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +27,7 @@ bar.z = x + y foo.y : Nat ``` + ``` ucm scratch/main> add @@ -37,6 +38,7 @@ scratch/main> add foo.y : Nat ``` + Let's see what we have created... ``` ucm @@ -47,6 +49,7 @@ scratch/main> ls 3. foo/ (2 terms) ``` + Now, if we try deleting the namespace `foo`, we get an error, as expected. ``` ucm @@ -66,6 +69,7 @@ scratch/main> delete.namespace foo without names, use delete.namespace.force ``` + Any numbered arguments should refer to `bar.z`. ``` ucm @@ -75,6 +79,7 @@ scratch/main> debug.numberedArgs 2. bar.z ``` + We can then delete the dependent term, and then delete `foo`. ``` ucm diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index 772f10e6c2..fa8b65309f 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -17,7 +17,6 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") ``` ``` ucm - Loading changes detected in scratch.u. The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/fix1709.output.md b/unison-src/transcripts/fix1709.output.md index 7159b5b54b..5f2163c58a 100644 --- a/unison-src/transcripts/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -7,7 +7,6 @@ id2 x = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,6 +19,7 @@ id2 x = id2 : x -> x ``` + ``` ucm scratch/main> add @@ -29,12 +29,12 @@ scratch/main> add id2 : x -> x ``` + ``` unison > id2 "hi" ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md index be55bbb4b2..b0d7b2a4ec 100644 --- a/unison-src/transcripts/fix1731.output.md +++ b/unison-src/transcripts/fix1731.output.md @@ -13,7 +13,6 @@ repro = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 97f93ed409..eeee1104b2 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -55,6 +55,7 @@ scratch/main> rename.term main3 code.main3 Done. ``` + The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ``` ucm @@ -71,6 +72,7 @@ scratch/main> run code.main3 () ``` + Now testing a few variations that should NOT typecheck. ``` unison @@ -97,6 +99,7 @@ scratch/main> run main4 main4 : '{IO, Exception} result ``` + ``` ucm scratch/main> run main5 diff --git a/unison-src/transcripts/fix1844.output.md b/unison-src/transcripts/fix1844.output.md index 76fe424654..f0df35990c 100644 --- a/unison-src/transcripts/fix1844.output.md +++ b/unison-src/transcripts/fix1844.output.md @@ -10,7 +10,6 @@ snoc k aN = match k with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index 1c940cc22f..f4a640d18e 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison > 'sq @@ -11,7 +12,6 @@ sq = 2934892384 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +30,7 @@ sq = 2934892384 do sq ``` + ``` unison > 'sq @@ -37,7 +38,6 @@ sq = 2934892384 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index 975aa0173f..835e5f26f9 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -36,7 +36,6 @@ Exception.unsafeRun! e _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -63,6 +62,7 @@ Exception.unsafeRun! e _ = toException : Either Failure a ->{Exception} a ``` + ``` ucm scratch/main> run ex diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index 3d224d6446..b3954645f4 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -45,7 +45,6 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,6 +76,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") toException : Either Failure a ->{Exception} a ``` + ``` ucm scratch/main> run myServer diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index a9354446f8..03ad411f31 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -49,7 +49,6 @@ Fold.Stream.fold = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -85,6 +84,7 @@ Fold.Stream.fold = true ``` + Tests some capabilities for catching runtime exceptions. ``` unison @@ -107,7 +107,6 @@ tests _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -120,6 +119,7 @@ tests _ = tests : ∀ _. _ ->{IO} [Result] ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix2156.output.md b/unison-src/transcripts/fix2156.output.md index 4a15b1accb..92d9ebab1a 100644 --- a/unison-src/transcripts/fix2156.output.md +++ b/unison-src/transcripts/fix2156.output.md @@ -9,7 +9,6 @@ sqr n = n * n ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2167.output.md b/unison-src/transcripts/fix2167.output.md index d4e630f596..b397e7530b 100644 --- a/unison-src/transcripts/fix2167.output.md +++ b/unison-src/transcripts/fix2167.output.md @@ -16,7 +16,6 @@ R.near1 region loc = match R.near 42 with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +29,7 @@ R.near1 region loc = match R.near 42 with R.near1 : region -> loc ->{R t} Nat ``` + The issue was that abilities with parameters like this were sometimes causing failures like this because the variable in the parameter would escape to a scope where it no longer made sense. Then solving would @@ -37,4 +37,3 @@ fail because the type was invalid. The fix was to avoid dropping certain existential variables out of scope. - diff --git a/unison-src/transcripts/fix2187.output.md b/unison-src/transcripts/fix2187.output.md index bc02ace239..72aa416fc1 100644 --- a/unison-src/transcripts/fix2187.output.md +++ b/unison-src/transcripts/fix2187.output.md @@ -15,7 +15,6 @@ lexicalScopeEx = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index d0e410477d..76810ca45f 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -21,7 +21,6 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +35,7 @@ txt = foldl (Text.++) "" ["a", "b", "c"] txt : Text ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 0958d7182d..62f202ec79 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -7,7 +7,6 @@ ex = {{ @eval{abort} }} ``` ``` ucm - Loading changes detected in scratch.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. @@ -16,6 +15,7 @@ ex = {{ @eval{abort} }} ``` + This file should also not typecheck - it has a triple backticks block that uses abilities. ``` ucm diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 05a1009e49..93a91e8440 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -52,6 +52,7 @@ scratch/a> branch /a2 `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 @@ -116,6 +117,7 @@ scratch/a2> todo You have no pending todo items. Good work! ✅ ``` + ## Record updates Here's a test of updating a record: @@ -127,7 +129,6 @@ combine r = uno r + dos r ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -146,6 +147,7 @@ combine r = uno r + dos r combine : Rec -> Nat ``` + ``` ucm scratch/r1> add @@ -168,12 +170,12 @@ scratch/r1> branch r2 `switch /r1` then `merge /r2`. ``` + ``` 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 @@ -198,6 +200,7 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } Rec.uno.set : Nat -> Rec -> Rec ``` + And checking that after updating this record, there's nothing `todo`: ``` ucm diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md index 79da655962..c404145faa 100644 --- a/unison-src/transcripts/fix2268.output.md +++ b/unison-src/transcripts/fix2268.output.md @@ -16,7 +16,6 @@ test _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2334.output.md b/unison-src/transcripts/fix2334.output.md index ab20adb8e7..79ec0611d2 100644 --- a/unison-src/transcripts/fix2334.output.md +++ b/unison-src/transcripts/fix2334.output.md @@ -15,7 +15,6 @@ f = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md index 1d57076149..a519728a76 100644 --- a/unison-src/transcripts/fix2344.output.md +++ b/unison-src/transcripts/fix2344.output.md @@ -17,7 +17,6 @@ sneezy dee _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2350.output.md b/unison-src/transcripts/fix2350.output.md index cb0cf5de75..3e74f3a62f 100644 --- a/unison-src/transcripts/fix2350.output.md +++ b/unison-src/transcripts/fix2350.output.md @@ -29,7 +29,6 @@ save a = !(save.impl a) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md index a6a8be6b6c..65cdb5f2c4 100644 --- a/unison-src/transcripts/fix2353.output.md +++ b/unison-src/transcripts/fix2353.output.md @@ -12,7 +12,6 @@ pure.run a0 a = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md index 226d20bc54..13ef614aca 100644 --- a/unison-src/transcripts/fix2354.output.md +++ b/unison-src/transcripts/fix2354.output.md @@ -9,7 +9,6 @@ x = 'f ``` ``` ucm - Loading changes detected in scratch.u. I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md index 609f107fdb..504d10f050 100644 --- a/unison-src/transcripts/fix2355.output.md +++ b/unison-src/transcripts/fix2355.output.md @@ -20,7 +20,6 @@ example = 'let ``` ``` ucm - Loading changes detected in scratch.u. I tried to infer a cyclic ability. diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md index 7cdb62623c..3d254cf7d2 100644 --- a/unison-src/transcripts/fix2378.output.md +++ b/unison-src/transcripts/fix2378.output.md @@ -39,7 +39,6 @@ x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2423.output.md b/unison-src/transcripts/fix2423.output.md index 2ff6c1361b..25b4734b17 100644 --- a/unison-src/transcripts/fix2423.output.md +++ b/unison-src/transcripts/fix2423.output.md @@ -27,7 +27,6 @@ Split.zipSame sa sb _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index 519f0d2b30..4ff211010a 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -24,6 +24,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison structural ability Stream a where emit : a -> () @@ -38,7 +39,6 @@ Stream.uncons s = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2663.output.md b/unison-src/transcripts/fix2663.output.md index 2e12426d9b..ee289a88fc 100644 --- a/unison-src/transcripts/fix2663.output.md +++ b/unison-src/transcripts/fix2663.output.md @@ -21,7 +21,6 @@ bad x = match Some (Some x) with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index e5414c32a8..300410d575 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -9,7 +9,6 @@ range = loop [] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ range = loop [] range : Nat -> [Nat] ``` + ``` ucm scratch/main> add @@ -31,12 +31,12 @@ scratch/main> add range : Nat -> [Nat] ``` + ``` unison > range 2000 ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -2051,6 +2051,7 @@ scratch/main> add ] ``` + Should be cached: ``` unison @@ -2058,7 +2059,6 @@ Should be cached: ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index cd4f15f596..97bb0c3593 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -6,7 +6,6 @@ mapWithKey f m = Tip ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ mapWithKey f m = Tip mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b ``` + ``` ucm scratch/main> add @@ -28,6 +28,7 @@ scratch/main> add mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b ``` + ``` unison naiomi = @@ -42,7 +43,6 @@ naiomi = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md index 08f321eaad..27d5dd9bb5 100644 --- a/unison-src/transcripts/fix2822.output.md +++ b/unison-src/transcripts/fix2822.output.md @@ -9,7 +9,6 @@ b = _a.blah + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ b = _a.blah + 1 b : Nat ``` + Or even that *are* a single “blank” component ``` unison @@ -31,7 +31,6 @@ x = _b + 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +43,7 @@ x = _b + 1 x : Nat ``` + Types can also have underscore-led components. ``` unison @@ -54,7 +54,6 @@ c = A ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +66,7 @@ c = A c : Blah ``` + And we should also be able to access underscore-led fields. ``` unison @@ -76,7 +76,6 @@ doStuff = _value.modify ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -92,6 +91,7 @@ doStuff = _value.modify doStuff : (Nat ->{g} Nat) -> Hello ->{g} Hello ``` + But pattern matching shouldn’t bind to underscore-led names. ``` unison @@ -101,7 +101,6 @@ dontMap f = cases ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what _used refers to here: @@ -118,6 +117,7 @@ dontMap f = cases * You have a typo in the name ``` + But we can use them as unbound patterns. ``` unison @@ -127,7 +127,6 @@ dontMap f = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2826.output.md b/unison-src/transcripts/fix2826.output.md index 932afef306..0de1299048 100644 --- a/unison-src/transcripts/fix2826.output.md +++ b/unison-src/transcripts/fix2826.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.mergeio Done. ``` + Supports fences that are longer than three backticks. ```` unison @@ -17,7 +18,6 @@ doc = {{ ```` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,6 +29,7 @@ doc = {{ doc : Doc2 ``` + And round-trips properly. ``` ucm @@ -55,6 +56,7 @@ scratch/main> load scratch.u file has been previously added to the codebase. ``` + ```` unison :added-by-ucm scratch.u doc : Doc2 doc = @@ -64,4 +66,3 @@ doc = ``` }} ```` - diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index 020c4b1a4d..e32f304670 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -17,6 +17,7 @@ scratch/main> add syntax.docWord : Text -> Doc2 ``` + Next, define and display a simple Doc: ``` unison @@ -31,6 +32,7 @@ scratch/main> display README Hi ``` + Previously, the error was: ``` @@ -39,4 +41,3 @@ Previously, the error was: ``` but as of this PR, it's okay. - diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index 7f5bddca1b..5b2fd656e0 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -6,13 +6,13 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo.+.doc : Nat foo.+.doc = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md index aebd61c502..09bedf2f10 100644 --- a/unison-src/transcripts/fix3037.output.md +++ b/unison-src/transcripts/fix3037.output.md @@ -14,7 +14,6 @@ runner = pureRunner ``` ``` ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the expression in red @@ -33,6 +32,7 @@ runner = pureRunner ``` + Application version: ``` unison @@ -48,7 +48,6 @@ h _ = () ``` ``` ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the application diff --git a/unison-src/transcripts/fix3171.output.md b/unison-src/transcripts/fix3171.output.md index 8778f0442e..00ef0d8865 100644 --- a/unison-src/transcripts/fix3171.output.md +++ b/unison-src/transcripts/fix3171.output.md @@ -10,7 +10,6 @@ f x y z _ = x + y * z ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md index e9811bdbef..9901d8fc96 100644 --- a/unison-src/transcripts/fix3196.output.md +++ b/unison-src/transcripts/fix3196.output.md @@ -30,7 +30,6 @@ w2 = cases W -> W ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3215.output.md b/unison-src/transcripts/fix3215.output.md index 2f5128ffbc..5927aba577 100644 --- a/unison-src/transcripts/fix3215.output.md +++ b/unison-src/transcripts/fix3215.output.md @@ -17,7 +17,6 @@ f = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3244.output.md b/unison-src/transcripts/fix3244.output.md index fe6c11275a..7165fe0c66 100644 --- a/unison-src/transcripts/fix3244.output.md +++ b/unison-src/transcripts/fix3244.output.md @@ -17,7 +17,6 @@ foo t = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3265.output.md b/unison-src/transcripts/fix3265.output.md index 1f70863dc7..c7918a37a3 100644 --- a/unison-src/transcripts/fix3265.output.md +++ b/unison-src/transcripts/fix3265.output.md @@ -22,7 +22,6 @@ are three cases that need to be 'fixed up.' ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -50,6 +49,7 @@ are three cases that need to be 'fixed up.' g (z -> x + f0 z)) ``` + Also check for some possible corner cases. `f` should not have its `x` argument eliminated, because it doesn't @@ -67,7 +67,6 @@ discard its arguments, where `f` also occurs. ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md index dbf435bc65..d80a3768d7 100644 --- a/unison-src/transcripts/fix3424.output.md +++ b/unison-src/transcripts/fix3424.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge lib.builtins Done. ``` + ``` unison a = do b b = "Hello, " ++ c ++ "!" @@ -24,6 +25,7 @@ scratch/main> run a "Hello, World!" ``` + ``` unison a = do b c = "Unison" @@ -46,5 +48,5 @@ scratch/main> run a "Hello, Unison!" ``` -The result should be "Hello, Unison\!". +The result should be "Hello, Unison\!". diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index ac92ec60c2..8b0f5f8dbd 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -11,7 +11,6 @@ d = {{ ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ d = {{ d : Doc2 ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix3678.output.md b/unison-src/transcripts/fix3678.output.md index 321c493f21..5db492266a 100644 --- a/unison-src/transcripts/fix3678.output.md +++ b/unison-src/transcripts/fix3678.output.md @@ -9,7 +9,6 @@ arr = Scope.run do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3752.output.md b/unison-src/transcripts/fix3752.output.md index 85996ca6a4..5f5a67ad46 100644 --- a/unison-src/transcripts/fix3752.output.md +++ b/unison-src/transcripts/fix3752.output.md @@ -17,7 +17,6 @@ bar = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3773.output.md b/unison-src/transcripts/fix3773.output.md index 498fbd7ef4..af1988e5af 100644 --- a/unison-src/transcripts/fix3773.output.md +++ b/unison-src/transcripts/fix3773.output.md @@ -8,7 +8,6 @@ foo = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index f5498f2645..2a3a9266fe 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -31,6 +31,7 @@ scratch/main> load scratch.u file has been previously added to the codebase. ``` + ``` unison :added-by-ucm scratch.u foo : Either Failure b foo = @@ -41,4 +42,3 @@ foo = ++ "message with concatenation") ()) ``` - diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index 447c3322a7..0f1a5adb3a 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -12,7 +12,6 @@ allowDebug = debug [1,2,3] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ allowDebug = debug [1,2,3] ✅ Passed Yay ``` + ``` ucm scratch/main> add @@ -55,12 +55,12 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + ``` unison bool = false ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -73,6 +73,7 @@ bool = false bool : Boolean ``` + ``` ucm scratch/main> update.old diff --git a/unison-src/transcripts/fix4280.output.md b/unison-src/transcripts/fix4280.output.md index 65561ba2a5..95ca6c2aa2 100644 --- a/unison-src/transcripts/fix4280.output.md +++ b/unison-src/transcripts/fix4280.output.md @@ -8,7 +8,6 @@ bonk = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4397.output.md b/unison-src/transcripts/fix4397.output.md index 3c1e87d864..8652929b3b 100644 --- a/unison-src/transcripts/fix4397.output.md +++ b/unison-src/transcripts/fix4397.output.md @@ -8,7 +8,6 @@ unique type Bar ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from diff --git a/unison-src/transcripts/fix4415.output.md b/unison-src/transcripts/fix4415.output.md index b17f16ddc4..77ac7c80df 100644 --- a/unison-src/transcripts/fix4415.output.md +++ b/unison-src/transcripts/fix4415.output.md @@ -4,7 +4,6 @@ unique type sub.Foo = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index 2c7c4b4b63..82193dc3b5 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -18,6 +18,7 @@ scratch/main> add countCat : Cat.Dog -> Rat.Dog ``` + Now I want to add a constructor. ``` unison diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index 6086d1b341..9a6449b475 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -7,7 +7,6 @@ mybar = bar + bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ mybar = bar + bar mybar : Nat ``` + ``` ucm myproj/main> add @@ -53,6 +53,7 @@ myproj/main> upgrade foo0 foo1 to delete the temporary branch and switch back to main. ``` + ``` unison :added-by-ucm scratch.u mybar : Nat mybar = @@ -60,4 +61,3 @@ mybar = use lib.foo0.lib.bonk1 bar bar + bar ``` - diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index 49cc9735f2..3d3e59af7a 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -6,7 +6,6 @@ myterm = foo + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ myterm = foo + 2 myterm : Nat ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix4515.output.md b/unison-src/transcripts/fix4515.output.md index 9e4b3ee657..47f4e4bdf6 100644 --- a/unison-src/transcripts/fix4515.output.md +++ b/unison-src/transcripts/fix4515.output.md @@ -9,7 +9,6 @@ useBar = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ useBar = cases useBar : Bar -> Nat ``` + ``` ucm myproject/main> add @@ -35,12 +35,12 @@ myproject/main> add useBar : Bar -> Nat ``` + ``` unison unique type Foo = Foo1 | Foo2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,6 +53,7 @@ unique type Foo = Foo1 | Foo2 type Foo ``` + ``` ucm myproject/main> update diff --git a/unison-src/transcripts/fix4528.output.md b/unison-src/transcripts/fix4528.output.md index 0266eef0a2..3d79701a57 100644 --- a/unison-src/transcripts/fix4528.output.md +++ b/unison-src/transcripts/fix4528.output.md @@ -6,7 +6,6 @@ main _ = MkFoo 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ main _ = MkFoo 5 main : 'Foo ``` + ``` ucm foo/main> add diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index 23bdc3a9f2..f77d0223b1 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -6,7 +6,6 @@ hey = foo.hello ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ hey = foo.hello thing : Nat ``` + ``` ucm scratch/main> add @@ -32,12 +32,12 @@ scratch/main> add thing : Nat ``` + ``` unison thing = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ thing = 2 thing : Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md index a6a05b76d6..f1713a206f 100644 --- a/unison-src/transcripts/fix4592.output.md +++ b/unison-src/transcripts/fix4592.output.md @@ -4,7 +4,6 @@ doc = {{ {{ bug "bug" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index a364ddc8f1..71a64ec459 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -4,7 +4,6 @@ unique type Bugs.Zonk = Bugs ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ unique type Bugs.Zonk = Bugs foo : Nat ``` + ``` ucm scratch/main> add @@ -26,13 +26,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo = 4 unique type Bugs = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,6 +49,7 @@ unique type Bugs = foo : Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/fix4711.output.md b/unison-src/transcripts/fix4711.output.md index 0bd5785547..5049a16260 100644 --- a/unison-src/transcripts/fix4711.output.md +++ b/unison-src/transcripts/fix4711.output.md @@ -7,7 +7,6 @@ thisDoesNotWork = ['(+1)] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,6 +19,7 @@ thisDoesNotWork = ['(+1)] thisWorks : 'Int ``` + Since this is fixed, `thisDoesNotWork` now does work. ``` ucm @@ -47,6 +47,7 @@ scratch/main> load file has been previously added to the codebase. ``` + ``` unison :added-by-ucm scratch.u thisDoesNotWork : ['{g} Int] thisDoesNotWork = [do +1] @@ -54,4 +55,3 @@ thisDoesNotWork = [do +1] thisWorks : 'Int thisWorks = do +1 ``` - diff --git a/unison-src/transcripts/fix4722.output.md b/unison-src/transcripts/fix4722.output.md index faa963b196..6646c8d8b8 100644 --- a/unison-src/transcripts/fix4722.output.md +++ b/unison-src/transcripts/fix4722.output.md @@ -35,7 +35,6 @@ foo = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md index 89801fcfcd..ab9a68c1bd 100644 --- a/unison-src/transcripts/fix4731.output.md +++ b/unison-src/transcripts/fix4731.output.md @@ -3,7 +3,6 @@ structural type Void = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ structural type Void = structural type Void ``` + ``` ucm scratch/main> add @@ -23,6 +23,7 @@ scratch/main> add structural type Void ``` + We should be able to `match` on empty types like `Void`. ``` unison @@ -31,7 +32,6 @@ Void.absurdly v = match !v with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -43,13 +43,13 @@ Void.absurdly v = match !v with Void.absurdly : '{e} Void ->{e} a ``` + ``` unison Void.absurdly : Void -> a Void.absurdly v = match v with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -61,6 +61,7 @@ Void.absurdly v = match v with Void.absurdly : Void -> a ``` + And empty `cases` should also work. ``` unison @@ -69,7 +70,6 @@ Void.absurdly = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -81,6 +81,7 @@ Void.absurdly = cases Void.absurdly : Void -> a ``` + But empty function bodies are not allowed. ``` unison @@ -89,7 +90,6 @@ Void.absurd x = ``` ``` ucm - Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: diff --git a/unison-src/transcripts/fix4780.output.md b/unison-src/transcripts/fix4780.output.md index 5fefbd4ccf..4aeda6dd32 100644 --- a/unison-src/transcripts/fix4780.output.md +++ b/unison-src/transcripts/fix4780.output.md @@ -6,7 +6,6 @@ builtins decompile properly. ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index 9bacabb90d..8aefaf3ddf 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison double : Int -> Int double x = x + x @@ -13,7 +14,6 @@ redouble x = double x + double x ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ redouble x = double x + double x redouble : Int -> Int ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix5055.output.md b/unison-src/transcripts/fix5055.output.md index 005e47585e..a627f67b5a 100644 --- a/unison-src/transcripts/fix5055.output.md +++ b/unison-src/transcripts/fix5055.output.md @@ -4,6 +4,7 @@ test-5055/main> builtins.merge Done. ``` + ``` unison foo.add x y = x Int.+ y @@ -11,7 +12,6 @@ foo.subtract x y = x Int.- y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +24,7 @@ foo.subtract x y = x Int.- y foo.subtract : Int -> Int -> Int ``` + ``` ucm test-5055/main> add diff --git a/unison-src/transcripts/fix5076.output.md b/unison-src/transcripts/fix5076.output.md index f92954cd23..789809c15b 100644 --- a/unison-src/transcripts/fix5076.output.md +++ b/unison-src/transcripts/fix5076.output.md @@ -8,7 +8,6 @@ x = {{ ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index f64f9c84ff..6d38768147 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -4,7 +4,6 @@ test> fix5080.tests.failure = [Fail "fail"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +27,7 @@ test> fix5080.tests.failure = [Fail "fail"] 🚫 FAILED fail ``` + ``` ucm scratch/main> add @@ -49,6 +49,7 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + ``` ucm scratch/main> delete.term 2 diff --git a/unison-src/transcripts/fix5141.output.md b/unison-src/transcripts/fix5141.output.md index 31f7667f43..fd50da1091 100644 --- a/unison-src/transcripts/fix5141.output.md +++ b/unison-src/transcripts/fix5141.output.md @@ -3,4 +3,3 @@ .> invalid.command ``` --> - diff --git a/unison-src/transcripts/fix5168.output.md b/unison-src/transcripts/fix5168.output.md index 1533d1b8e9..552e6a7d72 100644 --- a/unison-src/transcripts/fix5168.output.md +++ b/unison-src/transcripts/fix5168.output.md @@ -5,7 +5,6 @@ b = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md index c1da74b90c..1e94095d10 100644 --- a/unison-src/transcripts/fix5349.output.md +++ b/unison-src/transcripts/fix5349.output.md @@ -8,7 +8,6 @@ README = {{ ```` ``` ucm - Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: @@ -16,12 +15,12 @@ README = {{ ``` + ``` unison README = {{ {{ }} }} ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -46,12 +45,12 @@ README = {{ {{ }} }} * typeLink ``` + ``` unison README = {{ `` `` }} ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md index 51b872dc56..fd02084d09 100644 --- a/unison-src/transcripts/fix614.output.md +++ b/unison-src/transcripts/fix614.output.md @@ -12,7 +12,6 @@ ex1 = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ ex1 = do ex1 : '{Stream Nat} Nat ``` + This does not typecheck, we've accidentally underapplied `Stream.emit`: ``` unison @@ -34,7 +34,6 @@ ex2 = do ``` ``` ucm - Loading changes detected in scratch.u. I found a value of type: a ->{Stream a} Unit @@ -47,6 +46,7 @@ ex2 = do Use _ = to ignore a result. ``` + We can explicitly ignore an unused result like so: ``` unison @@ -56,7 +56,6 @@ ex3 = do ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,6 +67,7 @@ ex3 = do ex3 : '() ``` + Using a helper function like `void` also works fine: ``` unison @@ -79,7 +79,6 @@ ex4 = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -92,6 +91,7 @@ ex4 = void : x -> () ``` + One more example: ``` unison @@ -101,7 +101,6 @@ ex4 = ``` ``` ucm - Loading changes detected in scratch.u. I found a value of type: [Nat] diff --git a/unison-src/transcripts/fix689.output.md b/unison-src/transcripts/fix689.output.md index ed8ea04102..e1e4e0c5de 100644 --- a/unison-src/transcripts/fix689.output.md +++ b/unison-src/transcripts/fix689.output.md @@ -8,7 +8,6 @@ tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 35e07bec56..5f467d6ac5 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -7,7 +7,6 @@ structural ability Abort where ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,6 +19,7 @@ structural ability Abort where structural ability X t ``` + ``` ucm scratch/main> add @@ -29,6 +29,7 @@ scratch/main> add structural ability X t ``` + This code should not type check. The match on X.x ought to introduce a skolem variable `a` such that `c : a` and the continuation has type `a ->{X} b`. Thus, `handle c with h : Optional a`, which is not the @@ -42,7 +43,6 @@ h0 req = match req with ``` ``` ucm - Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -60,6 +60,7 @@ h0 req = match req with ``` + This code should not check because `t` does not match `b`. ``` unison @@ -70,7 +71,6 @@ h1 req = match req with ``` ``` ucm - Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -88,6 +88,7 @@ h1 req = match req with ``` + This code should not check for reasons similar to the first example, but with the continuation rather than a parameter. @@ -99,7 +100,6 @@ h2 req = match req with ``` ``` ucm - Loading changes detected in scratch.u. The 1st argument to `k` @@ -111,6 +111,7 @@ h2 req = match req with ``` + This should work fine. ``` unison @@ -122,7 +123,6 @@ h3 = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md index c192583c63..65d7eea602 100644 --- a/unison-src/transcripts/fix845.output.md +++ b/unison-src/transcripts/fix845.output.md @@ -9,7 +9,6 @@ Text.zonk txt = txt ++ "!! " ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ Text.zonk txt = txt ++ "!! " Text.zonk : Text -> Text ``` + Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: ``` unison @@ -30,7 +30,6 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what Blah.zonk refers to here: @@ -49,6 +48,7 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th * You have a typo in the name ``` + Here's another example, just checking that TDNR works for definitions in the same file: ``` unison @@ -62,7 +62,6 @@ ex = baz ++ ", world!" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,6 +82,7 @@ ex = baz ++ ", world!" "hello, world!" ``` + Here's another example, checking that TDNR works when multiple codebase definitions have matching names: ``` unison @@ -92,7 +92,6 @@ ex = zonk "hi" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -111,6 +110,7 @@ ex = zonk "hi" "hi!! " ``` + Last example, showing that TDNR works when there are multiple matching names in both the file and the codebase: ``` unison @@ -124,7 +124,6 @@ ex = zonk "hi" -- should resolve to Text.zonk, from the codebase ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix849.output.md b/unison-src/transcripts/fix849.output.md index c6c5c13904..6126d14c63 100644 --- a/unison-src/transcripts/fix849.output.md +++ b/unison-src/transcripts/fix849.output.md @@ -7,7 +7,6 @@ x = 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index 13dd97532b..e3722054c4 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -7,7 +7,6 @@ z = y + 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ z = y + 2 z : Nat ``` + ``` ucm scratch/main> add @@ -31,6 +31,7 @@ scratch/main> add z : Nat ``` + Now we edit `x` to be `7`, which should make `z` equal `10`: ``` unison @@ -38,7 +39,6 @@ x = 7 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +51,7 @@ x = 7 x : Nat ``` + ``` ucm scratch/main> update @@ -79,6 +80,7 @@ scratch/main> view x y z y + 2 ``` + Uh oh\! `z` is still referencing the old version. Just to confirm: ``` unison @@ -86,7 +88,6 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -105,6 +106,7 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ✅ Passed great ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index a128fa6c0a..1672040a83 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -11,7 +11,6 @@ spaceAttack1 x = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ spaceAttack1 x = spaceAttack1 : x ->{DeathStar} Text ``` + Add it to the codebase: ``` ucm @@ -35,6 +35,7 @@ scratch/main> add spaceAttack1 : x ->{DeathStar} Text ``` + Now we'll try to add a different definition that runs the actions in a different order. This should work fine: ``` unison @@ -45,7 +46,6 @@ spaceAttack2 x = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -57,6 +57,7 @@ spaceAttack2 x = spaceAttack2 : x ->{DeathStar} Text ``` + ``` ucm scratch/main> add @@ -65,5 +66,5 @@ scratch/main> add spaceAttack2 : x ->{DeathStar} Text ``` -Previously, this would fail because the hashing algorithm was being given one big let rec block whose binding order was normalized. +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/formatter.output.md b/unison-src/transcripts/formatter.output.md index 2a1bffb0ad..7cea63d39e 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -87,6 +87,7 @@ with a strike-through block~ scratch/main> debug.format ``` + ``` unison :added-by-ucm scratch.u x.doc = {{ @@ -172,7 +173,6 @@ brokenDoc = {{ hello }} + 1 ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what + refers to here: @@ -199,6 +199,7 @@ brokenDoc = {{ hello }} + 1 (Nat.+) : Nat -> Nat -> Nat ``` + ``` ucm scratch/main> debug.format diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index d83fd4341b..701158807d 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -7,8 +7,8 @@ If an argument is required but doesn't have a fuzzy resolver, the command should scratch/main> move.term `move.term foo bar` renames `foo` to `bar`. - ``` + If a fuzzy resolver doesn't have any options available it should print a message instead of opening an empty fuzzy-select. @@ -18,8 +18,8 @@ scratch/empty> view ⚠️ Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 - ``` + ``` unison optionOne = 1 @@ -43,6 +43,7 @@ scratch/main> debug.fuzzy-options view _ * nested.optionTwo ``` + Namespace args ``` ucm @@ -57,6 +58,7 @@ scratch/main> debug.fuzzy-options find-in _ * nested ``` + Project Branch args ``` ucm diff --git a/unison-src/transcripts/generic-parse-errors.output.md b/unison-src/transcripts/generic-parse-errors.output.md index 98627219da..2b236c6f03 100644 --- a/unison-src/transcripts/generic-parse-errors.output.md +++ b/unison-src/transcripts/generic-parse-errors.output.md @@ -6,7 +6,6 @@ x = ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -22,12 +21,12 @@ x = * identifier (ex: abba1, snake_case, .foo.bar#xyz, .foo.++#xyz, or 🌻) ``` + ``` unison namespace.blah = 1 ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -58,12 +57,12 @@ namespace.blah = 1 * use ``` + ``` unison x = 1 ] ``` ``` ucm - Loading changes detected in scratch.u. I found a closing ']' here without a matching '['. @@ -72,12 +71,12 @@ x = 1 ] ``` + ``` unison x = a.#abc ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -106,12 +105,12 @@ x = a.#abc * typeLink ``` + ``` unison x = "hi ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: @@ -126,12 +125,12 @@ x = "hi * literal character ``` + ``` unison y : a ``` ``` ucm - Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index 581f6c7ef1..e27ab16e98 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -30,7 +30,6 @@ x = 42 ``` ``` ucm - Loading changes detected in myfile.u. I found and typechecked these definitions in myfile.u. If you @@ -42,6 +41,7 @@ x = 42 x : Nat ``` + Let's go ahead and add that to the codebase, then make sure it's there: ``` ucm @@ -57,6 +57,7 @@ scratch/main> view x x = 42 ``` + If `view` returned no results, the transcript would fail at this point. ## Hiding output @@ -81,7 +82,6 @@ hmm = "Not, in fact, a number" ``` ``` ucm - Loading changes detected in scratch.u. I found a value of type: Text diff --git a/unison-src/transcripts/help.output.md b/unison-src/transcripts/help.output.md index deabd7ca56..914d727c47 100644 --- a/unison-src/transcripts/help.output.md +++ b/unison-src/transcripts/help.output.md @@ -1012,5 +1012,5 @@ scratch/main> help-topic testcache definitions it depends on has changed. ``` -We should add a command to show help for hidden commands also. +We should add a command to show help for hidden commands also. diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index 449617d84f..1ace1e00b3 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -10,7 +10,6 @@ f id = (id 1, id "hi") ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,6 +28,7 @@ f id = (id 1, id "hi") (1, "hi") ``` + Another example, involving abilities. Here the ability-polymorphic function is instantiated with two different ability lists, `{}` and `{IO}`: ``` unison @@ -39,7 +39,6 @@ f id _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +50,7 @@ f id _ = f : (∀ a g. '{g} a ->{h} '{g} a) -> '{h} () ``` + Here's an example, showing that polymorphic functions can be fields of a constructor, and the functions remain polymorphic even when the field is bound to a name during pattern matching: ``` unison @@ -67,7 +67,6 @@ Functor.blah = cases Functor f -> ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,6 +81,7 @@ Functor.blah = cases Functor f -> -> (∀ a b. (a -> b) -> f a -> f b) ``` + This example is similar, but involves abilities: ``` unison @@ -111,7 +111,6 @@ Loc.transform2 nt = cases Loc f -> ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -131,6 +130,7 @@ Loc.transform2 nt = cases Loc f -> -> Loc ``` + ## Types with polymorphic fields ``` unison diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md index 4dc0dc8133..151c389fb6 100644 --- a/unison-src/transcripts/input-parse-errors.output.md +++ b/unison-src/transcripts/input-parse-errors.output.md @@ -22,7 +22,6 @@ Sorry, I wasn’t sure how to process your request: You can run `help add` for more information on using `add`. - scratch/main> ls 1. lib/ (469 terms, 74 types) @@ -42,6 +41,7 @@ scratch/main> add 2 ⊡ Ignored previously added definitions: x ``` + todo: ``` haskell @@ -72,8 +72,8 @@ Sorry, I wasn’t sure how to process your request: You can run `help update` for more information on using `update`. - ``` + aliasTerm ``` @@ -204,4 +204,3 @@ view, viewGlobal, viewReflog ``` - diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index ee55371678..196e35bc37 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -39,6 +39,7 @@ scratch/main> io.test ioTest Tip: Use view 1 to view the source of a test. ``` + `io.test` doesn't cache results ``` ucm @@ -53,6 +54,7 @@ scratch/main> io.test ioAndExceptionTest Tip: Use view 1 to view the source of a test. ``` + `io.test.all` will run all matching tests except those in the `lib` namespace. ``` ucm diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index 77c84aea6b..26b45b286f 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -48,7 +48,6 @@ testCreateRename _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +59,7 @@ testCreateRename _ = testCreateRename : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -84,6 +84,7 @@ scratch/main> io.test testCreateRename Tip: Use view 1 to view the source of a test. ``` + ### Opening / Closing files Tests: @@ -132,7 +133,6 @@ testOpenClose _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -144,6 +144,7 @@ testOpenClose _ = testOpenClose : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -167,6 +168,7 @@ scratch/main> io.test testOpenClose Tip: Use view 1 to view the source of a test. ``` + ### Reading files with getSomeBytes Tests: @@ -224,7 +226,6 @@ testGetSomeBytes _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -236,6 +237,7 @@ testGetSomeBytes _ = testGetSomeBytes : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -261,6 +263,7 @@ scratch/main> io.test testGetSomeBytes Tip: Use view 1 to view the source of a test. ``` + ### Seeking in open files Tests: @@ -333,7 +336,6 @@ testAppend _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -346,6 +348,7 @@ testAppend _ = testSeek : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -381,6 +384,7 @@ scratch/main> io.test testAppend Tip: Use view 1 to view the source of a test. ``` + ### SystemTime ``` unison @@ -394,7 +398,6 @@ testSystemTime _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -406,6 +409,7 @@ testSystemTime _ = testSystemTime : '{IO} [Result] ``` + ``` ucm scratch/main> add @@ -424,6 +428,7 @@ scratch/main> io.test testSystemTime Tip: Use view 1 to view the source of a test. ``` + ### Get temp directory ``` unison @@ -455,6 +460,7 @@ scratch/main> io.test testGetTempDirectory Tip: Use view 1 to view the source of a test. ``` + ### Get current directory ``` unison @@ -486,6 +492,7 @@ scratch/main> io.test testGetCurrentDirectory Tip: Use view 1 to view the source of a test. ``` + ### Get directory contents ``` unison @@ -519,6 +526,7 @@ scratch/main> io.test testDirContents Tip: Use view 1 to view the source of a test. ``` + ### Read environment variables ``` unison @@ -552,6 +560,7 @@ scratch/main> io.test testGetEnv Tip: Use view 1 to view the source of a test. ``` + ### Read command line args `runMeWithNoArgs`, `runMeWithOneArg`, and `runMeWithTwoArgs` raise exceptions @@ -611,6 +620,7 @@ scratch/main> run runMeWithTwoArgs foo bar () ``` + Calling our examples with the wrong number of args will error. ``` ucm @@ -626,6 +636,7 @@ scratch/main> run runMeWithNoArgs foo ##raise ``` + ``` ucm scratch/main> run runMeWithOneArg @@ -639,6 +650,7 @@ scratch/main> run runMeWithOneArg ##raise ``` + ``` ucm scratch/main> run runMeWithOneArg foo bar @@ -653,6 +665,7 @@ scratch/main> run runMeWithOneArg foo bar ##raise ``` + ``` ucm scratch/main> run runMeWithTwoArgs @@ -666,6 +679,7 @@ scratch/main> run runMeWithTwoArgs ##raise ``` + ### Get the time zone ``` unison @@ -687,6 +701,7 @@ scratch/main> run testTimeZone () ``` + ### Get some random bytes ``` unison diff --git a/unison-src/transcripts/keyword-identifiers.output.md b/unison-src/transcripts/keyword-identifiers.output.md index 27a31d6f35..f983268f3a 100644 --- a/unison-src/transcripts/keyword-identifiers.output.md +++ b/unison-src/transcripts/keyword-identifiers.output.md @@ -269,4 +269,3 @@ cases! = 3943 cases' = 238448 structural type cases! cases_ = cases' cases_ | cases'' ``` - diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index 91d39bb0bd..820ba37c26 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -7,7 +7,6 @@ unique type T a = T a (a Nat) ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -16,6 +15,7 @@ unique type T a = T a (a Nat) a doesn't expect an argument; however, it is applied to Nat. ``` + conflicting constraints on the kind of `a` in a sum ``` unison @@ -25,7 +25,6 @@ unique type T a ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -34,6 +33,7 @@ unique type T a a doesn't expect an argument; however, it is applied to Nat. ``` + ## Kinds are inferred by decl component Successfully infer `a` in `Ping a` to be of kind `* -> *` by @@ -45,7 +45,6 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,6 +57,7 @@ unique type Pong = Pong (Ping Optional) type Pong ``` + Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts `a` to `*`, whereas `Pong` restricts `a` to `* -> *`. @@ -67,7 +67,6 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -77,6 +76,7 @@ unique type Pong = Pong (Ping Optional) it is applied to a which has kind: Type -> Type. ``` + Successful example between mutually recursive type and ability ``` unison @@ -86,7 +86,6 @@ unique ability Pong a where ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -99,6 +98,7 @@ unique ability Pong a where ability Pong a ``` + Catch conflict between mutually recursive type and ability ``` unison @@ -108,7 +108,6 @@ unique ability Pong a where ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -118,6 +117,7 @@ unique ability Pong a where applied to Optional which has kind: Type -> Type. ``` + Consistent instantiation of `T`'s `a` parameter in `S` ``` unison @@ -127,7 +127,6 @@ unique type S = S (T Nat) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -140,6 +139,7 @@ unique type S = S (T Nat) type T a ``` + Delay kind defaulting until all components are processed. Here `S` constrains the kind of `T`'s `a` parameter, although `S` is not in the same component as `T`. @@ -151,7 +151,6 @@ unique type S = S (T Optional) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -164,6 +163,7 @@ unique type S = S (T Optional) type T a ``` + Catch invalid instantiation of `T`'s `a` parameter in `S` ``` unison @@ -173,7 +173,6 @@ unique type S = S (T Optional) ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -183,6 +182,7 @@ unique type S = S (T Optional) to Optional which has kind: Type -> Type. ``` + ## Checking annotations Catch kind error in type annotation @@ -193,7 +193,6 @@ test = 0 ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -203,6 +202,7 @@ test = 0 Nat. ``` + Catch kind error in annotation example 2 ``` unison @@ -211,7 +211,6 @@ test _ = () ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -221,6 +220,7 @@ test _ = () it is applied to Optional which has kind: Type -> Type. ``` + Catch kind error in annotation example 3 ``` unison @@ -231,7 +231,6 @@ test _ = () ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -241,6 +240,7 @@ test _ = () applied to Nat which has kind: Type. ``` + Catch kind error in scoped type variable annotation ``` unison @@ -255,7 +255,6 @@ test _ = ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -265,6 +264,7 @@ test _ = applied to a which has kind: Type -> Type. ``` + ## Effect/type mismatch Effects appearing where types are expected @@ -278,7 +278,6 @@ test _ = () ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -288,6 +287,7 @@ test _ = () it is applied to Foo which has kind: Ability. ``` + Types appearing where effects are expected ``` unison @@ -296,7 +296,6 @@ test _ = () ``` ``` ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -307,6 +306,7 @@ test _ = () kind Ability. ``` + ## Cyclic kinds ``` unison @@ -314,7 +314,6 @@ unique type T a = T (a a) ``` ``` ucm - Loading changes detected in scratch.u. Cannot construct infinite kind @@ -325,12 +324,12 @@ unique type T a = T (a a) is the kind of a. ``` + ``` unison unique type T a b = T (a b) (b a) ``` ``` ucm - Loading changes detected in scratch.u. Cannot construct infinite kind @@ -341,13 +340,13 @@ unique type T a b = T (a b) (b a) k = (k -> Type) -> Type where k is the kind of b. ``` + ``` unison unique type Ping a = Ping (a Pong) unique type Pong a = Pong (a Ping) ``` ``` ucm - Loading changes detected in scratch.u. Cannot construct infinite kind diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index c7c6e01c24..9748c0d6c0 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -9,7 +9,6 @@ isEmpty x = match x with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ isEmpty x = match x with isEmpty : [t] -> Boolean ``` + Here's the same function written using `cases` syntax: ``` unison @@ -30,7 +30,6 @@ isEmpty2 = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -43,6 +42,7 @@ isEmpty2 = cases (also named isEmpty) ``` + Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ``` ucm @@ -54,6 +54,7 @@ scratch/main> view isEmpty _ -> false ``` + it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. ## Multi-argument cases @@ -78,6 +79,7 @@ scratch/main> add merge : [a] -> [a] -> [a] ``` + And here's a version using `cases`. The patterns are separated by commas: ``` unison @@ -91,7 +93,6 @@ merge2 = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -104,6 +105,7 @@ merge2 = cases (also named merge) ``` + Notice that Unison detects this as an alias of `merge`, and if we view `merge` ``` ucm @@ -118,6 +120,7 @@ scratch/main> view merge else h2 +: merge (h +: t) t2 ``` + it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. Here's another example: @@ -140,7 +143,6 @@ blorf = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,6 +171,7 @@ blorf = cases F ``` + ## Patterns with multiple guards ``` unison @@ -181,7 +184,6 @@ merge3 = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -193,6 +195,7 @@ merge3 = cases merge3 : [a] -> [a] -> [a] ``` + ``` ucm scratch/main> add @@ -211,6 +214,7 @@ scratch/main> view merge3 | otherwise -> h2 +: merge3 (h +: t) t2 ``` + This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. ``` unison @@ -223,7 +227,6 @@ merge4 a b = match (a,b) with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md index 9c310ea871..e4eb02719d 100644 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ b/unison-src/transcripts/lsp-name-completion.output.md @@ -28,6 +28,7 @@ scratch/main> debug.lsp-name-completion foldMap foldMap lib.dep.lib.transitive.foldMap #0o01gvr3fi ``` + Should still find the term which has a matching hash to a better name if the better name doesn't match. ``` ucm diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 600de90bf3..21bc6e5aea 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -24,6 +24,7 @@ scratch/main> help merge.commit * delete.branch /merge-topic-into-main ``` + Let's see a simple unconflicted merge in action: Alice (us) and Bob (them) add different terms. The merged result contains both additions. @@ -59,6 +60,7 @@ scratch/alice> view foo bar foo = "alices foo" ``` + ## Basic merge: two identical adds If Alice and Bob also happen to add the same definition, that's not a conflict. @@ -96,6 +98,7 @@ scratch/alice> view foo bar foo = "alice and bobs foo" ``` + ## Simple update propagation Updates that occur in one branch are propagated to the other. In this example, Alice updates `foo`, while Bob adds a new dependent `bar` of the original `foo`. When Bob's branch is merged into Alice's, her update to `foo` is propagated to his `bar`. @@ -127,6 +130,7 @@ scratch/bob> display bar "old foo - old foo" ``` + Merge result: ``` ucm @@ -149,6 +153,7 @@ scratch/alice> display bar "old foo - old foo" ``` + ## Update propagation with common dependent We classify something as an update if its "syntactic hash"—not its normal Unison hash—differs from the original definition. This allows us to cleanly merge unconflicted updates that were individually propagated to a common dependent. @@ -181,6 +186,7 @@ scratch/alice> display foo "foo - alices bar - old baz" ``` + Bob's updates: ``` unison @@ -194,6 +200,7 @@ scratch/bob> display foo "foo - old bar - bobs baz" ``` + Merge result: ``` ucm @@ -219,6 +226,7 @@ scratch/alice> display foo "foo - alices bar - bobs baz" ``` + ## Propagating an update to an update Of course, it's also possible for Alice's update to propagate to one of Bob's updates. In this example, `foo` depends on `bar` which depends on `baz`. Alice updates `baz`, propagating to `bar` and `foo`, while Bob updates `bar` (to something that still depends on `foo`), propagating to `baz`. The merged result will have Alice's update to `foo` incorporated into Bob's updated `bar`, and both updates will propagate to `baz`. @@ -242,6 +250,7 @@ scratch/main> display foo "old foo - old bar - old baz" ``` + Alice's updates: ``` unison @@ -255,6 +264,7 @@ scratch/alice> display foo "old foo - old bar - alices baz" ``` + Bob's updates: ``` unison @@ -268,6 +278,7 @@ scratch/bob> display foo "old foo - bobs bar - old baz" ``` + Merge result: ``` ucm @@ -295,6 +306,7 @@ scratch/alice> display foo "old foo - bobs bar - alices baz" ``` + ## Update + delete isn't (currently) a conflict We don't currently consider "update + delete" a conflict like Git does. In this situation, the delete is just ignored, allowing the update to proceed. @@ -321,6 +333,7 @@ scratch/bob> delete.term foo Done. ``` + Merge result: ``` ucm @@ -334,6 +347,7 @@ scratch/alice> view foo foo = "alices foo" ``` + In a future version, we'd like to give the user a warning at least. ## Library dependencies don't create merge conflicts @@ -391,6 +405,7 @@ scratch/alice> view foo bar baz lib.bothSame.bar = 18 ``` + ## No-op merge (Bob = Alice) If Bob is equals Alice, then merging Bob into Alice looks like this. @@ -417,6 +432,7 @@ scratch/alice> merge /bob scratch/alice was already up-to-date with scratch/bob. ``` + ## No-op merge (Bob \< Alice) If Bob is behind Alice, then merging Bob into Alice looks like this. @@ -437,6 +453,7 @@ scratch/main> branch bob `switch /main` then `merge /bob`. ``` + Alice's addition: ``` unison @@ -458,6 +475,7 @@ scratch/alice> merge /bob scratch/alice was already up-to-date with scratch/bob. ``` + ## Fast-forward merge (Bob \> Alice) If Bob is ahead of Alice, then merging Bob into Alice looks like this. @@ -478,6 +496,7 @@ scratch/main> branch bob `switch /main` then `merge /bob`. ``` + Bob's addition: ``` unison @@ -497,6 +516,7 @@ scratch/alice> merge /bob I fast-forward merged scratch/bob into scratch/alice. ``` + ## No-op merge: merge empty namespace into empty namespace ``` ucm @@ -514,6 +534,7 @@ scratch/main> merge /topic scratch/main was already up-to-date with scratch/topic. ``` + ## Merge failure: someone deleted something If either Alice or Bob delete something, so long as the other person didn't update it (in which case we ignore the delete, as explained above), then the delete goes through. @@ -537,6 +558,7 @@ scratch/alice> delete.term foo Done. ``` + Bob's new code that depends on `foo`: ``` unison @@ -570,6 +592,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u bar : Text bar = @@ -625,6 +648,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u bar : Text bar = @@ -691,6 +715,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice foo : Text @@ -720,6 +745,7 @@ scratch/merge-bob-into-alice> view bar baz baz = "bobs baz" ``` + ## Merge failure: simple type conflict Ditto for types; if the hashes don't match, it's a conflict. In this example, Alice and Bob do different things to the same constructor. However, any explicit changes to the same type will result in a conflict, including changes that could concievably be merged (e.g. Alice and Bob both add a new constructor, or edit different constructors). @@ -762,6 +788,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice type Foo = MkFoo Nat Nat @@ -795,6 +822,7 @@ scratch/bob> move.term Foo.Qux Foo.BobQux Done. ``` + ``` ucm scratch/alice> merge /bob @@ -815,6 +843,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice type Foo = Baz Nat Nat | Qux Text @@ -842,6 +871,7 @@ scratch/alice> move.term Foo.Baz Foo.Alice Done. ``` + Bob's rename: ``` ucm @@ -850,6 +880,7 @@ scratch/bob> move.term Foo.Qux Foo.Bob Done. ``` + ``` ucm scratch/alice> merge bob @@ -870,6 +901,7 @@ scratch/alice> merge bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice type Foo = Qux Text | Alice Nat @@ -917,6 +949,7 @@ scratch/alice> merge bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice my.cool.thing : Nat @@ -952,6 +985,7 @@ scratch/bob> delete.term Foo.Bar Done. ``` + ``` unison unique type Foo = Bar Nat Nat ``` @@ -978,6 +1012,7 @@ scratch/alice> merge bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice Foo.Bar : Nat @@ -1019,6 +1054,7 @@ scratch/alice> view Foo.Bar.Baz Foo.Bar.Qux Foo.Bar.Hello Foo.Bar.Qux = 200 ``` + Bob, meanwhile, first deletes the term, then sort of deletes the type and re-adds it under another name, but one constructor's fully qualified names doesn't actually change. The other constructor reuses the name of the deleted term. ``` ucm @@ -1027,6 +1063,7 @@ scratch/bob> view Foo.Bar type Foo.Bar = Baz Nat | Hello Nat Nat ``` + At this point, Bob and alice have both updated the name `Foo.Bar.Hello` in different ways, so that's a conflict. Therefore, Bob's entire type (`Foo.Bar` with constructors `Foo.Bar.Baz` and `Foo.Bar.Hello`) gets rendered into the scratch file. Notably, Alice's "unconflicted" update on the name "Foo.Bar.Baz" (because she changed its hash and Bob didn't touch it) is nonetheless considered conflicted with Bob's "Foo.Bar.Baz". @@ -1051,6 +1088,7 @@ scratch/alice> merge bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice Foo.Bar.Baz : Nat @@ -1111,6 +1149,7 @@ scratch/alice> merge bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice type Foo @@ -1179,6 +1218,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice foo : Text @@ -1198,7 +1238,6 @@ foo = "alice and bobs foo" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1211,6 +1250,7 @@ foo = "alice and bobs foo" foo : Text ``` + ``` ucm scratch/merge-bob-into-alice> update @@ -1237,6 +1277,7 @@ scratch/alice> branches 3. main ``` + ## `merge.commit` example (failure) `merge.commit` can only be run on a "merge branch". @@ -1250,12 +1291,14 @@ scratch/main> branch topic `switch /main` then `merge /topic`. ``` + ``` ucm scratch/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. @@ -1312,6 +1355,7 @@ scratch/alice> merge /bob and then try merging again. ``` + ### Conflict involving builtin We don't have a way of rendering a builtin in a scratch file, where users resolve merge conflicts. Thus, if there is a @@ -1327,6 +1371,7 @@ scratch/alice> alias.type lib.builtins.Nat MyNat Done. ``` + Bob's branch: ``` unison @@ -1347,6 +1392,7 @@ scratch/alice> merge /bob neither of them a builtin, and then try the merge again. ``` + ### Constructor alias Each naming of a decl may not have more than one name for each constructor, within the decl's namespace. @@ -1363,6 +1409,7 @@ scratch/alice> alias.term Foo.Bar Foo.some.other.Alias Done. ``` + Bob's branch: ``` unison @@ -1385,6 +1432,7 @@ scratch/alice> merge /bob try merging again. ``` + ### Missing constructor name Each naming of a decl must have a name for each constructor, within the decl's namespace. @@ -1401,6 +1449,7 @@ scratch/alice> delete.term Foo.Bar Done. ``` + Bob's branch: ``` unison @@ -1421,6 +1470,7 @@ scratch/alice> merge /bob each unnamed constructor, and then try the merge again. ``` + ### Nested decl alias A decl cannot be aliased within the namespace of another of its aliased. @@ -1440,6 +1490,7 @@ scratch/alice> names A Names: A A.inner.X ``` + Bob's branch: ``` unison @@ -1456,6 +1507,7 @@ scratch/alice> merge /bob then try merging again. ``` + ### Stray constructor alias Constructors may only exist within the corresponding decl's namespace. @@ -1474,6 +1526,7 @@ scratch/alice> alias.term Foo.Bar AliasOutsideFooNamespace Done. ``` + Bob's branch: ``` ucm @@ -1484,6 +1537,7 @@ scratch/bob> add bob : Nat ``` + ``` ucm scratch/alice> merge bob @@ -1497,6 +1551,7 @@ scratch/alice> merge bob simply `delete` it. Then try the merge again. ``` + ### Term or type in `lib` By convention, `lib` can only namespaces; each of these represents a library dependencies. Individual terms and types are not allowed at the top level of `lib`. @@ -1527,6 +1582,7 @@ scratch/alice> merge /bob Please move or remove it and then try merging again. ``` + ## LCA precondition violations The LCA is not subject to most precondition violations, which is good, because the user can't easily manipulate it\! @@ -1541,7 +1597,6 @@ structural type Foo = Bar Nat | Baz Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1553,6 +1608,7 @@ structural type Foo = Bar Nat | Baz Nat Nat structural type Foo ``` + ``` ucm scratch/main> add @@ -1565,6 +1621,7 @@ scratch/main> delete.term Foo.Baz Done. ``` + Alice's branch: ``` ucm @@ -1584,13 +1641,13 @@ scratch/alice> delete.term Foo.Bar Done. ``` + ``` unison alice : Nat alice = 100 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1602,6 +1659,7 @@ alice = 100 alice : Nat ``` + ``` ucm scratch/alice> add @@ -1610,6 +1668,7 @@ scratch/alice> add alice : Nat ``` + Bob's branch: ``` ucm @@ -1629,13 +1688,13 @@ scratch/bob> delete.term Foo.Bar Done. ``` + ``` unison bob : Nat bob = 101 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1647,6 +1706,7 @@ bob = 101 bob : Nat ``` + ``` ucm scratch/bob> add @@ -1655,6 +1715,7 @@ scratch/bob> add bob : Nat ``` + Now we merge: ``` ucm @@ -1663,6 +1724,7 @@ scratch/alice> merge /bob I merged scratch/bob into scratch/alice. ``` + ## Regression tests ### Delete one alias and update the other @@ -1673,7 +1735,6 @@ bar = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1686,6 +1747,7 @@ bar = 17 foo : Nat ``` + ``` ucm scratch/main> add @@ -1706,12 +1768,12 @@ scratch/alice> delete.term bar Done. ``` + ``` unison foo = 18 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1724,6 +1786,7 @@ foo = 18 foo : Nat ``` + ``` ucm scratch/alice> update @@ -1740,12 +1803,12 @@ scratch/main> branch bob `switch /main` then `merge /bob`. ``` + ``` unison bob = 101 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1757,6 +1820,7 @@ bob = 101 bob : Nat ``` + ``` ucm scratch/bob> add @@ -1765,12 +1829,14 @@ scratch/bob> add bob : Nat ``` + ``` ucm scratch/alice> merge /bob I merged scratch/bob into scratch/alice. ``` + ### Delete a constructor ``` unison @@ -1778,7 +1844,6 @@ type Foo = Bar | Baz ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1790,6 +1855,7 @@ type Foo = Bar | Baz type Foo ``` + ``` ucm scratch/main> add @@ -1805,12 +1871,12 @@ scratch/main> branch topic `switch /main` then `merge /topic`. ``` + ``` unison boop = "boop" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1822,6 +1888,7 @@ boop = "boop" boop : Text ``` + ``` ucm scratch/topic> add @@ -1830,12 +1897,12 @@ scratch/topic> add boop : Text ``` + ``` unison type Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1848,6 +1915,7 @@ type Foo = Bar type Foo ``` + ``` ucm scratch/main> update @@ -1857,6 +1925,7 @@ scratch/main> update Done. ``` + ``` ucm scratch/main> merge topic @@ -1867,6 +1936,7 @@ scratch/main> view Foo type Foo = Bar ``` + ### Dependent that doesn't need to be in the file This test demonstrates a bug. @@ -1885,7 +1955,6 @@ baz = "lca" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1899,6 +1968,7 @@ baz = "lca" foo : Nat ``` + ``` ucm scratch/alice> add @@ -1916,6 +1986,7 @@ scratch/alice> branch bob `switch /alice` then `merge /bob`. ``` + On Bob, we update `baz` to "bob". ``` unison @@ -1924,7 +1995,6 @@ baz = "bob" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1937,6 +2007,7 @@ baz = "bob" baz : Text ``` + ``` ucm scratch/bob> update @@ -1946,6 +2017,7 @@ scratch/bob> update Done. ``` + On Alice, we update `baz` to "alice" (conflict), but also update `foo` (unconflicted), which propagates to `bar`. ``` unison @@ -1957,7 +2029,6 @@ baz = "alice" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1971,6 +2042,7 @@ baz = "alice" foo : Nat ``` + ``` ucm scratch/alice> update @@ -1984,6 +2056,7 @@ scratch/alice> update Done. ``` + When we try to merge Bob into Alice, we should see both versions of `baz`, with Alice's unconflicted `foo` and `bar` in the underlying namespace. @@ -2007,6 +2080,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice baz : Text @@ -2040,7 +2114,6 @@ a = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2052,6 +2125,7 @@ a = 1 a : ##Nat ``` + ``` ucm scratch/alice> add @@ -2060,12 +2134,12 @@ scratch/alice> add a : ##Nat ``` + ``` unison b = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2077,6 +2151,7 @@ b = 2 b : ##Nat ``` + ``` ucm scratch/alice> add @@ -2085,18 +2160,19 @@ scratch/alice> add b : ##Nat ``` + ``` unison b = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. ``` + ``` ucm scratch/bob> add @@ -2105,12 +2181,12 @@ scratch/bob> add b : ##Nat ``` + ``` unison a = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2122,6 +2198,7 @@ a = 1 a : ##Nat ``` + ``` ucm scratch/bob> add @@ -2130,19 +2207,20 @@ scratch/bob> add a : ##Nat ``` + ``` unison a = 1 b = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. ``` + ``` ucm scratch/carol> add @@ -2176,6 +2254,7 @@ scratch/carol> history 3. #dm4u1eokg1 ``` + ### Variables named `_` This test demonstrates a change in syntactic hashing that fixed a bug due to auto-generated variable names for ignored @@ -2195,7 +2274,6 @@ bar = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2209,6 +2287,7 @@ bar = ignore : a -> () ``` + ``` ucm scratch/alice> add @@ -2226,6 +2305,7 @@ scratch/alice> branch bob `switch /alice` then `merge /bob`. ``` + ``` unison bar : Nat bar = @@ -2234,7 +2314,6 @@ bar = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2247,6 +2326,7 @@ bar = bar : Nat ``` + ``` ucm scratch/bob> update @@ -2256,6 +2336,7 @@ scratch/bob> update Done. ``` + Previously, this update to `foo` would also cause a "real update" on `bar`, its dependent. Now it doesn't, so the merge will succeed. @@ -2265,7 +2346,6 @@ foo = 19 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2278,6 +2358,7 @@ foo = 19 foo : Nat ``` + ``` ucm scratch/alice> update @@ -2291,12 +2372,14 @@ scratch/alice> update Done. ``` + ``` ucm scratch/alice> merge /bob I merged scratch/bob into scratch/alice. ``` + ### Unique type GUID reuse Previously, a merge branch would not include any dependents in the namespace, but that resulted in dependent unique @@ -2308,7 +2391,6 @@ type Bar = MkBar Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2321,6 +2403,7 @@ type Bar = MkBar Foo type Foo ``` + ``` ucm scratch/main> add @@ -2352,6 +2435,7 @@ scratch/bob> move.term Foo.Lca Foo.Bob Done. ``` + ``` ucm scratch/alice> merge /bob @@ -2372,6 +2456,7 @@ scratch/alice> merge /bob to delete the temporary branch and switch back to alice. ``` + ``` unison :added-by-ucm scratch.u -- scratch/alice type Foo @@ -2391,19 +2476,20 @@ type Bar ``` ucm ``` + ``` unison type Foo = Merged type Bar = MkBar Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. ``` + ``` ucm scratch/merge-bob-into-alice> update diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index 36116ad2bf..c9bf1e729a 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -12,7 +12,6 @@ unique type Foo.T = T ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +26,7 @@ unique type Foo.T = T Foo.termInA : Nat ``` + ``` ucm scratch/main> add @@ -38,13 +38,13 @@ scratch/main> add Foo.termInA : Nat ``` + ``` unison Foo.termInA = 2 unique type Foo.T = T1 | T2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,6 +59,7 @@ unique type Foo.T = T1 | T2 (also named Foo) ``` + ``` ucm scratch/main> update @@ -68,6 +69,7 @@ scratch/main> update Done. ``` + Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ``` ucm @@ -107,6 +109,7 @@ scratch/main> history Bar □ 2. #c5cggiaumo (start of history) ``` + ## Happy Path - Just term ``` unison @@ -114,7 +117,6 @@ bonk = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -126,6 +128,7 @@ bonk = 5 bonk : Nat ``` + ``` ucm z/main> builtins.merge @@ -147,6 +150,7 @@ z/main> ls 2. zonk (Nat) ``` + ## Happy Path - Just namespace ``` unison @@ -154,7 +158,6 @@ bonk.zonk = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -167,6 +170,7 @@ bonk.zonk = 5 (also named zonk) ``` + ``` ucm a/main> builtins.merge @@ -193,6 +197,7 @@ a/main> view zonk.zonk zonk.zonk = 5 ``` + ## Sad Path - No term, type, or namespace named src ``` ucm diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index c90e352696..065fb13edf 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -41,6 +41,7 @@ scratch/main> history □ 1. #g97lh1m2v7 (start of history) ``` + ``` ucm scratch/main> ls .root.at.path @@ -56,6 +57,7 @@ scratch/main> history .root.at.path □ 1. #08a6hgi6s4 (start of history) ``` + I should be able to move a sub namespace *over* the root. ``` ucm @@ -85,6 +87,7 @@ scratch/main> history □ 1. #08a6hgi6s4 (start of history) ``` + ``` ucm -- should be empty scratch/main> ls .root.at.path @@ -101,6 +104,7 @@ scratch/main> history .root.at.path □ 1. #sg60bvjo91 (start of history) ``` + ## Happy path Create a namespace and add some history to it @@ -111,7 +115,6 @@ unique type a.T = T ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -124,6 +127,7 @@ unique type a.T = T a.termInA : Nat ``` + ``` ucm scratch/happy> add @@ -133,13 +137,13 @@ scratch/happy> add a.termInA : Nat ``` + ``` unison a.termInA = 2 unique type a.T = T1 | T2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -153,6 +157,7 @@ unique type a.T = T1 | T2 a.termInA : Nat ``` + ``` ucm scratch/happy> update @@ -162,6 +167,7 @@ scratch/happy> update Done. ``` + Should be able to move the namespace, including its types, terms, and sub-namespaces. ``` ucm @@ -193,6 +199,7 @@ scratch/happy> history b □ 2. #avlnmh0erc (start of history) ``` + ## Namespace history Create some namespaces and add some history to them @@ -203,7 +210,6 @@ b.termInB = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -216,6 +222,7 @@ b.termInB = 10 b.termInB : Nat ``` + ``` ucm scratch/history> add @@ -225,13 +232,13 @@ scratch/history> add b.termInB : Nat ``` + ``` unison a.termInA = 2 b.termInB = 11 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -245,6 +252,7 @@ b.termInB = 11 b.termInB : Nat ``` + ``` ucm scratch/history> update @@ -254,6 +262,7 @@ scratch/history> update Done. ``` + 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. @@ -292,6 +301,7 @@ scratch/history> history a □ 1. #sg60bvjo91 (start of history) ``` + ## Moving over an existing branch Create some namespace and add some history to them @@ -302,7 +312,6 @@ b.termInB = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -315,6 +324,7 @@ b.termInB = 10 b.termInB : Nat ``` + ``` ucm scratch/existing> add @@ -324,13 +334,13 @@ scratch/existing> add b.termInB : Nat ``` + ``` unison a.termInA = 2 b.termInB = 11 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -344,6 +354,7 @@ b.termInB = 11 b.termInB : Nat ``` + ``` ucm scratch/existing> update diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md index 0624a26a8e..87e7cadec2 100644 --- a/unison-src/transcripts/name-resolution.output.md +++ b/unison-src/transcripts/name-resolution.output.md @@ -9,12 +9,12 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison type Namespace.Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ type Namespace.Foo = Bar type Namespace.Foo ``` + ``` ucm scratch/main> add @@ -34,13 +35,13 @@ scratch/main> add type Namespace.Foo ``` + ``` unison type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` ``` ucm - Loading changes detected in scratch.u. @@ -58,13 +59,13 @@ type UsesFoo = UsesFoo Foo ``` + ``` unison type File.Foo = Baz type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,10 +78,12 @@ type UsesFoo = UsesFoo Namespace.Foo File.Foo type UsesFoo ``` + ``` ucm scratch/main> project.delete scratch ``` + # Example 2 We have a namespace type named `Foo` and a file type named `File.Foo`. A reference to the type `Foo` is not ambiguous: @@ -92,12 +95,12 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison type Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,6 +112,7 @@ type Foo = Bar type Foo ``` + ``` ucm scratch/main> add @@ -117,13 +121,13 @@ scratch/main> add type Foo ``` + ``` unison type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -136,6 +140,7 @@ type UsesFoo = UsesFoo Foo type UsesFoo ``` + ``` ucm scratch/main> add @@ -149,10 +154,12 @@ scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo ``` + ``` ucm scratch/main> project.delete scratch ``` + # Example 3 We have a namespace type named `Namespace.Foo` and a file type named `Foo`. A reference to the type `Foo` is not ambiguous: @@ -164,12 +171,12 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison type Namespace.Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -181,6 +188,7 @@ type Namespace.Foo = Bar type Namespace.Foo ``` + ``` ucm scratch/main> add @@ -189,13 +197,13 @@ scratch/main> add type Namespace.Foo ``` + ``` unison type Foo = Baz type UsesFoo = UsesFoo Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -208,6 +216,7 @@ type UsesFoo = UsesFoo Foo type UsesFoo ``` + ``` ucm scratch/main> add @@ -221,10 +230,12 @@ scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo ``` + ``` ucm scratch/main> project.delete scratch ``` + # Example 4 We have a namespace term `ns.foo : Nat` and a file term `file.foo : Text`. A reference to the term `foo` is ambiguous, @@ -236,13 +247,13 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison ns.foo : Nat ns.foo = 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -254,6 +265,7 @@ ns.foo = 42 ns.foo : Nat ``` + ``` ucm scratch/main> add @@ -262,6 +274,7 @@ scratch/main> add ns.foo : Nat ``` + ``` unison file.foo : Text file.foo = "foo" @@ -271,7 +284,6 @@ bar = foo ++ "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -284,10 +296,12 @@ bar = foo ++ "bar" file.foo : Text ``` + ``` ucm scratch/main> project.delete scratch ``` + # Example 4 We have a namespace term `ns.foo : Nat` and a file term `file.foo : Text`. A reference to the term `foo` is ambiguous, @@ -299,13 +313,13 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison ns.foo : Nat ns.foo = 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -317,6 +331,7 @@ ns.foo = 42 ns.foo : Nat ``` + ``` ucm scratch/main> add @@ -325,6 +340,7 @@ scratch/main> add ns.foo : Nat ``` + ``` unison file.foo : Text file.foo = "foo" @@ -334,7 +350,6 @@ bar = foo + 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -347,10 +362,12 @@ bar = foo + 42 file.foo : Text ``` + ``` ucm scratch/main> project.delete scratch ``` + # Example 4 We have a namespace term `ns.foo : Nat` and a file term `file.foo : Nat`. A reference to the term `foo` is ambiguous. @@ -362,13 +379,13 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison ns.foo : Nat ns.foo = 42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -380,6 +397,7 @@ ns.foo = 42 ns.foo : Nat ``` + ``` ucm scratch/main> add @@ -388,6 +406,7 @@ scratch/main> add ns.foo : Nat ``` + ``` unison file.foo : Nat file.foo = 43 @@ -397,7 +416,6 @@ bar = foo + 10 ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what foo refers to here: @@ -413,6 +431,7 @@ bar = foo + 10 ns.foo : Nat ``` + ``` unison file.foo : Nat file.foo = 43 @@ -422,7 +441,6 @@ bar = file.foo + ns.foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -435,6 +453,7 @@ bar = file.foo + ns.foo file.foo : Nat ``` + ``` ucm scratch/main> add @@ -451,6 +470,7 @@ scratch/main> view bar file.foo + ns.foo ``` + ``` ucm scratch/main> project.delete scratch diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 4a58422746..ebe02cc5b4 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -16,6 +16,7 @@ scratch/main> view `=` `=` ``` + You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index 10bb357c98..8bc53afeda 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -29,6 +29,7 @@ scratch/main> view a.a b + 1 ``` + Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: ``` unison @@ -80,6 +81,7 @@ scratch/main> debug.alias.term.force a2.d a3.d Done. ``` + At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope, `a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments. @@ -114,6 +116,7 @@ scratch/main> view a b c d c#dcgdua2lj6 + 10 ``` + ## Name biasing ``` unison @@ -126,7 +129,6 @@ a = 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -140,6 +142,7 @@ a = 10 deeply.nested.term : Nat ``` + ``` ucm scratch/biasing> add @@ -160,6 +163,7 @@ scratch/biasing> view deeply.nested.term num + 1 ``` + Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` ``` unison @@ -167,7 +171,6 @@ other.num = 20 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -179,6 +182,7 @@ other.num = 20 other.num : Nat ``` + ``` ucm scratch/biasing> add diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index 06db804432..1a0c841a2c 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -6,6 +6,7 @@ scratch/main> builtins.merge lib.builtins Done. ``` + Example uses of the `names` command and output ``` unison @@ -19,7 +20,6 @@ somewhere.y = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,6 +35,7 @@ somewhere.y = 2 somewhere.z : Nat ``` + ``` ucm scratch/main> add @@ -47,6 +48,7 @@ scratch/main> add somewhere.z : Nat ``` + `names` searches relative to the current path. ``` ucm @@ -75,6 +77,7 @@ scratch/main> names .some.place.x Names: some.otherplace.y some.place.x somewhere.z ``` + `debug.names.global` searches from the root, and absolutely qualifies results ``` ucm diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md index f263473bf6..8165721f37 100644 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -6,6 +6,7 @@ scratch/main> builtins.merge lib.builtins Done. ``` + ``` unison const a b = a external.mynat = 1 diff --git a/unison-src/transcripts/namespace-directive.output.md b/unison-src/transcripts/namespace-directive.output.md index 92ecb360cf..45cd5b4ad3 100644 --- a/unison-src/transcripts/namespace-directive.output.md +++ b/unison-src/transcripts/namespace-directive.output.md @@ -11,6 +11,7 @@ scratch/main> builtins.mergeio lib.builtins Done. ``` + ``` unison namespace foo @@ -19,7 +20,6 @@ baz = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,6 +31,7 @@ baz = 17 foo.baz : Nat ``` + 2. Free variables whose names exactly match bindings in the file are rewritten to refer to the prefixed binder instead. That is, a term like `factorial = ... factorial ...` is rewritten to `foo.factorial = ... foo.factorial ...`. @@ -47,7 +48,6 @@ longer.evil.factorial n = n ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +60,7 @@ longer.evil.factorial n = n foo.longer.evil.factorial : Int -> Int ``` + ``` ucm scratch/main> add @@ -79,6 +80,7 @@ scratch/main> view factorial foo.longer.evil.factorial n = n ``` + Note that in the above example, we do not want the existence of a `namespace foo` directive to determine whether the reference to the name `factorial` within the body of `factorial` is a recursive reference (good, behavior without namespace directive, exact-name-match-wins semantics) or an ambiguous reference (bad, as would be the case if the @@ -93,7 +95,6 @@ type longer.foo.Baz = { qux : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -111,6 +112,7 @@ type longer.foo.Baz = { qux : Nat } longer.foo.Baz.qux.set : Nat -> Baz -> Baz ``` + ``` ucm scratch/main> add @@ -123,6 +125,7 @@ scratch/main> add longer.foo.Baz.qux.set : Nat -> Baz -> Baz ``` + ``` unison namespace foo @@ -142,7 +145,6 @@ hasTypeLink = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -164,6 +166,7 @@ hasTypeLink = foo.refersToQux : foo.Baz -> Nat ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/no-hash-in-term-declaration.output.md b/unison-src/transcripts/no-hash-in-term-declaration.output.md index aa3dc9d9fc..a72d53344c 100644 --- a/unison-src/transcripts/no-hash-in-term-declaration.output.md +++ b/unison-src/transcripts/no-hash-in-term-declaration.output.md @@ -1,4 +1,3 @@ # No Hashes in Term Declarations There should not be hashes in the names used in term declarations, either in the type signature or the type definition. - diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index 0567bcac3f..9f7fa75aba 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -12,7 +12,6 @@ corge = "corge" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,6 +28,7 @@ corge = "corge" qux : Text ``` + ``` ucm scratch/main> add @@ -42,6 +42,7 @@ scratch/main> add qux : Text ``` + We can get the list of things in the namespace, and UCM will give us a numbered list: @@ -58,6 +59,7 @@ scratch/main> find ``` + We can ask to `view` the second element of this list: ``` ucm @@ -78,6 +80,7 @@ scratch/main> view 2 baz = "baz" ``` + And we can `view` multiple elements by separating with spaces: ``` ucm @@ -104,6 +107,7 @@ scratch/main> view 2 3 5 quux = "quux" ``` + We can also ask for a range: ``` ucm @@ -130,6 +134,7 @@ scratch/main> view 2-4 foo = "foo" ``` + And we can ask for multiple ranges and use mix of ranges and numbers: ``` ucm diff --git a/unison-src/transcripts/old-fold-right.output.md b/unison-src/transcripts/old-fold-right.output.md index a74a317a49..6deffe6809 100644 --- a/unison-src/transcripts/old-fold-right.output.md +++ b/unison-src/transcripts/old-fold-right.output.md @@ -12,7 +12,6 @@ pecan = 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 6647fb1a37..f38610f79a 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -11,7 +11,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -25,6 +24,7 @@ test = cases * C ``` + ``` unison unique type T = A | B @@ -37,7 +37,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -52,6 +51,7 @@ test = cases * (B, Some B) ``` + ## redundant patterns ``` unison @@ -66,7 +66,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -74,6 +73,7 @@ test = cases ``` + ``` unison unique type T = A | B @@ -87,7 +87,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -95,6 +94,7 @@ test = cases ``` + # Uninhabited patterns match is complete without covering uninhabited patterns @@ -109,7 +109,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,6 +121,7 @@ test = cases test : Optional (Optional V) -> () ``` + uninhabited patterns are reported as redundant ``` unison @@ -133,7 +133,6 @@ test0 = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -141,6 +140,7 @@ test0 = cases ``` + ``` unison unique type V = @@ -152,7 +152,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -160,6 +159,7 @@ test = cases ``` + # Guards ## Incomplete patterns due to guards should be reported @@ -171,7 +171,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -183,6 +182,7 @@ test = cases * () ``` + ``` unison test : Optional Nat -> Nat test = cases @@ -192,7 +192,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -206,6 +205,7 @@ test = cases * Some _ ``` + ## Complete patterns with guards should be accepted ``` unison @@ -218,7 +218,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -230,6 +229,7 @@ test = cases test : Optional Nat -> Nat ``` + # Pattern instantiation depth Uncovered patterns are only instantiated as deeply as necessary to @@ -245,7 +245,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -258,6 +257,7 @@ test = cases * Some (Some _) ``` + ``` unison unique type T = A | B | C @@ -269,7 +269,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -285,6 +284,7 @@ test = cases * Some (Some C) ``` + # Literals ## Non-exhaustive @@ -298,7 +298,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -310,6 +309,7 @@ test = cases * _ ``` + Boolean ``` unison @@ -319,7 +319,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -331,6 +330,7 @@ test = cases * false ``` + ## Exhaustive Nat @@ -343,7 +343,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -355,6 +354,7 @@ test = cases test : Nat -> () ``` + Boolean ``` unison @@ -365,7 +365,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -377,6 +376,7 @@ test = cases test : Boolean -> () ``` + # Redundant Nat @@ -390,7 +390,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -398,6 +397,7 @@ test = cases ``` + Boolean ``` unison @@ -409,7 +409,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -417,6 +416,7 @@ test = cases ``` + # Sequences ## Exhaustive @@ -429,7 +429,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -441,6 +440,7 @@ test = cases test : [()] -> () ``` + ## Non-exhaustive ``` unison @@ -450,7 +450,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -462,6 +461,7 @@ test = cases * (() +: _) ``` + ``` unison test : [()] -> () test = cases @@ -469,7 +469,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -481,6 +480,7 @@ test = cases * [] ``` + ``` unison test : [()] -> () test = cases @@ -488,7 +488,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -500,6 +499,7 @@ test = cases * [] ``` + ``` unison test : [()] -> () test = cases @@ -508,7 +508,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -521,6 +520,7 @@ test = cases * (() +: []) ``` + ``` unison test : [()] -> () test = cases @@ -529,7 +529,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -542,6 +541,7 @@ test = cases * (() +: (() +: _)) ``` + ## Uninhabited `Cons` is not expected since `V` is uninhabited @@ -555,7 +555,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -568,6 +567,7 @@ test = cases test : [V] -> () ``` + ## Length restrictions can equate cons and nil patterns Here the first pattern matches lists of length two or greater, the @@ -587,7 +587,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -599,6 +598,7 @@ test = cases test : [Boolean] -> () ``` + This is the same idea as above but shows that fourth match is redundant. ``` unison @@ -612,7 +612,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -620,6 +619,7 @@ test = cases ``` + This is another similar example. The first pattern matches lists of length 5 or greater. The second matches lists of length 4 or greater where the first and third element are true. The third matches lists of length 4 @@ -637,7 +637,6 @@ test = cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -645,6 +644,7 @@ test = cases ``` + # bugfix: Sufficient data decl map ``` unison @@ -656,7 +656,6 @@ unit2t = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -669,6 +668,7 @@ unit2t = cases unit2t : 'T ``` + ``` ucm scratch/main> add @@ -678,6 +678,7 @@ scratch/main> add unit2t : 'T ``` + Pattern coverage checking needs the data decl map to contain all transitive type dependencies of the scrutinee type. We do this before typechecking begins in a roundabout way: fetching all @@ -693,7 +694,6 @@ witht = match unit2t () with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -705,6 +705,7 @@ witht = match unit2t () with witht : () ``` + ``` unison unique type V = @@ -713,7 +714,6 @@ evil = bug "" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -726,6 +726,7 @@ evil = bug "" evil : 'V ``` + ``` ucm scratch/main> add @@ -735,6 +736,7 @@ scratch/main> add evil : 'V ``` + ``` unison withV : Unit withV = match evil () with @@ -742,7 +744,6 @@ withV = match evil () with ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -750,12 +751,12 @@ withV = match evil () with ``` + ``` unison unique type SomeType = A ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -767,6 +768,7 @@ unique type SomeType = A type SomeType ``` + ``` ucm scratch/main> add @@ -775,6 +777,7 @@ scratch/main> add type SomeType ``` + ``` unison unique type R = R SomeType @@ -783,7 +786,6 @@ get x = match x with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -796,12 +798,12 @@ get x = match x with get : R -> SomeType ``` + ``` unison unique type R = { someType : SomeType } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -816,6 +818,7 @@ unique type R = { someType : SomeType } R.someType.set : SomeType -> R -> R ``` + # Ability handlers ## Exhaustive ability handlers are accepted @@ -832,7 +835,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -845,6 +847,7 @@ result f = handle !f with cases result : '{e, Abort} a ->{e} a ``` + ``` unison structural ability Abort where abort : {Abort} a @@ -859,7 +862,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -877,6 +879,7 @@ result f = handle !f with cases type T ``` + ``` unison structural ability Abort where abort : {Abort} a @@ -890,7 +893,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -903,6 +905,7 @@ result f = result : '{e, Abort} V ->{e} V ``` + ``` unison structural ability Abort where abort : {Abort} a @@ -920,7 +923,6 @@ handleMulti c = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -934,6 +936,7 @@ handleMulti c = handleMulti : '{Abort, Stream a} r -> (Optional r, [a]) ``` + ## Non-exhaustive ability handlers are rejected ``` unison @@ -948,7 +951,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -962,6 +964,7 @@ result f = handle !f with cases * { abortWithMessage _ -> _ } ``` + ``` unison structural ability Abort where abort : {Abort} a @@ -975,7 +978,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -988,6 +990,7 @@ result f = handle !f with cases * { B } ``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -1001,7 +1004,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1014,6 +1016,7 @@ result f = handle !f with cases * { give B -> _ } ``` + ``` unison structural ability Abort where abort : {Abort} a @@ -1031,7 +1034,6 @@ handleMulti c = ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1044,6 +1046,7 @@ handleMulti c = * { abort -> _ } ``` + ## Redundant handler cases are rejected ``` unison @@ -1060,7 +1063,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1068,6 +1070,7 @@ result f = handle !f with cases ``` + ## Exhaustive ability reinterpretations are accepted ``` unison @@ -1084,7 +1087,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1097,6 +1099,7 @@ result f = handle !f with cases result : '{e, Abort} a ->{e, Abort} a ``` + ``` unison structural ability Abort a where abort : {Abort a} r @@ -1112,7 +1115,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1125,6 +1127,7 @@ result f = result : '{e, Abort V} a ->{e, Abort V} a ``` + ## Non-exhaustive ability reinterpretations are rejected ``` unison @@ -1140,7 +1143,6 @@ result f = handle !f with cases ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1153,6 +1155,7 @@ result f = handle !f with cases * { abort -> _ } ``` + ## Hacky workaround for uninhabited abilities Although all of the constructors of an ability might be uninhabited, @@ -1180,7 +1183,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1194,6 +1196,7 @@ result f = * { give2 _ -> _ } ``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -1209,7 +1212,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1222,6 +1224,7 @@ result f = result : '{e, Give V} r ->{e} r ``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -1237,7 +1240,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1250,6 +1252,7 @@ result f = result : '{e, Give V} r ->{e} r ``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -1266,7 +1269,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1274,6 +1276,7 @@ result f = ``` + ``` unison unique ability GiveA a where giveA : a -> {GiveA a} Unit @@ -1296,7 +1299,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1304,6 +1306,7 @@ result f = ``` + ``` unison unique ability GiveA a where giveA : a -> {GiveA a} Unit @@ -1324,7 +1327,6 @@ result f = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index 4119b0fd94..39edc94d09 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -60,7 +60,6 @@ doc = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -86,6 +85,7 @@ doc = cases tremulous : (Nat, Nat) -> () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index 1e6e9ced27..dbcc1fac51 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -21,7 +21,6 @@ assertRight = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ assertRight = cases frank : '{IO} () ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/patterns.output.md b/unison-src/transcripts/patterns.output.md index 88185b5729..f3b8a97672 100644 --- a/unison-src/transcripts/patterns.output.md +++ b/unison-src/transcripts/patterns.output.md @@ -8,7 +8,6 @@ p1 = join [literal "blue", literal "frog"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index d438a96b37..03e2029592 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -10,7 +10,6 @@ fooToInt _ = +42 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ fooToInt _ = +42 fooToInt : Foo -> Int ``` + And then we add it. ``` ucm @@ -52,6 +52,7 @@ scratch/main> view fooToInt fooToInt _ = +42 ``` + Then if we change the type `Foo`... ``` unison @@ -59,7 +60,6 @@ unique type Foo = Foo | Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -72,6 +72,7 @@ unique type Foo = Foo | Bar type Foo ``` + and update the codebase to use the new type `Foo`... ``` ucm @@ -82,6 +83,7 @@ scratch/main> update.old type Foo ``` + ... it should automatically propagate the type to `fooToInt`. ``` ucm @@ -91,6 +93,7 @@ scratch/main> view fooToInt fooToInt _ = +42 ``` + ### Preserving user type variables We make a term that has a dependency on another term and also a non-redundant @@ -105,7 +108,6 @@ preserve.otherTerm y = someTerm y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -118,6 +120,7 @@ preserve.otherTerm y = someTerm y preserve.someTerm : Optional foo -> Optional foo ``` + Add that to the codebase: ``` ucm @@ -129,6 +132,7 @@ scratch/main> add preserve.someTerm : Optional foo -> Optional foo ``` + Let's now edit the dependency: ``` unison @@ -137,7 +141,6 @@ preserve.someTerm _ = None ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -150,6 +153,7 @@ preserve.someTerm _ = None preserve.someTerm : Optional x -> Optional x ``` + Update... ``` ucm @@ -160,6 +164,7 @@ scratch/main> update.old preserve.someTerm : Optional x -> Optional x ``` + Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md index 38afde71c9..951b112c72 100644 --- a/unison-src/transcripts/pull-errors.output.md +++ b/unison-src/transcripts/pull-errors.output.md @@ -21,7 +21,6 @@ Sorry, I wasn’t sure how to process your request: merging into the top level of a local project branch. You can run `help pull` for more information on using `pull`. - test/main> pull @aryairani/test-almost-empty/main a I think you want to merge @aryairani/test-almost-empty/main @@ -39,5 +38,4 @@ Sorry, I wasn’t sure how to process your request: merging into the top level of a local project branch. You can run `help pull` for more information on using `pull`. - ``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index 3e3d66245c..fd74ced1ee 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -12,6 +12,7 @@ scratch/main> view Record1 type Record1 = { a : Text } ``` + ## Record with 2 fields ``` unison @@ -24,6 +25,7 @@ scratch/main> view Record2 type Record2 = { a : Text, b : Int } ``` + ## Record with 3 fields ``` unison @@ -36,6 +38,7 @@ scratch/main> view Record3 type Record3 = { a : Text, b : Int, c : Nat } ``` + ## Record with many fields ``` unison @@ -63,6 +66,7 @@ scratch/main> view Record4 g : [Nat] } ``` + ## Record with many many fields ``` unison @@ -118,6 +122,7 @@ scratch/main> view Record5 twenty : [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] } ``` + ## Record with user-defined type fields This record type has two fields whose types are user-defined (`Record4` and `UserType`). @@ -137,6 +142,7 @@ scratch/main> view RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` + ## Syntax Trailing commas are allowed. @@ -149,7 +155,6 @@ unique type Record5 = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 9fbff90318..84b70ba8e3 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -5,7 +5,6 @@ x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ x = 1 x : Nat ``` + ``` ucm scratch/main> add @@ -25,12 +25,12 @@ scratch/main> add x : Nat ``` + ``` unison y = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,6 +42,7 @@ y = 2 y : Nat ``` + ``` ucm scratch/main> add @@ -69,6 +70,7 @@ newproject/main> alias.type lib.builtins.Nat MyNat Done. ``` + Should see reflog entries from the current branch ``` ucm @@ -88,6 +90,7 @@ scratch/main> reflog 4. scratch/main #sg60bvjo91 Project Created ``` + Should see reflog entries from the current project ``` ucm @@ -109,6 +112,7 @@ scratch/main> project.reflog 6. scratch/main #sg60bvjo91 Project Created ``` + Should see reflog entries from all projects ``` ucm diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md index 3354e764f9..a082c3c203 100644 --- a/unison-src/transcripts/release-draft-command.output.md +++ b/unison-src/transcripts/release-draft-command.output.md @@ -7,7 +7,6 @@ someterm = 18 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ someterm = 18 someterm : Nat ``` + ``` ucm foo/main> add @@ -27,6 +27,7 @@ foo/main> add someterm : Nat ``` + Now, the `release.draft` demo: `release.draft` accepts a single semver argument. @@ -49,6 +50,7 @@ foo/main> release.draft 1.2.3 `switch /releases/drafts/1.2.3`. ``` + It's an error to try to create a `releases/drafts/x.y.z` branch that already exists. ``` ucm diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index 7bcdacc4a1..20f841a42a 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -3,7 +3,6 @@ def = "first value" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ def = "first value" def : Text ``` + ``` unison def = "second value" ``` @@ -71,6 +71,7 @@ scratch/main> history □ 2. #4bigcpnl7t (start of history) ``` + Can reset to a value from reflog by number. ``` ucm @@ -120,6 +121,7 @@ scratch/main> history □ 3. #4bigcpnl7t (start of history) ``` + # reset branch ``` ucm @@ -133,6 +135,7 @@ foo/main> history □ 1. #sg60bvjo91 (start of history) ``` + ``` unison a = 5 ``` @@ -164,6 +167,7 @@ foo/empty> history □ 1. #5l94rduvel (start of history) ``` + ## second argument is always interpreted as a branch ``` unison diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index c4aaf98906..aa7c4574bb 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -10,6 +10,7 @@ scratch/main> builtins.merge lib.builtins Done. ``` + First we define differing types with the same name in different namespaces: ``` unison @@ -21,7 +22,6 @@ two.ambiguousTerm = "term two" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +36,7 @@ two.ambiguousTerm = "term two" two.ambiguousTerm : Text ``` + ``` ucm scratch/main> add @@ -47,6 +48,7 @@ scratch/main> add two.ambiguousTerm : Text ``` + ## Tests Now we introduce code which isn't sufficiently qualified. @@ -72,7 +74,6 @@ separateAmbiguousTypeUsage _ = () ``` ``` ucm - Loading changes detected in scratch.u. @@ -99,6 +100,7 @@ separateAmbiguousTypeUsage _ = () ``` + Currently, ambiguous terms are caught and handled by type directed name resolution, but expect it to eventually be handled by the above machinery. @@ -107,7 +109,6 @@ useAmbiguousTerm = ambiguousTerm ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what ambiguousTerm refers to here: diff --git a/unison-src/transcripts/rsa.output.md b/unison-src/transcripts/rsa.output.md index 04b242387f..8f7e28e824 100644 --- a/unison-src/transcripts/rsa.output.md +++ b/unison-src/transcripts/rsa.output.md @@ -32,7 +32,6 @@ sigKo = match signature with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/scope-ref.output.md b/unison-src/transcripts/scope-ref.output.md index c356bc531d..2975b6c9fc 100644 --- a/unison-src/transcripts/scope-ref.output.md +++ b/unison-src/transcripts/scope-ref.output.md @@ -14,7 +14,6 @@ test = Scope.run 'let ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index d8167704e4..c76fb31e0e 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -33,6 +33,7 @@ scratch/main> find take ``` + The `view` and `display` commands also benefit from this: ``` ucm @@ -45,6 +46,7 @@ scratch/main> display bar.a +99 ``` + In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: @@ -57,6 +59,7 @@ scratch/main> find : Nat -> [a] -> [a] ``` + ## Preferring names not in `lib.*.lib.*` Suffix-based resolution prefers names that are not in an indirect dependency. @@ -69,7 +72,6 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -84,6 +86,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" lib.distributed.lib.baz.qux : Text ``` + ``` ucm scratch/main> add @@ -95,12 +98,12 @@ scratch/main> add lib.distributed.lib.baz.qux : Text ``` + ``` unison > abra.cadabra ``` ``` ucm - Loading changes detected in scratch.u. I couldn't figure out what abra.cadabra refers to here: @@ -117,12 +120,12 @@ scratch/main> add distributed.abra.cadabra : Text ``` + ``` unison > baz.qux ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -137,6 +140,7 @@ scratch/main> add "direct dependency 2" ``` + ``` ucm scratch/main> view abra.cadabra @@ -152,6 +156,7 @@ scratch/main> view baz.qux lib.distributed.baz.qux = "direct dependency 2" ``` + Note that we can always still view indirect dependencies by using more name segments: ``` ucm diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index ba70632b86..580633e211 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -9,7 +9,6 @@ structural type X = x ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +21,7 @@ structural type X = x (also named lib.builtins.Unit) ``` + ``` ucm scratch/main> add @@ -31,6 +31,7 @@ scratch/main> add (also named lib.builtins.Unit) ``` + Now we update the type, changing the name of the constructors, *but*, we simultaneously add a new top-level term with the same name as the old constructor. @@ -44,7 +45,6 @@ dependsOnX = Text.size X.x ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -63,6 +63,7 @@ dependsOnX = Text.size X.x (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. diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index 96778f99d7..a2e456274b 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -7,7 +7,6 @@ someterm = 18 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ someterm = 18 someterm : Nat ``` + ``` ucm foo/main> add @@ -41,6 +41,7 @@ foo/main> branch topic `switch /main` then `merge /topic`. ``` + Now, the demo. When unambiguous, `switch` switches to either a project or a branch in the current project. A branch in the current project can be preceded by a forward slash (which makes it unambiguous). A project can be followed by a forward slash (which makes it unambiguous). @@ -57,6 +58,7 @@ foo/main> switch /topic foo/main> switch bar/ ``` + It's an error to try to switch to something ambiguous. ``` ucm @@ -71,6 +73,7 @@ foo/main> switch bar Tip: use `switch 1` or `switch 2` to pick one of these. ``` + It's an error to try to switch to something that doesn't exist, of course. ``` ucm @@ -79,6 +82,7 @@ scratch/main> switch foo/no-such-branch foo/no-such-branch does not exist. ``` + ``` ucm scratch/main> switch no-such-project @@ -86,6 +90,7 @@ scratch/main> switch no-such-project exists. ``` + ``` ucm foo/main> switch no-such-project-or-branch diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 2c0103bb95..5c15315b79 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -23,6 +23,7 @@ scratch/main> debug.tab-complete delete. delete.verbose ``` + ## Tab complete terms & types ``` unison @@ -35,7 +36,6 @@ unique type subnamespace.AType = A | B ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +51,7 @@ unique type subnamespace.AType = A | B subnamespace2.thing : ##Nat ``` + ``` ucm -- Should tab complete namespaces since they may contain terms/types scratch/main> debug.tab-complete view sub @@ -89,6 +90,7 @@ scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName ``` + ``` unison absolute.term = "absolute" ``` @@ -106,6 +108,7 @@ scratch/main> debug.tab-complete view .absolute.te * .absolute.term ``` + ## Tab complete namespaces ``` ucm @@ -141,6 +144,7 @@ scratch/main> debug.tab-complete io.test subnamespace. * subnamespace.someOtherName ``` + Tab Complete Delete Subcommands ``` unison @@ -150,7 +154,6 @@ add b = b ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -163,6 +166,7 @@ add b = b add : a -> a ``` + ``` ucm scratch/main> update.old @@ -181,6 +185,7 @@ scratch/main> debug.tab-complete delete.term add * add ``` + ## Tab complete projects and branches ``` ucm @@ -200,6 +205,7 @@ myproject/main> debug.tab-complete project.rename my myproject ``` + Commands which complete namespaces OR branches should list both ``` unison @@ -207,7 +213,6 @@ mybranchsubnamespace.term = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -219,6 +224,7 @@ mybranchsubnamespace.term = 1 mybranchsubnamespace.term : ##Nat ``` + ``` ucm myproject/main> add diff --git a/unison-src/transcripts/tdnr.output.md b/unison-src/transcripts/tdnr.output.md index 39356d031d..bf602d4629 100644 --- a/unison-src/transcripts/tdnr.output.md +++ b/unison-src/transcripts/tdnr.output.md @@ -7,7 +7,6 @@ thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (in file) that typechecks over local term (in namespace) that doesn't. ``` unison @@ -28,7 +28,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,6 +39,7 @@ bad.foo = "bar" bad.foo : Text ``` + ``` ucm scratch/main> add @@ -48,13 +48,13 @@ scratch/main> add bad.foo : Text ``` + ``` unison good.foo = 17 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +67,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (in file) that typechecks over local term (shadowing namespace) that doesn't. ``` unison @@ -74,7 +75,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -86,6 +86,7 @@ bad.foo = "bar" bad.foo : Text ``` + ``` ucm scratch/main> add @@ -94,6 +95,7 @@ scratch/main> add bad.foo : Text ``` + ``` unison good.foo = 17 bad.foo = "baz" @@ -101,7 +103,6 @@ thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -119,6 +120,7 @@ thing = foo Nat.+ foo bad.foo : Text ``` + TDNR selects local term (in namespace) that typechecks over local term (in file) that doesn't. ``` unison @@ -126,7 +128,6 @@ good.foo = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -138,6 +139,7 @@ good.foo = 17 good.foo : Nat ``` + ``` ucm scratch/main> add @@ -146,13 +148,13 @@ scratch/main> add good.foo : Nat ``` + ``` unison bad.foo = "bar" thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -165,6 +167,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (in namespace) that typechecks over local term (in namespace) that doesn't. ``` unison @@ -173,7 +176,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -186,6 +188,7 @@ bad.foo = "bar" good.foo : Nat ``` + ``` ucm scratch/main> add @@ -195,12 +198,12 @@ scratch/main> add good.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -212,6 +215,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (in namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` unison @@ -220,7 +224,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -233,6 +236,7 @@ bad.foo = "bar" good.foo : Nat ``` + ``` ucm scratch/main> add @@ -242,13 +246,13 @@ scratch/main> add good.foo : Nat ``` + ``` unison bad.foo = "baz" thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -265,6 +269,7 @@ thing = foo Nat.+ foo bad.foo : Text ``` + TDNR selects local term (shadowing namespace) that typechecks over local term (in file) that doesn't. ``` unison @@ -272,7 +277,6 @@ good.foo = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -284,6 +288,7 @@ good.foo = 17 good.foo : Nat ``` + ``` ucm scratch/main> add @@ -292,6 +297,7 @@ scratch/main> add good.foo : Nat ``` + ``` unison good.foo = 18 bad.foo = "bar" @@ -299,7 +305,6 @@ thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -317,6 +322,7 @@ thing = foo Nat.+ foo good.foo : Nat ``` + TDNR selects local term (shadowing namespace) that typechecks over local term (in namespace) that doesn't. ``` unison @@ -325,7 +331,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -338,6 +343,7 @@ bad.foo = "bar" good.foo : Nat ``` + ``` ucm scratch/main> add @@ -347,13 +353,13 @@ scratch/main> add good.foo : Nat ``` + ``` unison good.foo = 18 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -370,6 +376,7 @@ thing = foo Nat.+ foo good.foo : Nat ``` + TDNR selects local term (shadowing namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` unison @@ -378,7 +385,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -391,6 +397,7 @@ bad.foo = "bar" good.foo : Nat ``` + ``` ucm scratch/main> add @@ -400,6 +407,7 @@ scratch/main> add good.foo : Nat ``` + ``` unison good.foo = 18 bad.foo = "baz" @@ -407,7 +415,6 @@ thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -425,6 +432,7 @@ thing = foo Nat.+ foo good.foo : Nat ``` + \=== start local over direct dep TDNR selects local term (in file) that typechecks over direct dependency that doesn't. @@ -434,7 +442,6 @@ lib.bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -446,6 +453,7 @@ lib.bad.foo = "bar" lib.bad.foo : Text ``` + ``` ucm scratch/main> add @@ -454,13 +462,13 @@ scratch/main> add lib.bad.foo : Text ``` + ``` unison good.foo = 17 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -473,6 +481,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (in namespace) that typechecks over direct dependency that doesn't. ``` unison @@ -481,7 +490,6 @@ lib.bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -494,6 +502,7 @@ lib.bad.foo = "bar" lib.bad.foo : Text ``` + ``` ucm scratch/main> add @@ -503,12 +512,12 @@ scratch/main> add lib.bad.foo : Text ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -520,6 +529,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects local term (shadowing namespace) that typechecks over direct dependency that doesn't. ``` unison @@ -528,7 +538,6 @@ lib.bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -541,6 +550,7 @@ lib.bad.foo = "bar" lib.bad.foo : Text ``` + ``` ucm scratch/main> add @@ -550,13 +560,13 @@ scratch/main> add lib.bad.foo : Text ``` + ``` unison good.foo = 18 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -573,6 +583,7 @@ thing = foo Nat.+ foo good.foo : Nat ``` + TDNR not used to select local term (in file) that typechecks over indirect dependency that also typechecks. ``` unison @@ -580,7 +591,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -592,6 +602,7 @@ lib.dep.lib.dep.foo = 217 lib.dep.lib.dep.foo : Nat ``` + ``` ucm scratch/main> add @@ -600,13 +611,13 @@ scratch/main> add lib.dep.lib.dep.foo : Nat ``` + ``` unison good.foo = 17 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -619,6 +630,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR not used to select local term (in namespace) that typechecks over indirect dependency that also typechecks. ``` unison @@ -627,7 +639,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -640,6 +651,7 @@ lib.dep.lib.dep.foo = 217 lib.dep.lib.dep.foo : Nat ``` + ``` ucm scratch/main> add @@ -649,12 +661,12 @@ scratch/main> add lib.dep.lib.dep.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -666,6 +678,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR not used to select local term (shadowing namespace) that typechecks over indirect dependency that also typechecks. ``` unison @@ -674,7 +687,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -687,6 +699,7 @@ lib.dep.lib.dep.foo = 217 lib.dep.lib.dep.foo : Nat ``` + ``` ucm scratch/main> add @@ -696,13 +709,13 @@ scratch/main> add lib.dep.lib.dep.foo : Nat ``` + ``` unison good.foo = 18 thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -719,6 +732,7 @@ thing = foo Nat.+ foo good.foo : Nat ``` + TDNR selects direct dependency that typechecks over local term (in file) that doesn't. ``` unison @@ -726,7 +740,6 @@ lib.good.foo = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -738,6 +751,7 @@ lib.good.foo = 17 lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -746,13 +760,13 @@ scratch/main> add lib.good.foo : Nat ``` + ``` unison bad.foo = "bar" thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -765,6 +779,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects direct dependency that typechecks over local term (in namespace) that doesn't. ``` unison @@ -773,7 +788,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -786,6 +800,7 @@ bad.foo = "bar" lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -795,12 +810,12 @@ scratch/main> add lib.good.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -812,6 +827,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects direct dependency that typechecks over local term (shadowing namespace) that doesn't. ``` unison @@ -820,7 +836,6 @@ bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -833,6 +848,7 @@ bad.foo = "bar" lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -842,13 +858,13 @@ scratch/main> add lib.good.foo : Nat ``` + ``` unison bad.foo = "baz" thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -865,6 +881,7 @@ thing = foo Nat.+ foo bad.foo : Text ``` + TDNR selects direct dependency that typechecks over direct dependency that doesn't. ``` unison @@ -873,7 +890,6 @@ lib.bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -886,6 +902,7 @@ lib.bad.foo = "bar" lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -895,12 +912,12 @@ scratch/main> add lib.good.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -912,6 +929,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR not used to select direct dependency that typechecks over indirect dependency that also typechecks. ``` unison @@ -920,7 +938,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -933,6 +950,7 @@ lib.dep.lib.dep.foo = 217 lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -942,12 +960,12 @@ scratch/main> add lib.good.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -959,6 +977,7 @@ thing = foo Nat.+ foo thing : Nat ``` + TDNR selects indirect dependency that typechecks over indirect dependency that doesn't. ``` unison @@ -967,7 +986,6 @@ lib.dep.lib.bad.foo = "bar" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -980,6 +998,7 @@ lib.dep.lib.bad.foo = "bar" lib.dep.lib.good.foo : Nat ``` + ``` ucm scratch/main> add @@ -989,12 +1008,12 @@ scratch/main> add lib.dep.lib.good.foo : Nat ``` + ``` unison thing = foo Nat.+ foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index f603bc3f1b..486b3861fe 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -11,7 +11,6 @@ foo.test2 = [Ok "test2"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ foo.test2 = [Ok "test2"] test1 : [Result] ``` + ``` ucm scratch/main> test @@ -47,6 +47,7 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + Tests should be cached if unchanged. ``` ucm @@ -62,6 +63,7 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + `test` won't descend into the `lib` namespace, but `test.all` will. ``` unison @@ -70,7 +72,6 @@ lib.dep.testInLib = [Ok "testInLib"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,6 +83,7 @@ lib.dep.testInLib = [Ok "testInLib"] lib.dep.testInLib : [Result] ``` + ``` ucm scratch/main> test @@ -119,6 +121,7 @@ scratch/main> test.all Tip: Use view 1 to view the source of a test. ``` + `test` WILL run tests within `lib` if specified explicitly. ``` ucm @@ -133,6 +136,7 @@ scratch/main> test lib.dep Tip: Use view 1 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. ``` ucm diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index b023a3d062..5e5e1164e7 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -32,7 +32,6 @@ lit2 = """" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -85,6 +84,7 @@ lit2 = """" "This is a raw text literal, indented.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThis doesn't terminate the literal - \"\"\"" ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md index 4a100f543c..6915cac7c3 100644 --- a/unison-src/transcripts/textfind.output.md +++ b/unison-src/transcripts/textfind.output.md @@ -15,6 +15,7 @@ scratch/main> help grep Use `text.find.all` to include search of `lib`. ``` + ``` ucm scratch/main> help text.find.all @@ -28,6 +29,7 @@ scratch/main> help text.find.all Use `text.find` to exclude `lib` from search. ``` + Here's an example: ``` unison @@ -48,7 +50,6 @@ lib.bar = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +66,7 @@ lib.bar = 3 qux : Nat ``` + ``` ucm scratch/main> grep hi @@ -136,6 +138,7 @@ scratch/main> view 1 _ -> 0 ``` + ``` ucm scratch/main> grep quaffle @@ -188,6 +191,7 @@ scratch/main> view 1 _ -> 0 ``` + Now some failed searches: ``` ucm @@ -198,6 +202,7 @@ scratch/main> grep lsdkfjlskdjfsd Tip: `text.find.all` will search `lib` as well. ``` + Notice it gives the tip about `text.find.all`. But not here: ``` ucm diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md index 932353888f..314a35a933 100644 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ b/unison-src/transcripts/todo-bug-builtins.output.md @@ -7,7 +7,6 @@ ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -29,12 +28,12 @@ #qe5e1lcfn8 ``` + ``` unison > bug "there's a bug in my code" ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -56,6 +55,7 @@ #m67hcdcoda ``` + ## Todo `todo` is useful if you want to come back to a piece of code later but you want your project to compile. @@ -65,7 +65,6 @@ complicatedMathStuff x = todo "Come back and to something with x here" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,6 +76,7 @@ complicatedMathStuff x = todo "Come back and to something with x here" complicatedMathStuff : x -> r ``` + ## Bug `bug` is used to indicate that a particular branch is not expected to execute. @@ -88,7 +88,6 @@ test = match true with ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index 9b4ba914ba..436e543b65 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -8,6 +8,7 @@ scratch/main> todo You have no pending todo items. Good work! ✅ ``` + # Dependents of `todo` The `todo` command shows local (outside `lib`) terms that directly call `todo`. @@ -21,7 +22,6 @@ bar = foo + foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +34,7 @@ bar = foo + foo foo : Nat ``` + ``` ucm scratch/main> add @@ -49,6 +50,7 @@ scratch/main> todo 1. foo ``` + # Direct dependencies without names The `todo` command shows hashes of direct dependencies of local (outside `lib`) definitions that don't have names in @@ -60,7 +62,6 @@ baz = foo.bar + foo.bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -73,6 +74,7 @@ baz = foo.bar + foo.bar foo.bar : Nat ``` + ``` ucm scratch/main> add @@ -100,6 +102,7 @@ scratch/main> todo 1. #1jujb8oelv ``` + # Conflicted names The `todo` command shows conflicted names. @@ -110,7 +113,6 @@ bar = 17 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -123,6 +125,7 @@ bar = 17 foo : Nat ``` + ``` ucm scratch/main> add @@ -148,6 +151,7 @@ scratch/main> todo conflicts. ``` + # Definitions in lib The `todo` command complains about terms and types directly in `lib`. @@ -157,7 +161,6 @@ lib.foo = 16 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,6 +172,7 @@ lib.foo = 16 lib.foo : Nat ``` + ``` ucm scratch/main> add @@ -183,6 +187,7 @@ scratch/main> todo representing library dependencies. Please move or remove it. ``` + # Constructor aliases The `todo` command complains about constructor aliases. @@ -192,7 +197,6 @@ type Foo = One ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -204,6 +208,7 @@ type Foo = One type Foo ``` + ``` ucm scratch/main> add @@ -225,6 +230,7 @@ scratch/main> todo Please delete all but one name for each constructor. ``` + # Missing constructor names The `todo` command complains about missing constructor names. @@ -234,7 +240,6 @@ type Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -246,6 +251,7 @@ type Foo = Bar type Foo ``` + ``` ucm scratch/main> add @@ -268,6 +274,7 @@ scratch/main> todo to each unnamed constructor. ``` + # Nested decl aliases The `todo` command complains about nested decl aliases. @@ -278,7 +285,6 @@ structural type Foo.inner.Bar a = Uno a | Dos a a ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -291,6 +297,7 @@ structural type Foo.inner.Bar a = Uno a | Dos a a structural type Foo.inner.Bar a ``` + ``` ucm scratch/main> add @@ -308,6 +315,7 @@ scratch/main> todo 2. Foo.inner.Bar ``` + # Stray constructors The `todo` command complains about stray constructors. @@ -317,7 +325,6 @@ type Foo = Bar ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -329,6 +336,7 @@ type Foo = Bar type Foo ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index ded6bdda0e..7835d5fdce 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -12,6 +12,7 @@ scratch/main> view Exception Failure = Failure Type Text Any ``` + Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: ``` unison @@ -25,7 +26,6 @@ mytest _ = [Ok "Great"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,6 +38,7 @@ mytest _ = [Ok "Great"] mytest : '{IO, Exception} [Result] ``` + ``` ucm scratch/main> run main @@ -61,6 +62,7 @@ scratch/main> io.test mytest Tip: Use view 1 to view the source of a test. ``` + Now a test to show the handling of uncaught exceptions: ``` unison @@ -74,7 +76,6 @@ unique type RuntimeError = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -88,6 +89,7 @@ unique type RuntimeError = main2 : '{Exception} r ``` + ``` ucm scratch/main> run main2 diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md index af7d730d15..25053bb364 100644 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ b/unison-src/transcripts/transcript-parser-commands.output.md @@ -7,7 +7,6 @@ x = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ x = 1 x : Nat ``` + ``` ucm scratch/main> add @@ -27,6 +27,7 @@ scratch/main> add x : Nat ``` + ``` unison --- title: :scratch.u @@ -44,6 +45,7 @@ scratch/main> delete foo foo ``` + ``` ucm scratch/main> delete lineToken.call @@ -53,6 +55,7 @@ scratch/main> delete lineToken.call lineToken.call ``` + However handling of blocks of other languages should be supported. ``` python @@ -66,4 +69,3 @@ some C++ code ``` c9search some cloud9 code ``` - diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index 837d683a48..890f765758 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -16,7 +16,6 @@ structural type Y = Y Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ structural type Y = Y Nat (The old definition is also named builtin.Unit.) ``` + Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. ``` ucm diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md index 6cd6812daa..8632e2433c 100644 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -13,7 +13,6 @@ structural ability MyAbilityS where const : a ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/undo.output.md b/unison-src/transcripts/undo.output.md index 32933a2fb9..054d2a6f94 100644 --- a/unison-src/transcripts/undo.output.md +++ b/unison-src/transcripts/undo.output.md @@ -84,6 +84,7 @@ scratch/main> history □ 2. #ms9lggs2rg (start of history) ``` + ----- It should not be affected by changes on other branches. @@ -179,6 +180,7 @@ scratch/branch1> history □ 2. #ms9lggs2rg (start of history) ``` + ----- Undo should be a no-op on a newly created branch diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index 661b0b65dd..bcf46b0480 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -9,7 +9,6 @@ unique type C = C B ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ unique type C = C B type C ``` + ``` ucm scratch/main> add @@ -33,6 +33,7 @@ scratch/main> add type C ``` + ``` unison unique type A = A @@ -41,13 +42,13 @@ unique type C = C B ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. ``` + If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ``` ucm @@ -62,12 +63,12 @@ scratch/main> names A Names: A.A ``` + ``` unison unique type A = A () ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -80,6 +81,7 @@ unique type A = A () type A ``` + ``` ucm scratch/main> update @@ -99,12 +101,12 @@ scratch/main> names A Names: A.A ``` + ``` unison unique type A = A ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -117,6 +119,7 @@ unique type A = A type A ``` + Note that `A` is back to its original hash. ``` ucm diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 0a4833afee..b1b0b42cc2 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -3,7 +3,6 @@ ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ `()`.foo : ##Text ``` + ``` ucm scratch/main> add diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index 5b8913fffa..da469556c2 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -11,7 +11,6 @@ threadEyeDeez _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,6 +23,7 @@ threadEyeDeez _ = threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) ``` + ``` ucm scratch/main> add @@ -37,6 +37,7 @@ scratch/main> run threadEyeDeez (false, true) ``` + ``` unison > typeLink A == typeLink A > typeLink Text == typeLink Text @@ -45,7 +46,6 @@ scratch/main> run threadEyeDeez ``` ``` ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index 20380cb69f..cf4f74665a 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -12,7 +12,6 @@ main _ = ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +25,7 @@ main _ = main : '{IO, Exception} [Result] ``` + ``` ucm scratch/main> find unsafe.coerceAbilities diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index a91ca27840..eef9da9e73 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -8,7 +8,6 @@ lib.foo = 100 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ lib.foo = 100 lib.foo : Nat ``` + ``` ucm scratch/main> add @@ -30,12 +30,12 @@ scratch/main> add lib.foo : Nat ``` + ``` unison foo = 200 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,6 +49,7 @@ foo = 200 (The old definition is also named lib.foo.) ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 9beda9810c..4e6e269f2d 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -8,7 +8,6 @@ temp = 2 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ temp = 2 x : Nat ``` + ``` ucm scratch/main> add @@ -38,12 +38,12 @@ scratch/main> delete.term temp Done. ``` + ``` unison x = 3 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +56,7 @@ x = 3 x : Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md index dc4a224265..96cc361f9c 100644 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ b/unison-src/transcripts/update-suffixifies-properly.output.md @@ -8,7 +8,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ bar = a.x.x.x.x + c.y.y.y.y foo : Nat ``` + ``` ucm myproject/main> add @@ -38,12 +38,12 @@ myproject/main> add foo : Nat ``` + ``` unison foo = +30 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +56,7 @@ foo = +30 foo : Int ``` + ``` ucm myproject/main> update @@ -69,6 +70,7 @@ myproject/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u foo = +30 @@ -91,4 +93,3 @@ d.y.y.y.y = foo + 10 ``` - 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 5b0e7bf65d..75e422593c 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 @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 @@ -13,7 +14,6 @@ bar = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ bar = 5 foo : Nat ``` + ``` ucm scratch/main> add @@ -35,6 +36,7 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Nat foo = 6 @@ -44,7 +46,6 @@ bar = 7 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +61,7 @@ bar = 7 (The old definition is also named bar.) ``` + ``` ucm scratch/main> update 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 c1f65aacac..ad78aa32fd 100644 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ b/unison-src/transcripts/update-term-to-different-type.output.md @@ -4,13 +4,13 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +22,7 @@ foo = 5 foo : Nat ``` + ``` ucm scratch/main> add @@ -30,13 +31,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Int foo = +5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,6 +50,7 @@ foo = +5 foo : Int ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index b0fbeab2ae..b8e08459f4 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 @@ -13,7 +14,6 @@ bar = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ bar = 5 foo : Nat ``` + ``` ucm scratch/main> add @@ -35,13 +36,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Nat foo = 6 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -55,6 +56,7 @@ foo = 6 (The old definition is also named bar.) ``` + ``` ucm 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 e7e3543a60..41327d43ba 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 @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 @@ -13,7 +14,6 @@ bar = foo + 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ bar = foo + 10 foo : Nat ``` + ``` ucm scratch/main> add @@ -35,13 +36,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Int foo = +5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,6 +55,7 @@ foo = +5 foo : Int ``` + ``` ucm scratch/main> update @@ -67,6 +69,7 @@ scratch/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u foo : Int foo = +5 @@ -80,4 +83,3 @@ bar = foo + 10 ``` - diff --git a/unison-src/transcripts/update-term-with-dependent.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index 42ae8158f5..10024a9d3c 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -4,6 +4,7 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 @@ -13,7 +14,6 @@ bar = foo + 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,6 +26,7 @@ bar = foo + 10 foo : Nat ``` + ``` ucm scratch/main> add @@ -35,13 +36,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Nat foo = 6 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,6 +55,7 @@ foo = 6 foo : Nat ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index 54abb8e06a..d96c9e3c75 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -4,13 +4,13 @@ scratch/main> builtins.merge Done. ``` + ``` unison foo : Nat foo = 5 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +22,7 @@ foo = 5 foo : Nat ``` + ``` ucm scratch/main> add @@ -30,13 +31,13 @@ scratch/main> add foo : Nat ``` + ``` unison foo : Nat foo = 6 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,6 +50,7 @@ foo = 6 foo : Nat ``` + ``` ucm scratch/main> update 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 5275b97eb3..5b308c7d48 100644 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ b/unison-src/transcripts/update-test-to-non-test.output.md @@ -4,12 +4,12 @@ scratch/main> builtins.merge Done. ``` + ``` unison test> foo = [] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +27,7 @@ test> foo = [] ``` + After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ``` ucm @@ -42,12 +43,12 @@ scratch/main> view foo foo = [] ``` + ``` unison foo = 1 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +61,7 @@ foo = 1 foo : Nat ``` + After updating `foo` to not be a test, we expect `view` to not render it like a test. ``` ucm diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index 18810ecfbf..1d7a1bd7ed 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -17,6 +17,7 @@ scratch/main> add mynamespace.foo.test : [Result] ``` + if we change the type of the dependency, the test should show in the scratch file as a test watch. ``` unison @@ -24,7 +25,6 @@ foo n = "hello, world!" ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,6 +37,7 @@ foo n = "hello, world!" foo : n -> Text ``` + ``` ucm scratch/main> update @@ -50,6 +51,7 @@ scratch/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u foo n = "hello, world!" @@ -61,4 +63,3 @@ test> mynamespace.foo.test = if foo n == 2 then [Ok "passed"] else [Fail "wat"] ``` - diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index c87b1b7cd8..c0e6a4c38b 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -4,7 +4,6 @@ unique type Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -16,6 +15,7 @@ unique type Foo type Foo ``` + ``` ucm scratch/main> add @@ -24,6 +24,7 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = Bar Nat @@ -31,7 +32,6 @@ unique type Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +44,7 @@ unique type Foo type Foo ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 6741c27a09..78f3d63c07 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -3,7 +3,6 @@ unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Bar Nat type Foo ``` + ``` ucm scratch/main> add @@ -23,12 +23,12 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,6 +41,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm scratch/main> update 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 a96ce90c24..c17c2fd579 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -3,7 +3,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,6 +17,7 @@ unique type Foo = { bar : Nat } Foo.bar.set : Nat -> Foo -> Foo ``` + ``` ucm scratch/main> update 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 23365f09b7..ad48e9e36c 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -3,7 +3,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,6 +17,7 @@ unique type Foo = { bar : Nat } Foo.bar.set : Nat -> Foo -> Foo ``` + ``` ucm scratch/main> add @@ -29,12 +29,12 @@ scratch/main> add Foo.bar.set : Nat -> Foo -> Foo ``` + ``` unison unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +56,7 @@ unique type Foo = { bar : Nat, baz : Int } Foo.bar.set : Nat -> Foo -> Foo ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 5dfa27c938..fc7e6638d4 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -3,7 +3,6 @@ unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Bar Nat type Foo ``` + ``` ucm scratch/main> add @@ -27,12 +27,12 @@ scratch/main> alias.term Foo.Bar Foo.BarAlias Done. ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,6 +45,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm 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 f21cf56c79..bab8345237 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 @@ -10,7 +10,6 @@ foo = cases ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,6 +22,7 @@ foo = cases foo : Foo -> Nat ``` + ``` ucm scratch/main> add @@ -32,13 +32,13 @@ scratch/main> add foo : Foo -> Nat ``` + ``` unison unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +51,7 @@ unique type Foo type Foo ``` + ``` ucm scratch/main> update @@ -64,6 +65,7 @@ scratch/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u type Foo = Bar Nat @@ -76,4 +78,3 @@ foo = cases Baz n m -> n Nat.+ m ``` - diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index 31afdb7d41..c849cd5c54 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -5,7 +5,6 @@ unique type Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ unique type Foo type Foo ``` + ``` ucm scratch/main> add @@ -25,13 +25,13 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +44,7 @@ unique type Foo type Foo ``` + ``` ucm scratch/main> update 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 d83f9a1836..caf0f57ec6 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -3,7 +3,6 @@ unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ unique type Foo = { bar : Nat, baz : Int } Foo.baz.set : Int -> Foo -> Foo ``` + ``` ucm scratch/main> add @@ -35,12 +35,12 @@ scratch/main> add Foo.baz.set : Int -> Foo -> Foo ``` + ``` unison unique type Foo = { bar : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +56,7 @@ unique type Foo = { bar : Nat } Foo.bar.set : Nat -> Foo -> Foo ``` + We want the field accessors to go away; but for now they are here, causing the update to fail. ``` ucm @@ -103,6 +104,7 @@ scratch/main> find.verbose ``` + ``` unison :added-by-ucm scratch.u type Foo = { bar : Nat } @@ -119,4 +121,3 @@ Foo.baz.set : Int -> Foo -> Foo Foo.baz.set baz1 = cases Foo bar _ -> Foo bar baz1 ``` - diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index bd92140cdd..8fac7293b5 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -3,7 +3,6 @@ unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Bar Nat type Foo ``` + ``` ucm scratch/main> add @@ -27,6 +27,7 @@ scratch/main> delete.term Foo.Bar Done. ``` + Now we've set up a situation where the original constructor missing. ``` unison @@ -34,7 +35,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,6 +47,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm scratch/main> view Foo 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 96325c6404..065f8d61e1 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -6,7 +6,6 @@ structural type A = B.TheOtherAlias Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,6 +19,7 @@ structural type A = B.TheOtherAlias Foo type Foo ``` + ``` ucm scratch/main> add @@ -30,12 +30,12 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,6 +48,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm 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 763a1aba59..378ba50337 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -3,7 +3,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,6 +17,7 @@ unique type Foo = { bar : Nat } Foo.bar.set : Nat -> Foo -> Foo ``` + ``` ucm scratch/main> add @@ -29,6 +29,7 @@ scratch/main> add Foo.bar.set : Nat -> Foo -> Foo ``` + Bug: this no-op update should (of course) succeed. ``` ucm 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 78574abe55..e3f6f1ac7c 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -3,7 +3,6 @@ unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Bar Nat type Foo ``` + ``` ucm scratch/main> add @@ -27,12 +27,12 @@ scratch/main> alias.term Foo.Bar Stray.BarAlias Done. ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,6 +45,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm 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 f188fb9252..aa55378205 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -3,7 +3,6 @@ unique type Foo = Bar Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Bar Nat type Foo ``` + ``` ucm scratch/main> add @@ -27,6 +27,7 @@ scratch/main> move.term Foo.Bar Stray.Bar Done. ``` + Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. ``` unison @@ -34,7 +35,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,6 +47,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + 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 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 b6daa83021..f1d4c00556 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 @@ -6,7 +6,6 @@ makeFoo n = Bar (n+10) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ makeFoo n = Bar (n+10) makeFoo : Nat -> Foo ``` + ``` ucm scratch/main> add @@ -28,6 +28,7 @@ scratch/main> add makeFoo : Nat -> Foo ``` + ``` unison unique type Foo = internal.Bar Nat @@ -36,7 +37,6 @@ Foo.Bar n = internal.Bar n ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,6 +50,7 @@ Foo.Bar n = internal.Bar n Foo.Bar : Nat -> Foo ``` + ``` ucm scratch/main> update 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 edeb85642e..907ad1097e 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 @@ -3,7 +3,6 @@ unique type Foo = Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +14,7 @@ unique type Foo = Nat type Foo ``` + ``` ucm scratch/main> add @@ -23,12 +23,12 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = { bar : Nat } ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,6 +47,7 @@ unique type Foo = { bar : Nat } type Foo ``` + ``` ucm 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 3d11abb406..29154808b5 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -6,7 +6,6 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ incrFoo = cases Bar n -> Bar (n+1) incrFoo : Foo -> Foo ``` + ``` ucm scratch/main> add @@ -28,12 +28,12 @@ scratch/main> add incrFoo : Foo -> Foo ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,6 +46,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm scratch/main> update @@ -59,6 +60,7 @@ scratch/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u type Foo = Bar Nat Nat @@ -69,4 +71,3 @@ incrFoo : Foo -> Foo incrFoo = cases Bar n -> Bar (n Nat.+ 1) ``` - 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 496486a7cf..2fa947fbdb 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 @@ -4,7 +4,6 @@ unique type Baz = Qux Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ unique type Baz = Qux Foo type Foo ``` + ``` ucm scratch/main> add @@ -26,12 +26,12 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo a = Bar Nat a ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +44,7 @@ unique type Foo a = Bar Nat a type Foo a ``` + ``` ucm scratch/main> update @@ -57,6 +58,7 @@ scratch/main> update `update` again. ``` + ``` unison :added-by-ucm scratch.u type Foo a = Bar Nat a @@ -66,4 +68,3 @@ type Foo a = Bar Nat a type Baz = Qux Foo ``` - 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 6effd150c3..50a8a73d3c 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -4,7 +4,6 @@ unique type Baz = Qux Foo ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,6 +16,7 @@ unique type Baz = Qux Foo type Foo ``` + ``` ucm scratch/main> add @@ -26,12 +26,12 @@ scratch/main> add type Foo ``` + ``` unison unique type Foo = Bar Nat Nat ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,6 +44,7 @@ unique type Foo = Bar Nat Nat type Foo ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index feb53dc173..ad222483f8 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -3,7 +3,6 @@ ``` ``` ucm - Loading changes detected in scratch.u. ✅ @@ -18,6 +17,7 @@ 1 ``` + ``` ucm scratch/main> update diff --git a/unison-src/transcripts/upgrade-happy-path.output.md b/unison-src/transcripts/upgrade-happy-path.output.md index 127b0c4897..baf8c9fe7e 100644 --- a/unison-src/transcripts/upgrade-happy-path.output.md +++ b/unison-src/transcripts/upgrade-happy-path.output.md @@ -5,7 +5,6 @@ thingy = lib.old.foo + 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ thingy = lib.old.foo + 10 thingy : Nat ``` + ``` ucm proj/main> add @@ -29,6 +29,7 @@ proj/main> add thingy : Nat ``` + Test tab completion and fzf options of upgrade command. ``` ucm @@ -51,6 +52,7 @@ proj/main> debug.fuzzy-options upgrade old _ * old ``` + ``` ucm proj/main> upgrade old new diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md index 47ff7af09a..cd34d7604f 100644 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ b/unison-src/transcripts/upgrade-sad-path.output.md @@ -5,7 +5,6 @@ thingy = lib.old.foo + 10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,6 +18,7 @@ thingy = lib.old.foo + 10 thingy : Nat ``` + ``` ucm proj/main> add @@ -29,6 +29,7 @@ proj/main> add thingy : Nat ``` + ``` ucm proj/main> upgrade old new @@ -49,6 +50,7 @@ proj/main> upgrade old new to delete the temporary branch and switch back to main. ``` + ``` unison :added-by-ucm scratch.u thingy : Nat thingy = @@ -63,7 +65,6 @@ thingy = foo + +10 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -76,6 +77,7 @@ thingy = foo + +10 thingy : Int ``` + ``` ucm proj/upgrade-old-to-new> update diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md index 5046ea5166..80d483e483 100644 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ b/unison-src/transcripts/upgrade-suffixifies-properly.output.md @@ -9,7 +9,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,6 +26,7 @@ bar = a.x.x.x.x + c.y.y.y.y lib.old.foo : Nat ``` + ``` ucm myproject/main> add @@ -41,6 +41,7 @@ myproject/main> add lib.old.foo : Nat ``` + ``` ucm myproject/main> upgrade old new @@ -61,6 +62,7 @@ myproject/main> upgrade old new to delete the temporary branch and switch back to main. ``` + ``` unison :added-by-ucm scratch.u bar : Nat bar = @@ -77,4 +79,3 @@ d.y.y.y.y = use Nat + foo + 10 ``` - diff --git a/unison-src/transcripts/upgrade-with-old-alias.output.md b/unison-src/transcripts/upgrade-with-old-alias.output.md index 9afef6c22b..3b4dea9bae 100644 --- a/unison-src/transcripts/upgrade-with-old-alias.output.md +++ b/unison-src/transcripts/upgrade-with-old-alias.output.md @@ -6,7 +6,6 @@ mything = lib.old.foo + 100 ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +20,7 @@ mything = lib.old.foo + 100 mything : Nat ``` + ``` ucm myproject/main> update diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index 336a8c932e..273d846f1e 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -22,6 +22,7 @@ scratch/main> view .b.thing .b.thing = "b" ``` + TODO: swap this back to a 'ucm' block when view.global is re-implemented ``` @@ -30,4 +31,3 @@ scratch/other> view.global thing -- Should support branch relative paths scratch/other> view /main:a.thing ``` - diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 096f08e7a3..7472367008 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -4,12 +4,12 @@ scratch/main> builtins.mergeio Done. ``` + ``` unison test> pass = [Ok "Passed"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +28,7 @@ test> pass = [Ok "Passed"] ✅ Passed Passed ``` + ``` ucm scratch/main> add @@ -36,12 +37,12 @@ scratch/main> add pass : [Result] ``` + ``` unison test> pass = [Ok "Passed"] ``` ``` ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -55,6 +56,7 @@ test> pass = [Ok "Passed"] ✅ Passed Passed (cached) ``` + ``` ucm scratch/main> add @@ -71,13 +73,13 @@ scratch/main> test Tip: Use view 1 to view the source of a test. ``` + ``` unison > ImmutableArray.fromList [?a, ?b, ?c] > ImmutableByteArray.fromBytes 0xs123456 ``` ``` ucm - Loading changes detected in scratch.u. ✅ From 0735fb3c668894f3790ed783809fa611eb4cb559 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 1 Oct 2024 16:57:48 -0600 Subject: [PATCH 02/15] Replace recursive `awaitInput` with `Cli.Continue` --- .../src/Unison/Codebase/Transcript/Runner.hs | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index 61a73e2b68..dee6e36b52 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -215,13 +215,13 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL -- NB: This uses a `CMarkCodeBlock` instead of `Unison`, because `Unison` doesn’t yet support the -- `:added-by-ucm` token. This should change with #5199. Q.undequeue inputQueue (Left $ CMarkCodeBlock Nothing ("unison :added-by-ucm " <> fp) contents, Nothing) - awaitInput + Cli.returnEarlyWithoutOutput processUcmLine p = case p of UcmComment {} -> do liftIO . outputUcm $ Transcript.formatUcmLine p - awaitInput + Cli.returnEarlyWithoutOutput UcmCommand context lineTxt -> do curPath <- Cli.getCurrentProjectPath -- We're either going to run the command now (because we're in the right context), else we'll switch to @@ -256,7 +256,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL pure $ Right switchCommand Nothing -> do case words . Text.unpack $ lineTxt of - [] -> awaitInput + [] -> Cli.returnEarlyWithoutOutput args -> do liftIO . outputUcm $ Transcript.formatUcmLine p <> "\n" numberedArgs <- use #numberedArgs @@ -271,11 +271,11 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO (readIORef allowErrors) >>= \case True -> do liftIO . outputUcm . Text.pack $ Pretty.toPlain terminalWidth msg - awaitInput + Cli.returnEarlyWithoutOutput False -> liftIO . dieWithMsg $ Pretty.toPlain terminalWidth msg ) -- No input received from this line, try again. - (maybe awaitInput $ pure . Right . snd) + (maybe Cli.returnEarlyWithoutOutput $ pure . Right . snd) startProcessedBlock block = case block of Unison hide errOk filename txt -> do @@ -287,21 +287,20 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL atomically . Q.enqueue cmdQueue $ Nothing let sourceName = fromMaybe "scratch.u" filename liftIO $ updateVirtualFile sourceName txt - pure $ Left (UnisonFileChanged sourceName txt) + pure . Left $ UnisonFileChanged sourceName txt API apiRequests -> do - liftIO $ do - contents <- traverse apiRequest apiRequests + liftIO $ -- NB: This uses a `CMarkCodeBlock` instead of `API`, because `API` can’t yet contain API responses. This -- should change with #5199. - output . Left . CMarkCodeBlock Nothing "api" . Text.unlines $ fold contents - awaitInput + output . Left . CMarkCodeBlock Nothing "api" . Text.unlines . fold =<< traverse apiRequest apiRequests + Cli.returnEarlyWithoutOutput Ucm hide errOk cmds -> do liftIO (writeIORef hidden hide) liftIO (writeIORef allowErrors errOk) liftIO (writeIORef hasErrors False) traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds atomically . Q.enqueue cmdQueue $ Nothing - awaitInput + Cli.returnEarlyWithoutOutput showStatus alwaysShow indicator msg = unless (not alwaysShow && Verbosity.isSilent verbosity) do clearCurrentLine @@ -321,7 +320,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL either ( \node -> do liftIO . output $ Left node - awaitInput + Cli.returnEarlyWithoutOutput ) ( \block -> do liftIO . writeIORef mBlock $ pure block @@ -435,15 +434,12 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL let loop :: Cli.LoopState -> IO (Seq Stanza) loop s0 = do Cli.runCli env s0 awaitInput >>= \case - (Cli.Success input, s1) -> do - let next s = - loop case input of - Left _ -> s - Right inp -> s & #lastInput ?~ inp - Cli.runCli env s1 (HandleInput.loop input) >>= \case - (Cli.Success (), s2) -> next s2 - (Cli.Continue, s2) -> next s2 - (Cli.HaltRepl, _) -> onHalt + (Cli.Success input, s1) -> + let next s = loop $ either (const s) (\inp -> s & #lastInput ?~ inp) input + in Cli.runCli env s1 (HandleInput.loop input) >>= \case + (Cli.Success (), s2) -> next s2 + (Cli.Continue, s2) -> next s2 + (Cli.HaltRepl, _) -> onHalt (Cli.Continue, s1) -> loop s1 (Cli.HaltRepl, _) -> onHalt where From f41c78dc478427edf89e638bdd47ed5df0b56455 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 8 Oct 2024 22:43:46 -0600 Subject: [PATCH 03/15] Some transcript info tag improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This includes changes that get us closer to running transcript outputs as inputs - all `ProcessedBlock`s (`api`, `ucm`, and `unison`) now handle info tags the same way – previously `ucm` didn’t allow spaces between tags like `:hide :error`, and `api` didn’t support info tags at all. - preserve info tags in the output – `ucm :error` in the input results in `ucm :error` in the output - parser now supports `:added-by-unison` (only useful for parsing outputs as inputs) --- unison-cli/src/Unison/Codebase/Transcript.hs | 26 ++- .../src/Unison/Codebase/Transcript/Parser.hs | 74 +++++++-- .../src/Unison/Codebase/Transcript/Runner.hs | 124 +++++++++----- .../transcripts-manual/rewrites.output.md | 18 +- .../transcripts-round-trip/main.output.md | 4 +- .../transcripts-using-base/_base.output.md | 2 +- .../failure-tests.output.md | 4 +- .../transcripts-using-base/fix2297.output.md | 2 +- .../transcripts-using-base/fix5129.output.md | 4 +- .../transcripts-using-base/hashing.output.md | 2 +- .../transcripts-using-base/net.output.md | 2 +- .../test-watch-dependencies.output.md | 4 +- .../transcripts-using-base/tls.output.md | 2 +- ...ability-term-conflicts-on-update.output.md | 4 +- unison-src/transcripts/add-run.output.md | 6 +- .../add-test-watch-roundtrip.output.md | 2 +- unison-src/transcripts/alias-term.output.md | 2 +- unison-src/transcripts/alias-type.output.md | 2 +- .../transcripts/api-doc-rendering.output.md | 2 +- .../transcripts/api-getDefinition.output.md | 4 +- .../transcripts/api-summaries.output.md | 2 +- .../block-on-required-update.output.md | 2 +- unison-src/transcripts/blocks.output.md | 6 +- .../transcripts/branch-command.output.md | 4 +- unison-src/transcripts/builtins.output.md | 14 +- .../transcripts/debug-definitions.output.md | 2 +- unison-src/transcripts/deep-names.output.md | 2 +- ...elete-namespace-dependents-check.output.md | 2 +- .../transcripts/delete-namespace.output.md | 4 +- .../transcripts/delete-silent.output.md | 4 +- unison-src/transcripts/delete.output.md | 30 ++-- ...ependents-dependencies-debugfile.output.md | 2 +- .../transcripts/destructuring-binds.output.md | 4 +- .../transcripts/diff-namespace.output.md | 22 +-- .../doc-type-link-keywords.output.md | 2 +- unison-src/transcripts/doc2.output.md | 2 +- unison-src/transcripts/doc2markdown.output.md | 2 +- .../transcripts/duplicate-names.output.md | 8 +- .../duplicate-term-detection.output.md | 8 +- unison-src/transcripts/edit-command.output.md | 8 +- .../transcripts/empty-namespaces.output.md | 12 +- .../transcripts/emptyCodebase.output.md | 2 +- .../transcripts/error-messages.output.md | 42 ++--- .../errors/missing-result-typed.output.md | 2 +- .../errors/missing-result.output.md | 2 +- .../errors/ucm-hide-all-error.output.md | 2 +- .../transcripts/errors/ucm-hide-all.output.md | 2 +- .../errors/ucm-hide-error.output.md | 2 +- .../transcripts/errors/ucm-hide.output.md | 2 +- .../errors/unison-hide-all-error.output.md | 2 +- .../errors/unison-hide-all.output.md | 2 +- .../errors/unison-hide-error.output.md | 2 +- .../transcripts/errors/unison-hide.output.md | 2 +- unison-src/transcripts/find-by-type.output.md | 4 +- unison-src/transcripts/find-command.output.md | 4 +- .../fix-1381-excess-propagate.output.md | 6 +- .../fix-2258-if-as-list-element.output.md | 2 +- unison-src/transcripts/fix-5301.output.md | 4 +- unison-src/transcripts/fix-5320.output.md | 2 +- unison-src/transcripts/fix1532.output.md | 2 +- unison-src/transcripts/fix1696.output.md | 2 +- unison-src/transcripts/fix1731.output.md | 2 +- unison-src/transcripts/fix1800.output.md | 8 +- unison-src/transcripts/fix2027.output.md | 2 +- unison-src/transcripts/fix2238.output.md | 4 +- unison-src/transcripts/fix2254.output.md | 4 +- unison-src/transcripts/fix2354.output.md | 2 +- unison-src/transcripts/fix2355.output.md | 2 +- unison-src/transcripts/fix2628.output.md | 2 +- unison-src/transcripts/fix2822.output.md | 2 +- unison-src/transcripts/fix2840.output.md | 2 +- unison-src/transcripts/fix3037.output.md | 4 +- unison-src/transcripts/fix3424.output.md | 4 +- unison-src/transcripts/fix3977.output.md | 2 +- unison-src/transcripts/fix4172.output.md | 2 +- unison-src/transcripts/fix4397.output.md | 2 +- unison-src/transcripts/fix4424.output.md | 4 +- unison-src/transcripts/fix4482.output.md | 2 +- unison-src/transcripts/fix4731.output.md | 2 +- unison-src/transcripts/fix5080.output.md | 2 +- unison-src/transcripts/fix5349.output.md | 6 +- unison-src/transcripts/fix614.output.md | 4 +- unison-src/transcripts/fix693.output.md | 6 +- unison-src/transcripts/fix845.output.md | 2 +- unison-src/transcripts/formatter.output.md | 4 +- .../transcripts/fuzzy-options.output.md | 6 +- .../generic-parse-errors.output.md | 12 +- unison-src/transcripts/hello.output.md | 10 +- unison-src/transcripts/higher-rank.output.md | 2 +- .../transcripts/input-parse-errors.output.md | 6 +- .../transcripts/io-test-command.output.md | 2 +- unison-src/transcripts/io.output.md | 22 +-- .../transcripts/keyword-identifiers.output.md | 42 ++--- .../transcripts/kind-inference.output.md | 28 ++-- unison-src/transcripts/lambdacase.output.md | 2 +- .../transcripts/lsp-fold-ranges.output.md | 2 +- .../transcripts/lsp-name-completion.output.md | 2 +- unison-src/transcripts/merge.output.md | 154 +++++++++--------- unison-src/transcripts/move-all.output.md | 2 +- .../transcripts/move-namespace.output.md | 4 +- .../transcripts/name-resolution.output.md | 4 +- .../transcripts/name-segment-escape.output.md | 4 +- .../transcripts/name-selection.output.md | 4 +- .../namespace-dependencies.output.md | 2 +- .../pattern-match-coverage.output.md | 64 ++++---- unison-src/transcripts/pull-errors.output.md | 2 +- unison-src/transcripts/records.output.md | 12 +- .../release-draft-command.output.md | 2 +- unison-src/transcripts/reset.output.md | 6 +- .../transcripts/resolution-failures.output.md | 4 +- unison-src/transcripts/suffixes.output.md | 4 +- .../transcripts/switch-command.output.md | 8 +- .../transcripts/tab-completion.output.md | 2 +- unison-src/transcripts/textfind.output.md | 4 +- .../transcripts/todo-bug-builtins.output.md | 4 +- .../top-level-exceptions.output.md | 2 +- .../transcript-parser-commands.output.md | 10 +- unison-src/transcripts/type-deps.output.md | 4 +- unison-src/transcripts/undo.output.md | 6 +- .../transcripts/update-on-conflict.output.md | 2 +- .../update-suffixifies-properly.output.md | 2 +- ...with-dependent-to-different-type.output.md | 2 +- .../update-test-watch-roundtrip.output.md | 4 +- .../update-type-constructor-alias.output.md | 2 +- ...elete-constructor-with-dependent.output.md | 2 +- .../update-type-delete-record-field.output.md | 2 +- .../update-type-missing-constructor.output.md | 2 +- .../update-type-nested-decl-aliases.output.md | 2 +- ...ate-type-stray-constructor-alias.output.md | 2 +- .../update-type-stray-constructor.output.md | 2 +- .../update-type-with-dependent-term.output.md | 2 +- ...dependent-type-to-different-kind.output.md | 2 +- .../transcripts/upgrade-sad-path.output.md | 2 +- .../upgrade-suffixifies-properly.output.md | 2 +- unison-src/transcripts/view.output.md | 2 +- 135 files changed, 577 insertions(+), 499 deletions(-) diff --git a/unison-cli/src/Unison/Codebase/Transcript.hs b/unison-cli/src/Unison/Codebase/Transcript.hs index b777620426..f6e34642d6 100644 --- a/unison-cli/src/Unison/Codebase/Transcript.hs +++ b/unison-cli/src/Unison/Codebase/Transcript.hs @@ -10,6 +10,9 @@ module Unison.Codebase.Transcript APIRequest (..), pattern CMarkCodeBlock, Stanza, + InfoTags (..), + defaultInfoTags, + defaultInfoTags', ProcessedBlock (..), CMark.Node, ) @@ -25,7 +28,7 @@ type ExpectingError = Bool type ScratchFileName = Text data Hidden = Shown | HideOutput | HideAll - deriving (Eq, Show) + deriving (Eq, Ord, Read, Show) data UcmLine = UcmCommand UcmContext Text @@ -48,8 +51,23 @@ pattern CMarkCodeBlock pos info body = CMark.Node pos (CMark.CODE_BLOCK info bod type Stanza = Either CMark.Node ProcessedBlock +data InfoTags a = InfoTags + { hidden :: Hidden, + expectingError :: ExpectingError, + generated :: Bool, + additionalTags :: a + } + deriving (Eq, Ord, Read, Show) + +defaultInfoTags :: a -> InfoTags a +defaultInfoTags = InfoTags Shown False False + +-- | If the `additionalTags` form a `Monoid`, then you don’t need to provide a default value for them. +defaultInfoTags' :: (Monoid a) => InfoTags a +defaultInfoTags' = defaultInfoTags mempty + data ProcessedBlock - = Ucm Hidden ExpectingError [UcmLine] - | Unison Hidden ExpectingError (Maybe ScratchFileName) Text - | API [APIRequest] + = Ucm (InfoTags ()) [UcmLine] + | Unison (InfoTags (Maybe ScratchFileName)) Text + | API (InfoTags ()) [APIRequest] deriving (Eq, Show) diff --git a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs index 967327c27b..b5fdda6de5 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs @@ -3,6 +3,7 @@ module Unison.Codebase.Transcript.Parser ( -- * printing formatAPIRequest, formatUcmLine, + formatInfoString, formatStanzas, -- * parsing @@ -13,14 +14,18 @@ module Unison.Codebase.Transcript.Parser hidden, expectingError, language, + + -- * utilities + processedBlockToNode', ) where import CMark qualified +import Data.Bool (bool) import Data.Char qualified as Char import Data.Text qualified as Text import Text.Megaparsec qualified as P -import Unison.Codebase.Transcript +import Unison.Codebase.Transcript hiding (expectingError, generated, hidden) import Unison.Prelude import Unison.Project (fullyQualifiedProjectAndBranchNamesParser) @@ -40,12 +45,18 @@ formatStanzas :: [Stanza] -> Text formatStanzas = CMark.nodeToCommonmark [] Nothing . CMark.Node Nothing CMark.DOCUMENT . fmap (either id processedBlockToNode) +-- | +-- +-- __NB__: This convenience function is exposed until `ProcessedBlock` can store UCM command output and API responses. +-- Until then, this is used by the `Unison.Codebase.Transcript.Runner`. This should change with #5199. +processedBlockToNode' :: (a -> Text) -> Text -> InfoTags a -> Text -> CMark.Node +processedBlockToNode' formatA lang tags body = CMarkCodeBlock Nothing (formatInfoString formatA lang tags) body + processedBlockToNode :: ProcessedBlock -> CMark.Node processedBlockToNode = \case - Ucm _ _ cmds -> CMarkCodeBlock Nothing "ucm" $ foldr ((<>) . formatUcmLine) "" cmds - Unison _hide _ fname txt -> - CMarkCodeBlock Nothing "unison" $ maybe txt (\fname -> Text.unlines ["---", "title: " <> fname, "---", txt]) fname - API apiRequests -> CMarkCodeBlock Nothing "api" $ Text.unlines $ formatAPIRequest <$> apiRequests + Ucm tags cmds -> processedBlockToNode' (\() -> "") "ucm" tags $ foldr ((<>) . formatUcmLine) "" cmds + Unison tags txt -> processedBlockToNode' (maybe "" (" " <>)) "unison" tags txt + API tags apiRequests -> processedBlockToNode' (\() -> "") "api" tags $ foldr ((<>) . formatAPIRequest) "" apiRequests type P = P.Parsec Void Text @@ -92,26 +103,38 @@ apiRequest = do spaces pure (APIComment comment) +formatInfoString :: (a -> Text) -> Text -> InfoTags a -> Text +formatInfoString formatA language infoTags = + let infoTagText = formatInfoTags formatA infoTags + in if Text.null infoTagText then language else language <> " " <> infoTagText + +formatInfoTags :: (a -> Text) -> InfoTags a -> Text +formatInfoTags formatA (InfoTags hidden expectingError generated additionalTags) = + formatHidden hidden <> formatExpectingError expectingError <> formatGenerated generated <> formatA additionalTags + +infoTags :: P a -> P (InfoTags a) +infoTags p = + InfoTags + <$> lineToken hidden + <*> lineToken expectingError + <*> lineToken generated + <*> p + -- | Parses the info string and contents of a fenced code block. fenced :: P (Maybe ProcessedBlock) fenced = do - fenceType <- lineToken (word "ucm" <|> word "unison" <|> word "api" <|> language) + fenceType <- lineToken language case fenceType of "ucm" -> do - hide <- hidden - err <- expectingError - pure . Ucm hide err <$> (spaces *> P.manyTill ucmLine P.eof) + it <- infoTags $ pure () + pure . Ucm it <$> (spaces *> P.manyTill ucmLine P.eof) "unison" -> do - -- todo: this has to be more interesting - -- ``` unison :hide - -- ``` unison - -- ``` unison :hide:all scratch.u - hide <- lineToken hidden - err <- lineToken expectingError - fileName <- optional untilSpace1 + it <- infoTags $ optional untilSpace1 P.single '\n' - pure . Unison hide err fileName <$> P.getInput - "api" -> pure . API <$> (spaces *> P.manyTill apiRequest P.eof) + pure . Unison it <$> P.getInput + "api" -> do + it <- infoTags $ pure () + pure . API it <$> (spaces *> P.manyTill apiRequest P.eof) _ -> pure Nothing word :: Text -> P Text @@ -126,15 +149,30 @@ lineToken p = p <* nonNewlineSpaces nonNewlineSpaces :: P () nonNewlineSpaces = void $ P.takeWhileP Nothing (\ch -> ch == ' ' || ch == '\t') +formatHidden :: Hidden -> Text +formatHidden = \case + HideAll -> ":hide:all" + HideOutput -> ":hide" + Shown -> "" + hidden :: P Hidden hidden = (HideAll <$ word ":hide:all") <|> (HideOutput <$ word ":hide") <|> pure Shown +formatExpectingError :: ExpectingError -> Text +formatExpectingError = bool "" ":error" + expectingError :: P ExpectingError expectingError = isJust <$> optional (word ":error") +formatGenerated :: ExpectingError -> Text +formatGenerated = bool "" ":added-by-ucm" + +generated :: P Bool +generated = isJust <$> optional (word ":added-by-ucm") + untilSpace1 :: P Text untilSpace1 = P.takeWhile1P Nothing (not . Char.isSpace) diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index dee6e36b52..1781497e1f 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -116,6 +116,12 @@ withRunner isTest verbosity ucmVersion nrtp action = RTI.withRuntime True RTI.Persistent ucmVersion \sbRuntime -> action runtime sbRuntime =<< liftIO (RTI.startNativeRuntime ucmVersion nrtp) +isGeneratedBlock :: ProcessedBlock -> Bool +isGeneratedBlock = \case + Ucm InfoTags {generated} _ -> generated + Unison InfoTags {generated} _ -> generated + API InfoTags {generated} _ -> generated + run :: -- | Whether to treat this transcript run as a transcript test, which will try to make output deterministic Bool -> @@ -151,7 +157,9 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL mayShareAccessToken -- Queue of Stanzas and Just index, or Nothing if the stanza was programmatically generated -- e.g. a unison-file update by a command like 'edit' - inputQueue <- Q.prepopulatedIO . Seq.fromList $ stanzas `zip` (Just <$> [1 :: Int ..]) + inputQueue <- + Q.prepopulatedIO . Seq.fromList $ + filter (either (const True) (not . isGeneratedBlock)) stanzas `zip` (Just <$> [1 :: Int ..]) -- Queue of UCM commands to run. -- Nothing indicates the end of a ucm block. cmdQueue <- Q.newIO @(Maybe UcmLine) @@ -160,14 +168,15 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL ucmOutput <- newIORef mempty unisonFiles <- newIORef Map.empty out <- newIORef mempty - hidden <- newIORef Shown + currentTags <- newIORef Nothing + isHidden <- newIORef Shown allowErrors <- newIORef False hasErrors <- newIORef False mBlock <- newIORef Nothing let patternMap = Map.fromList $ (\p -> (patternName p, p) : ((,p) <$> aliases p)) =<< validInputs let output' :: Bool -> Stanza -> IO () output' inputEcho msg = do - hide <- readIORef hidden + hide <- readIORef isHidden unless (hideOutput inputEcho hide) $ modifyIORef' out (<> pure msg) hideOutput :: Bool -> Hidden -> Bool @@ -183,27 +192,46 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL outputUcm :: Text -> IO () outputUcm line = modifyIORef' ucmOutput (<> pure line) + maybeDieWithMsg :: String -> IO () + maybeDieWithMsg msg = do + errOk <- readIORef allowErrors + if errOk + then writeIORef hasErrors True + else dieWithMsg msg + apiRequest :: APIRequest -> IO [Text] apiRequest req = let input = Transcript.formatAPIRequest req in case req of APIComment {} -> pure $ pure input - GetRequest path -> do - req <- either (dieWithMsg . show) pure $ HTTP.parseRequest (Text.unpack $ baseURL <> path) - respBytes <- HTTP.httpLbs req httpManager - case Aeson.eitherDecode (HTTP.responseBody respBytes) of - Right (v :: Aeson.Value) -> - pure - [ input, - Text.pack . BL.unpack $ Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v - ] - Left err -> dieWithMsg ("Error decoding response from " <> Text.unpack path <> ": " <> err) + GetRequest path -> + either + (([] <$) . maybeDieWithMsg . show) + ( either + (([] <$) . maybeDieWithMsg . (("Error decoding response from " <> Text.unpack path <> ": ") <>)) + ( \(v :: Aeson.Value) -> + pure + [ input, + Text.pack . BL.unpack $ + Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v + ] + ) + . Aeson.eitherDecode + . HTTP.responseBody + <=< flip HTTP.httpLbs httpManager + ) + . HTTP.parseRequest + . Text.unpack + $ baseURL <> path endUcmBlock = do liftIO $ do - -- NB: This uses a `CMarkCodeBlock` instead of `Ucm`, because `Ucm` can’t yet contain command output. This - -- should change with #5199. - output . Left . CMarkCodeBlock Nothing "ucm" . Text.unlines =<< readIORef ucmOutput + tags <- readIORef currentTags + output + . Left + . Transcript.processedBlockToNode' (\() -> "") "ucm" (fromMaybe defaultInfoTags' tags) + . Text.unlines + =<< readIORef ucmOutput writeIORef ucmOutput [] dieUnexpectedSuccess atomically $ void $ do @@ -211,10 +239,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL -- Push them onto the front stanza queue in the correct order. for (reverse scratchFileUpdates) \(fp, contents) -> -- Output blocks for any scratch file updates the ucm block triggered. - -- - -- NB: This uses a `CMarkCodeBlock` instead of `Unison`, because `Unison` doesn’t yet support the - -- `:added-by-ucm` token. This should change with #5199. - Q.undequeue inputQueue (Left $ CMarkCodeBlock Nothing ("unison :added-by-ucm " <> fp) contents, Nothing) + Q.undequeue inputQueue (pure $ Unison (defaultInfoTags $ pure fp) {generated = True} contents, Nothing) Cli.returnEarlyWithoutOutput processUcmLine p = @@ -278,26 +303,30 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL (maybe Cli.returnEarlyWithoutOutput $ pure . Right . snd) startProcessedBlock block = case block of - Unison hide errOk filename txt -> do - liftIO (writeIORef hidden hide) - liftIO . outputEcho $ pure block - liftIO (writeIORef allowErrors errOk) + Unison infoTags txt -> do + liftIO do + writeIORef isHidden $ hidden infoTags + outputEcho $ pure block + writeIORef allowErrors $ expectingError infoTags -- Open a ucm block which will contain the output from UCM after processing the `UnisonFileChanged` event. -- Close the ucm block after processing the UnisonFileChanged event. atomically . Q.enqueue cmdQueue $ Nothing - let sourceName = fromMaybe "scratch.u" filename + let sourceName = fromMaybe "scratch.u" $ additionalTags infoTags liftIO $ updateVirtualFile sourceName txt pure . Left $ UnisonFileChanged sourceName txt - API apiRequests -> do - liftIO $ - -- NB: This uses a `CMarkCodeBlock` instead of `API`, because `API` can’t yet contain API responses. This - -- should change with #5199. - output . Left . CMarkCodeBlock Nothing "api" . Text.unlines . fold =<< traverse apiRequest apiRequests + API infoTags apiRequests -> do + liftIO do + writeIORef isHidden $ hidden infoTags + writeIORef allowErrors $ expectingError infoTags + output . Left . Transcript.processedBlockToNode' (\() -> "") "api" infoTags . Text.unlines . fold + =<< traverse apiRequest apiRequests Cli.returnEarlyWithoutOutput - Ucm hide errOk cmds -> do - liftIO (writeIORef hidden hide) - liftIO (writeIORef allowErrors errOk) - liftIO (writeIORef hasErrors False) + Ucm infoTags cmds -> do + liftIO do + writeIORef currentTags $ pure infoTags + writeIORef isHidden $ hidden infoTags + writeIORef allowErrors $ expectingError infoTags + writeIORef hasErrors False traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds atomically . Q.enqueue cmdQueue $ Nothing Cli.returnEarlyWithoutOutput @@ -318,20 +347,25 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL (\idx -> "Processing stanza " <> show idx <> " of " <> show (length stanzas) <> ".") midx either - ( \node -> do - liftIO . output $ Left node - Cli.returnEarlyWithoutOutput - ) - ( \block -> do - liftIO . writeIORef mBlock $ pure block - startProcessedBlock block + (bypassStanza . Left) + ( \block -> + if isGeneratedBlock block + then bypassStanza $ pure block + else do + liftIO . writeIORef mBlock $ pure block + startProcessedBlock block ) stanza + bypassStanza stanza = do + liftIO $ output stanza + Cli.returnEarlyWithoutOutput + whatsNext = do - liftIO (dieUnexpectedSuccess) - liftIO (writeIORef hidden Shown) - liftIO (writeIORef allowErrors False) + liftIO dieUnexpectedSuccess + liftIO $ writeIORef currentTags Nothing + liftIO $ writeIORef isHidden Shown + liftIO $ writeIORef allowErrors False maybe (liftIO finishTranscript) (uncurry processStanza) =<< atomically (Q.tryDequeue inputQueue) awaitInput :: Cli (Either Event Input) @@ -349,7 +383,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL writeSourceFile :: ScratchFileName -> Text -> IO () writeSourceFile fp contents = do - shouldShowSourceChanges <- (== Shown) <$> readIORef hidden + shouldShowSourceChanges <- (== Shown) <$> readIORef isHidden when shouldShowSourceChanges . atomically $ Q.enqueue ucmScratchFileUpdatesQueue (fp, contents) updateVirtualFile fp contents diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index d58261c507..576b35c1b6 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -2,7 +2,7 @@ Here's a scratch file with some rewrite rules: -``` unison +``` unison :hide ex1 = List.map (x -> x + 1) [1,2,3,4,5,6,7] eitherToOptional e a = @@ -138,7 +138,7 @@ scratch/main> view ex1 Either.mapRight rule1 Another example, showing that we can rewrite to definitions that only exist in the file: -``` unison +``` unison :hide unique ability Woot1 where woot1 : () -> Nat unique ability Woot2 where woot2 : () -> Nat @@ -207,7 +207,7 @@ scratch/main> view wootEx This example shows that rewrite rules can to refer to term definitions that only exist in the file: -``` unison +``` unison :hide foo1 = b = "b" 123 @@ -250,7 +250,7 @@ scratch/main> view foo1 foo2 sameFileEx ## Capture avoidance -``` unison +``` unison :hide bar1 = b = "bar" 123 @@ -305,7 +305,7 @@ sameFileEx = Instead, it should be an unbound free variable, which doesn't typecheck: -``` ucm +``` ucm :error scratch/main> load Loading changes detected in scratch.u. @@ -327,7 +327,7 @@ 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: -``` unison +``` unison :hide bar2 = a = 39494 233 @@ -364,7 +364,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 +``` ucm :error scratch/main> load Loading changes detected in scratch.u. @@ -386,11 +386,11 @@ scratch/main> load ## Structural find -``` unison +``` unison :hide eitherEx = Left ("hello", "there") ``` -``` unison +``` unison :hide findEitherEx x = @rewrite term Left ("hello", x) ==> Left ("hello" Text.++ x) findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index f8b6bec34e..eb2d65f37c 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -811,7 +811,7 @@ a |> f = f a 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 +``` ucm :error scratch/main> diff.namespace /a1: /a2: The namespaces are identical. @@ -822,7 +822,7 @@ Now check that definitions in 'reparses.u' at least parse on round trip: This just makes 'roundtrip.u' the latest scratch file. -``` unison +``` unison :hide x = () ``` diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index 0fff21404a..0d9d19ecbd 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -11,7 +11,7 @@ transcripts which contain less boilerplate. The test shows that `hex (fromHex str) == str` as expected. -``` unison +``` unison :hide test> hex.tests.ex1 = checks let s = "3984af9b" [hex (fromHex s) == s] diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index 6309e170eb..f09570c344 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -42,7 +42,7 @@ scratch/main> add ``` -``` ucm +``` ucm :error scratch/main> io.test test1 💔💥 @@ -59,7 +59,7 @@ scratch/main> io.test test1 ``` -``` ucm +``` ucm :error scratch/main> io.test test2 💔💥 diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index 4866353362..d66d93524e 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -1,6 +1,6 @@ This tests a case where a function was somehow discarding abilities. -``` unison +``` unison :error structural ability Trivial where trivial : () diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index 3bb62257d9..d6a5725a38 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -1,7 +1,7 @@ Checks for some bad type checking behavior. Some ability subtyping was too lenient when higher-order functions were involved. -``` unison +``` unison :error foreach : (a ->{g} ()) -> [a] ->{g} () foreach f = cases [] -> () @@ -40,7 +40,7 @@ go = do This comes from issue \#3513 -``` unison +``` unison :error (<<) : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c (<<) f g x = f (g x) diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index 2363a6ca87..7e65ee177e 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -181,7 +181,7 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente Here are some test vectors (taken from [here](https://www.di-mgt.com.au/sha_testvectors.html) and [here](https://en.wikipedia.org/wiki/BLAKE_\(hash_function\))) for the various hashing algorithms: -``` unison +``` unison :hide ex alg input expected = checks [hashBytes alg (ascii input) == fromHex expected] test> sha3_512.tests.ex1 = diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 028e5a0ca1..bba556954c 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide serverSocket = compose2 reraise IO.serverSocket.impl socketPort = compose reraise socketPort.impl listen = compose reraise listen.impl 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 7d3ddebaf7..7bf2e791a4 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -4,7 +4,7 @@ https://github.com/unisonweb/unison/issues/2195 We add a simple definition. -``` unison +``` unison :hide x = 999 ``` @@ -42,7 +42,7 @@ test> mytest = checks [x + 1 == 1001] We expect this 'add' to fail because the test is blocked by the update to `x`. -``` ucm +``` ucm :error scratch/main> add x These definitions failed: diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 17c19ab945..2789de4cf4 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -1,6 +1,6 @@ # Tests for TLS builtins -``` unison +``` unison :hide -- generated with: -- openssl req -newkey rsa:2048 -subj '/CN=test.unison.cloud/O=Unison/C=US' -nodes -keyout key.pem -x509 -days 3650 -out cert.pem diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md index 62a34bbe0b..22bb801e43 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -68,7 +68,7 @@ thing _ = send 1 These should fail with a term/ctor conflict since we exclude the ability from the update. -``` ucm +``` ucm :error scratch/main> update.old patch Channels.send x These definitions failed: @@ -219,7 +219,7 @@ structural ability X where This should fail with a ctor/term conflict. -``` ucm +``` ucm :error scratch/main2> add x These definitions failed: diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index 897fc3c1aa..f15b4d53ac 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -30,7 +30,7 @@ is2even = '(even 2) it errors if there isn't a previous run -``` ucm +``` ucm :error scratch/main> add.run foo ⚠️ @@ -50,7 +50,7 @@ scratch/main> run is2even it errors if the desired result name conflicts with a name in the unison file -``` ucm +``` ucm :error scratch/main> add.run is2even ⚠️ @@ -268,7 +268,7 @@ main = '5 ``` -``` ucm +``` ucm :error scratch/main> run main 5 diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 5366a47342..6d4b004a13 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide test> foo : [Test.Result] foo = [] ``` diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md index 17c5f43390..f5efed6622 100644 --- a/unison-src/transcripts/alias-term.output.md +++ b/unison-src/transcripts/alias-term.output.md @@ -14,7 +14,7 @@ project/main> ls It won't create a conflicted name, though. -``` ucm +``` ucm :error project/main> alias.term lib.builtins.todo foo ⚠️ diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md index 839d7e415d..f85d6c6782 100644 --- a/unison-src/transcripts/alias-type.output.md +++ b/unison-src/transcripts/alias-type.output.md @@ -14,7 +14,7 @@ project/main> ls It won't create a conflicted name, though. -``` ucm +``` ucm :error project/main> alias.type lib.builtins.Int Foo ⚠️ diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index aaa97d446a..27792d91f4 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -1,6 +1,6 @@ # Doc rendering -``` unison +``` unison :hide structural type Maybe a = Nothing | Just a otherTerm = "text" diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 768b6abe37..1f38dfd82d 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -1,6 +1,6 @@ # Get Definitions Test -``` unison +``` unison :hide nested.names.x.doc = {{ Documentation }} nested.names.x = 42 ``` @@ -207,7 +207,7 @@ GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relati } ``` -``` unison +``` unison :hide doctest.thing.doc = {{ The correct docs for the thing }} doctest.thing = "A thing" doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }} diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index 314196777c..2af77a7afd 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -1,6 +1,6 @@ # Definition Summary APIs -``` unison +``` unison :hide nat : Nat nat = 42 doc : Doc2 diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 7e06b01c90..9adabafe32 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -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 +``` ucm :error scratch/main> add y x These definitions failed: diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md index 7a032269a4..6d0ac39145 100644 --- a/unison-src/transcripts/blocks.output.md +++ b/unison-src/transcripts/blocks.output.md @@ -198,7 +198,7 @@ Since the forward reference to `pong` appears inside `ping`. This, however, will not compile: -``` unison +``` unison :error ex n = pong = ping + 1 ping = 42 @@ -217,7 +217,7 @@ ex n = This also won't compile; it's a cyclic reference that isn't guarded: -``` unison +``` unison :error ex n = loop = loop loop @@ -259,7 +259,7 @@ Just don't try to run it as it's an infinite loop\! The reason is it's unclear what the order should be of any requests that are made. It can also be viewed of a special case of the restriction that elements of a cycle must all be guarded. Here's an example: -``` unison +``` unison :error structural ability SpaceAttack where launchMissiles : Text -> Nat diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index 39522b339d..e6f4f0f703 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -2,7 +2,7 @@ The `branch` command creates a new branch. First, we'll create a term to include in the branches. -``` unison +``` unison :hide someterm = 18 ``` @@ -168,7 +168,7 @@ foo/main> switch /releases/drafts/1.2.3 The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. -``` ucm +``` ucm :error foo/main> branch releases/1.2.3 Branch names like releases/1.2.3 are reserved for releases. diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index 81b53c7a17..b9cc6a9406 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -4,7 +4,7 @@ This transcript defines unit tests for builtin functions. There's a single `scra ## `Int` functions -``` unison +``` unison :hide use Int -- used for some take/drop tests later @@ -83,7 +83,7 @@ test> Int.tests.conversions = ## `Nat` functions -``` unison +``` unison :hide use Nat test> Nat.tests.arithmetic = @@ -154,7 +154,7 @@ test> Nat.tests.conversions = ## `Boolean` functions -``` unison +``` unison :hide test> Boolean.tests.orTable = checks [ (true || true) == true, @@ -178,7 +178,7 @@ test> Boolean.tests.notTable = ## `Text` functions -``` unison +``` unison :hide test> Text.tests.takeDropAppend = checks [ "yabba" ++ "dabba" == "yabbadabba", @@ -272,7 +272,7 @@ test> Text.tests.indexOfEmoji = ## `Bytes` functions -``` unison +``` unison :hide test> Bytes.tests.at = bs = Bytes.fromList [77, 13, 12] checks [ @@ -332,7 +332,7 @@ test> Bytes.tests.indexOf = ## `List` comparison -``` unison +``` unison :hide test> checks [ compare [] [1,2,3] == -1, compare [1,2,3] [1,2,3,4] == -1, @@ -347,7 +347,7 @@ test> checks [ Other list functions -``` unison +``` unison :hide test> checks [ List.take bigN [1,2,3] == [1,2,3], List.drop bigN [1,2,3] == [] diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index bbcb0c9467..be97678061 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide x = 30 y : Nat diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index a325d5421c..d19a6c5da1 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -2,7 +2,7 @@ First we'll set up two libraries, and then we'll use them in some projects and s Our two "libraries": -``` unison +``` unison :hide text.a = 1 text.b = 2 text.c = 3 diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md index 428027ec8b..105d8d0679 100644 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ b/unison-src/transcripts/delete-namespace-dependents-check.output.md @@ -24,7 +24,7 @@ dependent = dependency + 99 ``` -``` ucm +``` ucm :error myproject/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index 43018b571a..5da42fb870 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -1,6 +1,6 @@ # delete.namespace.force -``` unison +``` unison :hide no_dependencies.thing = "no dependents on this term" dependencies.term1 = 1 @@ -21,7 +21,7 @@ scratch/main> delete.namespace no_dependencies Deleting a namespace with external dependencies should fail and list all dependents. -``` ucm +``` ucm :error scratch/main> delete.namespace dependencies ⚠️ diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index a6e42ffee7..755c217dad 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -1,4 +1,4 @@ -``` ucm +``` ucm :error scratch/main> delete foo ⚠️ @@ -8,7 +8,7 @@ scratch/main> delete foo ``` -``` unison +``` unison :hide foo = 1 structural type Foo = Foo () ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index c74ad3e46e..ee66a6162b 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -5,7 +5,7 @@ The delete command can delete both terms and types. First, let's make sure it complains when we try to delete a name that doesn't exist. -``` ucm +``` ucm :error scratch/main> delete.verbose foo ⚠️ @@ -18,7 +18,7 @@ scratch/main> delete.verbose foo Now for some easy cases. Deleting an unambiguous term, then deleting an unambiguous type. -``` unison +``` unison :hide foo = 1 structural type Foo = Foo () ``` @@ -62,7 +62,7 @@ scratch/main> delete.verbose Foo.Foo How about an ambiguous term? -``` unison +``` unison :hide a.foo = 1 a.bar = 2 ``` @@ -107,7 +107,7 @@ scratch/main> ls a Let's repeat all that on a type, for completeness. -``` unison +``` unison :hide structural type a.Foo = Foo () structural type a.Bar = Bar ``` @@ -154,7 +154,7 @@ scratch/main> delete.verbose a.Foo.Foo Finally, let's try to delete a term and a type with the same name. -``` unison +``` unison :hide foo = 1 structural type foo = Foo () ``` @@ -181,7 +181,7 @@ scratch/main> delete.verbose foo We want to be able to delete multiple terms at once -``` unison +``` unison :hide a = "a" b = "b" c = "c" @@ -211,7 +211,7 @@ scratch/main> delete.verbose a b c We can delete terms and types in the same invocation of delete -``` unison +``` unison :hide structural type Foo = Foo () a = "a" b = "b" @@ -255,7 +255,7 @@ scratch/main> delete.verbose Foo.Foo We can delete a type and its constructors -``` unison +``` unison :hide structural type Foo = Foo () ``` @@ -285,14 +285,14 @@ scratch/main> delete.verbose Foo Foo.Foo You should not be able to delete terms which are referenced by other terms -``` unison +``` unison :hide a = 1 b = 2 c = 3 d = a + b + c ``` -``` ucm +``` ucm :error scratch/main> add ⍟ I've added these definitions: @@ -319,7 +319,7 @@ scratch/main> delete.verbose a b c But you should be able to delete all terms which reference each other in a single command -``` unison +``` unison :hide e = 11 f = 12 + e g = 13 + f @@ -352,7 +352,7 @@ 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 -``` unison +``` unison :hide structural type Foo = Foo Nat incrementFoo : Foo -> Nat @@ -383,14 +383,14 @@ scratch/main> delete.verbose Foo Foo.Foo incrementFoo If you mess up on one of the names of your command, delete short circuits -``` unison +``` unison :hide e = 11 f = 12 + e g = 13 + f h = e + f + g ``` -``` ucm +``` ucm :error scratch/main> add ⍟ I've added these definitions: @@ -411,7 +411,7 @@ scratch/main> delete.verbose e f gg Cyclical terms which are guarded by a lambda are allowed to be deleted -``` unison +``` unison :hide ping _ = 1 Nat.+ !pong pong _ = 4 Nat.+ !ping ``` diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 900537ad70..6005a8e35b 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -4,7 +4,7 @@ I can use `debug.file` to see the hashes of the last typechecked file. Given this .u file: -``` unison +``` unison :hide structural type outside.A = A Nat outside.B structural type outside.B = B Int outside.c = 3 diff --git a/unison-src/transcripts/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index 51e78f339f..8dda9405cc 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -77,7 +77,7 @@ ex2 tup = match tup with Destructuring binds can't be recursive: the left-hand side bound variables aren't available on the right hand side. For instance, this doesn't typecheck: -``` unison +``` unison :error ex4 = (a,b) = (a Nat.+ b, 19) "Doesn't typecheck" @@ -157,7 +157,7 @@ Notice how it prints both an ordinary match. Also, for clarity, the pretty-printer shows a single-branch match if the match shadows free variables of the scrutinee, for example: -``` unison +``` unison :hide ex6 x = match x with (x, y) -> x Nat.+ y ``` diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index 93611f1c53..88bc8f1997 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide x = 23 fslkdjflskdjflksjdf = 663 ``` @@ -13,7 +13,7 @@ scratch/b1> add ``` -``` unison +``` unison :hide x = 23 fslkdjflskdjflksjdf = 23 abc = 23 @@ -64,7 +64,7 @@ Things we want to test: - New patches, modified patches, deleted patches, moved patches - With and without propagated updates -``` unison +``` unison :hide fromJust = 1 b = 2 bdependent = b @@ -107,7 +107,7 @@ scratch/ns1> branch /ns2 Here's what we've done so far: -``` ucm +``` ucm :error scratch/main> diff.namespace .nothing /ns1: ⚠️ @@ -116,14 +116,14 @@ scratch/main> diff.namespace .nothing /ns1: ``` -``` ucm +``` ucm :error scratch/main> diff.namespace /ns1: /ns2: The namespaces are identical. ``` -``` unison +``` unison :hide junk = "asldkfjasldkfj" ``` @@ -144,7 +144,7 @@ scratch/ns1> delete.term junk ``` -``` unison +``` unison :hide fromJust = 99 b = 999999999 d = 4 @@ -308,7 +308,7 @@ scratch/main> diff.namespace /ns3: /ns2: ``` -``` unison +``` unison :hide bdependent = "banana" ``` @@ -341,7 +341,7 @@ scratch/main> diff.namespace /ns2: /ns3: Currently, the auto-propagated name-conflicted definitions are not explicitly shown, only their also-conflicted dependency is shown. -``` unison +``` unison :hide a = 333 b = a + 1 @@ -373,7 +373,7 @@ scratch/nsx> branch /nsz ``` -``` unison +``` unison :hide a = 444 ``` @@ -391,7 +391,7 @@ scratch/nsy> update ``` -``` unison +``` unison :hide a = 555 ``` diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index e1b04a715c..da422345b4 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -6,7 +6,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. -``` unison +``` unison :hide abilityPatterns : () abilityPatterns = () diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index 1ef8493130..d1d7b80d0c 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -1,6 +1,6 @@ # Test parsing and round-trip of doc2 syntax elements -``` unison +``` unison :hide otherDoc : a -> Doc2 otherDoc _ = {{ yo }} diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index e7ca39527f..9e43732a02 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide otherDoc : a -> Doc2 otherDoc _ = {{ yo }} diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 19d1db9634..b156cafabc 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -2,7 +2,7 @@ Term and ability constructor collisions should cause a parse error. -``` unison +``` unison :error structural ability Stream where send : a -> () @@ -26,7 +26,7 @@ Stream.send _ = () Term and type constructor collisions should cause a parse error. -``` unison +``` unison :error structural type X = x X.x : a -> () @@ -49,7 +49,7 @@ X.x _ = () Ability and type constructor collisions should cause a parse error. -``` unison +``` unison :error structural type X = x structural ability X where x : () @@ -69,7 +69,7 @@ structural ability X where Field accessors and terms with the same name should cause a parse error. -``` unison +``` unison :error structural type X = {x : ()} X.x.modify = () X.x.set = () diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md index ee44b378a8..0072fcfd9c 100644 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ b/unison-src/transcripts/duplicate-term-detection.output.md @@ -2,7 +2,7 @@ Trivial duplicate terms should be detected: -``` unison +``` unison :error x = 1 x = 2 ``` @@ -21,7 +21,7 @@ x = 2 Equivalent duplicate terms should be detected: -``` unison +``` unison :error x = 1 x = 1 ``` @@ -40,7 +40,7 @@ x = 1 Duplicates from record accessors/setters should be detected -``` unison +``` unison :error structural type Record = {x: Nat, y: Nat} Record.x = 1 Record.x.set = 2 @@ -74,7 +74,7 @@ Record.x.modify = 2 Duplicate terms and constructors should be detected: -``` unison +``` unison :error structural type SumType = X SumType.X = 1 diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index f451d67517..431afe1a1d 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -5,16 +5,12 @@ scratch/main> builtins.merge ``` -``` unison ---- -title: /private/tmp/scratch.u ---- +``` unison /private/tmp/scratch.u foo = 123 bar = 456 mytest = [Ok "ok"] - ``` ``` ucm @@ -73,7 +69,7 @@ foo = 123 test> mytest = [Ok "ok"] ``` -``` ucm +``` ucm :error scratch/main> edit missing ⚠️ diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 6e62cd937c..d577f3dba5 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -1,19 +1,19 @@ # Empty namespace behaviours -``` unison +``` unison :hide mynamespace.x = 1 ``` The deleted namespace shouldn't appear in `ls` output. -``` ucm +``` ucm :error scratch/main> ls nothing to show ``` -``` ucm +``` ucm :error scratch/main> find.verbose ☝️ @@ -31,7 +31,7 @@ scratch/main> find.verbose ``` -``` ucm +``` ucm :error scratch/main> find mynamespace ☝️ @@ -67,7 +67,7 @@ scratch/main> history mynamespace Add and then delete a term to add some history to a deleted namespace. -``` unison +``` unison :hide deleted.x = 1 stuff.thing = 2 ``` @@ -108,7 +108,7 @@ scratch/main> history deleted ## move.namespace -``` unison +``` unison :hide moveoverme.x = 1 moveme.y = 2 ``` diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index f5b7cdc046..0aecd1406d 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -6,7 +6,7 @@ Not even `Nat` or `+`\! BEHOLD\!\!\! -``` ucm +``` ucm :error scratch/main> ls nothing to show diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md index 478cb06f59..d60a38ae83 100644 --- a/unison-src/transcripts/error-messages.output.md +++ b/unison-src/transcripts/error-messages.output.md @@ -6,7 +6,7 @@ Some basic errors of literals. ### Floating point literals -``` unison +``` unison :error x = 1. -- missing some digits after the decimal ``` @@ -22,7 +22,7 @@ x = 1. -- missing some digits after the decimal ``` -``` unison +``` unison :error x = 1e -- missing an exponent ``` @@ -38,7 +38,7 @@ x = 1e -- missing an exponent ``` -``` unison +``` unison :error x = 1e- -- missing an exponent ``` @@ -54,7 +54,7 @@ x = 1e- -- missing an exponent ``` -``` unison +``` unison :error x = 1E+ -- missing an exponent ``` @@ -72,7 +72,7 @@ x = 1E+ -- missing an exponent ### Hex, octal, binary, and bytes literals -``` unison +``` unison :error x = 0xoogabooga -- invalid hex chars ``` @@ -88,7 +88,7 @@ x = 0xoogabooga -- invalid hex chars ``` -``` unison +``` unison :error x = 0o987654321 -- 9 and 8 are not valid octal char ``` @@ -104,7 +104,7 @@ x = 0o987654321 -- 9 and 8 are not valid octal char ``` -``` unison +``` unison :error x = 0b3201 -- 3 and 2 are not valid binary chars ``` @@ -120,7 +120,7 @@ x = 0b3201 -- 3 and 2 are not valid binary chars ``` -``` unison +``` unison :error x = 0xsf -- odd number of hex chars in a bytes literal ``` @@ -136,7 +136,7 @@ x = 0xsf -- odd number of hex chars in a bytes literal ``` -``` unison +``` unison :error x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` @@ -154,7 +154,7 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ### Layout errors -``` unison +``` unison :error foo = else -- not matching if ``` @@ -168,7 +168,7 @@ foo = else -- not matching if ``` -``` unison +``` unison :error foo = then -- unclosed ``` @@ -182,7 +182,7 @@ foo = then -- unclosed ``` -``` unison +``` unison :error foo = with -- unclosed ``` @@ -198,7 +198,7 @@ foo = with -- unclosed ### Matching -``` unison +``` unison :error -- No cases foo = match 1 with ``` @@ -215,7 +215,7 @@ foo = match 1 with ``` -``` unison +``` unison :error foo = match 1 with 2 -- no right-hand-side ``` @@ -236,7 +236,7 @@ foo = match 1 with ``` -``` unison +``` unison :error -- Mismatched arities foo = cases 1, 2 -> () @@ -257,7 +257,7 @@ foo = cases ``` -``` unison +``` unison :error -- Missing a '->' x = match Some a with None -> @@ -285,7 +285,7 @@ x = match Some a with ``` -``` unison +``` unison :error -- Missing patterns x = match Some a with None -> 1 @@ -309,7 +309,7 @@ x = match Some a with ``` -``` unison +``` unison :error -- Guards following an unguarded case x = match Some a with None -> 1 @@ -334,7 +334,7 @@ x = match Some a with ### Watches -``` unison +``` unison :error -- Empty watch > ``` @@ -351,7 +351,7 @@ x = match Some a with ### Keywords -``` unison +``` unison :error use.keyword.in.namespace = 1 ``` @@ -367,7 +367,7 @@ use.keyword.in.namespace = 1 ``` -``` unison +``` unison :error -- reserved operator a ! b = 1 ``` diff --git a/unison-src/transcripts/errors/missing-result-typed.output.md b/unison-src/transcripts/errors/missing-result-typed.output.md index fb4c6783bb..8cea5ded3e 100644 --- a/unison-src/transcripts/errors/missing-result-typed.output.md +++ b/unison-src/transcripts/errors/missing-result-typed.output.md @@ -4,7 +4,7 @@ When an error is encountered in a `unison :hide:all` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide:all a : Nat a = b = 24 diff --git a/unison-src/transcripts/errors/missing-result.output.md b/unison-src/transcripts/errors/missing-result.output.md index c51a5c70b9..99dcdedfa0 100644 --- a/unison-src/transcripts/errors/missing-result.output.md +++ b/unison-src/transcripts/errors/missing-result.output.md @@ -4,7 +4,7 @@ When an error is encountered in a `unison :hide:all` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide:all x = y = 24 ``` 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 a9fca37adf..c416257ade 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.output.md @@ -6,7 +6,7 @@ When an expected error is not encountered in a `ucm :hide:all` block then the transcript parser should print the stanza and surface a helpful message. -``` ucm +``` ucm :hide:all:error scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all.output.md b/unison-src/transcripts/errors/ucm-hide-all.output.md index 8a3f4b3655..523ef40b2f 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all.output.md @@ -6,7 +6,7 @@ When an error is encountered in a `ucm :hide:all` block then the transcript parser should print the stanza and surface a helpful message. -``` ucm +``` ucm :hide:all scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index 41c15c48f4..e2045b6ee5 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -6,7 +6,7 @@ When an expected error is not encountered in a `ucm :hide` block then the transcript parser should print the stanza and surface a helpful message. -``` ucm +``` ucm :hide:error scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide.output.md b/unison-src/transcripts/errors/ucm-hide.output.md index 42f9e0a3e0..6f9083e070 100644 --- a/unison-src/transcripts/errors/ucm-hide.output.md +++ b/unison-src/transcripts/errors/ucm-hide.output.md @@ -6,7 +6,7 @@ When an error is encountered in a `ucm :hide` block then the transcript parser should print the stanza and surface a helpful message. -``` ucm +``` ucm :hide scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/unison-hide-all-error.output.md b/unison-src/transcripts/errors/unison-hide-all-error.output.md index b73f494ea8..3652dfebe5 100644 --- a/unison-src/transcripts/errors/unison-hide-all-error.output.md +++ b/unison-src/transcripts/errors/unison-hide-all-error.output.md @@ -4,7 +4,7 @@ When an expected error is not encountered in a `unison :hide:all:error` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide:all:error myVal = 3 ``` diff --git a/unison-src/transcripts/errors/unison-hide-all.output.md b/unison-src/transcripts/errors/unison-hide-all.output.md index cde7bbc2c5..30659b4c35 100644 --- a/unison-src/transcripts/errors/unison-hide-all.output.md +++ b/unison-src/transcripts/errors/unison-hide-all.output.md @@ -4,7 +4,7 @@ When an error is encountered in a `unison :hide:all` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide:all g 3 ``` diff --git a/unison-src/transcripts/errors/unison-hide-error.output.md b/unison-src/transcripts/errors/unison-hide-error.output.md index 171813e042..3a9477e8f8 100644 --- a/unison-src/transcripts/errors/unison-hide-error.output.md +++ b/unison-src/transcripts/errors/unison-hide-error.output.md @@ -4,7 +4,7 @@ When an expected error is not encountered in a `unison :hide:error` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide:error myVal = 3 ``` diff --git a/unison-src/transcripts/errors/unison-hide.output.md b/unison-src/transcripts/errors/unison-hide.output.md index 3e819920e0..571c94c396 100644 --- a/unison-src/transcripts/errors/unison-hide.output.md +++ b/unison-src/transcripts/errors/unison-hide.output.md @@ -4,7 +4,7 @@ When an error is encountered in a `unison :hide` block then the transcript parser should print the stanza and surface a helpful message. -``` unison +``` unison :hide g 3 ``` diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 0542ea4740..75964a5747 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide unique type A = A Text foo : A @@ -40,7 +40,7 @@ scratch/main> find : A ``` -``` ucm +``` ucm :error scratch/main> find : Text ☝️ diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index a5f10e2b7f..8749d3c528 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide foo = 1 lib.foo = 2 lib.bar = 3 @@ -83,7 +83,7 @@ scratch/main> find-in somewhere bar ``` -``` ucm +``` ucm :error scratch/main> find baz ☝️ diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index f5f7bad73c..d039c6255f 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -2,7 +2,7 @@ We were seeing an issue where (it seemed) that every namespace that was visited Example: -``` unison +``` unison :hide a = "a term" X.foo = "a namespace" ``` @@ -19,7 +19,7 @@ scratch/main> add Here is an update which should not affect `X`: -``` unison +``` unison :hide a = "an update" ``` @@ -49,7 +49,7 @@ 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 +``` ucm :error scratch/main> history #7nl6ppokhg 😶 diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md index 904ee3cf4f..3f2e8922f7 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.output.md @@ -1,6 +1,6 @@ Tests that `if` statements can appear as list and tuple elements. -``` unison +``` unison :hide > [ if true then 1 else 0 ] > [ if true then 1 else 0, 1] diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md index 367767a970..8b6b1bcdcc 100644 --- a/unison-src/transcripts/fix-5301.output.md +++ b/unison-src/transcripts/fix-5301.output.md @@ -8,7 +8,7 @@ scratch/main> builtins.merge ``` -``` unison +``` unison :error type Foo = Bar Nat foo : Foo -> Nat @@ -34,7 +34,7 @@ foo = cases ``` -``` unison +``` unison :error type Foo = Bar A type A = X type B = X diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md index 2c2a278043..13dbd63f47 100644 --- a/unison-src/transcripts/fix-5320.output.md +++ b/unison-src/transcripts/fix-5320.output.md @@ -5,7 +5,7 @@ scratch/main> builtins.merge lib.builtin ``` -``` unison +``` unison :error foo = cases bar.Baz -> 5 ``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index b924efa5e2..df7e19ca6e 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -52,7 +52,7 @@ scratch/main> ls Now, if we try deleting the namespace `foo`, we get an error, as expected. -``` ucm +``` ucm :error scratch/main> delete.namespace foo ⚠️ diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index fa8b65309f..a4fd473c72 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :error structural ability Ask where ask : Nat ability Zoot where diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md index b0d7b2a4ec..07723d05a8 100644 --- a/unison-src/transcripts/fix1731.output.md +++ b/unison-src/transcripts/fix1731.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide structural ability CLI where print : Text ->{CLI} () input : {CLI} Text diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index eeee1104b2..4151232ac6 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide printLine : Text ->{IO} () printLine msg = _ = putBytes.impl (stdHandle StdOut) (Text.toUtf8 (msg ++ "\n")) @@ -75,7 +75,7 @@ scratch/main> run code.main3 Now testing a few variations that should NOT typecheck. -``` unison +``` unison :hide main4 : Nat ->{IO} Nat main4 n = n @@ -85,7 +85,7 @@ main5 _ = () This shouldn't work since `main4` and `main5` don't have the right type. -``` ucm +``` ucm :error scratch/main> run main4 😶 @@ -100,7 +100,7 @@ scratch/main> run main4 ``` -``` ucm +``` ucm :error scratch/main> run main5 😶 diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index b3954645f4..1b10667d5f 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -77,7 +77,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` -``` ucm +``` ucm :error scratch/main> run myServer 💔💥 diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 62f202ec79..69d2ec9b26 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -1,6 +1,6 @@ This should not typecheck - the inline `@eval` expression uses abilities. -``` unison +``` unison :error structural ability Abort where abort : x ex = {{ @eval{abort} }} @@ -18,7 +18,7 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. -``` ucm +``` ucm :error scratch/main> load unison-src/transcripts/fix2238.u Loading changes detected in unison-src/transcripts/fix2238.u. diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 93a91e8440..544a272080 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -1,6 +1,6 @@ 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: -``` unison +``` unison :hide unique type A a b c d = A a | B b @@ -55,7 +55,7 @@ scratch/a> branch /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 +``` unison :hide unique type A a b c d = A a | B b diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md index 13ef614aca..24bbca3a0b 100644 --- a/unison-src/transcripts/fix2354.output.md +++ b/unison-src/transcripts/fix2354.output.md @@ -1,7 +1,7 @@ Tests that delaying an un-annotated higher-rank type gives a normal type error, rather than an internal compiler error. -``` unison +``` unison :error f : (forall a . a -> a) -> Nat f id = id 0 diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md index 504d10f050..abdd807f95 100644 --- a/unison-src/transcripts/fix2355.output.md +++ b/unison-src/transcripts/fix2355.output.md @@ -1,6 +1,6 @@ Tests for a loop that was previously occurring in the type checker. -``` unison +``` unison :error structural ability A t g where fork : '{g, A t g} a -> t a await : t a -> a diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 87aa68a672..8890250439 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide unique type foo.bar.baz.MyRecord = { value : Nat } diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md index 27d5dd9bb5..b33dde91cc 100644 --- a/unison-src/transcripts/fix2822.output.md +++ b/unison-src/transcripts/fix2822.output.md @@ -94,7 +94,7 @@ doStuff = _value.modify But pattern matching shouldn’t bind to underscore-led names. -``` unison +``` unison :error dontMap f = cases None -> false Some _used -> f _used diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index e32f304670..51f749aa31 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -20,7 +20,7 @@ scratch/main> add Next, define and display a simple Doc: -``` unison +``` unison :hide README = {{ Hi }} diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md index 09bedf2f10..b91f32a329 100644 --- a/unison-src/transcripts/fix3037.output.md +++ b/unison-src/transcripts/fix3037.output.md @@ -2,7 +2,7 @@ Tests for an unsound case of ability checking that was erroneously being accepted before. In certain cases, abilities were able to be added to rows in invariant positions. -``` unison +``` unison :error structural type Runner g = Runner (forall a. '{g} a -> {} a) pureRunner : Runner {} @@ -35,7 +35,7 @@ runner = pureRunner Application version: -``` unison +``` unison :error structural type A g = A (forall a. '{g} a ->{} a) anA : A {} diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md index d80a3768d7..937714613f 100644 --- a/unison-src/transcripts/fix3424.output.md +++ b/unison-src/transcripts/fix3424.output.md @@ -5,7 +5,7 @@ scratch/main> builtins.merge lib.builtins ``` -``` unison +``` unison :hide a = do b b = "Hello, " ++ c ++ "!" c = "World" @@ -26,7 +26,7 @@ scratch/main> run a ``` -``` unison +``` unison :hide a = do b c = "Unison" ``` diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index 2a3a9266fe..01b5b1202c 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -1,6 +1,6 @@ Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”. -``` unison +``` unison :hide failure msg context = Failure (typeLink Unit) msg (Any context) foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with concatenation") ()) diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index 0f1a5adb3a..f34ebb8a21 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -74,7 +74,7 @@ bool = false ``` -``` ucm +``` ucm :error scratch/main> update.old ⍟ I've updated these names to your new definition: diff --git a/unison-src/transcripts/fix4397.output.md b/unison-src/transcripts/fix4397.output.md index 8652929b3b..bdfd08501a 100644 --- a/unison-src/transcripts/fix4397.output.md +++ b/unison-src/transcripts/fix4397.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :error structural type Foo f = Foo (f ()) unique type Baz = Baz (Foo Bar) diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index 82193dc3b5..8b46bc70da 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -1,6 +1,6 @@ Some basics: -``` unison +``` unison :hide unique type Cat.Dog = Mouse Nat unique type Rat.Dog = Bird @@ -21,7 +21,7 @@ scratch/main> add Now I want to add a constructor. -``` unison +``` unison :hide unique type Rat.Dog = Bird | Mouse ``` diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index 9a6449b475..c7332500b8 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -23,7 +23,7 @@ mybar = bar + bar ``` -``` ucm +``` ucm :error myproj/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md index ab9a68c1bd..2dc23a8bca 100644 --- a/unison-src/transcripts/fix4731.output.md +++ b/unison-src/transcripts/fix4731.output.md @@ -84,7 +84,7 @@ Void.absurdly = cases But empty function bodies are not allowed. -``` unison +``` unison :error Void.absurd : Void -> a Void.absurd x = ``` diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index 6d38768147..8f376c0f12 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -28,7 +28,7 @@ test> fix5080.tests.failure = [Fail "fail"] ``` -``` ucm +``` ucm :error scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md index 1e94095d10..dde553f435 100644 --- a/unison-src/transcripts/fix5349.output.md +++ b/unison-src/transcripts/fix5349.output.md @@ -1,6 +1,6 @@ Empty code blocks are invalid in Unison, but shouldn’t crash the parser. -```` unison +```` unison :error README = {{ ``` ``` @@ -16,7 +16,7 @@ README = {{ ``` -``` unison +``` unison :error README = {{ {{ }} }} ``` @@ -46,7 +46,7 @@ README = {{ {{ }} }} ``` -``` unison +``` unison :error README = {{ `` `` }} ``` diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md index fd02084d09..1025d69379 100644 --- a/unison-src/transcripts/fix614.output.md +++ b/unison-src/transcripts/fix614.output.md @@ -27,7 +27,7 @@ ex1 = do This does not typecheck, we've accidentally underapplied `Stream.emit`: -``` unison +``` unison :error ex2 = do Stream.emit 42 @@ -94,7 +94,7 @@ ex4 = One more example: -``` unison +``` unison :error ex4 = [1,2,3] -- no good () diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 5f467d6ac5..0e79737d35 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -35,7 +35,7 @@ skolem variable `a` such that `c : a` and the continuation has type `a ->{X} b`. Thus, `handle c with h : Optional a`, which is not the correct result type. -``` unison +``` unison :error h0 : Request {X t} b -> Optional b h0 req = match req with { X.x _ c -> _ } -> handle c with h0 @@ -63,7 +63,7 @@ h0 req = match req with This code should not check because `t` does not match `b`. -``` unison +``` unison :error h1 : Request {X t} b -> Optional b h1 req = match req with { X.x t _ -> _ } -> handle t with h1 @@ -92,7 +92,7 @@ h1 req = match req with This code should not check for reasons similar to the first example, but with the continuation rather than a parameter. -``` unison +``` unison :error h2 : Request {Abort} r -> r h2 req = match req with { Abort.abort -> k } -> handle k 5 with h2 diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md index 65d7eea602..c002129894 100644 --- a/unison-src/transcripts/fix845.output.md +++ b/unison-src/transcripts/fix845.output.md @@ -24,7 +24,7 @@ Text.zonk txt = txt ++ "!! " Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: -``` unison +``` unison :error -- should not typecheck as there's no `Blah.zonk` in the codebase > Blah.zonk [1,2,3] ``` diff --git a/unison-src/transcripts/formatter.output.md b/unison-src/transcripts/formatter.output.md index 7cea63d39e..2028ff646a 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide {{ # Doc This is a *doc*! @@ -168,7 +168,7 @@ multilineBold = Formatter should leave things alone if the file doesn't typecheck. -``` unison +``` unison :error brokenDoc = {{ hello }} + 1 ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index 701158807d..2ede5313ee 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -2,7 +2,7 @@ If an argument is required but doesn't have a fuzzy resolver, the command should just print the help. -``` ucm +``` ucm :error -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver scratch/main> move.term @@ -12,7 +12,7 @@ scratch/main> move.term If a fuzzy resolver doesn't have any options available it should print a message instead of opening an empty fuzzy-select. -``` ucm +``` ucm :error scratch/empty> view ⚠️ @@ -20,7 +20,7 @@ scratch/empty> view Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 ``` -``` unison +``` unison :hide optionOne = 1 nested.optionTwo = 2 diff --git a/unison-src/transcripts/generic-parse-errors.output.md b/unison-src/transcripts/generic-parse-errors.output.md index 2b236c6f03..e27f709fa6 100644 --- a/unison-src/transcripts/generic-parse-errors.output.md +++ b/unison-src/transcripts/generic-parse-errors.output.md @@ -1,6 +1,6 @@ Just a bunch of random parse errors to test the error formatting. -``` unison +``` unison :error x = foo.123 ``` @@ -22,7 +22,7 @@ x = ``` -``` unison +``` unison :error namespace.blah = 1 ``` @@ -58,7 +58,7 @@ namespace.blah = 1 ``` -``` unison +``` unison :error x = 1 ] ``` @@ -72,7 +72,7 @@ x = 1 ] ``` -``` unison +``` unison :error x = a.#abc ``` @@ -106,7 +106,7 @@ x = a.#abc ``` -``` unison +``` unison :error x = "hi ``` @@ -126,7 +126,7 @@ x = "hi ``` -``` unison +``` unison :error y : a ``` diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index e27ab16e98..7e2ab87eb8 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -21,12 +21,8 @@ Take a look at [the elaborated output](hello.output.md) to see what this file lo In the `unison` fenced block, you can give an (optional) file name (defaults to `scratch.u`), like so: -``` unison ---- -title: myfile.u ---- +``` unison myfile.u x = 42 - ``` ``` ucm @@ -64,7 +60,7 @@ If `view` returned no results, the transcript would fail at this point. You may not always want to view the output of typechecking and evaluation every time, in which case, you can add `:hide` to the block. For instance: -``` unison +``` unison :hide y = 99 ``` @@ -76,7 +72,7 @@ Doing `unison :hide:all` hides the block altogether, both input and output - thi Sometimes, you have a block which you are *expecting* to fail, perhaps because you're illustrating how something would be a type error. Adding `:error` to the block will check for this. For instance, this program has a type error: -``` unison +``` unison :error hmm : .builtin.Nat hmm = "Not, in fact, a number" ``` diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index 1ace1e00b3..93368fe646 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -133,7 +133,7 @@ Loc.transform2 nt = cases Loc f -> ## Types with polymorphic fields -``` unison +``` unison :hide structural type HigherRanked = HigherRanked (forall a. a -> a) ``` diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md index 151c389fb6..a22c8ac517 100644 --- a/unison-src/transcripts/input-parse-errors.output.md +++ b/unison-src/transcripts/input-parse-errors.output.md @@ -1,12 +1,12 @@ # demonstrating our new input parsing errors -``` unison +``` unison :hide x = 55 ``` `handleNameArg` parse error in `add` -``` ucm +``` ucm :error scratch/main> add . ⚠️ @@ -61,7 +61,7 @@ todo: aliasMany: skipped -- similar to `add` -``` ucm +``` ucm :error scratch/main> update arg ⚠️ diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index 196e35bc37..5fb945022a 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -1,6 +1,6 @@ The `io.test` command should run all of the tests within the current namespace, excluding libs. -``` unison +``` unison :hide -- We manually specify types so we don't need to pull in base to run IO and such ioAndExceptionTest : '{IO, Exception} [Result] ioAndExceptionTest = do diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index 26b45b286f..12d6266793 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -431,7 +431,7 @@ scratch/main> io.test testSystemTime ### Get temp directory -``` unison +``` unison :hide testGetTempDirectory : '{io2.IO} [Result] testGetTempDirectory _ = test = 'let @@ -463,7 +463,7 @@ scratch/main> io.test testGetTempDirectory ### Get current directory -``` unison +``` unison :hide testGetCurrentDirectory : '{io2.IO} [Result] testGetCurrentDirectory _ = test = 'let @@ -495,7 +495,7 @@ scratch/main> io.test testGetCurrentDirectory ### Get directory contents -``` unison +``` unison :hide testDirContents : '{io2.IO} [Result] testDirContents _ = test = 'let @@ -529,7 +529,7 @@ scratch/main> io.test testDirContents ### Read environment variables -``` unison +``` unison :hide testGetEnv : '{io2.IO} [Result] testGetEnv _ = test = 'let @@ -566,7 +566,7 @@ scratch/main> io.test testGetEnv `runMeWithNoArgs`, `runMeWithOneArg`, and `runMeWithTwoArgs` raise exceptions unless they called with the right number of arguments. -``` unison +``` unison :hide testGetArgs.fail : Text -> Failure testGetArgs.fail descr = Failure (typeLink IOFailure) descr !Any @@ -623,7 +623,7 @@ scratch/main> run runMeWithTwoArgs foo bar Calling our examples with the wrong number of args will error. -``` ucm +``` ucm :error scratch/main> run runMeWithNoArgs foo 💔💥 @@ -637,7 +637,7 @@ scratch/main> run runMeWithNoArgs foo ``` -``` ucm +``` ucm :error scratch/main> run runMeWithOneArg 💔💥 @@ -651,7 +651,7 @@ scratch/main> run runMeWithOneArg ``` -``` ucm +``` ucm :error scratch/main> run runMeWithOneArg foo bar 💔💥 @@ -666,7 +666,7 @@ scratch/main> run runMeWithOneArg foo bar ``` -``` ucm +``` ucm :error scratch/main> run runMeWithTwoArgs 💔💥 @@ -682,7 +682,7 @@ scratch/main> run runMeWithTwoArgs ### Get the time zone -``` unison +``` unison :hide testTimeZone = do (offset, summer, name) = Clock.internals.systemTimeZone +0 _ = (offset : Int, summer : Nat, name : Text) @@ -704,7 +704,7 @@ scratch/main> run testTimeZone ### Get some random bytes -``` unison +``` unison :hide testRandom : '{io2.IO} [Result] testRandom = do test = do diff --git a/unison-src/transcripts/keyword-identifiers.output.md b/unison-src/transcripts/keyword-identifiers.output.md index f983268f3a..d8574e0995 100644 --- a/unison-src/transcripts/keyword-identifiers.output.md +++ b/unison-src/transcripts/keyword-identifiers.output.md @@ -40,7 +40,7 @@ identifier. `type`: -``` unison +``` unison :hide typeFoo = 99 type1 = "I am a variable" type_ = 292 @@ -52,7 +52,7 @@ structural type type! type_ = type' type_ | type'' `ability`: -``` unison +``` unison :hide abilityFoo = 99 ability1 = "I am a variable" ability_ = 292 @@ -63,7 +63,7 @@ structural type ability! ability_ = ability' ability_ | ability'' `structural` -``` unison +``` unison :hide structuralFoo = 99 structural1 = "I am a variable" structural_ = 292 @@ -74,7 +74,7 @@ structural type structural! structural_ = structural' structural_ | structural'' `unique` -``` unison +``` unison :hide uniqueFoo = 99 unique1 = "I am a variable" unique_ = 292 @@ -85,7 +85,7 @@ structural type unique! unique_ = unique' unique_ | unique'' `if` -``` unison +``` unison :hide ifFoo = 99 if1 = "I am a variable" if_ = 292 @@ -96,7 +96,7 @@ structural type if! if_ = if' if_ | if'' `then` -``` unison +``` unison :hide thenFoo = 99 then1 = "I am a variable" then_ = 292 @@ -107,7 +107,7 @@ structural type then! then_ = then' then_ | then'' `else` -``` unison +``` unison :hide elseFoo = 99 else1 = "I am a variable" else_ = 292 @@ -118,7 +118,7 @@ structural type else! else_ = else' else_ | else'' `forall` -``` unison +``` unison :hide forallFoo = 99 forall1 = "I am a variable" forall_ = 292 @@ -129,7 +129,7 @@ structural type forall! forall_ = forall' forall_ | forall'' `handle` -``` unison +``` unison :hide handleFoo = 99 handle1 = "I am a variable" handle_ = 292 @@ -140,7 +140,7 @@ structural type handle! handle_ = handle' handle_ | handle'' `with` -``` unison +``` unison :hide withFoo = 99 with1 = "I am a variable" with_ = 292 @@ -151,7 +151,7 @@ structural type with! with_ = with' with_ | with'' `where` -``` unison +``` unison :hide whereFoo = 99 where1 = "I am a variable" where_ = 292 @@ -162,7 +162,7 @@ structural type where! where_ = where' where_ | where'' `use` -``` unison +``` unison :hide useFoo = 99 use1 = "I am a variable" use_ = 292 @@ -173,7 +173,7 @@ structural type use! use_ = use' use_ | use'' `true` -``` unison +``` unison :hide trueFoo = 99 true1 = "I am a variable" true_ = 292 @@ -184,7 +184,7 @@ structural type true! true_ = true' true_ | true'' `false` -``` unison +``` unison :hide falseFoo = 99 false1 = "I am a variable" false_ = 292 @@ -195,7 +195,7 @@ structural type false! false_ = false' false_ | false'' `alias` -``` unison +``` unison :hide aliasFoo = 99 alias1 = "I am a variable" alias_ = 292 @@ -206,7 +206,7 @@ structural type alias! alias_ = alias' alias_ | alias'' `typeLink` -``` unison +``` unison :hide typeLinkFoo = 99 typeLink1 = "I am a variable" typeLink_ = 292 @@ -217,7 +217,7 @@ structural type typeLink! typeLink_ = typeLink' typeLink_ | typeLink'' `termLink` -``` unison +``` unison :hide termLinkFoo = 99 termLink1 = "I am a variable" termLink_ = 292 @@ -228,7 +228,7 @@ structural type termLink! termLink_ = termLink' termLink_ | termLink'' `let` -``` unison +``` unison :hide letFoo = 99 let1 = "I am a variable" let_ = 292 @@ -239,7 +239,7 @@ structural type let! let_ = let' let_ | let'' `namespace` -``` unison +``` unison :hide namespaceFoo = 99 namespace1 = "I am a variable" namespace_ = 292 @@ -250,7 +250,7 @@ structural type namespace! namespace_ = namespace' namespace_ | namespace'' `match` -``` unison +``` unison :hide matchFoo = 99 match1 = "I am a variable" match_ = 292 @@ -261,7 +261,7 @@ structural type match! match_ = match' match_ | match'' `cases` -``` unison +``` unison :hide casesFoo = 99 cases1 = "I am a variable" cases_ = 292 diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index 820ba37c26..6980e443d9 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -2,7 +2,7 @@ conflicting constraints on the kind of `a` in a product -``` unison +``` unison :error unique type T a = T a (a Nat) ``` @@ -18,7 +18,7 @@ unique type T a = T a (a Nat) conflicting constraints on the kind of `a` in a sum -``` unison +``` unison :error unique type T a = Star a | StarStar (a Nat) @@ -61,7 +61,7 @@ unique type Pong = Pong (Ping Optional) Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts `a` to `*`, whereas `Pong` restricts `a` to `* -> *`. -``` unison +``` unison :error unique type Ping a = Ping a Pong unique type Pong = Pong (Ping Optional) ``` @@ -101,7 +101,7 @@ unique ability Pong a where Catch conflict between mutually recursive type and ability -``` unison +``` unison :error unique type Ping a = Ping (a -> {Pong Nat} ()) unique ability Pong a where pong : Ping Optional -> () @@ -166,7 +166,7 @@ unique type S = S (T Optional) Catch invalid instantiation of `T`'s `a` parameter in `S` -``` unison +``` unison :error unique type T a = T a unique type S = S (T Optional) @@ -187,7 +187,7 @@ unique type S = S (T Optional) Catch kind error in type annotation -``` unison +``` unison :error test : Nat Nat test = 0 ``` @@ -205,7 +205,7 @@ test = 0 Catch kind error in annotation example 2 -``` unison +``` unison :error test : Optional -> () test _ = () ``` @@ -223,7 +223,7 @@ test _ = () Catch kind error in annotation example 3 -``` unison +``` unison :error unique type T a = T (a Nat) test : T Nat -> () @@ -243,7 +243,7 @@ test _ = () Catch kind error in scoped type variable annotation -``` unison +``` unison :error unique type StarStar a = StarStar (a Nat) unique type Star a = Star a @@ -269,7 +269,7 @@ test _ = Effects appearing where types are expected -``` unison +``` unison :error unique ability Foo where foo : () @@ -290,7 +290,7 @@ test _ = () Types appearing where effects are expected -``` unison +``` unison :error test : {Nat} () test _ = () ``` @@ -309,7 +309,7 @@ test _ = () ## Cyclic kinds -``` unison +``` unison :error unique type T a = T (a a) ``` @@ -325,7 +325,7 @@ unique type T a = T (a a) ``` -``` unison +``` unison :error unique type T a b = T (a b) (b a) ``` @@ -341,7 +341,7 @@ unique type T a b = T (a b) (b a) ``` -``` unison +``` unison :error unique type Ping a = Ping (a Pong) unique type Pong a = Pong (a Ping) ``` diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index 9748c0d6c0..2cdf496b42 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -61,7 +61,7 @@ it shows the definition using `cases` syntax opportunistically, even though the Functions that take multiple arguments and immediately match on a tuple of arguments can also be rewritten to use `cases`. Here's a version using regular `match` syntax on a tuple: -``` unison +``` unison :hide merge : [a] -> [a] -> [a] merge xs ys = match (xs, ys) with ([], ys) -> ys diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index e81293d1fa..848fee95ed 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide {{ Type doc }} structural type Optional a = diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md index e4eb02719d..16c880b767 100644 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ b/unison-src/transcripts/lsp-name-completion.output.md @@ -1,4 +1,4 @@ -``` unison +``` unison :hide foldMap = "top-level" nested.deeply.foldMap = "nested" lib.base.foldMap = "lib" diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 21bc6e5aea..7f7fc3062f 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -32,14 +32,14 @@ contains both additions. Alice's adds: -``` unison +``` unison :hide foo : Text foo = "alices foo" ``` Bob's adds: -``` unison +``` unison :hide bar : Text bar = "bobs bar" ``` @@ -67,14 +67,14 @@ If Alice and Bob also happen to add the same definition, that's not a conflict. Alice's adds: -``` unison +``` unison :hide foo : Text foo = "alice and bobs foo" ``` Bob's adds: -``` unison +``` unison :hide foo : Text foo = "alice and bobs foo" @@ -105,21 +105,21 @@ Updates that occur in one branch are propagated to the other. In this example, A Original branch: -``` unison +``` unison :hide foo : Text foo = "old foo" ``` Alice's updates: -``` unison +``` unison :hide foo : Text foo = "new foo" ``` Bob's adds: -``` unison +``` unison :hide bar : Text bar = foo ++ " - " ++ foo ``` @@ -162,7 +162,7 @@ Let's see an example. We have `foo`, which depends on `bar` and `baz`. Alice upd Original branch: -``` unison +``` unison :hide foo : Text foo = "foo" ++ " - " ++ bar ++ " - " ++ baz @@ -175,7 +175,7 @@ baz = "old baz" Alice's updates: -``` unison +``` unison :hide bar : Text bar = "alices bar" ``` @@ -189,7 +189,7 @@ scratch/alice> display foo Bob's updates: -``` unison +``` unison :hide baz : Text baz = "bobs baz" ``` @@ -233,7 +233,7 @@ Of course, it's also possible for Alice's update to propagate to one of Bob's up Original branch: -``` unison +``` unison :hide foo : Text foo = "old foo" ++ " - " ++ bar @@ -253,7 +253,7 @@ scratch/main> display foo Alice's updates: -``` unison +``` unison :hide baz : Text baz = "alices baz" ``` @@ -267,7 +267,7 @@ scratch/alice> display foo Bob's updates: -``` unison +``` unison :hide bar : Text bar = "bobs bar" ++ " - " ++ baz ``` @@ -313,14 +313,14 @@ We don't currently consider "update + delete" a conflict like Git does. In this Original branch: -``` unison +``` unison :hide foo : Text foo = "old foo" ``` Alice's updates: -``` unison +``` unison :hide foo : Text foo = "alices foo" ``` @@ -356,7 +356,7 @@ Library dependencies don't cause merge conflicts, the library dependencies are j Alice's adds: -``` unison +``` unison :hide lib.alice.foo : Nat lib.alice.foo = 17 @@ -369,7 +369,7 @@ lib.bothDifferent.baz = 19 Bob's adds: -``` unison +``` unison :hide lib.bob.foo : Nat lib.bob.foo = 20 @@ -456,7 +456,7 @@ scratch/main> branch bob Alice's addition: -``` unison +``` unison :hide foo : Text foo = "foo" ``` @@ -499,7 +499,7 @@ scratch/main> branch bob Bob's addition: -``` unison +``` unison :hide foo : Text foo = "foo" ``` @@ -545,7 +545,7 @@ In this example, Alice deletes `foo`, while Bob adds a new dependent of `foo`. Original branch: -``` unison +``` unison :hide foo : Text foo = "foo" ``` @@ -561,12 +561,12 @@ scratch/alice> delete.term foo Bob's new code that depends on `foo`: -``` unison +``` unison :hide bar : Text bar = foo ++ " - " ++ foo ``` -``` ucm +``` ucm :error scratch/bob> add ⍟ I've added these definitions: @@ -609,26 +609,26 @@ In this example, Alice updates a `Text` to a `Nat`, while Bob adds a new depende Original branch: -``` unison +``` unison :hide foo : Text foo = "foo" ``` Alice's update: -``` unison +``` unison :hide foo : Nat foo = 100 ``` Bob's new definition: -``` unison +``` unison :hide bar : Text bar = foo ++ " - " ++ foo ``` -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -664,7 +664,7 @@ are presented to the user to resolve. Original branch: -``` unison +``` unison :hide foo : Text foo = "old foo" @@ -674,7 +674,7 @@ bar = "old bar" Alice's changes: -``` unison +``` unison :hide foo : Text foo = "alices foo" @@ -687,7 +687,7 @@ qux = "alices qux depends on alices foo" ++ foo Bob's changes: -``` unison +``` unison :hide foo : Text foo = "bobs foo" @@ -695,7 +695,7 @@ baz : Text baz = "bobs baz" ``` -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -752,23 +752,23 @@ Ditto for types; if the hashes don't match, it's a conflict. In this example, Al Original branch: -``` unison +``` unison :hide unique type Foo = MkFoo Nat ``` Alice's changes: -``` unison +``` unison :hide unique type Foo = MkFoo Nat Nat ``` Bob's changes: -``` unison +``` unison :hide unique type Foo = MkFoo Nat Text ``` -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -804,13 +804,13 @@ We model the renaming of a type's constructor as an update, so if Alice updates Original branch: -``` unison +``` unison :hide unique type Foo = Baz Nat | Qux Text ``` Alice's changes `Baz Nat` to `Baz Nat Nat` -``` unison +``` unison :hide unique type Foo = Baz Nat Nat | Qux Text ``` @@ -823,7 +823,7 @@ scratch/bob> move.term Foo.Qux Foo.BobQux ``` -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -859,7 +859,7 @@ Here is another example demonstrating that constructor renames are modeled as up Original branch: -``` unison +``` unison :hide unique type Foo = Baz Nat | Qux Text ``` @@ -881,7 +881,7 @@ scratch/bob> move.term Foo.Qux Foo.Bob ``` -``` ucm +``` ucm :error scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -917,19 +917,19 @@ A constructor on one side can conflict with a regular term definition on the oth Alice's additions: -``` unison +``` unison :hide my.cool.thing : Nat my.cool.thing = 17 ``` Bob's additions: -``` unison +``` unison :hide unique ability my.cool where thing : Nat -> Nat ``` -``` ucm +``` ucm :error scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -966,14 +966,14 @@ Here's a subtle situation where a new type is added on each side of the merge, a Original branch: -``` unison +``` unison :hide Foo.Bar : Nat Foo.Bar = 17 ``` Alice adds this type `Foo` with constructor `Foo.Alice`: -``` unison +``` unison :hide unique type Foo = Alice Nat ``` @@ -986,13 +986,13 @@ scratch/bob> delete.term Foo.Bar ``` -``` unison +``` unison :hide unique type Foo = Bar Nat Nat ``` These won't cleanly merge. -``` ucm +``` ucm :error scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -1030,7 +1030,7 @@ Here's a more involved example that demonstrates the same idea. In the LCA, we have a type with two constructors, and some term. -``` unison +``` unison :hide unique type Foo = Bar.Baz Nat | Bar.Qux Nat Nat @@ -1068,7 +1068,7 @@ At this point, Bob and alice have both updated the name `Foo.Bar.Hello` in diffe Notably, Alice's "unconflicted" update on the name "Foo.Bar.Baz" (because she changed its hash and Bob didn't touch it) is nonetheless considered conflicted with Bob's "Foo.Bar.Baz". -``` ucm +``` ucm :error scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -1113,7 +1113,7 @@ We will resolve this situation automatically in a future version. Alice's additions: -``` unison +``` unison :hide unique type Foo = Bar alice : Foo -> Nat @@ -1122,14 +1122,14 @@ alice _ = 18 Bob's additions: -``` unison +``` unison :hide unique type Foo = Bar bob : Foo -> Nat bob _ = 19 ``` -``` ucm +``` ucm :error scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -1177,28 +1177,28 @@ After merge conflicts are resolved, you can use `merge.commit` rather than `swit Original branch: -``` unison +``` unison :hide foo : Text foo = "old foo" ``` Alice's changes: -``` unison +``` unison :hide foo : Text foo = "alices foo" ``` Bob's changes: -``` unison +``` unison :hide foo : Text foo = "bobs foo" ``` Attempt to merge: -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -1292,7 +1292,7 @@ scratch/main> branch topic ``` -``` ucm +``` ucm :error scratch/topic> merge.commit It doesn't look like there's a merge in progress. @@ -1309,7 +1309,7 @@ If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice' Original branch: -``` unison +``` unison :hide foo : Nat foo = 100 @@ -1319,7 +1319,7 @@ bar = 100 Alice's updates: -``` unison +``` unison :hide foo : Nat foo = 200 @@ -1329,12 +1329,12 @@ bar = 300 Bob's addition: -``` unison +``` unison :hide baz : Text baz = "baz" ``` -``` ucm +``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: @@ -1374,11 +1374,11 @@ scratch/alice> alias.type lib.builtins.Nat MyNat Bob's branch: -``` unison +``` unison :hide unique type MyNat = MyNat Nat ``` -``` ucm +``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: @@ -1399,7 +1399,7 @@ Each naming of a decl may not have more than one name for each constructor, with Alice's branch: -``` unison +``` unison :hide unique type Foo = Bar ``` @@ -1412,12 +1412,12 @@ scratch/alice> alias.term Foo.Bar Foo.some.other.Alias Bob's branch: -``` unison +``` unison :hide bob : Nat bob = 100 ``` -``` ucm +``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: @@ -1439,7 +1439,7 @@ Each naming of a decl must have a name for each constructor, within the decl's n Alice's branch: -``` unison +``` unison :hide unique type Foo = Bar ``` @@ -1452,12 +1452,12 @@ scratch/alice> delete.term Foo.Bar Bob's branch: -``` unison +``` unison :hide bob : Nat bob = 100 ``` -``` ucm +``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: @@ -1477,7 +1477,7 @@ A decl cannot be aliased within the namespace of another of its aliased. Alice's branch: -``` unison +``` unison :hide structural type A = B Nat | C Nat Nat structural type A.inner.X = Y Nat | Z Nat Nat ``` @@ -1493,12 +1493,12 @@ scratch/alice> names A Bob's branch: -``` unison +``` unison :hide bob : Nat bob = 100 ``` -``` ucm +``` ucm :error scratch/alice> merge /bob On scratch/alice, the type A.inner.X is an alias of A. I'm not @@ -1538,7 +1538,7 @@ scratch/bob> add ``` -``` ucm +``` ucm :error scratch/alice> merge bob Sorry, I wasn't able to perform the merge, because I need all @@ -1558,19 +1558,19 @@ By convention, `lib` can only namespaces; each of these represents a library dep Alice's branch: -``` unison +``` unison :hide lib.foo : Nat lib.foo = 1 ``` Bob's branch: -``` unison +``` unison :hide bob : Nat bob = 100 ``` -``` ucm +``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: @@ -2060,7 +2060,7 @@ scratch/alice> update When we try to merge Bob into Alice, we should see both versions of `baz`, with Alice's unconflicted `foo` and `bar` in the underlying namespace. -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -2436,7 +2436,7 @@ scratch/bob> move.term Foo.Lca Foo.Bob ``` -``` ucm +``` ucm :error scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index c9bf1e729a..a34ce03be3 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -200,7 +200,7 @@ a/main> view zonk.zonk ## Sad Path - No term, type, or namespace named src -``` ucm +``` ucm :error scratch/main> move doesntexist foo ⚠️ diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index 065fb13edf..665e0dcc98 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -4,7 +4,7 @@ I should be able to move the root into a sub-namespace -``` unison +``` unison :hide foo = 1 ``` @@ -88,7 +88,7 @@ scratch/main> history ``` -``` ucm +``` ucm :error -- should be empty scratch/main> ls .root.at.path diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md index 87e7cadec2..9724895aa2 100644 --- a/unison-src/transcripts/name-resolution.output.md +++ b/unison-src/transcripts/name-resolution.output.md @@ -36,7 +36,7 @@ scratch/main> add ``` -``` unison +``` unison :error type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` @@ -407,7 +407,7 @@ scratch/main> add ``` -``` unison +``` unison :error file.foo : Nat file.foo = 43 diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index ebe02cc5b4..157efa93a6 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -1,6 +1,6 @@ You can use a keyword or reserved operator as a name segment if you surround it with backticks. -``` ucm +``` ucm :error scratch/main> view `match` ⚠️ @@ -21,7 +21,7 @@ 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 +``` ucm :error scratch/main> view `.` ⚠️ diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index 8bc53afeda..399630d347 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -4,7 +4,7 @@ This transcript shows how the pretty-printer picks names for a hash when multipl 2. Shorter names (in terms of segment count) come before longer ones, for instance `base.List.map` comes before `somelibrary.external.base.List.map`. 3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. -``` unison +``` unison :hide a.a = a.b + 1 a.b = 0 + 1 a.aaa.but.more.segments = 0 + 1 @@ -32,7 +32,7 @@ scratch/main> view a.a Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: -``` unison +``` unison :hide a2.a = a2.b + 1 a2.b = 0 + 1 a2.aaa.but.more.segments = 0 + 1 diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md index 8165721f37..d7e75a87cf 100644 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -7,7 +7,7 @@ scratch/main> builtins.merge lib.builtins ``` -``` unison +``` unison :hide const a b = a external.mynat = 1 mynamespace.dependsOnText = const external.mynat 10 diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index f38610f79a..d0329085f6 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -2,7 +2,7 @@ ## non-exhaustive patterns -``` unison +``` unison :error unique type T = A | B | C test : T -> () @@ -25,7 +25,7 @@ test = cases ``` -``` unison +``` unison :error unique type T = A | B test : (T, Optional T) -> () @@ -54,7 +54,7 @@ test = cases ## redundant patterns -``` unison +``` unison :error unique type T = A | B | C test : T -> () @@ -74,7 +74,7 @@ test = cases ``` -``` unison +``` unison :error unique type T = A | B test : (T, Optional T) -> () @@ -124,7 +124,7 @@ test = cases uninhabited patterns are reported as redundant -``` unison +``` unison :error unique type V = test0 : V -> () @@ -141,7 +141,7 @@ test0 = cases ``` -``` unison +``` unison :error unique type V = test : Optional (Optional V) -> () @@ -164,7 +164,7 @@ test = cases ## Incomplete patterns due to guards should be reported -``` unison +``` unison :error test : () -> () test = cases () | false -> () @@ -183,7 +183,7 @@ test = cases ``` -``` unison +``` unison :error test : Optional Nat -> Nat test = cases None -> 0 @@ -208,7 +208,7 @@ test = cases ## Complete patterns with guards should be accepted -``` unison +``` unison :error test : Optional Nat -> Nat test = cases None -> 0 @@ -235,7 +235,7 @@ test = cases Uncovered patterns are only instantiated as deeply as necessary to distinguish them from existing patterns. -``` unison +``` unison :error unique type T = A | B | C test : Optional (Optional T) -> () @@ -258,7 +258,7 @@ test = cases ``` -``` unison +``` unison :error unique type T = A | B | C test : Optional (Optional T) -> () @@ -291,7 +291,7 @@ test = cases Nat -``` unison +``` unison :error test : Nat -> () test = cases 0 -> () @@ -312,7 +312,7 @@ test = cases Boolean -``` unison +``` unison :error test : Boolean -> () test = cases true -> () @@ -381,7 +381,7 @@ test = cases Nat -``` unison +``` unison :error test : Nat -> () test = cases 0 -> () @@ -400,7 +400,7 @@ test = cases Boolean -``` unison +``` unison :error test : Boolean -> () test = cases true -> () @@ -443,7 +443,7 @@ test = cases ## Non-exhaustive -``` unison +``` unison :error test : [()] -> () test = cases [] -> () @@ -462,7 +462,7 @@ test = cases ``` -``` unison +``` unison :error test : [()] -> () test = cases x +: xs -> () @@ -481,7 +481,7 @@ test = cases ``` -``` unison +``` unison :error test : [()] -> () test = cases xs :+ x -> () @@ -500,7 +500,7 @@ test = cases ``` -``` unison +``` unison :error test : [()] -> () test = cases x0 +: (x1 +: xs) -> () @@ -521,7 +521,7 @@ test = cases ``` -``` unison +``` unison :error test : [()] -> () test = cases [] -> () @@ -601,7 +601,7 @@ test = cases This is the same idea as above but shows that fourth match is redundant. -``` unison +``` unison :error test : [Boolean] -> () test = cases [a, b] ++ xs -> () @@ -627,7 +627,7 @@ or greater where the final 4 elements are `true, false, true, false`. The list must be exactly of length 4 to arrive at the second or third clause, so the third pattern is redundant. -``` unison +``` unison :error test : [Boolean] -> () test = cases [a, b, c, d, f] ++ xs -> () @@ -737,7 +737,7 @@ scratch/main> add ``` -``` unison +``` unison :error withV : Unit withV = match evil () with x -> () @@ -939,7 +939,7 @@ handleMulti c = ## Non-exhaustive ability handlers are rejected -``` unison +``` unison :error structural ability Abort where abort : {Abort} a abortWithMessage : Text -> {Abort} a @@ -965,7 +965,7 @@ result f = handle !f with cases ``` -``` unison +``` unison :error structural ability Abort where abort : {Abort} a @@ -991,7 +991,7 @@ result f = handle !f with cases ``` -``` unison +``` unison :error unique ability Give a where give : a -> {Give a} Unit @@ -1017,7 +1017,7 @@ result f = handle !f with cases ``` -``` unison +``` unison :error structural ability Abort where abort : {Abort} a @@ -1049,7 +1049,7 @@ handleMulti c = ## Redundant handler cases are rejected -``` unison +``` unison :error unique ability Give a where give : a -> {Give a} Unit @@ -1130,7 +1130,7 @@ result f = ## Non-exhaustive ability reinterpretations are rejected -``` unison +``` unison :error structural ability Abort where abort : {Abort} a abortWithMessage : Text -> {Abort} a @@ -1169,7 +1169,7 @@ they are all uninhabited. The messages here aren't the best, but I don't think uninhabited abilities will come up and get handlers written for them often. -``` unison +``` unison :error unique ability Give a where give : a -> {Give a} Unit give2 : a -> {Give a} Unit @@ -1253,7 +1253,7 @@ result f = ``` -``` unison +``` unison :error unique ability Give a where give : a -> {Give a} Unit give2 : a -> {Give a} Unit @@ -1277,7 +1277,7 @@ result f = ``` -``` unison +``` unison :error unique ability GiveA a where giveA : a -> {GiveA a} Unit giveA2 : a -> {GiveA a} Unit diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md index 951b112c72..c7f37ad11d 100644 --- a/unison-src/transcripts/pull-errors.output.md +++ b/unison-src/transcripts/pull-errors.output.md @@ -1,4 +1,4 @@ -``` ucm +``` ucm :error test/main> pull @aryairani/test-almost-empty/main lib.base_latest The use of `pull` to install libraries is now deprecated. diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index fd74ced1ee..caa8a381b8 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -2,7 +2,7 @@ Ensure that Records keep their syntax after being added to the codebase ## Record with 1 field -``` unison +``` unison :hide unique type Record1 = { a : Text } ``` @@ -15,7 +15,7 @@ scratch/main> view Record1 ## Record with 2 fields -``` unison +``` unison :hide unique type Record2 = { a : Text, b : Int } ``` @@ -28,7 +28,7 @@ scratch/main> view Record2 ## Record with 3 fields -``` unison +``` unison :hide unique type Record3 = { a : Text, b : Int, c : Nat } ``` @@ -41,7 +41,7 @@ scratch/main> view Record3 ## Record with many fields -``` unison +``` unison :hide unique type Record4 = { a : Text , b : Int @@ -69,7 +69,7 @@ scratch/main> view Record4 ## Record with many many fields -``` unison +``` unison :hide unique type Record5 = { zero : Nat, one : [Nat], @@ -127,7 +127,7 @@ scratch/main> view Record5 This record type has two fields whose types are user-defined (`Record4` and `UserType`). -``` unison +``` unison :hide unique type UserType = UserType Nat unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md index a082c3c203..4edbf6fc3e 100644 --- a/unison-src/transcripts/release-draft-command.output.md +++ b/unison-src/transcripts/release-draft-command.output.md @@ -53,7 +53,7 @@ foo/main> release.draft 1.2.3 It's an error to try to create a `releases/drafts/x.y.z` branch that already exists. -``` ucm +``` ucm :error foo/main> release.draft 1.2.3 foo/releases/drafts/1.2.3 already exists. You can switch to it diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index 20f841a42a..a7b492d207 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -15,7 +15,7 @@ def = "first value" ``` -``` unison +``` unison :hide def = "second value" ``` @@ -136,7 +136,7 @@ foo/main> history ``` -``` unison +``` unison :hide a = 5 ``` @@ -170,7 +170,7 @@ foo/empty> history ## second argument is always interpreted as a branch -``` unison +``` unison :hide main.a = 3 ``` diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index aa7c4574bb..96292f22bb 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -59,7 +59,7 @@ We expect the output to: 1. Print all ambiguous usage sites separately 2. Print possible disambiguation suggestions for each unique ambiguity -``` unison +``` unison :error -- We intentionally avoid using a constructor to ensure the constructor doesn't -- affect type resolution. useAmbiguousType : AmbiguousType -> () @@ -104,7 +104,7 @@ separateAmbiguousTypeUsage _ = () Currently, ambiguous terms are caught and handled by type directed name resolution, but expect it to eventually be handled by the above machinery. -``` unison +``` unison :error useAmbiguousTerm = ambiguousTerm ``` diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index c76fb31e0e..909af16e6b 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -2,7 +2,7 @@ Any unique name suffix can be used to refer to a definition. For instance: -``` unison +``` unison :hide -- No imports needed even though FQN is `builtin.{Int,Nat}` foo.bar.a : Int foo.bar.a = +99 @@ -99,7 +99,7 @@ scratch/main> add ``` -``` unison +``` unison :error > abra.cadabra ``` diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index a2e456274b..0ffa141f94 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -61,7 +61,7 @@ foo/main> switch bar/ It's an error to try to switch to something ambiguous. -``` ucm +``` ucm :error foo/main> switch bar I'm not sure if you wanted to switch to the branch foo/bar or @@ -76,14 +76,14 @@ foo/main> switch bar It's an error to try to switch to something that doesn't exist, of course. -``` ucm +``` ucm :error scratch/main> switch foo/no-such-branch foo/no-such-branch does not exist. ``` -``` ucm +``` ucm :error scratch/main> switch no-such-project Neither project no-such-project nor branch /no-such-project @@ -91,7 +91,7 @@ scratch/main> switch no-such-project ``` -``` ucm +``` ucm :error foo/main> switch no-such-project-or-branch Neither project no-such-project-or-branch nor branch diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 5c15315b79..8adee96ccf 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -91,7 +91,7 @@ scratch/main> debug.tab-complete view subnamespace.someOther ``` -``` unison +``` unison :hide absolute.term = "absolute" ``` diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md index 6915cac7c3..562b704ba7 100644 --- a/unison-src/transcripts/textfind.output.md +++ b/unison-src/transcripts/textfind.output.md @@ -194,7 +194,7 @@ scratch/main> view 1 Now some failed searches: -``` ucm +``` ucm :error scratch/main> grep lsdkfjlskdjfsd 😶 I couldn't find any matches. @@ -205,7 +205,7 @@ scratch/main> grep lsdkfjlskdjfsd Notice it gives the tip about `text.find.all`. But not here: -``` ucm +``` ucm :error scratch/main> grep.all lsdkfjlskdjfsd 😶 I couldn't find any matches. diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md index 314a35a933..25b45e9ece 100644 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ b/unison-src/transcripts/todo-bug-builtins.output.md @@ -2,7 +2,7 @@ `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. -``` unison +``` unison :error > todo "implement me later" ``` @@ -29,7 +29,7 @@ ``` -``` unison +``` unison :error > bug "there's a bug in my code" ``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 7835d5fdce..59d77b9904 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -90,7 +90,7 @@ unique type RuntimeError = ``` -``` ucm +``` ucm :error scratch/main> run main2 💔💥 diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md index 25053bb364..288028ade0 100644 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ b/unison-src/transcripts/transcript-parser-commands.output.md @@ -28,15 +28,11 @@ scratch/main> add ``` -``` unison ---- -title: :scratch.u ---- +``` unison :hide:error :scratch.u z - ``` -``` ucm +``` ucm :error scratch/main> delete foo ⚠️ @@ -46,7 +42,7 @@ scratch/main> delete foo ``` -``` ucm +``` ucm :error scratch/main> delete lineToken.call ⚠️ diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index 890f765758..5ea2ba55e7 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -4,7 +4,7 @@ https://github.com/unisonweb/unison/pull/2821 Define a type. -``` unison +``` unison :hide structural type Y = Y ``` @@ -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 +``` ucm :error scratch/main> add x These definitions failed: diff --git a/unison-src/transcripts/undo.output.md b/unison-src/transcripts/undo.output.md index 054d2a6f94..542daa3b95 100644 --- a/unison-src/transcripts/undo.output.md +++ b/unison-src/transcripts/undo.output.md @@ -2,7 +2,7 @@ Undo should pop a node off of the history of the current branch. -``` unison +``` unison :hide x = 1 ``` @@ -89,7 +89,7 @@ scratch/main> history It should not be affected by changes on other branches. -``` unison +``` unison :hide x = 1 ``` @@ -185,7 +185,7 @@ scratch/branch1> history Undo should be a no-op on a newly created branch -``` ucm +``` ucm :error scratch/main> branch.create-empty new Done. I've created an empty branch scratch/new. diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 4e6e269f2d..29973394aa 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -57,7 +57,7 @@ x = 3 ``` -``` ucm +``` ucm :error scratch/main> update This branch has more than one term with the name `x`. Please diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md index 96cc361f9c..c721773abc 100644 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ b/unison-src/transcripts/update-suffixifies-properly.output.md @@ -57,7 +57,7 @@ foo = +30 ``` -``` ucm +``` ucm :error myproject/main> update Okay, I'm searching the branch for code that needs to be 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 41327d43ba..767b272378 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 @@ -56,7 +56,7 @@ foo = +5 ``` -``` ucm +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index 1d7a1bd7ed..33d0a52d58 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -1,6 +1,6 @@ Given a test that depends on another definition, -``` unison +``` unison :hide foo n = n + 1 test> mynamespace.foo.test = @@ -38,7 +38,7 @@ foo n = "hello, world!" ``` -``` ucm +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index fc7e6638d4..9db935e039 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -46,7 +46,7 @@ unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :error scratch/main> update Sorry, I wasn't able to perform the 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 bab8345237..c20be2868f 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 @@ -52,7 +52,7 @@ unique type Foo ``` -``` ucm +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be 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 caf0f57ec6..c7ab5fc2dc 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -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 +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index 8fac7293b5..8bbbbadd37 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -48,7 +48,7 @@ unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :error scratch/main> view Foo type Foo = #b509v3eg4k#0 Nat 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 065f8d61e1..403eb17062 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -49,7 +49,7 @@ unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :error scratch/main> update The type A.B is an alias of A. I'm not able to perform an 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 e3f6f1ac7c..c8f3538f2c 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -46,7 +46,7 @@ unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :error scratch/main> update Sorry, I wasn't able to perform the update, because I need all diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index aa55378205..7bb13fa262 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -50,7 +50,7 @@ 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 +``` ucm :error scratch/main> view Foo type Foo = Stray.Bar Nat 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 29154808b5..427bc7758b 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -47,7 +47,7 @@ unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be 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 2fa947fbdb..0f69b2fa4b 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 @@ -45,7 +45,7 @@ unique type Foo a = Bar Nat a ``` -``` ucm +``` ucm :error scratch/main> update Okay, I'm searching the branch for code that needs to be diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md index cd34d7604f..9a8d511c12 100644 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ b/unison-src/transcripts/upgrade-sad-path.output.md @@ -30,7 +30,7 @@ proj/main> add ``` -``` ucm +``` ucm :error proj/main> upgrade old new I couldn't automatically upgrade old to new. However, I've diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md index 80d483e483..e06538148f 100644 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ b/unison-src/transcripts/upgrade-suffixifies-properly.output.md @@ -42,7 +42,7 @@ myproject/main> add ``` -``` ucm +``` ucm :error myproject/main> upgrade old new I couldn't automatically upgrade old to new. However, I've diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index 273d846f1e..2520387f7c 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -1,6 +1,6 @@ # View commands -``` unison +``` unison :hide a.thing = "a" b.thing = "b" ``` From c84495f17d1bacfd2524c7cd89fad5e4558dfa64 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 00:36:09 -0600 Subject: [PATCH 04/15] Toward idempotent transcripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix `:hide` on `ucm` and `api` blocks – previously it behaved the same as `:hide:all`, which prevents the outputs being used as transcripts - include `:added-by-ucm` to `ucm` blocks inserted after `unison` blocks - ensure output lines have 2-space indents This adds a couple transcripts testing the `:hide` behavior. --- .../IntegrationTests/transcript.output.md | 10 +- .../src/Unison/Codebase/Transcript/Runner.hs | 69 +- .../transcripts-manual/docs.to-html.output.md | 5 +- .../transcripts-manual/rewrites.output.md | 39 +- .../transcripts-round-trip/main.output.md | 55 +- .../transcripts-using-base/_base.output.md | 14 +- .../all-base-hashes.output.md | 1 - .../binary-encoding-nats.output.md | 4 +- .../transcripts-using-base/codeops.output.md | 16 +- .../transcripts-using-base/doc.output.md | 24 +- .../failure-tests.output.md | 5 +- .../fix2158-1.output.md | 2 +- .../transcripts-using-base/fix2297.output.md | 2 +- .../transcripts-using-base/fix2358.output.md | 3 +- .../transcripts-using-base/fix3166.output.md | 6 +- .../transcripts-using-base/fix3542.output.md | 2 +- .../transcripts-using-base/fix3939.output.md | 5 +- .../transcripts-using-base/fix4746.output.md | 2 +- .../transcripts-using-base/fix5129.output.md | 8 +- .../transcripts-using-base/hashing.output.md | 20 +- .../transcripts-using-base/mvar.output.md | 4 +- .../nat-coersion.output.md | 4 +- .../transcripts-using-base/net.output.md | 12 +- .../random-deserial.output.md | 4 +- .../ref-promise.output.md | 19 +- .../serial-test-00.output.md | 4 +- .../serial-test-01.output.md | 4 +- .../serial-test-02.output.md | 4 +- .../serial-test-03.output.md | 4 +- .../serial-test-04.output.md | 4 +- .../transcripts-using-base/stm.output.md | 7 +- .../test-watch-dependencies.output.md | 10 +- .../transcripts-using-base/thread.output.md | 15 +- .../transcripts-using-base/tls.output.md | 14 +- .../transcripts-using-base/utf8.output.md | 9 +- unison-src/transcripts/abilities.output.md | 7 +- ...ability-order-doesnt-affect-hash.output.md | 4 +- ...ability-term-conflicts-on-update.output.md | 26 +- unison-src/transcripts/add-run.output.md | 39 +- .../add-test-watch-roundtrip.output.md | 6 +- .../transcripts/addupdatemessages.output.md | 16 +- unison-src/transcripts/alias-many.output.md | 10 +- unison-src/transcripts/alias-term.output.md | 10 +- unison-src/transcripts/alias-type.output.md | 10 +- unison-src/transcripts/anf-tests.output.md | 7 +- unison-src/transcripts/any-extract.output.md | 9 +- .../transcripts/api-doc-rendering.output.md | 9 +- unison-src/transcripts/api-find.output.md | 3 +- .../transcripts/api-getDefinition.output.md | 12 + .../api-list-projects-branches.output.md | 9 + .../api-namespace-details.output.md | 7 +- .../transcripts/api-namespace-list.output.md | 7 +- .../transcripts/api-summaries.output.md | 10 + .../block-on-required-update.output.md | 10 +- unison-src/transcripts/blocks.output.md | 30 +- .../boolean-op-pretty-print-2819.output.md | 8 +- .../transcripts/branch-command.output.md | 31 +- .../branch-relative-path.output.md | 14 +- unison-src/transcripts/bug-fix-4354.output.md | 6 +- .../transcripts/bug-strange-closure.output.md | 16 +- .../transcripts/builtins-merge.output.md | 2 - unison-src/transcripts/builtins.output.md | 53 +- .../transcripts/bytesFromList.output.md | 6 +- unison-src/transcripts/check763.output.md | 9 +- unison-src/transcripts/check873.output.md | 9 +- .../constructor-applied-to-unit.output.md | 7 +- .../transcripts/contrabilities.output.md | 6 +- .../transcripts/create-author.output.md | 6 +- .../transcripts/cycle-update-1.output.md | 11 +- .../transcripts/cycle-update-2.output.md | 11 +- .../transcripts/cycle-update-3.output.md | 11 +- .../transcripts/cycle-update-4.output.md | 11 +- .../transcripts/debug-definitions.output.md | 12 +- .../transcripts/debug-name-diffs.output.md | 8 +- unison-src/transcripts/deep-names.output.md | 23 +- .../transcripts/definition-diff-api.output.md | 10 +- ...elete-namespace-dependents-check.output.md | 10 +- .../transcripts/delete-namespace.output.md | 17 +- .../delete-project-branch.output.md | 12 - .../transcripts/delete-project.output.md | 11 - .../transcripts/delete-silent.output.md | 5 - unison-src/transcripts/delete.output.md | 37 +- ...ependents-dependencies-debugfile.output.md | 11 +- .../transcripts/destructuring-binds.output.md | 18 +- .../transcripts/diff-namespace.output.md | 58 +- .../transcripts/doc-formatting.output.md | 96 ++- .../doc-type-link-keywords.output.md | 12 +- unison-src/transcripts/doc1.output.md | 15 +- unison-src/transcripts/doc2.output.md | 5 +- unison-src/transcripts/doc2markdown.output.md | 11 +- ...t-upgrade-refs-that-exist-in-old.output.md | 9 +- .../transcripts/duplicate-names.output.md | 16 +- .../duplicate-term-detection.output.md | 12 +- unison-src/transcripts/ed25519.output.md | 6 +- unison-src/transcripts/edit-command.output.md | 7 +- .../transcripts/edit-namespace.output.md | 9 +- .../transcripts/empty-namespaces.output.md | 25 +- .../transcripts/emptyCodebase.output.md | 5 - .../transcripts/error-messages.output.md | 46 +- .../errors/dont-hide-unexpected-ucm-errors.md | 20 + .../dont-hide-unexpected-ucm-errors.output.md | 55 ++ .../dont-hide-unexpected-unison-errors.md | 17 + ...nt-hide-unexpected-unison-errors.output.md | 56 ++ .../errors/missing-result-typed.output.md | 4 + .../errors/ucm-hide-error.output.md | 4 + .../transcripts/escape-sequences.output.md | 2 +- unison-src/transcripts/find-by-type.output.md | 9 +- unison-src/transcripts/find-command.output.md | 20 +- .../fix-1381-excess-propagate.output.md | 4 - .../fix-2258-if-as-list-element.output.md | 4 + unison-src/transcripts/fix-5267.output.md | 12 +- unison-src/transcripts/fix-5301.output.md | 5 +- unison-src/transcripts/fix-5312.output.md | 7 +- unison-src/transcripts/fix-5320.output.md | 3 +- unison-src/transcripts/fix-5323.output.md | 5 +- unison-src/transcripts/fix-5326.output.md | 20 +- unison-src/transcripts/fix-5340.output.md | 11 +- unison-src/transcripts/fix-5357.output.md | 8 +- unison-src/transcripts/fix-5369.output.md | 6 +- unison-src/transcripts/fix-5374.output.md | 6 +- unison-src/transcripts/fix-5380.output.md | 6 +- unison-src/transcripts/fix-5402.output.md | 4 +- .../transcripts/fix-big-list-crash.output.md | 6 +- unison-src/transcripts/fix-ls.output.md | 6 +- unison-src/transcripts/fix1063.output.md | 8 +- unison-src/transcripts/fix1327.output.md | 5 +- unison-src/transcripts/fix1334.output.md | 2 - unison-src/transcripts/fix1390.output.md | 7 +- unison-src/transcripts/fix1421.output.md | 4 +- unison-src/transcripts/fix1532.output.md | 9 +- unison-src/transcripts/fix1696.output.md | 6 +- unison-src/transcripts/fix1709.output.md | 5 +- unison-src/transcripts/fix1731.output.md | 10 +- unison-src/transcripts/fix1800.output.md | 16 +- unison-src/transcripts/fix1844.output.md | 2 +- unison-src/transcripts/fix1926.output.md | 5 +- unison-src/transcripts/fix2026.output.md | 7 +- unison-src/transcripts/fix2027.output.md | 7 +- unison-src/transcripts/fix2049.output.md | 10 +- unison-src/transcripts/fix2053.output.md | 5 +- unison-src/transcripts/fix2156.output.md | 6 +- unison-src/transcripts/fix2167.output.md | 6 +- unison-src/transcripts/fix2187.output.md | 6 +- unison-src/transcripts/fix2231.output.md | 7 +- unison-src/transcripts/fix2238.output.md | 7 +- unison-src/transcripts/fix2244.output.md | 9 +- unison-src/transcripts/fix2254.output.md | 21 +- unison-src/transcripts/fix2268.output.md | 6 +- unison-src/transcripts/fix2334.output.md | 6 +- unison-src/transcripts/fix2344.output.md | 6 +- unison-src/transcripts/fix2350.output.md | 2 +- unison-src/transcripts/fix2353.output.md | 6 +- unison-src/transcripts/fix2354.output.md | 6 +- unison-src/transcripts/fix2355.output.md | 6 +- unison-src/transcripts/fix2378.output.md | 6 +- unison-src/transcripts/fix2423.output.md | 6 +- unison-src/transcripts/fix2474.output.md | 3 +- unison-src/transcripts/fix2628.output.md | 6 +- unison-src/transcripts/fix2663.output.md | 6 +- unison-src/transcripts/fix2693.output.md | 11 +- unison-src/transcripts/fix2712.output.md | 9 +- unison-src/transcripts/fix2795.output.md | 3 - unison-src/transcripts/fix2822.output.md | 16 +- unison-src/transcripts/fix2826.output.md | 6 +- unison-src/transcripts/fix2840.output.md | 6 +- unison-src/transcripts/fix2970.output.md | 3 +- unison-src/transcripts/fix3037.output.md | 8 +- unison-src/transcripts/fix3171.output.md | 6 +- unison-src/transcripts/fix3196.output.md | 6 +- unison-src/transcripts/fix3215.output.md | 6 +- unison-src/transcripts/fix3244.output.md | 6 +- unison-src/transcripts/fix3265.output.md | 8 +- unison-src/transcripts/fix3424.output.md | 5 - unison-src/transcripts/fix3634.output.md | 8 +- unison-src/transcripts/fix3678.output.md | 6 +- unison-src/transcripts/fix3752.output.md | 6 +- unison-src/transcripts/fix3773.output.md | 6 +- unison-src/transcripts/fix3977.output.md | 7 +- unison-src/transcripts/fix4172.output.md | 12 +- unison-src/transcripts/fix4280.output.md | 6 +- unison-src/transcripts/fix4397.output.md | 2 +- unison-src/transcripts/fix4415.output.md | 2 +- unison-src/transcripts/fix4424.output.md | 6 +- unison-src/transcripts/fix4482.output.md | 8 +- unison-src/transcripts/fix4498.output.md | 8 +- unison-src/transcripts/fix4515.output.md | 10 +- unison-src/transcripts/fix4528.output.md | 8 +- unison-src/transcripts/fix4556.output.md | 10 +- unison-src/transcripts/fix4592.output.md | 6 +- unison-src/transcripts/fix4618.output.md | 10 +- unison-src/transcripts/fix4711.output.md | 9 +- unison-src/transcripts/fix4722.output.md | 6 +- unison-src/transcripts/fix4731.output.md | 11 +- unison-src/transcripts/fix4780.output.md | 6 +- unison-src/transcripts/fix4898.output.md | 6 +- unison-src/transcripts/fix5055.output.md | 6 +- unison-src/transcripts/fix5076.output.md | 6 +- unison-src/transcripts/fix5080.output.md | 10 +- unison-src/transcripts/fix5168.output.md | 2 +- unison-src/transcripts/fix5349.output.md | 10 +- unison-src/transcripts/fix614.output.md | 18 +- unison-src/transcripts/fix689.output.md | 6 +- unison-src/transcripts/fix693.output.md | 15 +- unison-src/transcripts/fix845.output.md | 18 +- unison-src/transcripts/fix849.output.md | 6 +- unison-src/transcripts/fix942.output.md | 15 +- unison-src/transcripts/fix987.output.md | 10 +- unison-src/transcripts/formatter.output.md | 8 +- .../transcripts/fuzzy-options.output.md | 16 +- .../generic-parse-errors.output.md | 12 +- unison-src/transcripts/hello.output.md | 14 +- unison-src/transcripts/help.output.md | 8 - unison-src/transcripts/higher-rank.output.md | 16 +- .../transcripts/input-parse-errors.output.md | 54 +- .../transcripts/io-test-command.output.md | 12 +- unison-src/transcripts/io.output.md | 52 +- .../transcripts/kind-inference.output.md | 40 +- unison-src/transcripts/lambdacase.output.md | 25 +- .../transcripts/lsp-fold-ranges.output.md | 5 +- .../transcripts/lsp-name-completion.output.md | 10 +- unison-src/transcripts/merge.output.md | 802 ++++++++++++++---- unison-src/transcripts/move-all.output.md | 28 +- .../transcripts/move-namespace.output.md | 51 +- .../transcripts/name-resolution.output.md | 52 +- .../transcripts/name-segment-escape.output.md | 4 - .../transcripts/name-selection.output.md | 19 +- unison-src/transcripts/names.output.md | 10 +- .../namespace-deletion-regression.output.md | 5 - .../namespace-dependencies.output.md | 3 - .../transcripts/namespace-directive.output.md | 15 +- .../transcripts/numbered-args.output.md | 16 +- .../transcripts/old-fold-right.output.md | 6 +- .../pattern-match-coverage.output.md | 113 +-- .../pattern-pretty-print-2345.output.md | 21 +- .../transcripts/patternMatchTls.output.md | 8 +- unison-src/transcripts/patterns.output.md | 6 +- unison-src/transcripts/propagate.output.md | 21 +- unison-src/transcripts/pull-errors.output.md | 40 +- unison-src/transcripts/records.output.md | 37 +- unison-src/transcripts/reflog.output.md | 17 +- .../release-draft-command.output.md | 9 +- unison-src/transcripts/reset.output.md | 27 +- .../transcripts/resolution-failures.output.md | 8 +- unison-src/transcripts/rsa.output.md | 6 +- unison-src/transcripts/scope-ref.output.md | 6 +- unison-src/transcripts/suffixes.output.md | 20 +- .../sum-type-update-conflicts.output.md | 10 +- .../transcripts/switch-command.output.md | 19 +- .../transcripts/tab-completion.output.md | 34 +- unison-src/transcripts/tdnr.output.md | 270 ++++-- unison-src/transcripts/test-command.output.md | 22 +- .../transcripts/text-literals.output.md | 8 +- unison-src/transcripts/textfind.output.md | 27 +- .../transcripts/todo-bug-builtins.output.md | 12 +- unison-src/transcripts/todo.output.md | 102 ++- .../top-level-exceptions.output.md | 13 +- .../transcript-parser-commands.output.md | 9 +- unison-src/transcripts/type-deps.output.md | 12 +- .../type-modifier-are-optional.output.md | 6 +- unison-src/transcripts/undo.output.md | 22 - .../transcripts/unique-type-churn.output.md | 14 +- .../transcripts/unitnamespace.output.md | 6 +- .../transcripts/universal-cmp.output.md | 10 +- .../transcripts/unsafe-coerce.output.md | 9 +- .../update-ignores-lib-namespace.output.md | 11 +- .../transcripts/update-on-conflict.output.md | 12 +- .../update-suffixifies-properly.output.md | 10 +- ...e-term-aliases-in-different-ways.output.md | 8 +- .../update-term-to-different-type.output.md | 8 +- .../update-term-with-alias.output.md | 8 +- ...with-dependent-to-different-type.output.md | 7 +- .../update-term-with-dependent.output.md | 8 +- unison-src/transcripts/update-term.output.md | 8 +- .../update-test-to-non-test.output.md | 9 +- .../update-test-watch-roundtrip.output.md | 8 +- .../update-type-add-constructor.output.md | 12 +- .../update-type-add-field.output.md | 12 +- .../update-type-add-new-record.output.md | 8 +- .../update-type-add-record-field.output.md | 12 +- .../update-type-constructor-alias.output.md | 11 +- ...elete-constructor-with-dependent.output.md | 10 +- .../update-type-delete-constructor.output.md | 12 +- .../update-type-delete-record-field.output.md | 12 +- .../update-type-missing-constructor.output.md | 12 +- .../update-type-nested-decl-aliases.output.md | 10 +- .../update-type-no-op-record.output.md | 8 +- ...ate-type-stray-constructor-alias.output.md | 11 +- .../update-type-stray-constructor.output.md | 12 +- ...nstructor-into-smart-constructor.output.md | 12 +- ...type-turn-non-record-into-record.output.md | 12 +- .../update-type-with-dependent-term.output.md | 10 +- ...dependent-type-to-different-kind.output.md | 10 +- .../update-type-with-dependent-type.output.md | 13 +- unison-src/transcripts/update-watch.output.md | 3 +- .../transcripts/upgrade-happy-path.output.md | 13 +- .../transcripts/upgrade-sad-path.output.md | 15 +- .../upgrade-suffixifies-properly.output.md | 8 +- .../upgrade-with-old-alias.output.md | 10 +- unison-src/transcripts/view.output.md | 10 +- .../transcripts/watch-expressions.output.md | 10 +- 300 files changed, 2868 insertions(+), 2013 deletions(-) create mode 100644 unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.md create mode 100644 unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md create mode 100644 unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.md create mode 100644 unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md diff --git a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md index d36ed5460f..99ce54eff4 100644 --- a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md +++ b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md @@ -1,5 +1,11 @@ # Integration test: transcript +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +scratch/main> load ./unison-src/transcripts-using-base/base.u +scratch/main> add +``` + ``` unison use lib.builtins @@ -27,7 +33,7 @@ main = do _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,7 +51,6 @@ main = do ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability Break @@ -54,5 +59,4 @@ scratch/main> add resume : Request {g, Break} x -> x scratch/main> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main - ``` diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index 1781497e1f..cdf3189fb3 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -189,8 +189,13 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL output = output' False outputEcho = output' True - outputUcm :: Text -> IO () - outputUcm line = modifyIORef' ucmOutput (<> pure line) + outputUcmLine :: UcmLine -> IO () + outputUcmLine line = modifyIORef' ucmOutput (<> pure (Transcript.formatUcmLine line)) + + outputUcmResult :: String -> IO () + outputUcmResult line = do + hide <- readIORef isHidden + unless (hideOutput False hide) $ modifyIORef' ucmOutput (<> pure (Text.pack line)) maybeDieWithMsg :: String -> IO () maybeDieWithMsg msg = do @@ -200,38 +205,44 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL else dieWithMsg msg apiRequest :: APIRequest -> IO [Text] - apiRequest req = + apiRequest req = do + hide <- readIORef isHidden let input = Transcript.formatAPIRequest req - in case req of - APIComment {} -> pure $ pure input - GetRequest path -> - either - (([] <$) . maybeDieWithMsg . show) - ( either - (([] <$) . maybeDieWithMsg . (("Error decoding response from " <> Text.unpack path <> ": ") <>)) - ( \(v :: Aeson.Value) -> - pure + case req of + APIComment {} -> pure $ pure input + GetRequest path -> + either + (([] <$) . maybeDieWithMsg . show) + ( either + (([] <$) . maybeDieWithMsg . (("Error decoding response from " <> Text.unpack path <> ": ") <>)) + ( \(v :: Aeson.Value) -> + pure $ + if hide == HideOutput + then [input] + else [ input, Text.pack . BL.unpack $ Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v ] - ) - . Aeson.eitherDecode - . HTTP.responseBody - <=< flip HTTP.httpLbs httpManager ) - . HTTP.parseRequest - . Text.unpack - $ baseURL <> path + . Aeson.eitherDecode + . HTTP.responseBody + <=< flip HTTP.httpLbs httpManager + ) + . HTTP.parseRequest + . Text.unpack + $ baseURL <> path endUcmBlock = do liftIO $ do tags <- readIORef currentTags - output + ucmOut <- readIORef ucmOutput + unless (null ucmOut && tags == Nothing) + . outputEcho . Left - . Transcript.processedBlockToNode' (\() -> "") "ucm" (fromMaybe defaultInfoTags' tags) - . Text.unlines - =<< readIORef ucmOutput + . Transcript.processedBlockToNode' (\() -> "") "ucm" (fromMaybe defaultInfoTags' {generated = True} tags) + $ Text.unlines ucmOut + writeIORef ucmOutput [] dieUnexpectedSuccess atomically $ void $ do @@ -245,7 +256,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL processUcmLine p = case p of UcmComment {} -> do - liftIO . outputUcm $ Transcript.formatUcmLine p + liftIO $ outputUcmLine p Cli.returnEarlyWithoutOutput UcmCommand context lineTxt -> do curPath <- Cli.getCurrentProjectPath @@ -283,7 +294,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL case words . Text.unpack $ lineTxt of [] -> Cli.returnEarlyWithoutOutput args -> do - liftIO . outputUcm $ Transcript.formatUcmLine p <> "\n" + liftIO $ outputUcmLine p numberedArgs <- use #numberedArgs PP.ProjectAndBranch projId branchId <- PP.toProjectAndBranch . NonEmpty.head <$> use #projectPathStack @@ -295,7 +306,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO $ writeIORef hasErrors True liftIO (readIORef allowErrors) >>= \case True -> do - liftIO . outputUcm . Text.pack $ Pretty.toPlain terminalWidth msg + liftIO . outputUcmResult . Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg Cli.returnEarlyWithoutOutput False -> liftIO . dieWithMsg $ Pretty.toPlain terminalWidth msg ) @@ -318,7 +329,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO do writeIORef isHidden $ hidden infoTags writeIORef allowErrors $ expectingError infoTags - output . Left . Transcript.processedBlockToNode' (\() -> "") "api" infoTags . Text.unlines . fold + outputEcho . Left . Transcript.processedBlockToNode' (\() -> "") "api" infoTags . Text.unlines . fold =<< traverse apiRequest apiRequests Cli.returnEarlyWithoutOutput Ucm infoTags cmds -> do @@ -395,7 +406,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL msg <- notifyUser dir o errOk <- readIORef allowErrors let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" - outputUcm $ Text.pack rendered + outputUcmResult rendered when (Output.isFailure o) $ if errOk then writeIORef hasErrors True @@ -406,7 +417,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL let (msg, numberedArgs) = notifyNumbered o errOk <- readIORef allowErrors let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" - outputUcm $ Text.pack rendered + outputUcmResult rendered when (Output.isNumberedFailure o) $ if errOk then writeIORef hasErrors True diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index 79a2cf133b..c8e04727eb 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -1,6 +1,5 @@ ``` ucm test-html-docs/main> builtins.mergeio lib.builtins - Done. ``` @@ -16,7 +15,7 @@ some.ns.pretty.deeply.nested = 2 some.outside = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,7 +35,6 @@ some.outside = 3 ``` ucm test-html-docs/main> add - ⍟ I've added these definitions: some.ns.direct : Nat @@ -47,5 +45,4 @@ test-html-docs/main> add some.outside.doc : Doc2 test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html - ``` diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 576b35c1b6..d5012ef1d9 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -1,3 +1,9 @@ +``` ucm :hide +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add +``` + ## Structural find and replace Here's a scratch file with some rewrite rules: @@ -31,7 +37,6 @@ Let's rewrite these: ``` ucm scratch/main> rewrite rule1 - ☝️ I found and replaced matches in these definitions: ex1 @@ -39,7 +44,6 @@ scratch/main> rewrite rule1 The rewritten file has been added to the top of scratch.u scratch/main> rewrite eitherToOptional - ☝️ I found and replaced matches in these definitions: @@ -109,11 +113,15 @@ type Optional2 a = Some2 a | None2 rule2 x = @rewrite signature Optional ==> Optional2 ``` +``` ucm :hide +scratch/main> load +scratch/main> add +``` + After adding to the codebase, here's the rewritten source: ``` ucm scratch/main> view ex1 Either.mapRight rule1 - Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b Either.mapRight f = cases None -> None @@ -160,7 +168,6 @@ Let's apply the rewrite `woot1to2`: ``` ucm scratch/main> rewrite woot1to2 - ☝️ I found and replaced matches in these definitions: wootEx @@ -193,11 +200,15 @@ blah = 123 blah2 = 456 ``` +``` ucm :hide +scratch/main> load +scratch/main> add +``` + After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ``` ucm scratch/main> view wootEx - wootEx : Nat ->{Woot2} Nat wootEx a = _ = woot2() @@ -226,11 +237,16 @@ sameFileEx = foo1 ``` +``` ucm :hide +scratch/main> rewrite rule +scratch/main> load +scratch/main> add +``` + After adding the rewritten form to the codebase, here's the rewritten definitions: ``` ucm scratch/main> view foo1 foo2 sameFileEx - foo1 : Nat foo1 = b = "b" @@ -272,7 +288,6 @@ In the above example, `bar2` is locally bound by the rule, so when applied, it s ``` ucm scratch/main> rewrite rule - ☝️ I found and replaced matches in these definitions: sameFileEx @@ -307,7 +322,6 @@ Instead, it should be an unbound free variable, which doesn't typecheck: ``` ucm :error scratch/main> load - Loading changes detected in scratch.u. I couldn't figure out what bar21 refers to here: @@ -339,7 +353,6 @@ rule a = @rewrite ``` ucm scratch/main> rewrite rule - ☝️ I found and replaced matches in these definitions: bar2 @@ -366,7 +379,6 @@ The `a` introduced will be freshened to not capture the `a` in scope, so it rema ``` ucm :error scratch/main> load - Loading changes detected in scratch.u. I couldn't figure out what a1 refers to here: @@ -390,6 +402,10 @@ scratch/main> load eitherEx = Left ("hello", "there") ``` +``` ucm :hide +scratch/main> add +``` + ``` unison :hide findEitherEx x = @rewrite term Left ("hello", x) ==> Left ("hello" Text.++ x) findEitherFailure = @rewrite signature a . Either Failure a ==> () @@ -397,7 +413,6 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ucm scratch/main> sfind findEitherEx - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -407,7 +422,6 @@ scratch/main> sfind findEitherEx Tip: Try `edit 1` to bring this into your scratch file. scratch/main> sfind findEitherFailure - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -422,7 +436,6 @@ scratch/main> sfind findEitherFailure scratch file. scratch/main> find 1-5 - 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a 2. Exception.reraise : Either Failure a ->{Exception} a 3. Exception.toEither : '{ε, Exception} a diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index eb2d65f37c..ddb1b1cd20 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -1,10 +1,21 @@ 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 lib.builtins +scratch/a1> builtins.mergeio lib.builtins +scratch/a2> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/a1> load unison-src/transcripts-round-trip/reparses-with-same-hash.u +scratch/a1> add +``` + ``` unison x = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,11 +28,14 @@ x = () ``` +``` ucm :hide +scratch/a1> find +``` + So we can see the pretty-printed output: ``` ucm scratch/a1> edit 1-1000 - ☝️ I added 111 definitions to the top of scratch.u @@ -809,26 +823,47 @@ UUID.randomUUIDBytes = do a |> f = f a ````` +``` ucm :hide +scratch/a1> delete.namespace.force lib.builtins +``` + +``` ucm :hide +scratch/a2> load +``` + +``` ucm :hide +scratch/a2> add +scratch/a2> delete.namespace.force lib.builtins +``` + 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: - The namespaces are identical. ``` Now check that definitions in 'reparses.u' at least parse on round trip: +``` ucm :hide +scratch/a3> builtins.mergeio lib.builtins +scratch/a3> load unison-src/transcripts-round-trip/reparses.u +scratch/a3> add +``` + This just makes 'roundtrip.u' the latest scratch file. ``` unison :hide x = () ``` +``` ucm :hide +scratch/a3> find +``` + ``` ucm scratch/a3> edit 1-5000 - ☝️ I added 2 definitions to the top of scratch.u @@ -860,11 +895,18 @@ sloppyDocEval = }} ```` +``` ucm :hide +scratch/a3_new> builtins.mergeio lib.builtins +scratch/a3_new> load +scratch/a3_new> add +scratch/a3> delete.namespace.force lib.builtins +scratch/a3_new> delete.namespace.force lib.builtins +``` + These are currently all expected to have different hashes on round trip. ``` ucm scratch/main> diff.namespace /a3_new: /a3: - Updates: 1. sloppyDocEval : Doc2 @@ -881,11 +923,9 @@ Regression test for https://github.com/unisonweb/unison/pull/3548 ``` ucm scratch/regressions> alias.term ##Nat.+ plus - Done. scratch/regressions> edit plus - ☝️ I added 1 definitions to the top of scratch.u @@ -894,7 +934,6 @@ scratch/regressions> edit plus definitions currently in this namespace. scratch/regressions> load - Loading changes detected in scratch.u. I loaded scratch.u and didn't find anything. diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index 0d9d19ecbd..4589924176 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -9,6 +9,12 @@ transcripts which contain less boilerplate. ## Usage +``` ucm :hide +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. ``` unison :hide @@ -17,6 +23,10 @@ test> hex.tests.ex1 = checks let [hex (fromHex s) == s] ``` +``` ucm :hide +scratch/main> test +``` + Lets do some basic testing of our test harness to make sure its working. @@ -39,7 +49,7 @@ testAutoClean _ = Left (Failure _ t _) -> results :+ (Fail t) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,13 +64,11 @@ testAutoClean _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testAutoClean : '{IO} [Result] scratch/main> io.test testAutoClean - New test results: 1. testAutoClean ◉ our temporary directory should exist 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 0b656ef0c3..0f4e66a4c7 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -2,7 +2,6 @@ This transcript is intended to make visible accidental changes to the hashing al ``` ucm scratch/main> find.verbose - 1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo <| : (i ->{g} o) -> i ->{g} o 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 29e096766f..dca5ffce15 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -53,7 +53,7 @@ testABunchOfNats _ = (runTest (testNat 0)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,7 +77,6 @@ testABunchOfNats _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: type EncDec @@ -92,7 +91,6 @@ scratch/main> add testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () scratch/main> io.test testABunchOfNats - New test results: 1. testABunchOfNats ◉ successfully decoded 4294967295 using 64 bit Big Endian diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index beaf8b6cf8..772386b90f 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -151,7 +151,7 @@ swapped name link = rejected ("swapped " ++ name) rco ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -200,7 +200,6 @@ swapped name link = ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Three a b c @@ -316,7 +315,7 @@ badLoad _ = Left _ -> [Fail "Exception"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -345,7 +344,6 @@ to actual show that the serialization works. ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability Zap @@ -361,7 +359,6 @@ scratch/main> add zapper : Three Nat Nat Nat -> Request {Zap} r -> r scratch/main> io.test tests - New test results: 1. tests ◉ (ext f) passed @@ -383,7 +380,6 @@ scratch/main> io.test tests Tip: Use view 1 to view the source of a test. scratch/main> io.test badLoad - New test results: 1. badLoad ◉ serialized77 @@ -430,7 +426,7 @@ codeTests = ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -445,13 +441,11 @@ codeTests = ``` ucm scratch/main> add - ⍟ I've added these definitions: codeTests : '{IO} [Result] scratch/main> io.test codeTests - New test results: 1. codeTests ◉ (idem f) passed @@ -517,7 +511,7 @@ vtests _ = ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -533,14 +527,12 @@ vtests _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] scratch/main> io.test vtests - New test results: 1. vtests ◉ validated diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index ce59f07202..043e62c57d 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -28,7 +28,7 @@ The 7 days of the week, defined as: unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,15 +52,12 @@ You can preview what docs will look like when rendered to the console using the ``` ucm scratch/main> display d1 - Hello there Alice! scratch/main> docs ImportantConstant - An important constant, equal to `42` scratch/main> docs DayOfWeek - The 7 days of the week, defined as: type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat @@ -75,7 +72,6 @@ First, we'll load the `syntax.u` file which has examples of all the syntax: ``` ucm 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. @@ -97,13 +93,16 @@ scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u ``` +``` ucm :hide +scratch/main> add +``` + Now we can review different portions of the guide. we'll show both the pretty-printed source using `view` and the rendered output using `display`: ```` ucm scratch/main> view basicFormatting - basicFormatting : Doc2 basicFormatting = {{ @@ -133,7 +132,6 @@ scratch/main> view basicFormatting }} scratch/main> display basicFormatting - # Basic formatting Paragraphs are separated by one or more blanklines. Sections @@ -158,7 +156,6 @@ scratch/main> display basicFormatting *Next up:* lists scratch/main> view lists - lists : Doc2 lists = {{ @@ -201,7 +198,6 @@ scratch/main> view lists }} scratch/main> display lists - # Lists # Bulleted lists @@ -240,7 +236,6 @@ scratch/main> display lists 3. Get dressed. scratch/main> view evaluation - evaluation : Doc2 evaluation = use Nat * + @@ -275,7 +270,6 @@ scratch/main> view evaluation }} scratch/main> display evaluation - # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -303,7 +297,6 @@ scratch/main> display evaluation cube x = x * x * x scratch/main> view includingSource - includingSource : Doc2 includingSource = use Nat + @@ -344,7 +337,6 @@ scratch/main> view includingSource }} scratch/main> display includingSource - # Including Unison source code Unison definitions can be included in docs. For instance: @@ -390,7 +382,6 @@ scratch/main> display includingSource so: `sqr x`. This is equivalent to `sqr x`. scratch/main> view nonUnisonCodeBlocks - nonUnisonCodeBlocks : Doc2 nonUnisonCodeBlocks = {{ @@ -423,7 +414,6 @@ scratch/main> view nonUnisonCodeBlocks }} scratch/main> display nonUnisonCodeBlocks - # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -452,7 +442,6 @@ scratch/main> display nonUnisonCodeBlocks ``` scratch/main> view otherElements - otherElements : Doc2 otherElements = {{ @@ -509,7 +498,6 @@ scratch/main> view otherElements }} scratch/main> display otherElements - There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -553,7 +541,6 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub ```` ucm scratch/main> view doc.guide - doc.guide : Doc2 doc.guide = {{ @@ -573,7 +560,6 @@ scratch/main> view doc.guide }} scratch/main> display doc.guide - # Unison computable documentation # Basic formatting diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index f09570c344..049fae655b 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -18,7 +18,7 @@ test2 = do [Ok "test2"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +34,6 @@ test2 = do ``` ucm scratch/main> add - ⍟ I've added these definitions: test1 : '{IO, Exception} [Result] @@ -44,7 +43,6 @@ scratch/main> add ``` ucm :error scratch/main> io.test test1 - 💔💥 The program halted with an unhandled exception: @@ -61,7 +59,6 @@ scratch/main> io.test test1 ``` ucm :error scratch/main> io.test test2 - 💔💥 The program halted with an unhandled exception: diff --git a/unison-src/transcripts-using-base/fix2158-1.output.md b/unison-src/transcripts-using-base/fix2158-1.output.md index 50c22139c4..1baf78a47e 100644 --- a/unison-src/transcripts-using-base/fix2158-1.output.md +++ b/unison-src/transcripts-using-base/fix2158-1.output.md @@ -11,7 +11,7 @@ Async.parMap f as = List.map await tasks ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index d66d93524e..a02f6d34bb 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -24,7 +24,7 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti > handleTrivial testAction ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The expression in red needs the {IO} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index e2d47acc32..76d9c701db 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -8,7 +8,7 @@ timingApp2 _ = printLine "World" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +23,6 @@ timingApp2 _ = ``` ucm scratch/main> run timingApp2 - () ``` diff --git a/unison-src/transcripts-using-base/fix3166.output.md b/unison-src/transcripts-using-base/fix3166.output.md index 1b7351b9cb..0973c3df99 100644 --- a/unison-src/transcripts-using-base/fix3166.output.md +++ b/unison-src/transcripts-using-base/fix3166.output.md @@ -31,7 +31,7 @@ increment n = 1 + n Stream.toList s2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,7 +82,7 @@ foo _ = > h foo 337 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -126,7 +126,7 @@ hmm = > hmm ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3542.output.md b/unison-src/transcripts-using-base/fix3542.output.md index 4a6ca9e644..d151cb33b1 100644 --- a/unison-src/transcripts-using-base/fix3542.output.md +++ b/unison-src/transcripts-using-base/fix3542.output.md @@ -13,7 +13,7 @@ arrayList v n = do > Scope.run '(catch (arrayList 7 8)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 35ae1a7c89..96e26ccc2c 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -5,7 +5,7 @@ A simple doc. meh = 9 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,20 +21,17 @@ meh = 9 ``` ucm scratch/main> add - ⍟ I've added these definitions: meh : Nat meh.doc : Doc2 scratch/main> find meh - 1. meh : Nat 2. meh.doc : Doc2 scratch/main> docs 1 - A simple doc. ``` diff --git a/unison-src/transcripts-using-base/fix4746.output.md b/unison-src/transcripts-using-base/fix4746.output.md index 48afbecdfd..eee5122dcd 100644 --- a/unison-src/transcripts-using-base/fix4746.output.md +++ b/unison-src/transcripts-using-base/fix4746.output.md @@ -35,7 +35,7 @@ run s = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index d6a5725a38..e9164960b3 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Checks for some bad type checking behavior. Some ability subtyping was too lenient when higher-order functions were involved. @@ -22,7 +26,7 @@ go = do foreach forkIt [thunk] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found an ability mismatch when checking the application @@ -56,7 +60,7 @@ fancyTryEval : '{g, IO, Exception} a ->{g, IO, Exception} a fancyTryEval = reraise << catchAll.impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The expression in red diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index 7e65ee177e..a89d066a46 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -4,7 +4,6 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.w ``` ucm scratch/main> ls builtin.Bytes - 1. ++ (Bytes -> Bytes -> Bytes) 2. at (Nat -> Bytes -> Optional Nat) 3. decodeNat16be (Bytes -> Optional (Nat, Bytes)) @@ -75,7 +74,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex > ex5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,7 +121,6 @@ And here's the full API: ``` ucm scratch/main> find-in builtin.crypto - 1. type CryptoFailure 2. Ed25519.sign.impl : Bytes -> Bytes @@ -161,7 +159,7 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente > hash Sha3_256 (fromHex "3849238492") ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -313,9 +311,12 @@ test> crypto.hash.numTests = checks (List.map t (range 0 20)) ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> test - Cached test results (`help testcache` to learn more) 1. blake2b_512.tests.ex1 ◉ Passed @@ -381,7 +382,7 @@ test> hmac_sha2_512.tests.ex2 = "164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -444,7 +445,7 @@ test> md5.tests.ex3 = "e4d909c290d0fb1ca068ffaddf22cbd0" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -476,9 +477,12 @@ test> md5.tests.ex3 = ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> test - Cached test results (`help testcache` to learn more) 1. blake2b_512.tests.ex1 ◉ Passed diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index d93f41a0b5..da94449851 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -50,7 +50,7 @@ testMvars _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,14 +66,12 @@ testMvars _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] scratch/main> io.test testMvars - New test results: 1. testMvars ◉ ma should not be empty diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index 839166f3fe..8b36d3f1d9 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -32,7 +32,7 @@ test = 'let runTest testABunchOfNats ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,7 +51,6 @@ test = 'let ``` ucm scratch/main> add - ⍟ I've added these definitions: test : '{IO} [Result] @@ -61,7 +60,6 @@ scratch/main> add ->{Stream Result} () scratch/main> io.test test - New test results: 1. test ◉ expected 0.0 got 0.0 diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index bba556954c..46f2c954c2 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -9,6 +9,10 @@ socketReceive = compose2 reraise socketReceive.impl socketAccept = compose reraise socketAccept.impl ``` +``` ucm :hide +scratch/main> add +``` + # Tests for network related builtins ### Creating server sockets @@ -92,7 +96,7 @@ testDefaultPort _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,7 +113,6 @@ testDefaultPort _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testDefaultHost : '{IO} [Result] @@ -117,7 +120,6 @@ scratch/main> add testExplicitHost : '{IO} [Result] scratch/main> io.test testDefaultPort - New test results: 1. testDefaultPort ◉ successfully created socket @@ -181,7 +183,7 @@ testTcpConnect = 'let ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -198,7 +200,6 @@ testTcpConnect = 'let ``` ucm scratch/main> add - ⍟ I've added these definitions: clientThread : MVar Nat -> MVar Text -> '{IO} () @@ -206,7 +207,6 @@ scratch/main> add testTcpConnect : '{IO} [Result] scratch/main> io.test testTcpConnect - New test results: 1. testTcpConnect ◉ should have reaped what we've sown diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index bf517aeade..3ff0fbd0f3 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -62,7 +62,7 @@ serialTests = do List.map snd (bSort (List.map runTestCase cs)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,7 +82,6 @@ serialTests = do ``` ucm scratch/main> add - ⍟ I've added these definitions: availableCases : '{IO, Exception} [Text] @@ -93,7 +92,6 @@ scratch/main> add shuffle : Nat -> [a] -> [a] scratch/main> io.test serialTests - New test results: 1. serialTests ◉ case-00 diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index 5f297f4e74..e69104a161 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -18,7 +18,7 @@ casTest = do runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,13 +33,11 @@ casTest = do ``` ucm scratch/main> add - ⍟ I've added these definitions: casTest : '{IO} [Result] scratch/main> io.test casTest - New test results: 1. casTest ◉ CAS is successful is there were no conflicting writes @@ -81,7 +79,7 @@ promiseConcurrentTest = do runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -97,14 +95,12 @@ promiseConcurrentTest = do ``` ucm scratch/main> add - ⍟ I've added these definitions: promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] scratch/main> io.test promiseSequentialTest - New test results: 1. promiseSequentialTest ◉ Should read a value that's been written @@ -115,7 +111,6 @@ scratch/main> io.test promiseSequentialTest Tip: Use view 1 to view the source of a test. scratch/main> io.test promiseConcurrentTest - New test results: 1. promiseConcurrentTest ◉ Reads awaits for completion of the Promise @@ -136,7 +131,7 @@ atomicUpdate ref f = if Ref.cas ref ticket value then () else atomicUpdate ref f ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -151,7 +146,6 @@ atomicUpdate ref f = ``` ucm scratch/main> add - ⍟ I've added these definitions: atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () @@ -176,7 +170,7 @@ spawnN n fa = map Promise.read (go n []) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -191,7 +185,6 @@ spawnN n fa = ``` ucm scratch/main> add - ⍟ I've added these definitions: spawnN : Nat -> '{IO} a ->{IO} [a] @@ -226,7 +219,7 @@ fullTest = do runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -241,13 +234,11 @@ fullTest = do ``` ucm scratch/main> add - ⍟ I've added these definitions: fullTest : '{IO} [Result] scratch/main> io.test fullTest - New test results: 1. fullTest ◉ The state of the counter is consistent 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 4209bc6b4d..38a0daa03b 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -67,7 +67,7 @@ mkTestCase = do saveTestCase "case-00" "v5" f tup ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -96,7 +96,6 @@ mkTestCase = do ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Tree a @@ -116,7 +115,6 @@ scratch/main> add tree3 : Tree Text 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 4413dbdbc2..6935196651 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -15,7 +15,7 @@ mkTestCase = do saveTestCase "case-01" "v5" combines (l1, l2, l3) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +34,6 @@ mkTestCase = do ``` ucm scratch/main> add - ⍟ I've added these definitions: combines : ([Float], [Int], [Char]) -> Text @@ -44,7 +43,6 @@ scratch/main> add mkTestCase : '{IO, Exception} () 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 d611fdee11..df2d6d47b7 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -29,7 +29,7 @@ mkTestCase = do ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,7 +50,6 @@ mkTestCase = do ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability Exit a @@ -62,7 +61,6 @@ scratch/main> add products : ([Nat], [Nat], [Nat]) -> Text 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 3dab5f2b94..03d2a3e5c3 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -43,7 +43,7 @@ mkTestCase = do saveTestCase "case-03" "v5" finish trip ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -69,7 +69,6 @@ mkTestCase = do ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability DC r @@ -85,7 +84,6 @@ scratch/main> add suspSum : [Nat] -> Delayed Nat 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 0206d434df..a1afc95405 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -13,7 +13,7 @@ mkTestCase = do saveTestCase "case-04" "v5" mutual1 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,7 +30,6 @@ mkTestCase = do ``` ucm scratch/main> add - ⍟ I've added these definitions: mkTestCase : '{IO, Exception} () @@ -38,7 +37,6 @@ scratch/main> add mutual1 : Nat -> Text scratch/main> run mkTestCase - () ``` diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index 9b0f0a3ae2..1e97076515 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -28,7 +28,7 @@ body k out v = atomically '(TVar.write out (Some n)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,7 +46,6 @@ body k out v = ``` ucm scratch/main> add - ⍟ I've added these definitions: body : Nat -> TVar (Optional Nat) -> TVar Nat ->{IO} () @@ -91,7 +90,7 @@ tests : '{io2.IO} [Result] tests = '(map spawn nats) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,7 +108,6 @@ tests = '(map spawn nats) ``` ucm scratch/main> add - ⍟ I've added these definitions: display : Nat -> Nat -> Nat -> Text @@ -118,7 +116,6 @@ scratch/main> add tests : '{IO} [Result] scratch/main> io.test tests - New test results: 1. tests ◉ verified 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 7bf2e791a4..a556d9c217 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -8,6 +8,10 @@ We add a simple definition. x = 999 ``` +``` ucm :hide +scratch/main> add +``` + Now, we update that definition and define a test-watch which depends on it. ``` unison @@ -15,7 +19,7 @@ x = 1000 test> mytest = checks [x + 1 == 1001] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +48,6 @@ We expect this 'add' to fail because the test is blocked by the update to `x`. ``` ucm :error scratch/main> add - x These definitions failed: Reason @@ -62,7 +65,7 @@ y = 42 test> useY = checks [y + 1 == 43] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,7 +90,6 @@ This should correctly identify `y` as a dependency and add that too. ``` ucm scratch/main> add useY - ⍟ I've added these definitions: useY : [Result] diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index 5912bb12bb..a954f648a4 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -16,7 +16,7 @@ testBasicFork = 'let ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +32,11 @@ testBasicFork = 'let See if we can get another thread to stuff a value into a MVar +``` ucm :hide +scratch/main> add +scratch/main> io.test testBasicFork +``` + ``` unison thread1 : Nat -> MVar Nat -> '{io2.IO}() thread1 x mv = 'let @@ -56,7 +61,7 @@ testBasicMultiThreadMVar = 'let ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -72,14 +77,12 @@ testBasicMultiThreadMVar = 'let ``` ucm scratch/main> add - ⍟ I've added these definitions: testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () scratch/main> io.test testBasicMultiThreadMVar - New test results: 1. testBasicMultiThreadMVar ◉ other thread should have incremented @@ -128,7 +131,7 @@ testTwoThreads = 'let ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -146,7 +149,6 @@ testTwoThreads = 'let ``` ucm scratch/main> add - ⍟ I've added these definitions: receivingThread : MVar Nat -> MVar Text -> '{IO} () @@ -155,7 +157,6 @@ scratch/main> add testTwoThreads : '{IO} [Result] scratch/main> io.test testTwoThreads - New test results: 1. testTwoThreads ◉ diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 2789de4cf4..79a283f214 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -11,6 +11,10 @@ self_signed_cert_pem2 = "-----BEGIN CERTIFICATE-----\nMIIDVTCCAj2gAwIBAgIUdMNT5s not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----" ``` +``` ucm :hide +scratch/main> add +``` + # Using an alternative certificate store First lets make sure we can load our cert and private key @@ -27,7 +31,7 @@ this_should_not_work=match (decodeCert.impl (toUtf8 not_a_cert) with what_should_work _ = this_should_work ++ this_should_not_work ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +48,6 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ucm scratch/main> add - ⍟ I've added these definitions: this_should_not_work : [Result] @@ -52,7 +55,6 @@ scratch/main> add what_should_work : ∀ _. _ -> [Result] scratch/main> io.test what_should_work - New test results: 1. what_should_work ◉ succesfully decoded self_signed_pem @@ -218,7 +220,7 @@ testCNReject _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -240,7 +242,6 @@ testCNReject _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: serverThread : MVar Nat -> Text -> '{IO} () @@ -253,7 +254,6 @@ scratch/main> add testConnectSelfSigned : '{IO} [Result] scratch/main> io.test testConnectSelfSigned - New test results: 1. testConnectSelfSigned ◉ should have reaped what we've sown @@ -263,7 +263,6 @@ scratch/main> io.test testConnectSelfSigned Tip: Use view 1 to view the source of a test. scratch/main> io.test testCAReject - New test results: 1. testCAReject ◉ correctly rejected self-signed cert @@ -273,7 +272,6 @@ scratch/main> io.test testCAReject Tip: Use view 1 to view the source of a test. scratch/main> io.test testCNReject - New test results: 1. testCNReject ◉ correctly rejected self-signed cert diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index 96f132593d..f4eaedd2b5 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -4,7 +4,6 @@ Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding o ``` ucm scratch/main> find Utf8 - 1. builtin.Text.toUtf8 : Text -> Bytes 2. Text.fromUtf8 : Bytes ->{Exception} Text 3. builtin.Text.fromUtf8.impl : Bytes -> Either Failure Text @@ -22,7 +21,7 @@ ascii = "ABCDE" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,7 +51,7 @@ greek = "ΑΒΓΔΕ" > toUtf8 greek ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,7 +86,7 @@ greek = "ΑΒΓΔΕ" test> greekTest = checkRoundTrip greek ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,7 +121,7 @@ greek_bytes = Bytes.fromList [206, 145, 206, 146, 206, 147, 206, 148, 206] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index a8b1057dd9..914389b163 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Some random ability stuff to ensure things work. ``` unison @@ -17,7 +21,7 @@ ha = cases { four i -> c } -> handle c (j k l -> i+j+k+l) with ha ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,7 +37,6 @@ ha = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: ability A 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 431fe74112..2ac5ea6698 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -14,7 +14,7 @@ term2 : () ->{Bar, Foo} () term2 _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,7 +32,6 @@ term2 _ = () ``` ucm scratch/main> add - ⍟ I've added these definitions: ability Bar @@ -41,7 +40,6 @@ scratch/main> add term2 : '{Bar, Foo} () scratch/main> names term1 - Term Hash: #8hum58rlih Names: term1 term2 diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md index 22bb801e43..2ba38b7735 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -2,6 +2,10 @@ https://github.com/unisonweb/unison/issues/2786 +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + First we add an ability to the codebase. Note that this will create the name `Channels.send` as an ability constructor. @@ -10,7 +14,7 @@ unique ability Channels where send : a -> {Channels} () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +29,6 @@ unique ability Channels where ``` ucm scratch/main> add - ⍟ I've added these definitions: ability Channels @@ -47,7 +50,7 @@ thing : '{Channels} () thing _ = send 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -70,7 +73,6 @@ These should fail with a term/ctor conflict since we exclude the ability from th ``` ucm :error scratch/main> update.old patch Channels.send - x These definitions failed: Reason @@ -79,7 +81,6 @@ scratch/main> update.old patch Channels.send Tip: Use `help filestatus` to learn more. scratch/main> update.old patch thing - ⍟ I've added these definitions: Channels.send : a -> () @@ -104,7 +105,7 @@ thing : '{Channels} () thing _ = send 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -125,7 +126,6 @@ These updates should succeed since `Channels` is a dependency. ``` ucm scratch/main> update.old.preview patch Channels.send - I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: @@ -138,7 +138,6 @@ scratch/main> update.old.preview patch Channels.send Channels.send : a ->{Channels} () scratch/main> update.old.preview patch thing - I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: @@ -157,7 +156,6 @@ We should also be able to successfully update the whole thing. ``` ucm scratch/main> update.old - ⊡ Ignored previously added definitions: Channels ⍟ I've updated these names to your new definition: @@ -169,11 +167,15 @@ scratch/main> update.old # Constructor-term conflict +``` ucm :hide +scratch/main2> builtins.merge lib.builtins +``` + ``` unison X.x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -188,7 +190,6 @@ X.x = 1 ``` ucm scratch/main2> add - ⍟ I've added these definitions: X.x : Nat @@ -200,7 +201,7 @@ structural ability X where x : () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -221,7 +222,6 @@ This should fail with a ctor/term conflict. ``` ucm :error scratch/main2> add - x These definitions failed: Reason diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index f15b4d53ac..c4ba8b15b6 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -2,6 +2,10 @@ ## Basic usage +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison even : Nat -> Boolean even x = if x == 0 then true else odd (drop x 1) @@ -13,7 +17,7 @@ is2even : 'Boolean is2even = '(even 2) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,7 +36,6 @@ it errors if there isn't a previous run ``` ucm :error scratch/main> add.run foo - ⚠️ There is no previous evaluation to save. Use `run` to evaluate @@ -42,7 +45,6 @@ scratch/main> add.run foo ``` ucm scratch/main> run is2even - true ``` @@ -52,7 +54,6 @@ unison file ``` ucm :error scratch/main> add.run is2even - ⚠️ Cannot save the last run result into `is2even` because that @@ -64,7 +65,6 @@ otherwise, the result is successfully persisted ``` ucm scratch/main> add.run foo.bar.baz - ⍟ I've added these definitions: foo.bar.baz : Boolean @@ -73,7 +73,6 @@ scratch/main> add.run foo.bar.baz ``` ucm scratch/main> view foo.bar.baz - foo.bar.baz : Boolean foo.bar.baz = true @@ -92,7 +91,7 @@ main : '{IO, Exception} (Nat -> Nat -> Nat) main _ = y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,11 +108,9 @@ main _ = y ``` ucm scratch/main> run main - a b -> a Nat.+ b Nat.+ z 10 scratch/main> add.run result - ⍟ I've added these definitions: result : Nat -> Nat -> Nat @@ -128,7 +125,7 @@ inc : Nat -> Nat inc x = x + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -143,7 +140,6 @@ inc x = x + 1 ``` ucm scratch/main> add inc - ⍟ I've added these definitions: inc : Nat -> Nat @@ -155,7 +151,7 @@ main : '(Nat -> Nat) main _ x = inc x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -170,17 +166,14 @@ main _ x = inc x ``` ucm scratch/main> run main - inc scratch/main> add.run natfoo - ⍟ I've added these definitions: natfoo : Nat -> Nat scratch/main> view natfoo - natfoo : Nat -> Nat natfoo = inc @@ -194,7 +187,7 @@ y = x + x main = 'y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -211,7 +204,6 @@ main = 'y ``` ucm scratch/main> run main - 2 ``` @@ -220,7 +212,7 @@ scratch/main> run main x = 50 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -237,13 +229,11 @@ this saves 2 to xres, rather than 100 ``` ucm scratch/main> add.run xres - ⍟ I've added these definitions: xres : Nat scratch/main> view xres - xres : Nat xres = 2 @@ -255,7 +245,7 @@ scratch/main> view xres main = '5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -270,11 +260,9 @@ main = '5 ``` ucm :error scratch/main> run main - 5 scratch/main> add.run xres - x These definitions failed: Reason @@ -290,7 +278,7 @@ scratch/main> add.run xres main = '5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -305,17 +293,14 @@ main = '5 ``` ucm scratch/main> run main - 5 scratch/main> add.run .an.absolute.name - ⍟ I've added these definitions: .an.absolute.name : Nat scratch/main> view .an.absolute.name - .an.absolute.name : Nat .an.absolute.name = 5 diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 6d4b004a13..62a80f5483 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide test> foo : [Test.Result] foo = [] @@ -7,13 +11,11 @@ Apparently when we add a test watch, we add a type annotation to it, even if it ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : [Result] scratch/main> view foo - foo : [Result] foo : [Result] foo = [] diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index 366cfc8fc1..fade80c1d9 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -2,6 +2,10 @@ Let's set up some definitions to start: +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison x = 1 y = 2 @@ -10,7 +14,7 @@ structural type X = One Nat structural type Y = Two Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,7 +34,6 @@ Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type X @@ -48,7 +51,7 @@ z = 1 structural type Z = One Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -69,7 +72,6 @@ Also, `Z` is an alias for `X`. ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Z @@ -86,7 +88,7 @@ x = 3 structural type X = Three Nat Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -107,7 +109,6 @@ Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -126,7 +127,7 @@ x = 2 structural type X = Two Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -147,7 +148,6 @@ Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index eb15536180..f4677577fe 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -1,3 +1,11 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + +``` ucm :hide +scratch/main> add +``` + 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: @@ -14,7 +22,6 @@ Let's try it\! ``` ucm 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 - Here's what changed in mylib : Added definitions: @@ -43,7 +50,6 @@ scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.ch 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 diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md index f5efed6622..9bc37bcd8f 100644 --- a/unison-src/transcripts/alias-term.output.md +++ b/unison-src/transcripts/alias-term.output.md @@ -1,12 +1,14 @@ `alias.term` makes a new name for a term. +``` ucm :hide +project/main> builtins.mergeio lib.builtins +``` + ``` ucm project/main> alias.term lib.builtins.bug foo - Done. project/main> ls - 1. foo (a -> b) 2. lib/ (643 terms, 92 types) @@ -16,7 +18,6 @@ It won't create a conflicted name, though. ``` ucm :error project/main> alias.term lib.builtins.todo foo - ⚠️ A term by that name already exists. @@ -25,7 +26,6 @@ project/main> alias.term lib.builtins.todo foo ``` ucm project/main> ls - 1. foo (a -> b) 2. lib/ (643 terms, 92 types) @@ -35,11 +35,9 @@ You can use `debug.alias.term.force` for that. ``` ucm project/main> debug.alias.term.force lib.builtins.todo foo - Done. project/main> ls - 1. foo (a -> b) 2. foo (a -> b) 3. lib/ (643 terms, 92 types) diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md index f85d6c6782..1767f2874f 100644 --- a/unison-src/transcripts/alias-type.output.md +++ b/unison-src/transcripts/alias-type.output.md @@ -1,12 +1,14 @@ `alias.type` makes a new name for a type. +``` ucm :hide +project/main> builtins.mergeio lib.builtins +``` + ``` ucm project/main> alias.type lib.builtins.Nat Foo - Done. project/main> ls - 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) @@ -16,7 +18,6 @@ It won't create a conflicted name, though. ``` ucm :error project/main> alias.type lib.builtins.Int Foo - ⚠️ A type by that name already exists. @@ -25,7 +26,6 @@ project/main> alias.type lib.builtins.Int Foo ``` ucm project/main> ls - 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) @@ -35,11 +35,9 @@ You can use `debug.alias.type.force` for that. ``` ucm project/main> debug.alias.type.force lib.builtins.Int Foo - Done. project/main> ls - 1. Foo (builtin type) 2. Foo (builtin type) 3. lib/ (643 terms, 92 types) diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index 45218c14b2..56b28b2730 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This tests a variable related bug in the ANF compiler. The nested let would get flattened out, resulting in: @@ -25,7 +29,7 @@ foo _ = > !foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +51,6 @@ foo _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : ∀ _. _ -> Nat diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index 6e8adfb698..e611635370 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -1,5 +1,11 @@ # Unit tests for Any.unsafeExtract +``` ucm :hide +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. ``` unison @@ -12,7 +18,7 @@ test> Any.unsafeExtract.works = ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +40,6 @@ test> Any.unsafeExtract.works = ``` ucm scratch/main> add - ⍟ I've added these definitions: Any.unsafeExtract.works : [Result] diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index 27792d91f4..76b2386517 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -1,5 +1,9 @@ # Doc rendering +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide structural type Maybe a = Nothing | Just a otherTerm = "text" @@ -77,9 +81,12 @@ Transclusion/evaluation: term = 42 ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> display term.doc - # Heading # Heading 2 diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 036af4aaed..3c5c18dcfc 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -7,7 +7,7 @@ joey.httpServer.z = 44 joey.yaml.zz = 45 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +25,6 @@ joey.yaml.zz = 45 ``` ucm scratch/main> add - ⍟ I've added these definitions: joey.httpServer.z : ##Nat diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 1f38dfd82d..531f94d3cd 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -1,10 +1,18 @@ # Get Definitions Test +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison :hide nested.names.x.doc = {{ Documentation }} nested.names.x = 42 ``` +``` ucm :hide +scratch/main> add +``` + ``` api -- Should NOT find names by suffix GET /api/projects/scratch/branches/main/getDefinition?names=x @@ -216,6 +224,10 @@ doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, doctest.otherstuff.thing = "A different thing" ``` +``` ucm :hide +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 diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 52a3fac22f..4b2c0cacf8 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -1,5 +1,14 @@ # List Projects And Branches Test +``` ucm :hide +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 +``` + ``` api -- Should list all projects GET /api/projects diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 6952a0cd32..8cdd90e36a 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -1,5 +1,9 @@ # Namespace Details Test +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison {{ Documentation }} nested.names.x = 42 @@ -9,7 +13,7 @@ Here's a *README*! }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,7 +30,6 @@ Here's a *README*! ``` ucm scratch/main> add - ⍟ I've added these definitions: nested.names.readme : Doc2 diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index 5d65eaae4b..7477221289 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -1,5 +1,9 @@ # Namespace list api +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison {{ Documentation }} nested.names.x = 42 @@ -7,7 +11,7 @@ nested.names.x = 42 nested.names.readme = {{ I'm a readme! }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ nested.names.readme = {{ I'm a readme! }} ``` ucm scratch/main> add - ⍟ I've added these definitions: nested.names.readme : Doc2 diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index 2af77a7afd..e5a34881b5 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -1,5 +1,9 @@ # Definition Summary APIs +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide nat : Nat nat = 42 @@ -19,6 +23,12 @@ structural ability Stream s where send : s -> () ``` +``` ucm :hide +scratch/main> add +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl +``` + ## Term Summary APIs ``` api diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 9adabafe32..d89fcc0cb4 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -2,11 +2,15 @@ Should block an `add` if it requires an update on an in-file dependency. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ x = 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: x : Nat @@ -35,7 +38,7 @@ x = 10 y = x + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -57,7 +60,6 @@ Try to add only the new `y`. This should fail because it requires an update to ` ``` ucm :error scratch/main> add y - x These definitions failed: Reason diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md index 6d0ac39145..d90a91e574 100644 --- a/unison-src/transcripts/blocks.output.md +++ b/unison-src/transcripts/blocks.output.md @@ -1,5 +1,9 @@ ## Blocks and scoping +``` ucm :hide +scratch/main> builtins.merge +``` + ### Names introduced by a block shadow names introduced in outer scopes For example: @@ -15,7 +19,7 @@ ex thing = > ex "hello" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +52,7 @@ ex thing = > ex "hello" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,7 +87,7 @@ ex thing = > ex (x -> x * 100) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -115,7 +119,7 @@ ex thing = > ex (x -> x * 100) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -154,7 +158,7 @@ ex n = ping 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -181,7 +185,7 @@ ex n = ping 0 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -205,7 +209,7 @@ ex n = pong ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 @@ -223,7 +227,7 @@ ex n = loop ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 @@ -240,7 +244,7 @@ ex n = !loop ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -269,7 +273,7 @@ ex n = zap1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. @@ -293,7 +297,7 @@ ex n = zap1 "pluto" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -322,7 +326,7 @@ ex n = ping 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -349,7 +353,7 @@ ex n = ping 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you 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 f12f51e270..89239ef01e 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -1,5 +1,9 @@ Regression test for https://github.com/unisonweb/unison/pull/2819 +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison hangExample : Boolean hangExample = @@ -7,7 +11,7 @@ hangExample = && ("a long piece of text to hang the line" == "") ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,13 +26,11 @@ hangExample = ``` ucm scratch/main> add - ⍟ I've added these definitions: hangExample : Boolean scratch/main> view hangExample - hangExample : Boolean hangExample = "a long piece of text to hang the line" == "" diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index e6f4f0f703..942980eff3 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -1,5 +1,10 @@ The `branch` command creates a new branch. +``` ucm :hide +scratch/main> project.create-empty foo +scratch/main> project.create-empty bar +``` + First, we'll create a term to include in the branches. ``` unison :hide @@ -8,11 +13,9 @@ someterm = 18 ``` ucm scratch/main> builtins.merge lib.builtins - Done. scratch/main> add - ⍟ I've added these definitions: someterm : Nat @@ -26,125 +29,105 @@ project. It can also create an empty branch. ``` ucm foo/main> branch topic1 - Done. I've created the topic1 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic1`. foo/main> branch /topic2 - Done. I've created the topic2 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic2`. foo/main> branch foo/topic3 - Done. I've created the topic3 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic3`. foo/main> branch main topic4 - Done. I've created the topic4 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic4`. foo/main> branch main /topic5 - Done. I've created the topic5 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic5`. foo/main> branch main foo/topic6 - Done. I've created the topic6 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic6`. foo/main> branch /main topic7 - Done. I've created the topic7 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic7`. foo/main> branch /main /topic8 - Done. I've created the topic8 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic8`. foo/main> branch /main foo/topic9 - Done. I've created the topic9 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic9`. foo/main> branch foo/main topic10 - Done. I've created the topic10 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic10`. foo/main> branch foo/main /topic11 - Done. I've created the topic11 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. scratch/main> branch foo/main foo/topic12 - Done. I've created the topic12 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic12`. foo/main> branch bar/topic - Done. I've created the bar/topic branch based off foo/main. bar/main> branch foo/main topic2 - Done. I've created the bar/topic2 branch based off foo/main. bar/main> branch foo/main /topic3 - Done. I've created the bar/topic3 branch based off foo/main. scratch/main> branch foo/main bar/topic4 - Done. I've created the bar/topic4 branch based off foo/main. foo/main> branch.empty empty1 - Done. I've created an empty branch foo/empty1. Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty /empty2 - Done. I've created an empty branch foo/empty2. Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty foo/empty3 - Done. I've created an empty branch foo/empty3. Tip: Use `merge /somebranch` to initialize this branch. scratch/main> branch.empty foo/empty4 - Done. I've created an empty branch foo/empty4. Tip: Use `merge /somebranch` to initialize this branch. @@ -155,7 +138,6 @@ The `branch` command can create branches named `releases/drafts/*` (because why ``` ucm foo/main> branch releases/drafts/1.2.3 - Done. I've created the releases/drafts/1.2.3 branch based off of main. @@ -163,14 +145,12 @@ foo/main> branch releases/drafts/1.2.3 `switch /main` then `merge /releases/drafts/1.2.3`. foo/main> switch /releases/drafts/1.2.3 - ``` The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. ``` ucm :error foo/main> branch releases/1.2.3 - Branch names like releases/1.2.3 are reserved for releases. Tip: to download an existing release, try @@ -179,7 +159,6 @@ foo/main> branch releases/1.2.3 Tip: to draft a new release, try `release.draft 1.2.3`. foo/main> switch /releases/1.2.3 - foo/releases/1.2.3 does not exist. ``` diff --git a/unison-src/transcripts/branch-relative-path.output.md b/unison-src/transcripts/branch-relative-path.output.md index 59154da629..76b5a78c07 100644 --- a/unison-src/transcripts/branch-relative-path.output.md +++ b/unison-src/transcripts/branch-relative-path.output.md @@ -3,7 +3,7 @@ foo = 5 foo.bar = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +19,6 @@ foo.bar = 1 ``` ucm p0/main> add - ⍟ I've added these definitions: foo : ##Nat @@ -32,7 +31,7 @@ bonk = 5 donk.bonk = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,49 +49,40 @@ donk.bonk = 1 ``` ucm p1/main> add - ⍟ I've added these definitions: bonk : ##Nat donk.bonk : ##Nat p1/main> fork p0/main: zzz - Done. p1/main> find zzz - 1. zzz.foo : ##Nat 2. zzz.foo.bar : ##Nat p1/main> fork p0/main:foo yyy - Done. p1/main> find yyy - 1. yyy.bar : ##Nat p0/main> fork p1/main: p0/main:p1 - Done. p0/main> ls p1 - 1. bonk (##Nat) 2. donk/ (1 term) 3. yyy/ (1 term) 4. zzz/ (2 terms) p0/main> ls p1.zzz - 1. foo (##Nat) 2. foo/ (1 term) p0/main> ls p1.yyy - 1. bar (##Nat) ``` diff --git a/unison-src/transcripts/bug-fix-4354.output.md b/unison-src/transcripts/bug-fix-4354.output.md index 7fcba60d94..faa66cafe9 100644 --- a/unison-src/transcripts/bug-fix-4354.output.md +++ b/unison-src/transcripts/bug-fix-4354.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison bonk : forall a. a -> a bonk x = @@ -8,7 +12,7 @@ bonk x = x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index b3aae7236f..808eabf014 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +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 scratch/main> display doc.guide - # Unison computable documentation # Basic formatting @@ -200,7 +204,6 @@ scratch/main> display doc.guide Some text More text Zounds! scratch/main> add - ⍟ I've added these definitions: basicFormatting : Doc2 @@ -213,7 +216,6 @@ scratch/main> add sqr : Nat -> Nat scratch/main> display doc.guide - # Unison computable documentation # Basic formatting @@ -418,7 +420,7 @@ But we can't display this due to a decompilation problem. rendered = Pretty.get (docFormatConsole doc.guide) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -433,7 +435,6 @@ rendered = Pretty.get (docFormatConsole doc.guide) ```` ucm scratch/main> display rendered - # Unison computable documentation # Basic formatting @@ -631,13 +632,11 @@ scratch/main> display rendered Some text More text Zounds! scratch/main> add - ⍟ I've added these definitions: rendered : Annotated () (Either SpecialForm ConsoleText) scratch/main> display rendered - # Unison computable documentation # Basic formatting @@ -835,7 +834,6 @@ scratch/main> display rendered Some text More text Zounds! scratch/main> undo - Here are the changes I undid Added definitions: @@ -852,7 +850,7 @@ rendered = Pretty.get (docFormatConsole doc.guide) > rendered ``` -```` ucm +```` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md index 8147375776..5f121260ef 100644 --- a/unison-src/transcripts/builtins-merge.output.md +++ b/unison-src/transcripts/builtins-merge.output.md @@ -2,11 +2,9 @@ The `builtins.merge` command adds the known builtins to the specified subnamespa ``` ucm scratch/main> builtins.merge builtins - Done. scratch/main> ls builtins - 1. Any (builtin type) 2. Any/ (2 terms) 3. Boolean (builtin type) diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index b9cc6a9406..250ea54602 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -1,5 +1,11 @@ # Unit tests for builtin functions +``` ucm :hide +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 `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. ## `Int` functions @@ -81,6 +87,10 @@ test> Int.tests.conversions = ] ``` +``` ucm :hide +scratch/main> add +``` + ## `Nat` functions ``` unison :hide @@ -152,6 +162,10 @@ test> Nat.tests.conversions = ] ``` +``` ucm :hide +scratch/main> add +``` + ## `Boolean` functions ``` unison :hide @@ -176,6 +190,10 @@ test> Boolean.tests.notTable = ] ``` +``` ucm :hide +scratch/main> add +``` + ## `Text` functions ``` unison :hide @@ -270,6 +288,10 @@ test> Text.tests.indexOfEmoji = ``` +``` ucm :hide +scratch/main> add +``` + ## `Bytes` functions ``` unison :hide @@ -330,6 +352,10 @@ test> Bytes.tests.indexOf = ``` +``` ucm :hide +scratch/main> add +``` + ## `List` comparison ``` unison :hide @@ -345,6 +371,10 @@ test> checks [ ] ``` +``` ucm :hide +scratch/main> add +``` + Other list functions ``` unison :hide @@ -363,7 +393,7 @@ test> Any.test1 = checks [(Any "hi" == Any "hi")] test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -392,6 +422,10 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` +``` ucm :hide +scratch/main> add +``` + ## Sandboxing functions ``` unison @@ -415,7 +449,7 @@ test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] openFile] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -455,6 +489,10 @@ openFile] ``` +``` ucm :hide +scratch/main> add +``` + ``` unison openFilesIO = do checks @@ -468,7 +506,7 @@ openFilesIO = do ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -483,13 +521,11 @@ openFilesIO = do ``` ucm scratch/main> add - ⍟ I've added these definitions: openFilesIO : '{IO} [Result] scratch/main> io.test openFilesIO - New test results: 1. openFilesIO ◉ Passed @@ -509,7 +545,7 @@ Just exercises the function test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -533,13 +569,16 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` +``` ucm :hide +scratch/main> add +``` + ## Run the tests 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 scratch/main> test - Cached test results (`help testcache` to learn more) 1. Any.test1 ◉ Passed diff --git a/unison-src/transcripts/bytesFromList.output.md b/unison-src/transcripts/bytesFromList.output.md index 2351e4e192..0342f1682c 100644 --- a/unison-src/transcripts/bytesFromList.output.md +++ b/unison-src/transcripts/bytesFromList.output.md @@ -1,10 +1,14 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`: ``` unison > Bytes.fromList [1,2,3,4] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md index fc2a48001e..a8247b27e7 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -1,11 +1,15 @@ Regression test for https://github.com/unisonweb/unison/issues/763 +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison (+-+) : Nat -> Nat -> Nat (+-+) x y = x * y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,17 +24,14 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ucm scratch/main> add - ⍟ I've added these definitions: +-+ : Nat -> Nat -> Nat scratch/main> move.term +-+ boppitybeep - Done. scratch/main> move.term boppitybeep +-+ - Done. ``` diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index 39f9435a9f..13c6fd4f37 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -1,10 +1,14 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point being, this shouldn't crash the runtime. :) +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison (-) = builtin.Nat.sub ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ucm scratch/main> add - ⍟ I've added these definitions: - : Nat -> Nat -> Int @@ -30,7 +33,7 @@ scratch/main> add baz x = x - 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/constructor-applied-to-unit.output.md b/unison-src/transcripts/constructor-applied-to-unit.output.md index 3e410800b8..2a05c185c0 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.output.md +++ b/unison-src/transcripts/constructor-applied-to-unit.output.md @@ -1,3 +1,8 @@ +``` ucm :hide +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##Any.Any Any +``` + ``` unison structural type Zoink a b c = Zoink a b c @@ -5,7 +10,7 @@ structural type Zoink a b c = Zoink a b c > [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/contrabilities.output.md b/unison-src/transcripts/contrabilities.output.md index d3d0cfd6f2..a871895e4b 100644 --- a/unison-src/transcripts/contrabilities.output.md +++ b/unison-src/transcripts/contrabilities.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison f : (() -> a) -> Nat f x = 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md index caa4d2740d..b71461cf4f 100644 --- a/unison-src/transcripts/create-author.output.md +++ b/unison-src/transcripts/create-author.output.md @@ -1,8 +1,11 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + Demonstrating `create.author`: ``` ucm scratch/main> create.author alicecoder "Alice McGee" - Added definitions: 1. metadata.authors.alicecoder : Author @@ -12,7 +15,6 @@ scratch/main> create.author alicecoder "Alice McGee" Tip: Add License values for alicecoder under metadata. scratch/main> find alicecoder - 1. metadata.authors.alicecoder : Author 2. metadata.copyrightHolders.alicecoder : CopyrightHolder 3. metadata.authors.alicecoder.guid : GUID diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index c885dd236d..9bd0a0ae22 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -1,5 +1,9 @@ Update a member of a cycle, but retain the cycle. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison ping : 'Nat ping _ = !pong + 1 @@ -8,7 +12,7 @@ pong : 'Nat pong _ = !ping + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ pong _ = !ping + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: ping : 'Nat @@ -37,7 +40,7 @@ ping : 'Nat ping _ = !pong + 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +56,6 @@ ping _ = !pong + 3 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -64,7 +66,6 @@ scratch/main> update Done. scratch/main> view ping pong - ping : 'Nat ping _ = use Nat + diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index 20be4fd088..f11c49bc27 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -1,5 +1,9 @@ Update a member of a cycle with a type-preserving update, but sever the cycle. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison ping : 'Nat ping _ = !pong + 1 @@ -8,7 +12,7 @@ pong : 'Nat pong _ = !ping + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ pong _ = !ping + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: ping : 'Nat @@ -37,7 +40,7 @@ ping : 'Nat ping _ = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +56,6 @@ ping _ = 3 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -64,7 +66,6 @@ scratch/main> update Done. scratch/main> view ping pong - ping : 'Nat ping _ = 3 diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index 8f9c750346..fb5f1e78cf 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -1,5 +1,9 @@ Update a member of a cycle with a type-changing update, thus severing the cycle. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison ping : 'Nat ping _ = !pong + 1 @@ -8,7 +12,7 @@ pong : 'Nat pong _ = !ping + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ pong _ = !ping + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: ping : 'Nat @@ -37,7 +40,7 @@ ping : Nat ping = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,13 +56,11 @@ ping = 3 ``` ucm scratch/main> update.old - ⍟ I've updated these names to your new definition: ping : Nat scratch/main> view ping pong - ping : Nat ping = 3 diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index 5d884c8d14..a9a7d17e0e 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -1,5 +1,9 @@ `update` properly discovers and establishes new cycles. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison ping : 'Nat ping _ = 1 @@ -8,7 +12,7 @@ pong : 'Nat pong _ = !ping + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ pong _ = !ping + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: ping : 'Nat @@ -40,7 +43,7 @@ clang : 'Nat clang _ = !pong + 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,7 +63,6 @@ clang _ = !pong + 3 ``` ucm scratch/main> update.old ping - ⍟ I've added these definitions: clang : 'Nat @@ -71,7 +73,6 @@ scratch/main> update.old ping pong : 'Nat scratch/main> view ping pong clang - clang : 'Nat clang _ = use Nat + diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index be97678061..6b908ed7f1 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide x = 30 @@ -14,7 +18,6 @@ ability Ask a where ``` ucm scratch/main> add - ⍟ I've added these definitions: ability Ask a @@ -24,15 +27,12 @@ scratch/main> add y : Nat scratch/main> debug.term.abt Nat.+ - Builtin term: ##Nat.+ 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" scratch/main> debug.term.abt Some - Constructor #0 of the following type: DataDeclaration { modifier = Structural @@ -62,7 +62,6 @@ scratch/main> debug.term.abt Some } scratch/main> debug.term.abt ask - Constructor #0 of the following type: EffectDeclaration { toDataDecl = DataDeclaration @@ -91,11 +90,9 @@ scratch/main> debug.term.abt ask } scratch/main> debug.type.abt Nat - Builtin type: ##Nat scratch/main> debug.type.abt Optional - DataDeclaration { modifier = Structural , annotation = External @@ -124,7 +121,6 @@ scratch/main> debug.type.abt Optional } scratch/main> debug.type.abt Ask - EffectDeclaration { toDataDecl = DataDeclaration { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index b338836d66..17fac9b18a 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -9,7 +9,7 @@ structural type a.x.Foo = Foo | Bar structural type a.b.Baz = Boo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +29,6 @@ structural type a.b.Baz = Boo ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type a.b.Baz @@ -40,7 +39,6 @@ scratch/main> add a.x.three : ##Nat scratch/main> delete.term.verbose a.b.one - Removed definitions: 1. a.b.one : ##Nat @@ -49,15 +47,12 @@ scratch/main> delete.term.verbose a.b.one this change. scratch/main> alias.term a.two a.newtwo - Done. scratch/main> move.namespace a.x a.y - Done. scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -92,7 +87,6 @@ scratch/main> history □ 4. #gss5s88mo3 (start of history) scratch/main> debug.name-diff 4 1 - Kind Name Change Ref Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg Term a.y.four Added #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index d19a6c5da1..1228bbe6bf 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -12,31 +12,31 @@ http.y = 7 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 scratch/app1> fork text lib.text_v1 - Done. 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. ``` @@ -45,13 +45,11 @@ As such, we see two copies of `a` and two copies of `x` via these direct depende ``` ucm scratch/app1> names a - Term Hash: #gjmq673r1v Names: lib.text_v1.a lib.text_v2.a scratch/app1> names x - Term Hash: #nsmc4p1ra4 Names: lib.http_v3.x lib.http_v4.x @@ -63,31 +61,24 @@ 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 - Done. scratch/app2> delete.namespace text - Done. ``` @@ -97,13 +88,11 @@ We see neither the second indirect copy of `a` nor the indirect copy of `x` via ``` ucm scratch/app2> names a - Term Hash: #gjmq673r1v Names: lib.webutil.lib.text_v1.a scratch/app2> names x - Term Hash: #nsmc4p1ra4 Names: lib.http_v1.x lib.http_v2.x diff --git a/unison-src/transcripts/definition-diff-api.output.md b/unison-src/transcripts/definition-diff-api.output.md index d33aafa5f1..b02aa136b4 100644 --- a/unison-src/transcripts/definition-diff-api.output.md +++ b/unison-src/transcripts/definition-diff-api.output.md @@ -1,14 +1,11 @@ ``` ucm diffs/main> builtins.mergeio lib.builtins - Done. diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> - Done. diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- - Done. ``` @@ -35,7 +32,7 @@ take n s = handle s() with h n ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +50,6 @@ take n s = ``` ucm diffs/main> add - ⍟ I've added these definitions: ability Stream a @@ -62,7 +58,6 @@ diffs/main> add term : Nat diffs/main> branch.create new - Done. I've created the new branch based off of main. Tip: To merge your work back into the main branch, first @@ -94,7 +89,7 @@ take n s = else None ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -114,7 +109,6 @@ take n s = ``` ucm diffs/new> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md index 105d8d0679..e72bab95d7 100644 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ b/unison-src/transcripts/delete-namespace-dependents-check.output.md @@ -4,13 +4,17 @@ This is a regression test, previously `delete.namespace` allowed a delete as long as the deletions had a name *anywhere* in your codebase, it should only check the current project branch. +``` ucm :hide +myproject/main> builtins.merge +``` + ``` unison sub.dependency = 123 dependent = dependency + 99 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,21 +30,18 @@ dependent = dependency + 99 ``` ucm :error myproject/main> add - ⍟ I've added these definitions: dependent : Nat sub.dependency : Nat myproject/main> branch /new - Done. I've created the new branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /new`. myproject/new> delete.namespace sub - ⚠️ I didn't delete the namespace because the following @@ -53,7 +54,6 @@ myproject/new> delete.namespace sub without names, use delete.namespace.force myproject/new> view dependent - dependent : Nat dependent = use Nat + diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index 5da42fb870..cde3b2d81f 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -1,5 +1,9 @@ # delete.namespace.force +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide no_dependencies.thing = "no dependents on this term" @@ -10,11 +14,14 @@ dependents.usage1 = dependencies.term1 + dependencies.term2 dependents.usage2 = dependencies.term1 * dependencies.term2 ``` +``` ucm :hide +scratch/main> add +``` + Deleting a namespace with no external dependencies should succeed. ``` ucm scratch/main> delete.namespace no_dependencies - Done. ``` @@ -23,7 +30,6 @@ Deleting a namespace with external dependencies should fail and list all depende ``` ucm :error scratch/main> delete.namespace dependencies - ⚠️ I didn't delete the namespace because the following @@ -45,7 +51,6 @@ Deleting a namespace with external dependencies should succeed when using `delet ``` ucm scratch/main> delete.namespace.force dependencies - Done. ⚠️ @@ -66,7 +71,6 @@ I should be able to view an affected dependency by number ``` ucm scratch/main> view 2 - dependents.usage2 : Nat dependents.usage2 = use Nat * @@ -78,7 +82,6 @@ Deleting the root namespace should require confirmation if not forced. ``` ucm scratch/main> delete.namespace . - ⚠️ Are you sure you want to clear away everything? @@ -86,14 +89,12 @@ scratch/main> delete.namespace . instead, or delete the current branch with `delete.branch` 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 scratch/main> history . - Note: The most recent namespace hash is immediately below this message. @@ -107,14 +108,12 @@ Deleting the root namespace shouldn't require confirmation if forced. ``` ucm 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 scratch/main> history . - Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index 3724341733..cba6fa8b50 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -3,58 +3,49 @@ your working directory with each command). ``` ucm foo/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`. foo/topic> delete.branch /topic - ``` A branch need not be preceded by a forward slash. ``` ucm foo/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`. foo/topic> delete.branch topic - ``` You can precede the branch name by a project name. ``` ucm foo/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`. scratch/main> delete.branch foo/topic - ``` You can delete the only branch in a project. ``` ucm foo/main> delete.branch /main - ``` You can delete the last branch in the project, a new one will be created. ``` ucm scratch/main> delete.branch scratch/main - scratch/main> branches - Branch Remote branch 1. main 2. main2 @@ -65,11 +56,8 @@ If the the last branch isn't /main, then /main will be created. ``` ucm scratch/main2> delete.branch /main - scratch/main2> delete.branch /main2 - scratch/other> branches - Branch Remote branch 1. main 2. other diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md index 37d8b2e350..7af8d92aaa 100644 --- a/unison-src/transcripts/delete-project.output.md +++ b/unison-src/transcripts/delete-project.output.md @@ -2,7 +2,6 @@ ``` ucm scratch/main> project.create-empty foo - 🎉 I've created the project foo. 🎨 Type `ui` to explore this project's code in your browser. @@ -18,7 +17,6 @@ scratch/main> project.create-empty foo 🎉 🥳 Happy coding! scratch/main> project.create-empty bar - 🎉 I've created the project bar. 🎨 Type `ui` to explore this project's code in your browser. @@ -35,34 +33,25 @@ scratch/main> project.create-empty bar -- I can delete the project I'm currently on scratch/main> delete.project scratch - foo/main> projects - 1. bar 2. foo -- I can delete a different project foo/main> delete.project bar - foo/main> projects - 1. foo -- I can delete the last project, a new scratch project will be created foo/main> delete.project foo - project/main> projects - 1. project 2. scratch -- If the last project is scratch, a scratch2 project will be created. scratch/main> delete.project project - scratch/main> delete.project scratch - project/main> projects - 1. project 2. scratch2 diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index 755c217dad..dbc0fd16e9 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -1,6 +1,5 @@ ``` ucm :error scratch/main> delete foo - ⚠️ The following names were not found in the codebase. Check your spelling. @@ -15,22 +14,18 @@ structural type Foo = Foo () ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo foo : ##Nat scratch/main> delete foo - Done. scratch/main> delete.type Foo - Done. scratch/main> delete.term Foo.Foo - Done. ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index ee66a6162b..48f6802440 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -1,5 +1,9 @@ # Delete +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + The delete command can delete both terms and types. First, let's make sure it complains when we try to delete a name that doesn't @@ -7,7 +11,6 @@ exist. ``` ucm :error scratch/main> delete.verbose foo - ⚠️ The following names were not found in the codebase. Check your spelling. @@ -25,14 +28,12 @@ structural type Foo = Foo () ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo foo : Nat scratch/main> delete.verbose foo - Removed definitions: 1. foo : Nat @@ -41,7 +42,6 @@ scratch/main> delete.verbose foo this change. scratch/main> delete.verbose Foo - Removed definitions: 1. structural type Foo @@ -50,7 +50,6 @@ scratch/main> delete.verbose Foo this change. scratch/main> delete.verbose Foo.Foo - Removed definitions: 1. Foo.Foo : '#089vmor9c5 @@ -69,14 +68,12 @@ a.bar = 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: a.bar : Nat a.foo : Nat scratch/main> debug.alias.term.force a.bar a.foo - Done. ``` @@ -85,7 +82,6 @@ A delete should remove both versions of the term. ``` ucm scratch/main> delete.verbose a.foo - Removed definitions: 1. a.foo#gjmq673r1v : Nat @@ -100,7 +96,6 @@ scratch/main> delete.verbose a.foo this change. scratch/main> ls a - 1. bar (Nat) ``` @@ -114,7 +109,6 @@ structural type a.Bar = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type a.Bar @@ -122,11 +116,9 @@ scratch/main> add structural type a.Foo scratch/main> debug.alias.type.force a.Bar a.Foo - Done. scratch/main> delete.verbose a.Foo - Removed definitions: 1. structural type a.Foo#089vmor9c5 @@ -142,7 +134,6 @@ scratch/main> delete.verbose a.Foo this change. scratch/main> delete.verbose a.Foo.Foo - Removed definitions: 1. a.Foo.Foo : '#089vmor9c5 @@ -161,14 +152,12 @@ structural type foo = Foo () ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type foo foo : Nat scratch/main> delete.verbose foo - Removed definitions: 1. structural type foo @@ -189,7 +178,6 @@ c = "c" ``` ucm scratch/main> add - ⍟ I've added these definitions: a : Text @@ -197,7 +185,6 @@ scratch/main> add c : Text scratch/main> delete.verbose a b c - Removed definitions: 1. a : Text @@ -220,7 +207,6 @@ c = "c" ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo @@ -229,7 +215,6 @@ scratch/main> add c : Text scratch/main> delete.verbose a b c Foo - Removed definitions: 1. structural type Foo @@ -241,7 +226,6 @@ scratch/main> delete.verbose a b c Foo this change. scratch/main> delete.verbose Foo.Foo - Name changes: Original Changes @@ -261,13 +245,11 @@ structural type Foo = Foo () ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo scratch/main> delete.verbose Foo Foo.Foo - Removed definitions: 1. structural type Foo @@ -294,7 +276,6 @@ d = a + b + c ``` ucm :error scratch/main> add - ⍟ I've added these definitions: a : Nat @@ -304,7 +285,6 @@ scratch/main> add d : Nat scratch/main> delete.verbose a b c - ⚠️ I didn't delete the following definitions because they are @@ -328,7 +308,6 @@ h = e + f + g ``` ucm scratch/main> add - ⍟ I've added these definitions: e : Nat @@ -337,7 +316,6 @@ scratch/main> add h : Nat scratch/main> delete.verbose e f g h - Removed definitions: 1. e : Nat @@ -362,14 +340,12 @@ incrementFoo = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo incrementFoo : Foo -> Nat scratch/main> delete.verbose Foo Foo.Foo incrementFoo - Removed definitions: 1. structural type Foo @@ -392,7 +368,6 @@ h = e + f + g ``` ucm :error scratch/main> add - ⍟ I've added these definitions: e : Nat @@ -401,7 +376,6 @@ scratch/main> add h : Nat scratch/main> delete.verbose e f gg - ⚠️ The following names were not found in the codebase. Check your spelling. @@ -418,14 +392,12 @@ pong _ = 4 Nat.+ !ping ``` ucm scratch/main> add - ⍟ I've added these definitions: ping : 'Nat pong : 'Nat scratch/main> delete.verbose ping - Removed definitions: 1. ping : 'Nat @@ -434,7 +406,6 @@ scratch/main> delete.verbose ping this change. scratch/main> view pong - pong : 'Nat pong _ = use Nat + diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 6005a8e35b..4649c1c2a7 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ### `debug.file` I can use `debug.file` to see the hashes of the last typechecked file. @@ -18,7 +22,6 @@ inside.r = d ``` ucm scratch/main> debug.file - type inside.M#h37a56c5ep type outside.A#6l6krl7n4l type outside.B#eo6rj0lj1b @@ -38,7 +41,6 @@ But wait, there's more. I can check the dependencies and dependents of a defini ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type inside.M @@ -51,11 +53,9 @@ scratch/main> add outside.d : Boolean scratch/main> dependents q - q has no dependents. scratch/main> dependencies q - Dependencies of: q Types: @@ -72,7 +72,6 @@ scratch/main> dependencies q the above list. scratch/main> dependencies B - Dependencies of: type B, B Types: @@ -84,7 +83,6 @@ scratch/main> dependencies B the above list. scratch/main> dependencies d - Dependencies of: d Types: @@ -103,7 +101,6 @@ scratch/main> dependencies d the above list. scratch/main> dependents d - Dependents of: d Terms: diff --git a/unison-src/transcripts/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index 8dda9405cc..c25e9ffb69 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -1,5 +1,9 @@ # Destructuring binds +``` ucm :hide +scratch/main> builtins.merge +``` + Here's a couple examples: ``` unison @@ -14,7 +18,7 @@ ex1 tup = c + d ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,14 +34,12 @@ ex1 tup = ``` ucm scratch/main> add - ⍟ I've added these definitions: ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat scratch/main> view ex0 ex1 - ex0 : Nat -> Nat ex0 n = use Nat + @@ -59,7 +61,7 @@ ex2 tup = match tup with (a, b, (c,d)) -> c + d ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,7 +85,7 @@ ex4 = "Doesn't typecheck" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what a refers to here: @@ -117,7 +119,7 @@ ex5a _ = match (99 + 1, "hi") with _ -> "impossible" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -133,14 +135,12 @@ ex5a _ = match (99 + 1, "hi") with ``` ucm scratch/main> add - ⍟ I've added these definitions: ex5 : 'Text ex5a : 'Text scratch/main> view ex5 ex5a - ex5 : 'Text ex5 _ = match 99 Nat.+ 1 with 12 -> "Hi" @@ -166,13 +166,11 @@ For clarity, the pretty-printer leaves this alone, even though in theory it coul ``` ucm scratch/main> add - ⍟ I've added these definitions: ex6 : (Nat, Nat) -> Nat scratch/main> view ex6 - ex6 : (Nat, Nat) -> Nat ex6 = cases (x, y) -> x Nat.+ y diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index 88bc8f1997..a098da0639 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -1,3 +1,11 @@ +``` ucm :hide +scratch/b1> builtins.merge lib.builtins +scratch/b2> builtins.merge lib.builtins +scratch/nsx> builtins.merge lib.builtins +scratch/main> builtins.merge lib.builtins +scratch/ns1> builtins.merge lib.builtins +``` + ``` unison :hide x = 23 fslkdjflskdjflksjdf = 663 @@ -5,7 +13,6 @@ fslkdjflskdjflksjdf = 663 ``` ucm scratch/b1> add - ⍟ I've added these definitions: fslkdjflskdjflksjdf : Nat @@ -21,7 +28,6 @@ abc = 23 ``` ucm scratch/b2> add - ⍟ I've added these definitions: abc : Nat @@ -29,14 +35,12 @@ scratch/b2> add x : Nat scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf - Done. ``` ``` ucm scratch/main> diff.namespace /b1: /b2: - Resolved name conflicts: 1. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : Nat @@ -77,7 +81,6 @@ structural ability X a1 a2 where x : () ``` ucm scratch/ns1> add - ⍟ I've added these definitions: structural type A a @@ -89,15 +92,12 @@ scratch/ns1> add helloWorld : Text scratch/ns1> alias.term fromJust fromJust' - Done. scratch/ns1> alias.term helloWorld helloWorld2 - Done. scratch/ns1> branch /ns2 - Done. I've created the ns2 branch based off of ns1. Tip: To merge your work back into the ns1 branch, first @@ -109,7 +109,6 @@ Here's what we've done so far: ``` ucm :error scratch/main> diff.namespace .nothing /ns1: - ⚠️ The namespace scratch/main:.nothing is empty. Was there a typo? @@ -118,7 +117,6 @@ scratch/main> diff.namespace .nothing /ns1: ``` ucm :error scratch/main> diff.namespace /ns1: /ns2: - The namespaces are identical. ``` @@ -129,17 +127,14 @@ junk = "asldkfjasldkfj" ``` ucm scratch/ns1> add - ⍟ I've added these definitions: junk : Text scratch/ns1> debug.alias.term.force junk fromJust - Done. scratch/ns1> delete.term junk - Done. ``` @@ -155,7 +150,6 @@ unique type Y a b = Y a b ``` ucm scratch/ns2> update - Okay, I'm searching the branch for code that needs to be updated... @@ -166,7 +160,6 @@ scratch/ns2> update Done. scratch/main> diff.namespace /ns1: /ns2: - Resolved name conflicts: 1. ┌ fromJust#gjmq673r1v : Nat @@ -199,27 +192,21 @@ scratch/main> diff.namespace /ns1: /ns2: 15. fromJust#gjmq673r1v ┘ scratch/ns2> alias.term d d' - Done. scratch/ns2> alias.type A A' - Done. scratch/ns2> alias.term A.A A'.A - Done. scratch/ns2> alias.type X X' - Done. scratch/ns2> alias.term X.x X'.x - Done. scratch/main> diff.namespace /ns1: /ns2: - Resolved name conflicts: 1. ┌ fromJust#gjmq673r1v : Nat @@ -261,34 +248,27 @@ scratch/main> diff.namespace /ns1: /ns2: 23. X.x 24. X'.x (added) scratch/ns1> alias.type X X2 - Done. scratch/ns1> alias.term X.x X2.x - Done. scratch/ns2> alias.type A' A'' - Done. scratch/ns2> alias.term A'.A A''.A - Done. scratch/ns2> branch /ns3 - Done. I've created the ns3 branch based off of ns2. Tip: To merge your work back into the ns2 branch, first `switch /ns2` then `merge /ns3`. scratch/ns2> alias.term fromJust' yoohoo - Done. scratch/ns2> delete.term.verbose fromJust' - Name changes: Original Changes @@ -299,7 +279,6 @@ scratch/ns2> delete.term.verbose fromJust' this change. scratch/main> diff.namespace /ns3: /ns2: - Name changes: Original Changes @@ -314,14 +293,12 @@ bdependent = "banana" ``` ucm scratch/ns3> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> diff.namespace /ns2: /ns3: - Updates: 1. bdependent : Nat @@ -350,7 +327,6 @@ forconflicts = 777 ``` ucm scratch/nsx> add - ⍟ I've added these definitions: a : Nat @@ -358,14 +334,12 @@ scratch/nsx> add forconflicts : Nat scratch/nsx> branch /nsy - Done. I've created the nsy branch based off of nsx. Tip: To merge your work back into the nsx branch, first `switch /nsx` then `merge /nsy`. scratch/nsx> branch /nsz - Done. I've created the nsz branch based off of nsx. Tip: To merge your work back into the nsx branch, first @@ -379,7 +353,6 @@ a = 444 ``` ucm scratch/nsy> update - Okay, I'm searching the branch for code that needs to be updated... @@ -397,7 +370,6 @@ a = 555 ``` ucm scratch/nsz> update - Okay, I'm searching the branch for code that needs to be updated... @@ -408,25 +380,21 @@ scratch/nsz> update Done. scratch/nsy> branch /nsw - Done. I've created the nsw branch based off of nsy. Tip: To merge your work back into the nsy branch, first `switch /nsy` then `merge /nsw`. scratch/nsw> debug.alias.term.force .forconflicts .a - Done. scratch/nsw> debug.alias.term.force .forconflicts .b - Done. ``` ``` ucm scratch/main> diff.namespace /nsx: /nsw: - New name conflicts: 1. a#uiiiv8a86s : Nat @@ -446,7 +414,6 @@ scratch/main> diff.namespace /nsx: /nsw: 9. b#r3msrbpp1v (added) scratch/nsw> view a - a#mdl4vqtu00 : Nat a#mdl4vqtu00 = 444 @@ -454,7 +421,6 @@ scratch/nsw> view a a#r3msrbpp1v = 777 scratch/nsw> view b - b#r3msrbpp1v : Nat b#r3msrbpp1v = 777 @@ -471,7 +437,7 @@ scratch/nsw> view b x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -486,7 +452,6 @@ x = 1 ``` ucm scratch/hashdiff> add - ⍟ I've added these definitions: x : ##Nat @@ -497,7 +462,7 @@ scratch/hashdiff> add y = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -512,13 +477,11 @@ y = 2 ``` ucm scratch/hashdiff> add - ⍟ I've added these definitions: y : ##Nat scratch/hashdiff> history - Note: The most recent namespace hash is immediately below this message. @@ -531,7 +494,6 @@ scratch/hashdiff> history □ 2. #i52j9fd57b (start of history) scratch/hashdiff> diff.namespace 2 1 - Added definitions: 1. y : ##Nat diff --git a/unison-src/transcripts/doc-formatting.output.md b/unison-src/transcripts/doc-formatting.output.md index 210299b64d..5359e0921d 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -2,6 +2,10 @@ This transcript explains a few minor details about doc parsing and pretty-printi Docs can be used as inline code comments. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison foo : Nat -> Nat foo n = @@ -9,7 +13,7 @@ foo n = n + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,9 +26,12 @@ foo n = ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view foo - foo : Nat -> Nat foo n = use Nat + @@ -39,7 +46,7 @@ Note that `@` and `:]` must be escaped within docs. escaping = [: Docs look [: like \@this \:] :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,9 +59,12 @@ escaping = [: Docs look [: like \@this \:] :] ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view escaping - escaping : Doc escaping = [: Docs look [: like \@this \:] :] @@ -72,7 +82,7 @@ commented = [: :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -85,9 +95,12 @@ commented = [: ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view commented - commented : Doc commented = [: example: @@ -108,7 +121,7 @@ Handling of indenting in docs between the parser and pretty-printer is a bit fid doc1 = [: hi :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -121,9 +134,12 @@ doc1 = [: hi :] ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc1 - doc1 : Doc doc1 = [: hi :] @@ -141,7 +157,7 @@ doc2 = [: hello and the rest. :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -154,9 +170,12 @@ doc2 = [: hello ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc2 - doc2 : Doc doc2 = [: hello @@ -181,7 +200,7 @@ Note that because of the special treatment of the first line mentioned above, wh :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -194,9 +213,12 @@ Note that because of the special treatment of the first line mentioned above, wh ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc3 - doc3 : Doc doc3 = [: When Unison identifies a paragraph, it removes any @@ -229,7 +251,7 @@ doc4 = [: Here's another example of some paragraphs. - Apart from this one. :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -242,9 +264,12 @@ doc4 = [: Here's another example of some paragraphs. ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc4 - doc4 : Doc doc4 = [: Here's another example of some paragraphs. @@ -265,7 +290,7 @@ doc5 = [: - foo and the rest. :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -278,9 +303,12 @@ doc5 = [: - foo ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc5 - doc5 : Doc doc5 = [: - foo @@ -298,7 +326,7 @@ doc6 = [: :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -311,9 +339,12 @@ doc6 = [: ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view doc6 - doc6 : Doc doc6 = [: - foo @@ -332,7 +363,7 @@ empty = [::] expr = foo 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -346,9 +377,12 @@ expr = foo 1 ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view empty - empty : Doc empty = [: :] @@ -394,7 +428,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -407,9 +441,12 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view test1 - test1 : Doc test1 = [: The internal logic starts to get hairy when you use the @@ -477,7 +514,7 @@ reg1363 = [: `@List.take foo` bar baz :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -490,9 +527,12 @@ reg1363 = [: `@List.take foo` bar ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view reg1363 - reg1363 : Doc reg1363 = [: `@List.take foo` bar baz :] @@ -508,7 +548,7 @@ test2 = [: :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -521,11 +561,14 @@ test2 = [: ``` +``` ucm :hide +scratch/main> add +``` + View is fine. ``` ucm scratch/main> view test2 - test2 : Doc test2 = [: Take a look at this: @@ -538,7 +581,6 @@ But note it's not obvious how display should best be handling this. At the mome ``` ucm scratch/main> display test2 - Take a look at this: foo : Nat -> Nat foo n = diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index da422345b4..f893a2811c 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -6,6 +6,10 @@ 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 +scratch/main> builtins.mergeio +``` + ``` unison :hide abilityPatterns : () abilityPatterns = () @@ -23,23 +27,23 @@ docs.example3 = {{A doc that links to the {typeLabels} term}} docs.example4 = {{A doc that links to the {type Labels} type}} ``` +``` ucm :hide +scratch/main> add +``` + Now we check that each doc links to the object of the correct name: ``` ucm scratch/main> display docs.example1 - A doc that links to the abilityPatterns term scratch/main> display docs.example2 - A doc that links to the Patterns ability scratch/main> display docs.example3 - A doc that links to the typeLabels term scratch/main> display docs.example4 - A doc that links to the Labels type ``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 9c99704ef9..8c3a91633a 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -1,10 +1,13 @@ # Documenting Unison code +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + Unison documentation is written in Unison. Documentation is a value of the following type: ``` ucm scratch/main> view lib.builtins.Doc - type lib.builtins.Doc = Blob Text | Link Link @@ -27,7 +30,7 @@ Can link to definitions like @List.drop or @List :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,7 +62,7 @@ List.take.ex1 = take 0 [1,2,3,4,5] List.take.ex2 = take 2 [1,2,3,4,5] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -75,7 +78,6 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ucm scratch/main> add - ⍟ I've added these definitions: List.take.ex1 : [Nat] @@ -102,7 +104,7 @@ List.take.doc = [: :] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -119,7 +121,6 @@ Let's add it to the codebase. ``` ucm scratch/main> add - ⍟ I've added these definitions: List.take.doc : Doc @@ -130,7 +131,6 @@ We can view it with `docs`, which shows the `Doc` value that is associated with ``` 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 @@ -156,7 +156,6 @@ Note that if we view the source of the documentation, the various references are ``` ucm scratch/main> view List.take - builtin lib.builtins.List.take : lib.builtins.Nat -> [a] -> [a] diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index d1d7b80d0c..1e164c14ce 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -1,5 +1,9 @@ # Test parsing and round-trip of doc2 syntax elements +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide otherDoc : a -> Doc2 otherDoc _ = {{ yo }} @@ -111,7 +115,6 @@ Format it to check that everything pretty-prints in a valid way. ``` ucm scratch/main> debug.format - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index 9e43732a02..e95aed2bcc 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide otherDoc : a -> Doc2 otherDoc _ = {{ yo }} @@ -81,9 +85,12 @@ Table }} ``` +``` ucm :hide +scratch/main> add +``` + ```` ucm scratch/main> debug.doc-to-markdown fulldoc - Heres some text with a soft line break hard line break @@ -175,7 +182,7 @@ unique type MyUniqueType = MyUniqueType structural type MyStructuralType = MyStructuralType ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md index c0515cf3be..d0c424546a 100644 --- a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md +++ b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md @@ -1,6 +1,10 @@ If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrade old new` would rewrite references to `#old` with references to `#new`. And it will... \!\!unless\!\! `#old` still exists in new. +``` ucm :hide +foo/main> builtins.merge lib.builtin +``` + ``` unison lib.old.foo = 18 lib.new.other = 18 @@ -8,7 +12,7 @@ lib.new.foo = 19 mything = lib.old.foo + lib.old.foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,7 +30,6 @@ mything = lib.old.foo + lib.old.foo ``` ucm foo/main> add - ⍟ I've added these definitions: lib.new.foo : Nat @@ -35,11 +38,9 @@ foo/main> add mything : Nat foo/main> upgrade old new - I upgraded old to new, and removed old. foo/main> view mything - mything : Nat mything = use Nat + diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index b156cafabc..619288ac11 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -1,5 +1,9 @@ # Duplicate names in scratch file. +``` ucm :hide +scratch/main> builtins.merge +``` + Term and ability constructor collisions should cause a parse error. ``` unison :error @@ -10,7 +14,7 @@ Stream.send : a -> () Stream.send _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -33,7 +37,7 @@ X.x : a -> () X.x _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -55,7 +59,7 @@ structural ability X where x : () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found two types called X: @@ -76,7 +80,7 @@ X.x.set = () X.x = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -109,7 +113,7 @@ structural type X = Z X = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -126,7 +130,6 @@ X = () ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type X @@ -134,7 +137,6 @@ scratch/main> add X : () scratch/main> view X - structural type X = Z X : () diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md index 0072fcfd9c..12d8bbf32a 100644 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ b/unison-src/transcripts/duplicate-term-detection.output.md @@ -1,5 +1,9 @@ # Duplicate Term Detection +``` ucm :hide +scratch/main> builtins.merge +``` + Trivial duplicate terms should be detected: ``` unison :error @@ -7,7 +11,7 @@ x = 1 x = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -26,7 +30,7 @@ x = 1 x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -47,7 +51,7 @@ Record.x.set = 2 Record.x.modify = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ @@ -85,7 +89,7 @@ structural ability AnAbility where AnAbility.thing = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ❗️ diff --git a/unison-src/transcripts/ed25519.output.md b/unison-src/transcripts/ed25519.output.md index e0827e510a..bc9dbcad3d 100644 --- a/unison-src/transcripts/ed25519.output.md +++ b/unison-src/transcripts/ed25519.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison up = 0xs0123456789abcdef @@ -20,7 +24,7 @@ sigOkay = match signature with > sigOkay ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index 431afe1a1d..b3bd7c23ab 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ bar = 456 mytest = [Ok "ok"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in /private/tmp/scratch.u. I found and typechecked these definitions in @@ -30,7 +29,6 @@ mytest = [Ok "ok"] ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -38,7 +36,6 @@ scratch/main> add mytest : [Result] scratch/main> edit foo bar - ☝️ I added 2 definitions to the top of /private/tmp/scratch.u @@ -47,7 +44,6 @@ scratch/main> edit foo bar definitions currently in this namespace. scratch/main> edit mytest - ☝️ I added 1 definitions to the top of /private/tmp/scratch.u @@ -71,7 +67,6 @@ test> mytest = [Ok "ok"] ``` ucm :error scratch/main> edit missing - ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/edit-namespace.output.md b/unison-src/transcripts/edit-namespace.output.md index e766cd12c3..f82823a2a3 100644 --- a/unison-src/transcripts/edit-namespace.output.md +++ b/unison-src/transcripts/edit-namespace.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +project/main> builtins.mergeio lib.builtin +``` + ``` unison {{ ping doc }} nested.cycle.ping n = n Nat.+ pong n @@ -17,7 +21,7 @@ lib.project.ignoreMe = 30 unique type Foo = { bar : Nat, baz : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,7 +50,6 @@ unique type Foo = { bar : Nat, baz : Nat } ``` ucm project/main> add - ⍟ I've added these definitions: type Foo @@ -71,7 +74,6 @@ project/main> add ``` ucm project/main> edit.namespace - ☝️ I added 8 definitions to the top of scratch.u @@ -114,7 +116,6 @@ toplevel = "hi" ``` ucm project/main> edit.namespace nested simple - ☝️ I added 6 definitions to the top of scratch.u diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index d577f3dba5..6ba39dc79a 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -4,18 +4,21 @@ mynamespace.x = 1 ``` +``` ucm :hide +scratch/main> add +scratch/main> delete.namespace mynamespace +``` + The deleted namespace shouldn't appear in `ls` output. ``` ucm :error scratch/main> ls - nothing to show ``` ``` ucm :error scratch/main> find.verbose - ☝️ I couldn't find matches in this namespace, searching in @@ -33,7 +36,6 @@ scratch/main> find.verbose ``` ucm :error scratch/main> find mynamespace - ☝️ I couldn't find matches in this namespace, searching in @@ -55,7 +57,6 @@ The history of the namespace should be empty. ``` ucm scratch/main> history mynamespace - Note: The most recent namespace hash is immediately below this message. @@ -72,13 +73,17 @@ deleted.x = 1 stuff.thing = 2 ``` +``` ucm :hide +scratch/main> add +scratch/main> delete.namespace deleted +``` + ## fork I should be allowed to fork over a deleted namespace ``` ucm scratch/main> fork stuff deleted - Done. ``` @@ -87,7 +92,6 @@ The history from the `deleted` namespace should have been overwritten by the his ``` ucm scratch/main> history stuff - Note: The most recent namespace hash is immediately below this message. @@ -96,7 +100,6 @@ scratch/main> history stuff □ 1. #q2dq4tsno1 (start of history) scratch/main> history deleted - Note: The most recent namespace hash is immediately below this message. @@ -113,16 +116,18 @@ moveoverme.x = 1 moveme.y = 2 ``` +``` ucm :hide +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 scratch/main> delete.namespace moveoverme - Done. scratch/main> history moveme - Note: The most recent namespace hash is immediately below this message. @@ -131,11 +136,9 @@ scratch/main> history moveme □ 1. #c5uisu4kll (start of history) scratch/main> move.namespace moveme moveoverme - Done. scratch/main> history moveoverme - Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index 0aecd1406d..cb56e5e902 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -8,7 +8,6 @@ BEHOLD\!\!\! ``` ucm :error scratch/main> ls - nothing to show ``` @@ -17,11 +16,9 @@ Technically, the definitions all exist, but they have no names. `builtins.merge` ``` ucm scratch/main> builtins.merge lib.builtins - Done. scratch/main> ls lib - 1. builtins/ (469 terms, 74 types) ``` @@ -30,11 +27,9 @@ And for a limited time, you can get even more builtin goodies: ``` ucm scratch/main> builtins.mergeio lib.builtinsio - Done. scratch/main> ls lib - 1. builtins/ (469 terms, 74 types) 2. builtinsio/ (643 terms, 92 types) diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md index d60a38ae83..903f8c0fcc 100644 --- a/unison-src/transcripts/error-messages.output.md +++ b/unison-src/transcripts/error-messages.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +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. ## Parse errors @@ -10,7 +14,7 @@ Some basic errors of literals. x = 1. -- missing some digits after the decimal ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -26,7 +30,7 @@ x = 1. -- missing some digits after the decimal x = 1e -- missing an exponent ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -42,7 +46,7 @@ x = 1e -- missing an exponent x = 1e- -- missing an exponent ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -58,7 +62,7 @@ x = 1e- -- missing an exponent x = 1E+ -- missing an exponent ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -76,7 +80,7 @@ x = 1E+ -- missing an exponent x = 0xoogabooga -- invalid hex chars ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -92,7 +96,7 @@ x = 0xoogabooga -- invalid hex chars x = 0o987654321 -- 9 and 8 are not valid octal char ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -108,7 +112,7 @@ x = 0o987654321 -- 9 and 8 are not valid octal char x = 0b3201 -- 3 and 2 are not valid binary chars ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This number isn't valid syntax: @@ -124,7 +128,7 @@ x = 0b3201 -- 3 and 2 are not valid binary chars x = 0xsf -- odd number of hex chars in a bytes literal ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsf @@ -140,7 +144,7 @@ x = 0xsf -- odd number of hex chars in a bytes literal x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsnotvalidhexchars @@ -158,7 +162,7 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal foo = else -- not matching if ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a closing 'else' here without a matching 'then'. @@ -172,7 +176,7 @@ foo = else -- not matching if foo = then -- unclosed ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a closing 'then' here without a matching 'if'. @@ -186,7 +190,7 @@ foo = then -- unclosed foo = with -- unclosed ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a closing 'with' here without a matching 'handle' or 'match'. @@ -203,7 +207,7 @@ foo = with -- unclosed foo = match 1 with ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -220,7 +224,7 @@ foo = match 1 with 2 -- no right-hand-side ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -243,7 +247,7 @@ foo = cases 3 -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. 😶 @@ -266,7 +270,7 @@ x = match Some a with 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -293,7 +297,7 @@ x = match Some a with -> 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -316,7 +320,7 @@ x = match Some a with | true -> 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -339,7 +343,7 @@ x = match Some a with > ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I expected a non-empty watch expression and not just ">" @@ -355,7 +359,7 @@ x = match Some a with use.keyword.in.namespace = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The identifier `namespace` used here is a reserved keyword: @@ -372,7 +376,7 @@ use.keyword.in.namespace = 1 a ! b = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This looks like the start of an expression here diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.md b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.md new file mode 100644 index 0000000000..e84a409d72 --- /dev/null +++ b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.md @@ -0,0 +1,20 @@ +Since this code block is expecting an error, we still hide it. It seems unusual to want to hide an error, but maybe it’s just too verbose or something. This follows the author’s intent. + +``` ucm :hide :error +scratch/main> help pull +scratch/main> not.a.command +``` + +For comparison, here’s what we get without `:hide`. + +``` ucm :error +scratch/main> help pull +scratch/main> not.a.command +``` + +Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. But we should continue to hide the output _before_ the error. + +``` ucm :hide +scratch/main> help pull +scratch/main> not.a.command +``` diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md new file mode 100644 index 0000000000..3eace7ffd1 --- /dev/null +++ b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md @@ -0,0 +1,55 @@ +Since this code block is expecting an error, we still hide it. It seems unusual to want to hide an error, but maybe it’s just too verbose or something. This follows the author’s intent. + +``` ucm :hide:error +scratch/main> help pull +scratch/main> not.a.command +``` + +For comparison, here’s what we get without `:hide`. + +``` ucm :error +scratch/main> help pull + pull + The `pull` command merges a remote namespace into a local + branch + + `pull @unison/base/main` merges the branch + `main` of the Unison + Share hosted project + `@unison/base` into + the current branch + `pull @unison/base/main my-base/topic` merges the branch + `main` of the Unison + Share hosted project + `@unison/base` into + the branch `topic` of + the local `my-base` + project + + where `remote` is a project or project branch, such as: + Project (defaults to the /main branch) `@unison/base` + Project Branch `@unison/base/feature` + Contributor Branch `@unison/base/@johnsmith/feature` + Project Release `@unison/base/releases/1.0.0` + +scratch/main> not.a.command + ⚠️ + I don't know how to not.a.command. Type `help` or `?` to get + help. +``` + +Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. But we should continue to hide the output *before* the error. + +``` ucm :hide +scratch/main> help pullscratch/main> not.a.command +``` + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + +``` +⚠️ +I don't know how to not.a.command. Type `help` or `?` to get +help. +``` diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.md b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.md new file mode 100644 index 0000000000..a903e385be --- /dev/null +++ b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.md @@ -0,0 +1,17 @@ +Since this code block is expecting an error, we still hide it. It seems unusual to want to hide an error, but maybe it’s just too verbose or something. This follows the author’s intent. + +``` unison :hide :error +x + x + +``` + +For comparison, here is what we get without the `:hide`. + +``` unison :error +x + x + +``` + +Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. + +``` unison :hide +x + x + +``` diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md new file mode 100644 index 0000000000..d21d307c54 --- /dev/null +++ b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md @@ -0,0 +1,56 @@ +Since this code block is expecting an error, we still hide it. It seems unusual to want to hide an error, but maybe it’s just too verbose or something. This follows the author’s intent. + +``` unison :hide:error +x + x + +``` + +For comparison, here is what we get without the `:hide`. + +``` unison :error +x + x + +``` + +``` ucm :added-by-ucm + Loading changes detected in scratch.u. + + I got confused here: + + 1 | x + x + + + + I was surprised to find a x here. + I was expecting one of these instead: + + * ability + * namespace + * newline or semicolon + * type + * use + +``` + +Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. + +``` unison :hide +x + x + +``` + +🛑 + +The transcript failed due to an error in the stanza above. The error is: + +``` + I got confused here: + + 1 | x + x + + + + I was surprised to find a x here. + I was expecting one of these instead: + + * ability + * namespace + * newline or semicolon + * type + * use +``` diff --git a/unison-src/transcripts/errors/missing-result-typed.output.md b/unison-src/transcripts/errors/missing-result-typed.output.md index 8cea5ded3e..67d150b507 100644 --- a/unison-src/transcripts/errors/missing-result-typed.output.md +++ b/unison-src/transcripts/errors/missing-result-typed.output.md @@ -4,6 +4,10 @@ When an error is encountered in a `unison :hide:all` block then the transcript parser should print the stanza and surface a helpful message. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide:all a : Nat a = diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index e2045b6ee5..e6415e1ab6 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -10,6 +10,10 @@ and surface a helpful message. scratch/main> history ``` +``` ucm :hide:error +scratch/main> history +``` + 🛑 The transcript was expecting an error in the stanza above, but did not encounter one. diff --git a/unison-src/transcripts/escape-sequences.output.md b/unison-src/transcripts/escape-sequences.output.md index c401add1c3..4a946f64d8 100644 --- a/unison-src/transcripts/escape-sequences.output.md +++ b/unison-src/transcripts/escape-sequences.output.md @@ -4,7 +4,7 @@ > "古池や蛙飛びこむ水の音" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 75964a5747..55208ea082 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> alias.type ##Text builtin.Text +``` + ``` unison :hide unique type A = A Text @@ -14,7 +18,6 @@ baz = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: type A @@ -23,18 +26,15 @@ scratch/main> add foo : A scratch/main> find : Text -> A - 1. bar : Text -> A 2. A.A : Text -> A scratch/main> find : A -> Text - 1. baz : A -> Text scratch/main> find : A - 1. foo : A @@ -42,7 +42,6 @@ scratch/main> find : A ``` ucm :error scratch/main> find : Text - ☝️ I couldn't find exact type matches, resorting to fuzzy diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index 8749d3c528..0fce545203 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison :hide foo = 1 lib.foo = 2 @@ -8,20 +12,21 @@ cat.lib.bar = 6 somewhere.bar = 7 ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> find foo - 1. cat.foo : Nat 2. foo : Nat scratch/main> view 1 - cat.foo : Nat cat.foo = 4 scratch/main> find.all foo - 1. cat.foo : Nat 2. cat.lib.foo : Nat 3. lib.foo : Nat @@ -29,7 +34,6 @@ scratch/main> find.all foo scratch/main> view 1 - cat.foo : Nat cat.foo = 4 @@ -37,23 +41,19 @@ scratch/main> view 1 ``` ucm scratch/main> find-in cat foo - 1. foo : Nat scratch/main> view 1 - cat.foo : Nat cat.foo = 4 scratch/main> find-in.all cat foo - 1. lib.foo : Nat 2. foo : Nat scratch/main> view 1 - cat.lib.foo : Nat cat.lib.foo = 5 @@ -63,12 +63,10 @@ Finding within a namespace ``` ucm scratch/main> find bar - 1. somewhere.bar : Nat scratch/other> debug.find.global bar - Found results in scratch/main 1. .cat.lib.bar : Nat @@ -77,7 +75,6 @@ scratch/other> debug.find.global bar scratch/main> find-in somewhere bar - 1. bar : Nat @@ -85,7 +82,6 @@ scratch/main> find-in somewhere bar ``` ucm :error scratch/main> find baz - ☝️ I couldn't find matches in this namespace, searching in diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index d039c6255f..290b5f5154 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -9,7 +9,6 @@ X.foo = "a namespace" ``` ucm scratch/main> add - ⍟ I've added these definitions: X.foo : ##Text @@ -25,7 +24,6 @@ a = "an update" ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -37,7 +35,6 @@ As of the time of this writing, the history for `X` should be a single node, `#4 ``` ucm scratch/main> history X - Note: The most recent namespace hash is immediately below this message. @@ -51,7 +48,6 @@ however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is ``` ucm :error scratch/main> history #7nl6ppokhg - 😶 I don't know of a namespace with that hash. diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md index 3f2e8922f7..32224c32e3 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.output.md @@ -1,5 +1,9 @@ Tests that `if` statements can appear as list and tuple elements. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide > [ if true then 1 else 0 ] diff --git a/unison-src/transcripts/fix-5267.output.md b/unison-src/transcripts/fix-5267.output.md index fab5b2ae34..8afd54082f 100644 --- a/unison-src/transcripts/fix-5267.output.md +++ b/unison-src/transcripts/fix-5267.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.direct.foo = 17 lib.direct.lib.indirect.foo = 18 @@ -6,7 +10,7 @@ bar : Nat bar = direct.foo + direct.foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,7 +30,6 @@ indirect dependency. It used to render as `direct.foo + direct.foo`. ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -34,7 +37,6 @@ scratch/main> add lib.direct.lib.indirect.foo : Nat scratch/main> view bar - bar : Nat bar = use Nat + @@ -51,7 +53,7 @@ type lib.direct.lib.indirect.Foo = MkFoo type Bar = MkBar direct.Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,7 +70,6 @@ type Bar = MkBar direct.Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Bar @@ -76,7 +77,6 @@ scratch/main> add type lib.direct.lib.indirect.Foo scratch/main> view Bar - type Bar = MkBar Foo ``` diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md index 8b6b1bcdcc..735d96bab9 100644 --- a/unison-src/transcripts/fix-5301.output.md +++ b/unison-src/transcripts/fix-5301.output.md @@ -3,7 +3,6 @@ letter) that is either not found or ambiguouus fails. Previously, it would be tr ``` ucm scratch/main> builtins.merge - Done. ``` @@ -16,7 +15,7 @@ foo = cases Bar X -> 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. @@ -44,7 +43,7 @@ foo = cases Bar X -> 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/fix-5312.output.md b/unison-src/transcripts/fix-5312.output.md index 9ca04f0ec6..c26770f3d6 100644 --- a/unison-src/transcripts/fix-5312.output.md +++ b/unison-src/transcripts/fix-5312.output.md @@ -3,7 +3,6 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -17,7 +16,7 @@ b.y = x + 1 c = b.y + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ c = b.y + 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: a.y : Nat @@ -49,7 +47,7 @@ scratch/main> add x = 100 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,7 +63,6 @@ x = 100 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md index 13dbd63f47..c5fd690038 100644 --- a/unison-src/transcripts/fix-5320.output.md +++ b/unison-src/transcripts/fix-5320.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -10,7 +9,7 @@ foo = cases bar.Baz -> 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/fix-5323.output.md b/unison-src/transcripts/fix-5323.output.md index 6eac65c4b2..5c2df6dc5c 100644 --- a/unison-src/transcripts/fix-5323.output.md +++ b/unison-src/transcripts/fix-5323.output.md @@ -3,7 +3,6 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -18,7 +17,7 @@ b.y = lib.old.x + 1 c = b.y + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,7 +36,6 @@ c = b.y + 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: a.y : Nat @@ -50,7 +48,6 @@ scratch/main> add ``` ucm scratch/main> upgrade old new - I upgraded old to new, and removed old. ``` diff --git a/unison-src/transcripts/fix-5326.output.md b/unison-src/transcripts/fix-5326.output.md index e97b5ecfe7..34503a69fc 100644 --- a/unison-src/transcripts/fix-5326.output.md +++ b/unison-src/transcripts/fix-5326.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -9,7 +8,7 @@ scratch/main> builtins.merge lib.builtin x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,14 +23,12 @@ x = 1 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch foo - Done. I've created the foo branch based off of main. Tip: To merge your work back into the main branch, first @@ -49,7 +46,7 @@ A x = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,14 +62,12 @@ x = 2 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch bar - Done. I've created the bar branch based off of main. Tip: To merge your work back into the main branch, first @@ -92,7 +87,7 @@ B - A x = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -108,7 +103,6 @@ x = 3 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -128,7 +122,7 @@ C - B - A x = 4 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -144,7 +138,6 @@ x = 4 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -164,7 +157,7 @@ D - C - B - A y = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -179,7 +172,6 @@ y = 5 ``` ucm scratch/foo> update - Okay, I'm searching the branch for code that needs to be updated... @@ -201,7 +193,6 @@ D - C - B - A ``` ucm scratch/main> merge /foo - I merged scratch/foo into scratch/main. ``` @@ -220,7 +211,6 @@ F - D - C - B - A ``` ucm scratch/main> merge /bar - 😶 scratch/main was already up-to-date with scratch/bar. diff --git a/unison-src/transcripts/fix-5340.output.md b/unison-src/transcripts/fix-5340.output.md index 63cfc0cba1..317f3cd506 100644 --- a/unison-src/transcripts/fix-5340.output.md +++ b/unison-src/transcripts/fix-5340.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison type my.Foo = MkFoo type lib.dep.lib.dep.Foo = MkFoo @@ -6,7 +10,7 @@ my.foo = 17 lib.dep.lib.dep.foo = 18 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ lib.dep.lib.dep.foo = 18 ``` ucm scratch/main> add - ⍟ I've added these definitions: type lib.dep.lib.dep.Foo @@ -42,7 +45,7 @@ type my.Foo = MkFoo type Bar = MkBar Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -62,7 +65,7 @@ my.foo = 17 bar = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-5357.output.md b/unison-src/transcripts/fix-5357.output.md index 271ca2b6eb..3a3a90b997 100644 --- a/unison-src/transcripts/fix-5357.output.md +++ b/unison-src/transcripts/fix-5357.output.md @@ -8,7 +8,7 @@ foo = ignore 4 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +24,6 @@ foo = ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : () @@ -37,7 +36,7 @@ lib.base.ignore : a -> () lib.base.ignore _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,14 +52,12 @@ lib.base.ignore _ = () ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.base.ignore : a -> () (also named util.ignore) scratch/main> edit.namespace - ☝️ I added 2 definitions to the top of scratch.u @@ -69,7 +66,6 @@ scratch/main> edit.namespace definitions currently in this namespace. scratch/main> load - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix-5369.output.md b/unison-src/transcripts/fix-5369.output.md index 687bace774..48835c5043 100644 --- a/unison-src/transcripts/fix-5369.output.md +++ b/unison-src/transcripts/fix-5369.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ two.foo : Text two.foo = "blah" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ two.foo = "blah" ``` ucm scratch/main> add - ⍟ I've added these definitions: one.foo : Nat @@ -45,7 +43,7 @@ bar : Nat bar = foo + foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-5374.output.md b/unison-src/transcripts/fix-5374.output.md index 80253cb086..6d8babf064 100644 --- a/unison-src/transcripts/fix-5374.output.md +++ b/unison-src/transcripts/fix-5374.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -12,7 +11,7 @@ lib.direct.lib.indirect.foo = 18 thing = indirect.foo + indirect.foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ thing = indirect.foo + indirect.foo ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.direct.foo : Nat @@ -37,7 +35,6 @@ scratch/main> add thing : Nat scratch/main> view thing - thing : Nat thing = use Nat + @@ -45,7 +42,6 @@ scratch/main> view thing foo + foo scratch/main> edit thing - ☝️ I added 1 definitions to the top of scratch.u diff --git a/unison-src/transcripts/fix-5380.output.md b/unison-src/transcripts/fix-5380.output.md index ec62264519..4f24f830cd 100644 --- a/unison-src/transcripts/fix-5380.output.md +++ b/unison-src/transcripts/fix-5380.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge lib.builtin - Done. ``` @@ -16,7 +15,7 @@ bar = foo + qux ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,18 +31,15 @@ bar = ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> move.term foo qux - Done. scratch/main> view bar - bar : Nat bar = use Nat + diff --git a/unison-src/transcripts/fix-5402.output.md b/unison-src/transcripts/fix-5402.output.md index 939c0b73ff..5fcd16e5a4 100644 --- a/unison-src/transcripts/fix-5402.output.md +++ b/unison-src/transcripts/fix-5402.output.md @@ -6,7 +6,7 @@ use bar baz x = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +25,7 @@ namespace foo x = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md index d2b6e59fc2..2d902fd498 100644 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ b/unison-src/transcripts/fix-big-list-crash.output.md @@ -1,5 +1,9 @@ #### Big list crash +``` ucm :hide +scratch/main> builtins.merge +``` + Big lists have been observed to crash, while in the garbage collection step. ``` unison @@ -8,7 +12,7 @@ unique type Direction = U | D | L | R x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U,336),(L,697),(D,682),(L,180),(U,951),(L,189),(D,547),(R,697),(U,583),(L,172),(D,859),(L,370),(D,114),(L,519),(U,829),(R,389),(U,608),(R,66),(D,634),(L,320),(D,49),(L,931),(U,137),(L,349),(D,689),(L,351),(D,829),(R,819),(D,138),(L,118),(D,849),(R,230),(U,858),(L,509),(D,311),(R,815),(U,217),(R,359),(U,840),(R,77),(U,230),(R,361),(U,322),(R,300),(D,646),(R,348),(U,815),(R,793),(D,752),(R,967),(U,128),(R,948),(D,499),(R,359),(U,572),(L,566),(U,815),(R,630),(D,290),(L,829),(D,736),(R,358),(U,778),(R,891),(U,941),(R,544),(U,889),(L,920),(U,913),(L,447),(D,604),(R,538),(U,818),(L,215),(D,437),(R,447),(U,576),(R,452),(D,794),(R,864),(U,269),(L,325),(D,35),(L,268),(D,639),(L,101),(U,777),(L,776),(U,958),(R,105),(U,517),(R,667),(D,423),(R,603),(U,469),(L,125),(D,919),(R,879),(U,994),(R,665),(D,377),(R,456),(D,570),(L,685),(U,291),(R,261),(U,846),(R,840),(U,418),(L,974),(D,270),(L,312),(D,426),(R,621),(D,334),(L,855),(D,378),(R,694),(U,845),(R,481),(U,895),(L,362),(D,840),(L,712),(U,57),(R,276),(D,643),(R,566),(U,348),(R,361),(D,144),(L,287),(D,864),(L,556),(U,610),(L,927),(U,322),(R,271),(D,90),(L,741),(U,446),(R,181),(D,527),(R,56),(U,805),(L,907),(D,406),(L,286),(U,873),(L,79),(D,280),(L,153),(D,377),(R,253),(D,61),(R,475),(D,804),(R,788),(U,393),(L,660),(U,314),(R,489),(D,491),(L,234),(D,712),(L,253),(U,651),(L,777),(D,726),(R,146),(U,47),(R,630),(U,517),(R,226),(U,624),(L,834),(D,153),(L,513),(U,799),(R,287),(D,868),(R,982),(U,390),(L,296),(D,373),(R,9),(U,994),(R,105),(D,673),(L,657),(D,868),(R,738),(D,277),(R,374),(U,828),(R,860),(U,247),(R,484),(U,986),(L,723),(D,847),(L,578),(U,487),(L,51),(D,865),(L,328),(D,199),(R,812),(D,726),(R,355),(D,463),(R,761),(U,69),(R,508),(D,753),(L,81),(D,50),(L,345),(D,66),(L,764),(D,466),(L,975),(U,619),(R,59),(D,788),(L,737),(D,360),(R,14),(D,253),(L,512),(D,417),(R,828),(D,188),(L,394),(U,212),(R,658),(U,369),(R,920),(U,927),(L,339),(U,552),(R,856),(D,458),(R,407),(U,41),(L,930),(D,460),(R,809),(U,467),(L,410),(D,800),(L,135),(D,596),(R,678),(D,4),(L,771),(D,637),(L,876),(U,192),(L,406),(D,136),(R,666),(U,730),(R,711),(D,291),(L,586),(U,845),(R,606),(U,2),(L,228),(D,759),(R,244),(U,946),(R,948),(U,160),(R,397),(U,134),(R,188),(U,850),(R,623),(D,315),(L,219),(D,450),(R,489),(U,374),(R,299),(D,474),(L,767),(D,679),(L,160),(D,403),(L,708)] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix-ls.output.md b/unison-src/transcripts/fix-ls.output.md index d691f9ee2b..d329b86713 100644 --- a/unison-src/transcripts/fix-ls.output.md +++ b/unison-src/transcripts/fix-ls.output.md @@ -1,6 +1,5 @@ ``` ucm test-ls/main> builtins.merge - Done. ``` @@ -11,7 +10,7 @@ foo.bar.add x y = x Int.+ y foo.bar.subtract x y = x Int.- y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,18 +26,15 @@ foo.bar.subtract x y = x Int.- y ``` ucm test-ls/main> add - ⍟ I've added these definitions: foo.bar.add : Int -> Int -> Int foo.bar.subtract : Int -> Int -> Int test-ls/main> ls foo - 1. bar/ (2 terms) test-ls/main> ls 1 - 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index e32f23e1f7..22235d4814 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -1,5 +1,9 @@ Tests that functions named `.` are rendered correctly. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison (`.`) f g x = f (g x) @@ -8,7 +12,7 @@ use Boolean not noop = not `.` not ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,14 +28,12 @@ noop = not `.` not ``` ucm scratch/main> add - ⍟ I've added these definitions: `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean scratch/main> view noop - noop : Boolean -> Boolean noop = use Boolean not diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md index d40448037c..1067f7c7ff 100644 --- a/unison-src/transcripts/fix1327.output.md +++ b/unison-src/transcripts/fix1327.output.md @@ -4,7 +4,7 @@ foo = 4 bar = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,19 +24,16 @@ Now `ls` returns a pair of the absolute search directory and the result relative ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : ##Nat foo : ##Nat scratch/main> ls - 1. bar (##Nat) 2. foo (##Nat) scratch/main> alias.many 1-2 .ns1_nohistory - Here's what changed in .ns1_nohistory : Added definitions: diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md index dfadcbe0ad..cea4e87f10 100644 --- a/unison-src/transcripts/fix1334.output.md +++ b/unison-src/transcripts/fix1334.output.md @@ -6,11 +6,9 @@ Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ``` ucm scratch/main> alias.type ##Nat Cat - Done. scratch/main> alias.term ##Nat.+ please_fix_763.+ - Done. ``` diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index 1b142e7eeb..ddf61e7518 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -14,7 +13,7 @@ List.map f = go [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,13 +28,11 @@ List.map f = ``` ucm scratch/main> add - ⍟ I've added these definitions: List.map : (i ->{g} o) -> [i] ->{g} [o] scratch/main> view List.map - List.map : (i ->{g} o) -> [i] ->{g} [o] List.map f = go acc = cases @@ -55,7 +52,7 @@ List.map2 f = go [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1421.output.md b/unison-src/transcripts/fix1421.output.md index 10368900b4..5e752640fe 100644 --- a/unison-src/transcripts/fix1421.output.md +++ b/unison-src/transcripts/fix1421.output.md @@ -1,10 +1,8 @@ ``` ucm scratch/main> alias.type ##Nat Nat - Done. scratch/main> alias.term ##Nat.+ Nat.+ - Done. ``` @@ -14,7 +12,7 @@ unique type A = A Nat unique type B = B Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index df7e19ca6e..e3d01b3dd3 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ foo.y = 100 bar.z = x + y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,7 +29,6 @@ bar.z = x + y ``` ucm scratch/main> add - ⍟ I've added these definitions: bar.z : Nat @@ -43,7 +41,6 @@ Let's see what we have created... ``` ucm scratch/main> ls - 1. bar/ (1 term) 2. builtin/ (469 terms, 74 types) 3. foo/ (2 terms) @@ -54,7 +51,6 @@ Now, if we try deleting the namespace `foo`, we get an error, as expected. ``` ucm :error scratch/main> delete.namespace foo - ⚠️ I didn't delete the namespace because the following @@ -74,7 +70,6 @@ Any numbered arguments should refer to `bar.z`. ``` ucm scratch/main> debug.numberedArgs - 1. bar.z 2. bar.z @@ -84,11 +79,9 @@ We can then delete the dependent term, and then delete `foo`. ``` ucm scratch/main> delete.term 1 - Done. scratch/main> delete.namespace foo - Done. ``` diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index a4fd473c72..b4505a29bb 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :error structural ability Ask where ask : Nat @@ -16,7 +20,7 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") > dialog ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/fix1709.output.md b/unison-src/transcripts/fix1709.output.md index 5f2163c58a..b4b1e6c579 100644 --- a/unison-src/transcripts/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -6,7 +6,7 @@ id2 x = id x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,7 +22,6 @@ id2 x = ``` ucm scratch/main> add - ⍟ I've added these definitions: id : x -> x @@ -34,7 +33,7 @@ scratch/main> add > id2 "hi" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md index 07723d05a8..497c94f266 100644 --- a/unison-src/transcripts/fix1731.output.md +++ b/unison-src/transcripts/fix1731.output.md @@ -1,9 +1,17 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide structural ability CLI where print : Text ->{CLI} () input : {CLI} Text ``` +``` ucm :hide +scratch/main> add +``` + The `input` here should parse as a wildcard, not as `CLI.input`. ``` unison @@ -12,7 +20,7 @@ repro = cases input -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 4151232ac6..0226cd01af 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide printLine : Text ->{IO} () printLine msg = @@ -22,19 +26,15 @@ Testing a few variations here: ``` ucm scratch/main> run main1 - () scratch/main> run main2 - () scratch/main> run main3 - () scratch/main> add - ⍟ I've added these definitions: main1 : '{IO} () @@ -43,15 +43,12 @@ scratch/main> add printLine : Text ->{IO} () scratch/main> rename.term main1 code.main1 - Done. scratch/main> rename.term main2 code.main2 - Done. scratch/main> rename.term main3 code.main3 - Done. ``` @@ -60,15 +57,12 @@ The renaming just ensures that when running `code.main1`, it has to get that mai ``` ucm scratch/main> run code.main1 - () scratch/main> run code.main2 - () scratch/main> run code.main3 - () ``` @@ -87,7 +81,6 @@ This shouldn't work since `main4` and `main5` don't have the right type. ``` ucm :error scratch/main> run main4 - 😶 I found this function: @@ -102,7 +95,6 @@ scratch/main> run main4 ``` ucm :error scratch/main> run main5 - 😶 I found this function: diff --git a/unison-src/transcripts/fix1844.output.md b/unison-src/transcripts/fix1844.output.md index f0df35990c..6924f886d7 100644 --- a/unison-src/transcripts/fix1844.output.md +++ b/unison-src/transcripts/fix1844.output.md @@ -9,7 +9,7 @@ snoc k aN = match k with > snoc (One 1) 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index f4a640d18e..610ba4dc79 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -11,7 +10,7 @@ scratch/main> builtins.merge sq = 2934892384 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,7 +36,7 @@ sq = 2934892384 sq = 2934892384 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index 835e5f26f9..3e885bc29a 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison structural ability Exception where raise : Failure -> x @@ -35,7 +39,7 @@ Exception.unsafeRun! e _ = handle !e with h ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,7 +69,6 @@ Exception.unsafeRun! e _ = ``` ucm scratch/main> run ex - () ``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index 1b10667d5f..690309327f 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural ability Exception where raise : Failure -> x @@ -44,7 +48,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -79,7 +83,6 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ucm :error scratch/main> run myServer - 💔💥 I've encountered a call to builtin.bug with the following diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index 03ad411f31..a5eaf76460 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison id x = x @@ -48,7 +52,7 @@ Fold.Stream.fold = !res Universal.== false ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -106,7 +110,7 @@ tests _ = ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,14 +126,12 @@ tests _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] scratch/main> io.test tests - New test results: 1. tests ◉ caught diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md index ae97366dfb..f33013e7c4 100644 --- a/unison-src/transcripts/fix2053.output.md +++ b/unison-src/transcripts/fix2053.output.md @@ -1,6 +1,9 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` ucm scratch/main> display List.map - f a -> let use Nat + diff --git a/unison-src/transcripts/fix2156.output.md b/unison-src/transcripts/fix2156.output.md index 92d9ebab1a..db73b9184d 100644 --- a/unison-src/transcripts/fix2156.output.md +++ b/unison-src/transcripts/fix2156.output.md @@ -1,6 +1,10 @@ Tests for a case where bad eta reduction was causing erroneous watch output/caching. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison sqr : Nat -> Nat sqr n = n * n @@ -8,7 +12,7 @@ sqr n = n * n > sqr ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2167.output.md b/unison-src/transcripts/fix2167.output.md index b397e7530b..855705dddc 100644 --- a/unison-src/transcripts/fix2167.output.md +++ b/unison-src/transcripts/fix2167.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This is just a simple transcript to regression check an ability inference/checking issue. @@ -15,7 +19,7 @@ R.near1 region loc = match R.near 42 with ls -> R.die () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2187.output.md b/unison-src/transcripts/fix2187.output.md index 72aa416fc1..0012feb4d2 100644 --- a/unison-src/transcripts/fix2187.output.md +++ b/unison-src/transcripts/fix2187.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison lexicalScopeEx: [Text] @@ -14,7 +18,7 @@ lexicalScopeEx = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index 76810ca45f..aa93b11bd4 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -6,6 +6,10 @@ and while they are all valid and some may be equivalently general, the choices may not work equally well with the type checking strategies. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison (<<) : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c (<<) f g x = f (g x) @@ -20,7 +24,7 @@ foldl f a = cases txt = foldl (Text.++) "" ["a", "b", "c"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +42,6 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ucm scratch/main> add - ⍟ I've added these definitions: << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 69d2ec9b26..fe084510ae 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + This should not typecheck - the inline `@eval` expression uses abilities. ``` unison :error @@ -6,7 +10,7 @@ structural ability Abort where abort : x ex = {{ @eval{abort} }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. @@ -20,7 +24,6 @@ This file should also not typecheck - it has a triple backticks block that uses ``` ucm :error scratch/main> load unison-src/transcripts/fix2238.u - Loading changes detected in unison-src/transcripts/fix2238.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md index 2341d1a265..f0c2251c95 100644 --- a/unison-src/transcripts/fix2244.output.md +++ b/unison-src/transcripts/fix2244.output.md @@ -1,8 +1,11 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + Ensure closing token is emitted by closing brace in doc eval block. ``` ucm scratch/main> load ./unison-src/transcripts/fix2244.u - Loading changes detected in ./unison-src/transcripts/fix2244.u. @@ -15,3 +18,7 @@ scratch/main> load ./unison-src/transcripts/fix2244.u x : Doc2 ``` + +``` ucm :hide +scratch/main> add +``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 544a272080..9f7ae93737 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +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: ``` unison :hide @@ -34,7 +38,6 @@ We'll make our edits in a new branch. ``` ucm scratch/a> add - ⍟ I've added these definitions: type A a b c d @@ -45,7 +48,6 @@ scratch/a> add g : A Nat Nat Nat Nat -> Nat 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 @@ -68,7 +70,6 @@ Let's do the update now, and verify that the definitions all look good and there ``` ucm scratch/a2> update - Okay, I'm searching the branch for code that needs to be updated... @@ -79,7 +80,6 @@ scratch/a2> update Done. scratch/a2> view A NeedsA f f2 f3 g - type A a b c d = A a | D d @@ -113,7 +113,6 @@ scratch/a2> view A NeedsA f f2 f3 g _ -> 43 scratch/a2> todo - You have no pending todo items. Good work! ✅ ``` @@ -122,13 +121,17 @@ scratch/a2> todo 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 +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -150,7 +153,6 @@ combine r = uno r + dos r ``` ucm scratch/r1> add - ⍟ I've added these definitions: structural type Rec @@ -163,7 +165,6 @@ scratch/r1> add 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 @@ -175,7 +176,7 @@ scratch/r1> branch r2 structural type Rec = { uno : Nat, dos : Nat, tres : Text } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -205,7 +206,6 @@ And checking that after updating this record, there's nothing `todo`: ``` ucm scratch/r2> update - Okay, I'm searching the branch for code that needs to be updated... @@ -216,7 +216,6 @@ scratch/r2> update Done. scratch/r2> todo - You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md index c404145faa..897cbbeec3 100644 --- a/unison-src/transcripts/fix2268.output.md +++ b/unison-src/transcripts/fix2268.output.md @@ -2,6 +2,10 @@ Tests for a TDNR case that wasn't working. The code wasn't 'relaxing' inferred types that didn't contain arrows, so effects that just yield a value weren't getting disambiguated. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison unique ability A where a : Nat @@ -15,7 +19,7 @@ test _ = toNat x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2334.output.md b/unison-src/transcripts/fix2334.output.md index 79ec0611d2..0b1c79e8a9 100644 --- a/unison-src/transcripts/fix2334.output.md +++ b/unison-src/transcripts/fix2334.output.md @@ -1,6 +1,10 @@ Tests an issue where pattern matching matrices involving built-in types was discarding default cases in some branches. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison f = cases 0, 0 -> 0 @@ -14,7 +18,7 @@ f = cases > f 1 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md index a519728a76..8e6882afdb 100644 --- a/unison-src/transcripts/fix2344.output.md +++ b/unison-src/transcripts/fix2344.output.md @@ -3,6 +3,10 @@ Checks a corner case with type checking involving destructuring binds. The binds were causing some sequences of lets to be unnecessarily recursive. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison unique ability Nate where nate: (Boolean, Nat) @@ -16,7 +20,7 @@ sneezy dee _ = dee 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2350.output.md b/unison-src/transcripts/fix2350.output.md index 3e74f3a62f..a00fbc4bfb 100644 --- a/unison-src/transcripts/fix2350.output.md +++ b/unison-src/transcripts/fix2350.output.md @@ -28,7 +28,7 @@ save : a ->{Storage d g, g} (d a) save a = !(save.impl a) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md index 65cdb5f2c4..4d716911b2 100644 --- a/unison-src/transcripts/fix2353.output.md +++ b/unison-src/transcripts/fix2353.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison use builtin Scope unique ability Async t g where async : {g} Nat @@ -11,7 +15,7 @@ pure.run a0 a = Scope.run a' ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md index 24bbca3a0b..99a876c556 100644 --- a/unison-src/transcripts/fix2354.output.md +++ b/unison-src/transcripts/fix2354.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests that delaying an un-annotated higher-rank type gives a normal type error, rather than an internal compiler error. @@ -8,7 +12,7 @@ f id = id 0 x = 'f ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md index abdd807f95..3802986dde 100644 --- a/unison-src/transcripts/fix2355.output.md +++ b/unison-src/transcripts/fix2355.output.md @@ -1,5 +1,9 @@ Tests for a loop that was previously occurring in the type checker. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :error structural ability A t g where fork : '{g, A t g} a -> t a @@ -19,7 +23,7 @@ example = 'let A.await r ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I tried to infer a cyclic ability. diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md index 3d254cf7d2..d1a7ee435d 100644 --- a/unison-src/transcripts/fix2378.output.md +++ b/unison-src/transcripts/fix2378.output.md @@ -2,6 +2,10 @@ Tests for an ability failure that was caused by order dependence of checking wanted vs. provided abilities. It was necessary to re-check rows until a fixed point is reached. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison unique ability C c where new : c a @@ -38,7 +42,7 @@ x : '{} (Either () Nat) x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2423.output.md b/unison-src/transcripts/fix2423.output.md index 25b4734b17..5f8aaaef39 100644 --- a/unison-src/transcripts/fix2423.output.md +++ b/unison-src/transcripts/fix2423.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural ability Split where skip! : x @@ -26,7 +30,7 @@ Split.zipSame sa sb _ = handle !sa with go sb ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index 4ff211010a..57a91cdff6 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -20,7 +20,6 @@ should be typed in the following way: ``` ucm scratch/main> builtins.merge - Done. ``` @@ -38,7 +37,7 @@ Stream.uncons s = handle !s with go ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 8890250439..eec696ee74 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> alias.type ##Nat lib.base.Nat +``` + ``` unison :hide unique type foo.bar.baz.MyRecord = { value : Nat @@ -6,7 +10,6 @@ unique type foo.bar.baz.MyRecord = { ``` ucm scratch/main> add - ⍟ I've added these definitions: type foo.bar.baz.MyRecord @@ -19,7 +22,6 @@ scratch/main> add -> MyRecord scratch/main> find : Nat -> MyRecord - 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord diff --git a/unison-src/transcripts/fix2663.output.md b/unison-src/transcripts/fix2663.output.md index ee289a88fc..87b7bbb5bd 100644 --- a/unison-src/transcripts/fix2663.output.md +++ b/unison-src/transcripts/fix2663.output.md @@ -8,6 +8,10 @@ T p1 p3 p3 and z would end up referring to the first p3 rather than the second. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural type Trip = T Nat Nat Nat @@ -20,7 +24,7 @@ bad x = match Some (Some x) with > bad 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index 300410d575..cb9d6b5f17 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison loop : List Nat -> Nat -> List Nat loop l = cases @@ -8,7 +12,7 @@ range : Nat -> List Nat range = loop [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ range = loop [] ``` ucm scratch/main> add - ⍟ I've added these definitions: loop : [Nat] -> Nat -> [Nat] @@ -36,7 +39,7 @@ scratch/main> add > range 2000 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -2058,7 +2061,7 @@ Should be cached: > range 2000 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index 97bb0c3593..347317ce3c 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison unique type Map k v = Tip | Bin Nat k v (Map k v) (Map k v) @@ -5,7 +9,7 @@ mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b mapWithKey f m = Tip ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ mapWithKey f m = Tip ``` ucm scratch/main> add - ⍟ I've added these definitions: type Map k v @@ -42,7 +45,7 @@ naiomi = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md index 39da527ba0..48c52dd339 100644 --- a/unison-src/transcripts/fix2795.output.md +++ b/unison-src/transcripts/fix2795.output.md @@ -1,10 +1,8 @@ ``` ucm scratch/main> builtins.mergeio - Done. scratch/main> load unison-src/transcripts/fix2795/docs.u - Loading changes detected in unison-src/transcripts/fix2795/docs.u. @@ -18,7 +16,6 @@ scratch/main> load unison-src/transcripts/fix2795/docs.u test : Doc2 scratch/main> display test - t : Text t = "hi" t diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md index b33dde91cc..40a907feac 100644 --- a/unison-src/transcripts/fix2822.output.md +++ b/unison-src/transcripts/fix2822.output.md @@ -1,5 +1,9 @@ # Inability to reference a term or type with a name that has segments starting with an underscore +``` ucm :hide +scratch/main> builtins.mergeio +``` + There should be no issue having terms with an underscore-led component ``` unison @@ -8,7 +12,7 @@ _a.blah = 2 b = _a.blah + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,7 +34,7 @@ _b = 2 x = _b + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +57,7 @@ c : _a.Blah c = A ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -75,7 +79,7 @@ type Hello = {_value : Nat} doStuff = _value.modify ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -100,7 +104,7 @@ dontMap f = cases Some _used -> f _used ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what _used refers to here: @@ -126,7 +130,7 @@ dontMap f = cases Some _unused -> f 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix2826.output.md b/unison-src/transcripts/fix2826.output.md index 0de1299048..7100351042 100644 --- a/unison-src/transcripts/fix2826.output.md +++ b/unison-src/transcripts/fix2826.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.mergeio - Done. ``` @@ -17,7 +16,7 @@ doc = {{ ```` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,13 +33,11 @@ And round-trips properly. ``` ucm scratch/main> add - ⍟ I've added these definitions: doc : Doc2 scratch/main> edit doc - ☝️ I added 1 definitions to the top of scratch.u @@ -49,7 +46,6 @@ scratch/main> edit doc definitions currently in this namespace. scratch/main> load scratch.u - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index 51f749aa31..141484ed98 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -1,10 +1,13 @@ 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 +scratch/main> builtins.merge +``` + First, a few \[hidden\] definitions necessary for typechecking a simple Doc2. ``` ucm scratch/main> add - ⍟ I've added these definitions: type Doc2 @@ -28,7 +31,6 @@ Hi ``` ucm scratch/main> display README - Hi ``` diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index 5b2fd656e0..ba59baae40 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -2,7 +2,6 @@ Also fixes \#1519 (it's the same issue). ``` ucm scratch/main> builtins.merge - Done. ``` @@ -12,7 +11,7 @@ foo.+.doc : Nat foo.+.doc = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md index b91f32a329..e9e55ee063 100644 --- a/unison-src/transcripts/fix3037.output.md +++ b/unison-src/transcripts/fix3037.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests for an unsound case of ability checking that was erroneously being accepted before. In certain cases, abilities were able to be added to rows in invariant positions. @@ -13,7 +17,7 @@ runner : Runner {IO} runner = pureRunner ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found an ability mismatch when checking the expression in red @@ -47,7 +51,7 @@ h _ = () > h anA ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found an ability mismatch when checking the application diff --git a/unison-src/transcripts/fix3171.output.md b/unison-src/transcripts/fix3171.output.md index 00ef0d8865..619479c3ee 100644 --- a/unison-src/transcripts/fix3171.output.md +++ b/unison-src/transcripts/fix3171.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests an case where decompiling could cause function arguments to occur in the opposite order for partially applied functions. @@ -9,7 +13,7 @@ f x y z _ = x + y * z > f 1 2 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md index 9901d8fc96..75a972181e 100644 --- a/unison-src/transcripts/fix3196.output.md +++ b/unison-src/transcripts/fix3196.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests ability checking in scenarios where one side is concrete and the other is a variable. This was supposed to be covered, but the method wasn't actually symmetric, so doing `equate l r` might work, but not `equate r l`. @@ -29,7 +33,7 @@ w2 = cases W -> W > w2 w1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3215.output.md b/unison-src/transcripts/fix3215.output.md index 5927aba577..44be78ec30 100644 --- a/unison-src/transcripts/fix3215.output.md +++ b/unison-src/transcripts/fix3215.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests a case where concrete abilities were appearing multiple times in an inferred type. This was due to the pre-pass that figures out which abilities are being matched on. It was just concatenating the ability for each pattern @@ -16,7 +20,7 @@ f = cases {x} -> 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3244.output.md b/unison-src/transcripts/fix3244.output.md index 7165fe0c66..75eb1e7d75 100644 --- a/unison-src/transcripts/fix3244.output.md +++ b/unison-src/transcripts/fix3244.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This tests an previously erroneous case in the pattern compiler. It was assuming that the variables bound in a guard matched the variables bound in the rest of the branch exactly, but apparently this needn't be the case. @@ -16,7 +20,7 @@ foo t = > foo (10,20) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3265.output.md b/unison-src/transcripts/fix3265.output.md index c7918a37a3..1810711a41 100644 --- a/unison-src/transcripts/fix3265.output.md +++ b/unison-src/transcripts/fix3265.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Tests cases that produced bad decompilation output previously. There are three cases that need to be 'fixed up.' @@ -21,7 +25,7 @@ are three cases that need to be 'fixed up.' g (z -> x + f0 z)) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -66,7 +70,7 @@ discard its arguments, where `f` also occurs. f x 20) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md index 937714613f..ebec5bf745 100644 --- a/unison-src/transcripts/fix3424.output.md +++ b/unison-src/transcripts/fix3424.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge lib.builtins - Done. ``` @@ -13,7 +12,6 @@ c = "World" ``` ucm scratch/main> add - ⍟ I've added these definitions: a : 'Text @@ -21,7 +19,6 @@ scratch/main> add c : Text scratch/main> run a - "Hello, World!" ``` @@ -33,7 +30,6 @@ c = "Unison" ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -44,7 +40,6 @@ scratch/main> update Done. scratch/main> run a - "Hello, Unison!" ``` diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index 8b0f5f8dbd..4ed044b9ec 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison structural type M a = N | J a @@ -10,7 +14,7 @@ d = {{ }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,7 +31,6 @@ d = {{ ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type M a @@ -35,7 +38,6 @@ scratch/main> add d : Doc2 scratch/main> display d - `x -> J x` J diff --git a/unison-src/transcripts/fix3678.output.md b/unison-src/transcripts/fix3678.output.md index 5db492266a..81b585d867 100644 --- a/unison-src/transcripts/fix3678.output.md +++ b/unison-src/transcripts/fix3678.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Array comparison was indexing out of bounds. ``` unison @@ -8,7 +12,7 @@ arr = Scope.run do > compare arr arr ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3752.output.md b/unison-src/transcripts/fix3752.output.md index 5f5a67ad46..959a7701a3 100644 --- a/unison-src/transcripts/fix3752.output.md +++ b/unison-src/transcripts/fix3752.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + These were failing to type check before, because id was not generalized. @@ -16,7 +20,7 @@ bar = do id "hello" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3773.output.md b/unison-src/transcripts/fix3773.output.md index af1988e5af..737f262366 100644 --- a/unison-src/transcripts/fix3773.output.md +++ b/unison-src/transcripts/fix3773.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison foo = _ = 1 @@ -7,7 +11,7 @@ foo = > foo + 20 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index 01b5b1202c..3667cc35dc 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”. ``` unison :hide @@ -8,14 +12,12 @@ foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with ``` ucm scratch/main> add - ⍟ I've added these definitions: failure : Text -> context -> Failure foo : Either Failure b scratch/main> edit foo - ☝️ I added 1 definitions to the top of scratch.u @@ -24,7 +26,6 @@ scratch/main> edit foo definitions currently in this namespace. scratch/main> load scratch.u - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index f34ebb8a21..1bcbc9973f 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison debug a = match Debug.toText a with None -> "" @@ -11,7 +15,7 @@ bool = true allowDebug = debug [1,2,3] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,7 +40,6 @@ allowDebug = debug [1,2,3] ``` ucm scratch/main> add - ⍟ I've added these definitions: allowDebug : Text @@ -45,7 +48,6 @@ scratch/main> add t1 : [Result] scratch/main> test - Cached test results (`help testcache` to learn more) 1. t1 ◉ Yay @@ -60,7 +62,7 @@ scratch/main> test bool = false ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -76,13 +78,11 @@ bool = false ``` ucm :error scratch/main> update.old - ⍟ I've updated these names to your new definition: bool : Boolean scratch/main> test - ✅ diff --git a/unison-src/transcripts/fix4280.output.md b/unison-src/transcripts/fix4280.output.md index 95ca6c2aa2..c31afe0293 100644 --- a/unison-src/transcripts/fix4280.output.md +++ b/unison-src/transcripts/fix4280.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison foo.bar._baz = 5 @@ -7,7 +11,7 @@ bonk = _baz ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4397.output.md b/unison-src/transcripts/fix4397.output.md index bdfd08501a..e09bfbc80a 100644 --- a/unison-src/transcripts/fix4397.output.md +++ b/unison-src/transcripts/fix4397.output.md @@ -7,7 +7,7 @@ unique type Bar = Bar Baz ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from diff --git a/unison-src/transcripts/fix4415.output.md b/unison-src/transcripts/fix4415.output.md index 77ac7c80df..ff8234939c 100644 --- a/unison-src/transcripts/fix4415.output.md +++ b/unison-src/transcripts/fix4415.output.md @@ -3,7 +3,7 @@ unique type Foo = Foo unique type sub.Foo = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index 8b46bc70da..23d4451d3d 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Some basics: ``` unison :hide @@ -10,7 +14,6 @@ countCat = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: type Cat.Dog @@ -27,7 +30,6 @@ unique type Rat.Dog = Bird | Mouse ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index c7332500b8..638424a4b2 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +myproj/main> builtins.merge +``` + ``` unison lib.foo0.lib.bonk1.bar = 203 lib.foo0.baz = 1 @@ -6,7 +10,7 @@ lib.foo1.lib.bonk2.qux = 1 mybar = bar + bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +29,6 @@ mybar = bar + bar ``` ucm :error myproj/main> add - ⍟ I've added these definitions: lib.foo0.baz : Nat @@ -35,7 +38,6 @@ myproj/main> add mybar : Nat myproj/main> upgrade foo0 foo1 - I couldn't automatically upgrade foo0 to foo1. However, I've added the definitions that need attention to the top of scratch.u. diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index 3d3e59af7a..0f52664efd 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison lib.dep0.bonk.foo = 5 lib.dep0.zonk.foo = "hi" @@ -5,7 +9,7 @@ lib.dep0.lib.dep1.foo = 6 myterm = foo + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +27,6 @@ myterm = foo + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.dep0.bonk.foo : Nat @@ -32,7 +35,6 @@ scratch/main> add myterm : Nat scratch/main> view myterm - myterm : Nat myterm = use Nat + diff --git a/unison-src/transcripts/fix4515.output.md b/unison-src/transcripts/fix4515.output.md index 47f4e4bdf6..ec3a3f1b8a 100644 --- a/unison-src/transcripts/fix4515.output.md +++ b/unison-src/transcripts/fix4515.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +myproject/main> builtins.merge +``` + ``` unison unique type Foo = Foo1 unique type Bar = X Foo @@ -8,7 +12,7 @@ useBar = cases Bar.X _ -> 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,7 +30,6 @@ useBar = cases ``` ucm myproject/main> add - ⍟ I've added these definitions: type Bar @@ -40,7 +43,7 @@ myproject/main> add unique type Foo = Foo1 | Foo2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,7 +59,6 @@ unique type Foo = Foo1 | Foo2 ``` ucm myproject/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4528.output.md b/unison-src/transcripts/fix4528.output.md index 3d79701a57..8f044ba80e 100644 --- a/unison-src/transcripts/fix4528.output.md +++ b/unison-src/transcripts/fix4528.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +foo/main> builtins.merge +``` + ``` unison structural type Foo = MkFoo Nat @@ -5,7 +9,7 @@ main : () -> Foo main _ = MkFoo 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,14 +25,12 @@ main _ = MkFoo 5 ``` ucm foo/main> add - ⍟ I've added these definitions: structural type Foo main : 'Foo foo/main> run main - MkFoo 5 ``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index f77d0223b1..9f7508848b 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison thing = 3 foo.hello = 5 + thing @@ -5,7 +9,7 @@ bar.hello = 5 + thing hey = foo.hello ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +27,6 @@ hey = foo.hello ``` ucm scratch/main> add - ⍟ I've added these definitions: bar.hello : Nat @@ -37,7 +40,7 @@ scratch/main> add thing = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +56,6 @@ thing = 2 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md index f1713a206f..478612ee26 100644 --- a/unison-src/transcripts/fix4592.output.md +++ b/unison-src/transcripts/fix4592.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison doc = {{ {{ bug "bug" 52 }} }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index 71a64ec459..353f1524c4 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison foo = 5 unique type Bugs.Zonk = Bugs ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ unique type Bugs.Zonk = Bugs ``` ucm scratch/main> add - ⍟ I've added these definitions: type Bugs.Zonk @@ -32,7 +35,7 @@ foo = 4 unique type Bugs = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,7 +55,6 @@ unique type Bugs = ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4711.output.md b/unison-src/transcripts/fix4711.output.md index 5049a16260..7e491c7c40 100644 --- a/unison-src/transcripts/fix4711.output.md +++ b/unison-src/transcripts/fix4711.output.md @@ -1,12 +1,16 @@ # Delayed Int literal doesn't round trip +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison thisWorks = '(+1) thisDoesNotWork = ['(+1)] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,14 +28,12 @@ Since this is fixed, `thisDoesNotWork` now does work. ``` ucm scratch/main> add - ⍟ I've added these definitions: thisDoesNotWork : ['{g} Int] thisWorks : 'Int scratch/main> edit thisWorks thisDoesNotWork - ☝️ I added 2 definitions to the top of scratch.u @@ -40,7 +42,6 @@ scratch/main> edit thisWorks thisDoesNotWork definitions currently in this namespace. scratch/main> load - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix4722.output.md b/unison-src/transcripts/fix4722.output.md index 6646c8d8b8..c7daf6f328 100644 --- a/unison-src/transcripts/fix4722.output.md +++ b/unison-src/transcripts/fix4722.output.md @@ -7,6 +7,10 @@ and subtyping, but we can instead check a match by pushing the expected type into each case, allowing top-level annotations to act like annotations on each case. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison ability X a where yield : {X a} () ability Y where y : () @@ -34,7 +38,7 @@ foo = cases f (_ -> ()) (foo l) (foo r) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md index 2dc23a8bca..27152bee46 100644 --- a/unison-src/transcripts/fix4731.output.md +++ b/unison-src/transcripts/fix4731.output.md @@ -2,7 +2,7 @@ structural type Void = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,7 +17,6 @@ structural type Void = ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Void @@ -31,7 +30,7 @@ Void.absurdly : '{e} Void ->{e} a Void.absurdly v = match !v with ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,7 +48,7 @@ Void.absurdly : Void -> a Void.absurdly v = match v with ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -69,7 +68,7 @@ Void.absurdly : Void -> a Void.absurdly = cases ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -89,7 +88,7 @@ Void.absurd : Void -> a Void.absurd x = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: diff --git a/unison-src/transcripts/fix4780.output.md b/unison-src/transcripts/fix4780.output.md index 4aeda6dd32..c5770aa455 100644 --- a/unison-src/transcripts/fix4780.output.md +++ b/unison-src/transcripts/fix4780.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Just a simple test case to see whether partially applied builtins decompile properly. @@ -5,7 +9,7 @@ builtins decompile properly. > (+) 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index 8aefaf3ddf..142a05a1c1 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ redouble : Int -> Int redouble x = double x + double x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,14 +28,12 @@ redouble x = double x + double x ``` ucm scratch/main> add - ⍟ I've added these definitions: double : Int -> Int redouble : Int -> Int scratch/main> dependents double - Dependents of: double Terms: @@ -47,7 +44,6 @@ scratch/main> dependents double the above list. scratch/main> delete.term 1 - Done. ``` diff --git a/unison-src/transcripts/fix5055.output.md b/unison-src/transcripts/fix5055.output.md index a627f67b5a..8cf0e386a6 100644 --- a/unison-src/transcripts/fix5055.output.md +++ b/unison-src/transcripts/fix5055.output.md @@ -1,6 +1,5 @@ ``` ucm test-5055/main> builtins.merge - Done. ``` @@ -11,7 +10,7 @@ foo.add x y = x Int.+ y foo.subtract x y = x Int.- y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,19 +26,16 @@ foo.subtract x y = x Int.- y ``` ucm test-5055/main> add - ⍟ I've added these definitions: foo.add : Int -> Int -> Int foo.subtract : Int -> Int -> Int test-5055/main> ls foo - 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) test-5055/main> view 1 - foo.add : Int -> Int -> Int foo.add x y = use Int + diff --git a/unison-src/transcripts/fix5076.output.md b/unison-src/transcripts/fix5076.output.md index 789809c15b..97536bc208 100644 --- a/unison-src/transcripts/fix5076.output.md +++ b/unison-src/transcripts/fix5076.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + Nested call to code lexer wasn’t terminating inline examples containing blocks properly. ``` unison @@ -7,7 +11,7 @@ x = {{ }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index 8f376c0f12..275bfba4bd 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + ``` unison test> fix5080.tests.success = [Ok "success"] test> fix5080.tests.failure = [Fail "fail"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,14 +34,12 @@ test> fix5080.tests.failure = [Fail "fail"] ``` ucm :error scratch/main> add - ⍟ I've added these definitions: fix5080.tests.failure : [Result] fix5080.tests.success : [Result] scratch/main> test - Cached test results (`help testcache` to learn more) 1. fix5080.tests.success ◉ success @@ -52,11 +54,9 @@ scratch/main> test ``` ucm scratch/main> delete.term 2 - Done. scratch/main> test - Cached test results (`help testcache` to learn more) 1. fix5080.tests.success ◉ success diff --git a/unison-src/transcripts/fix5168.output.md b/unison-src/transcripts/fix5168.output.md index 552e6a7d72..a62179ca2a 100644 --- a/unison-src/transcripts/fix5168.output.md +++ b/unison-src/transcripts/fix5168.output.md @@ -4,7 +4,7 @@ The `edit` seems to suppress a following ` ``` unison ` block: b = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md index dde553f435..9111ef9bef 100644 --- a/unison-src/transcripts/fix5349.output.md +++ b/unison-src/transcripts/fix5349.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + Empty code blocks are invalid in Unison, but shouldn’t crash the parser. ```` unison :error @@ -7,7 +11,7 @@ README = {{ }} ```` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: @@ -20,7 +24,7 @@ README = {{ README = {{ {{ }} }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -50,7 +54,7 @@ README = {{ {{ }} }} README = {{ `` `` }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md index 1025d69379..74c60e9838 100644 --- a/unison-src/transcripts/fix614.output.md +++ b/unison-src/transcripts/fix614.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. This works, as expected: @@ -11,7 +15,7 @@ ex1 = do 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +29,10 @@ ex1 = do ``` +``` ucm :hide +scratch/main> add +``` + This does not typecheck, we've accidentally underapplied `Stream.emit`: ``` unison :error @@ -33,7 +41,7 @@ ex2 = do 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a value of type: a ->{Stream a} Unit @@ -55,7 +63,7 @@ ex3 = do () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -78,7 +86,7 @@ ex4 = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -100,7 +108,7 @@ ex4 = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a value of type: [Nat] diff --git a/unison-src/transcripts/fix689.output.md b/unison-src/transcripts/fix689.output.md index e1e4e0c5de..f3247263ac 100644 --- a/unison-src/transcripts/fix689.output.md +++ b/unison-src/transcripts/fix689.output.md @@ -1,5 +1,9 @@ Tests the fix for https://github.com/unisonweb/unison/issues/689 +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural ability SystemTime where systemTime : ##Nat @@ -7,7 +11,7 @@ structural ability SystemTime where tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 0e79737d35..42eee96662 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural ability X t where x : t -> a -> a @@ -6,7 +10,7 @@ structural ability Abort where abort : a ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,7 +26,6 @@ structural ability Abort where ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability Abort @@ -42,7 +45,7 @@ h0 req = match req with { d } -> Some d ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -70,7 +73,7 @@ h1 req = match req with { d } -> Some d ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -99,7 +102,7 @@ h2 req = match req with { r } -> r ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. The 1st argument to `k` @@ -122,7 +125,7 @@ h3 = cases { X.x b _ -> _ } -> Some b ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md index c002129894..02bab5c080 100644 --- a/unison-src/transcripts/fix845.output.md +++ b/unison-src/transcripts/fix845.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Add `List.zonk` to the codebase: ``` unison @@ -8,7 +12,7 @@ Text.zonk : Text -> Text Text.zonk txt = txt ++ "!! " ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,6 +26,10 @@ Text.zonk txt = txt ++ "!! " ``` +``` ucm :hide +scratch/main> add +``` + Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: ``` unison :error @@ -29,7 +37,7 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th > Blah.zonk [1,2,3] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what Blah.zonk refers to here: @@ -61,7 +69,7 @@ ex = baz ++ ", world!" > ex ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -91,7 +99,7 @@ ex = zonk "hi" > ex ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -123,7 +131,7 @@ ex = zonk "hi" -- should resolve to Text.zonk, from the codebase > ex ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix849.output.md b/unison-src/transcripts/fix849.output.md index 6126d14c63..750dc80402 100644 --- a/unison-src/transcripts/fix849.output.md +++ b/unison-src/transcripts/fix849.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + See [this ticket](https://github.com/unisonweb/unison/issues/849). ``` unison @@ -6,7 +10,7 @@ x = 42 > x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index e3722054c4..41ac3175d7 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + First we add some code: ``` unison @@ -6,7 +10,7 @@ y = x + 1 z = y + 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +27,6 @@ z = y + 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: x : Nat @@ -38,7 +41,7 @@ Now we edit `x` to be `7`, which should make `z` equal `10`: x = 7 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,7 +57,6 @@ x = 7 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -65,7 +67,6 @@ scratch/main> update Done. scratch/main> view x y z - x : Nat x = 7 @@ -87,7 +88,7 @@ Uh oh\! `z` is still referencing the old version. Just to confirm: test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,13 +110,11 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ucm scratch/main> add - ⍟ I've added these definitions: t1 : [Result] scratch/main> test - Cached test results (`help testcache` to learn more) 1. t1 ◉ great diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index 1672040a83..54ef23c45b 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + First we'll add a definition: ``` unison @@ -10,7 +14,7 @@ spaceAttack1 x = "All done" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,7 +32,6 @@ Add it to the codebase: ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability DeathStar @@ -45,7 +48,7 @@ spaceAttack2 x = "All done" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,7 +63,6 @@ spaceAttack2 x = ``` ucm scratch/main> add - ⍟ I've added these definitions: spaceAttack2 : x ->{DeathStar} Text diff --git a/unison-src/transcripts/formatter.output.md b/unison-src/transcripts/formatter.output.md index 2028ff646a..b02f196653 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide {{ # Doc This is a *doc*! @@ -85,7 +89,6 @@ with a strike-through block~ ``` ucm scratch/main> debug.format - ``` ``` unison :added-by-ucm scratch.u @@ -172,7 +175,7 @@ Formatter should leave things alone if the file doesn't typecheck. brokenDoc = {{ hello }} + 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what + refers to here: @@ -202,5 +205,4 @@ brokenDoc = {{ hello }} + 1 ``` ucm scratch/main> debug.format - ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index 2ede5313ee..c86d65c76b 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -5,8 +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 scratch/main> move.term - -`move.term foo bar` renames `foo` to `bar`. + `move.term foo bar` renames `foo` to `bar`. ``` If a fuzzy resolver doesn't have any options available it should print a message instead of @@ -14,10 +13,9 @@ opening an empty fuzzy-select. ``` ucm :error scratch/empty> view - -⚠️ - -Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 + ⚠️ + + Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 ``` ``` unison :hide @@ -30,14 +28,12 @@ Definition args ``` ucm scratch/main> add - ⍟ I've added these definitions: nested.optionTwo : ##Nat optionOne : ##Nat scratch/main> debug.fuzzy-options view _ - Select a definition to view: * optionOne * nested.optionTwo @@ -48,12 +44,10 @@ Namespace args ``` ucm scratch/main> add - ⊡ Ignored previously added definitions: nested.optionTwo optionOne scratch/main> debug.fuzzy-options find-in _ - Select a namespace: * nested @@ -63,14 +57,12 @@ Project Branch args ``` ucm 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`. scratch/main> debug.fuzzy-options switch _ - Select a project or branch to switch to: * myproject/main * myproject/mybranch diff --git a/unison-src/transcripts/generic-parse-errors.output.md b/unison-src/transcripts/generic-parse-errors.output.md index e27f709fa6..fac94257ea 100644 --- a/unison-src/transcripts/generic-parse-errors.output.md +++ b/unison-src/transcripts/generic-parse-errors.output.md @@ -5,7 +5,7 @@ x = foo.123 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -26,7 +26,7 @@ x = namespace.blah = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -62,7 +62,7 @@ namespace.blah = 1 x = 1 ] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a closing ']' here without a matching '['. @@ -76,7 +76,7 @@ x = 1 ] x = a.#abc ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -110,7 +110,7 @@ x = a.#abc x = "hi ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: @@ -130,7 +130,7 @@ x = "hi y : a ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index 7e2ab87eb8..e062fa24fd 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -1,5 +1,9 @@ # Hello\! +``` ucm :hide +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. The format is just a regular markdown file with some fenced code blocks that are typechecked and elaborated by `ucm`. For example, you can call this transcript via: @@ -25,7 +29,7 @@ In the `unison` fenced block, you can give an (optional) file name (defaults to x = 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in myfile.u. I found and typechecked these definitions in myfile.u. If you @@ -42,13 +46,11 @@ Let's go ahead and add that to the codebase, then make sure it's there: ``` ucm scratch/main> add - ⍟ I've added these definitions: x : Nat scratch/main> view x - x : Nat x = 42 @@ -66,6 +68,10 @@ y = 99 This works for `ucm` blocks as well. +``` ucm :hide +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. ## Expecting failures @@ -77,7 +83,7 @@ hmm : .builtin.Nat hmm = "Not, in fact, a number" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found a value of type: Text diff --git a/unison-src/transcripts/help.output.md b/unison-src/transcripts/help.output.md index 914d727c47..1d3c1e6e59 100644 --- a/unison-src/transcripts/help.output.md +++ b/unison-src/transcripts/help.output.md @@ -2,7 +2,6 @@ ``` ucm scratch/main> help - add `add` adds to the codebase all the definitions from the most recently typechecked file. @@ -881,7 +880,6 @@ scratch/main> help `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. scratch/main> help-topics - 🌻 Here's a list of topics I can tell you more about: @@ -896,7 +894,6 @@ scratch/main> help-topics Example: use `help-topics filestatus` to learn more about that topic. scratch/main> help-topic filestatus - 📓 Here's a list of possible status messages you might see for @@ -927,7 +924,6 @@ scratch/main> help-topic filestatus selected. scratch/main> help-topic messages.disallowedAbsolute - 🤖 Although I can understand absolute (ex: .foo.bar) or relative @@ -939,7 +935,6 @@ scratch/main> help-topic messages.disallowedAbsolute temporarily (like `exports.blah.foo`) and then use `move.*`. scratch/main> help-topic namespaces - 🧐 There are two kinds of namespaces, absolute, such as (.foo.bar @@ -965,7 +960,6 @@ scratch/main> help-topic namespaces answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 scratch/main> help-topic projects - A project is a versioned collection of code that can be edited, published, and depended on other projects. Unison projects are analogous to Git repositories. @@ -986,7 +980,6 @@ scratch/main> help-topic projects https://unison-lang.org/learn/projects scratch/main> help-topic remotes - 🤖 Local projects may be associated with at most one remote @@ -1001,7 +994,6 @@ scratch/main> help-topic remotes the relationship will be established on the first `push`. scratch/main> help-topic testcache - 🎈 Unison caches the results of test> watch expressions. Since diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index 93368fe646..b6f8225015 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -1,5 +1,11 @@ This transcript does some testing of higher-rank types. Regression tests related to higher-rank types can be added here. +``` ucm :hide +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: ``` unison @@ -9,7 +15,7 @@ f id = (id 1, id "hi") > f (x -> x) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +44,7 @@ f id _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,7 +72,7 @@ Functor.blah = cases Functor f -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -110,7 +116,7 @@ Loc.transform2 nt = cases Loc f -> Loc f' ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -141,13 +147,11 @@ We should be able to add and view records with higher-rank fields. ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type HigherRanked scratch/main> view HigherRanked - structural type HigherRanked = HigherRanked (∀ a. a -> a) ``` diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md index a22c8ac517..d75ff85e69 100644 --- a/unison-src/transcripts/input-parse-errors.output.md +++ b/unison-src/transcripts/input-parse-errors.output.md @@ -1,43 +1,46 @@ # demonstrating our new input parsing errors +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison :hide x = 55 ``` +``` ucm :hide +scratch/main> add +``` + `handleNameArg` parse error in `add` ``` ucm :error scratch/main> add . - -⚠️ - -Sorry, I wasn’t sure how to process your request: - - 1:2: - | - 1 | . - | ^ - unexpected end of input - expecting '`' or operator (valid characters: !$%&*+-/:<=>\^|~) + ⚠️ - -You can run `help add` for more information on using `add`. + Sorry, I wasn’t sure how to process your request: + + 1:2: + | + 1 | . + | ^ + unexpected end of input + expecting '`' or operator (valid characters: !$%&*+-/:<=>\^|~) + + + You can run `help add` for more information on using `add`. scratch/main> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> add 1 - scratch/main> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> add 2 - ⊡ Ignored previously added definitions: x ``` @@ -63,15 +66,14 @@ aliasMany: skipped -- similar to `add` ``` ucm :error scratch/main> update arg - -⚠️ - -Sorry, I wasn’t sure how to process your request: - - I expected no arguments, but received one. - -You can run `help update` for more information on using -`update`. + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I expected no arguments, but received one. + + You can run `help update` for more information on using + `update`. ``` aliasTerm diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index 5fb945022a..66cae88e83 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + The `io.test` command should run all of the tests within the current namespace, excluding libs. ``` unison :hide @@ -15,11 +19,14 @@ lib.ioAndExceptionTestInLib = do [Ok "Success"] ``` +``` ucm :hide +scratch/main> add +``` + Run a IO tests one by one ``` ucm scratch/main> io.test ioAndExceptionTest - New test results: 1. ioAndExceptionTest ◉ Success @@ -29,7 +36,6 @@ scratch/main> io.test ioAndExceptionTest Tip: Use view 1 to view the source of a test. scratch/main> io.test ioTest - New test results: 1. ioTest ◉ Success @@ -44,7 +50,6 @@ scratch/main> io.test ioTest ``` ucm scratch/main> io.test ioAndExceptionTest - New test results: 1. ioAndExceptionTest ◉ Success @@ -59,7 +64,6 @@ scratch/main> io.test ioAndExceptionTest ``` ucm scratch/main> io.test.all - diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index 12d6266793..dc5af467e5 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -1,5 +1,12 @@ # tests for built-in IO functions +``` ucm :hide +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. ## Setup @@ -9,6 +16,10 @@ You can skip the section which is just needed to make the transcript self-contai TempDirs/autoCleaned is an ability/hanlder which allows you to easily create a scratch directory which will automatically get cleaned up. +``` ucm :hide +scratch/main> add +``` + ## Basic File Functions ### Creating/Deleting/Renaming Directories @@ -47,7 +58,7 @@ testCreateRename _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -62,13 +73,11 @@ testCreateRename _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testCreateRename : '{IO} [Result] scratch/main> io.test testCreateRename - New test results: 1. testCreateRename ◉ create a foo directory @@ -132,7 +141,7 @@ testOpenClose _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -147,13 +156,11 @@ testOpenClose _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testOpenClose : '{IO} [Result] scratch/main> io.test testOpenClose - New test results: 1. testOpenClose ◉ file should be open @@ -225,7 +232,7 @@ testGetSomeBytes _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -240,13 +247,11 @@ testGetSomeBytes _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testGetSomeBytes : '{IO} [Result] scratch/main> io.test testGetSomeBytes - New test results: 1. testGetSomeBytes ◉ chunk size splits data into 2 uneven sides @@ -335,7 +340,7 @@ testAppend _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -351,14 +356,12 @@ testAppend _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testAppend : '{IO} [Result] testSeek : '{IO} [Result] scratch/main> io.test testSeek - New test results: 1. testSeek ◉ seeked @@ -374,7 +377,6 @@ scratch/main> io.test testSeek Tip: Use view 1 to view the source of a test. scratch/main> io.test testAppend - New test results: 1. testAppend ◉ should be able to read our temporary file @@ -397,7 +399,7 @@ testSystemTime _ = runTest test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -412,13 +414,11 @@ testSystemTime _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testSystemTime : '{IO} [Result] scratch/main> io.test testSystemTime - New test results: 1. testSystemTime ◉ systemTime should be sane @@ -443,13 +443,11 @@ testGetTempDirectory _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testGetTempDirectory : '{IO} [Result] scratch/main> io.test testGetTempDirectory - New test results: 1. testGetTempDirectory ◉ Temp directory is directory @@ -475,13 +473,11 @@ testGetCurrentDirectory _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testGetCurrentDirectory : '{IO} [Result] scratch/main> io.test testGetCurrentDirectory - New test results: 1. testGetCurrentDirectory ◉ Current directory is directory @@ -509,13 +505,11 @@ testDirContents _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testDirContents : '{IO} [Result] scratch/main> io.test testDirContents - New test results: 1. testDirContents ◉ directory size should be @@ -543,13 +537,11 @@ testGetEnv _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: testGetEnv : '{IO} [Result] scratch/main> io.test testGetEnv - New test results: 1. testGetEnv ◉ PATH environent variable should be set @@ -599,7 +591,6 @@ Test that they can be run with the right number of args. ``` ucm scratch/main> add - ⍟ I've added these definitions: testGetArgs.fail : Text -> Failure @@ -608,15 +599,12 @@ scratch/main> add testGetArgs.runMeWithTwoArgs : '{IO, Exception} () scratch/main> run runMeWithNoArgs - () scratch/main> run runMeWithOneArg foo - () scratch/main> run runMeWithTwoArgs foo bar - () ``` @@ -625,7 +613,6 @@ Calling our examples with the wrong number of args will error. ``` ucm :error scratch/main> run runMeWithNoArgs foo - 💔💥 The program halted with an unhandled exception: @@ -639,7 +626,6 @@ scratch/main> run runMeWithNoArgs foo ``` ucm :error scratch/main> run runMeWithOneArg - 💔💥 The program halted with an unhandled exception: @@ -653,7 +639,6 @@ scratch/main> run runMeWithOneArg ``` ucm :error scratch/main> run runMeWithOneArg foo bar - 💔💥 The program halted with an unhandled exception: @@ -668,7 +653,6 @@ scratch/main> run runMeWithOneArg foo bar ``` ucm :error scratch/main> run runMeWithTwoArgs - 💔💥 The program halted with an unhandled exception: @@ -691,13 +675,11 @@ testTimeZone = do ``` ucm scratch/main> add - ⍟ I've added these definitions: testTimeZone : '{IO} () scratch/main> run testTimeZone - () ``` @@ -715,13 +697,11 @@ testRandom = do ``` ucm scratch/main> add - ⍟ I've added these definitions: testRandom : '{IO} [Result] scratch/main> io.test testGetEnv - New test results: 1. testGetEnv ◉ PATH environent variable should be set diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index 6980e443d9..1168182888 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ## A type param cannot have conflicting kind constraints within a single decl conflicting constraints on the kind of `a` in a product @@ -6,7 +10,7 @@ conflicting constraints on the kind of `a` in a product unique type T a = T a (a Nat) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -24,7 +28,7 @@ unique type T a | StarStar (a Nat) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -44,7 +48,7 @@ unique type Ping a = Ping Pong unique type Pong = Pong (Ping Optional) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,7 +70,7 @@ unique type Ping a = Ping a Pong unique type Pong = Pong (Ping Optional) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -85,7 +89,7 @@ unique ability Pong a where pong : Ping Optional -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -107,7 +111,7 @@ unique ability Pong a where pong : Ping Optional -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -126,7 +130,7 @@ unique type T a = T a unique type S = S (T Nat) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -150,7 +154,7 @@ unique type T a = T unique type S = S (T Optional) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -172,7 +176,7 @@ unique type T a = T a unique type S = S (T Optional) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -192,7 +196,7 @@ test : Nat Nat test = 0 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -210,7 +214,7 @@ test : Optional -> () test _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -230,7 +234,7 @@ test : T Nat -> () test _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -254,7 +258,7 @@ test _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -277,7 +281,7 @@ test : Foo -> () test _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -295,7 +299,7 @@ test : {Nat} () test _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Kind mismatch arising from @@ -313,7 +317,7 @@ test _ = () unique type T a = T (a a) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Cannot construct infinite kind @@ -329,7 +333,7 @@ unique type T a = T (a a) unique type T a b = T (a b) (b a) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Cannot construct infinite kind @@ -346,7 +350,7 @@ unique type Ping a = Ping (a Pong) unique type Pong a = Pong (a Ping) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Cannot construct infinite kind diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index 2cdf496b42..4a33b8c37e 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -1,5 +1,9 @@ # Lambda case syntax +``` ucm :hide +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: ``` unison @@ -8,7 +12,7 @@ isEmpty x = match x with _ -> false ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,6 +25,10 @@ isEmpty x = match x with ``` +``` ucm :hide +scratch/main> add +``` + Here's the same function written using `cases` syntax: ``` unison @@ -29,7 +37,7 @@ isEmpty2 = cases _ -> false ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +55,6 @@ Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpt ``` ucm scratch/main> view isEmpty - isEmpty : [t] -> Boolean isEmpty = cases [] -> true @@ -73,7 +80,6 @@ merge xs ys = match (xs, ys) with ``` ucm scratch/main> add - ⍟ I've added these definitions: merge : [a] -> [a] -> [a] @@ -92,7 +98,7 @@ merge2 = cases else h2 +: merge2 (h +: t) t2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -110,7 +116,6 @@ Notice that Unison detects this as an alias of `merge`, and if we view `merge` ``` ucm scratch/main> view merge - merge : [a] -> [a] -> [a] merge = cases [], ys -> ys @@ -142,7 +147,7 @@ blorf = cases > blorf T F ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -183,7 +188,7 @@ merge3 = cases | otherwise -> h2 +: merge3 (h +: t) t2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -198,13 +203,11 @@ merge3 = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: merge3 : [a] -> [a] -> [a] scratch/main> view merge3 - merge3 : [a] -> [a] -> [a] merge3 = cases [], ys -> ys @@ -226,7 +229,7 @@ merge4 a b = match (a,b) with h +: t, h2 +: t2 | otherwise -> h2 +: merge4 (h +: t) t2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index 848fee95ed..a8fc578c98 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.mergeio +``` + ``` unison :hide {{ Type doc }} @@ -26,7 +30,6 @@ test> z = let ``` ucm scratch/main> debug.lsp.fold-ranges - 《{{ Type doc }}》 《structural type Optional a = diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md index 16c880b767..0040e7316f 100644 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ b/unison-src/transcripts/lsp-name-completion.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + ``` unison :hide foldMap = "top-level" nested.deeply.foldMap = "nested" @@ -11,6 +15,10 @@ foldMapWith = "partial match" other = "other" ``` +``` ucm :hide +scratch/main> add +``` + Completion should find all the `foldMap` definitions in the codebase, sorted by number of name segments, shortest first. @@ -19,7 +27,6 @@ prioritizing exact matches over partial matches. We don't have any control over ``` ucm scratch/main> debug.lsp-name-completion foldMap - Matching Path Name Hash foldMap foldMap #o38ps8p4q6 foldMapWith foldMapWith #r9rs4mcb0m @@ -33,7 +40,6 @@ Should still find the term which has a matching hash to a better name if the bet ``` ucm scratch/main> debug.lsp-name-completion transitive_same_hash.foldMap - Matching Path Name Hash transitive_same_hash.foldMap lib.dep.lib.transitive_same_hash.foldMap #o38ps8p4q6 diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 7f7fc3062f..a450e8a4b7 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -5,12 +5,10 @@ branch. For example, to merge `topic` into `main`, switch to `main` and run `mer ``` ucm scratch/main> help merge - merge `merge /branch` merges `branch` into the current branch scratch/main> help merge.commit - merge.commit (or commit.merge) `merge.commit` merges a temporary branch created by the `merge` command back into its parent branch, and removes the @@ -30,6 +28,14 @@ contains both additions. ## Basic merge: two unconflicted adds +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/main> branch alice +``` + Alice's adds: ``` unison :hide @@ -37,6 +43,11 @@ foo : Text foo = "alices foo" ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's adds: ``` unison :hide @@ -44,15 +55,17 @@ bar : Text bar = "bobs bar" ``` +``` ucm :hide +scratch/bob> add +``` + Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar - bar : Text bar = "bobs bar" @@ -61,10 +74,19 @@ scratch/alice> view foo bar ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Basic merge: two identical adds If Alice and Bob also happen to add the same definition, that's not a conflict. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +scratch/main> branch alice +``` + Alice's adds: ``` unison :hide @@ -72,6 +94,11 @@ foo : Text foo = "alice and bobs foo" ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's adds: ``` unison :hide @@ -82,15 +109,17 @@ bar : Text bar = "bobs bar" ``` +``` ucm :hide +scratch/bob> add +``` + Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar - bar : Text bar = "bobs bar" @@ -99,10 +128,18 @@ scratch/alice> view foo bar ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Simple update propagation Updates that occur in one branch are propagated to the other. In this example, Alice updates `foo`, while Bob adds a new dependent `bar` of the original `foo`. When Bob's branch is merged into Alice's, her update to `foo` is propagated to his `bar`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -110,6 +147,11 @@ foo : Text foo = "old foo" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's updates: ``` unison :hide @@ -117,6 +159,11 @@ foo : Text foo = "new foo" ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's adds: ``` unison :hide @@ -126,20 +173,21 @@ bar = foo ++ " - " ++ foo ``` ucm scratch/bob> display bar - "old foo - old foo" ``` +``` ucm :hide +scratch/bob> add +``` + Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar - bar : Text bar = use Text ++ @@ -149,17 +197,24 @@ scratch/alice> view foo bar foo = "new foo" scratch/alice> display bar - "old foo - old foo" ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Update propagation with common dependent We classify something as an update if its "syntactic hash"—not its normal Unison hash—differs from the original definition. This allows us to cleanly merge unconflicted updates that were individually propagated to a common dependent. Let's see an example. We have `foo`, which depends on `bar` and `baz`. Alice updates `bar` (propagating to `foo`), and Bob updates `baz` (propagating to `foo`). When we merge their updates, both updates will be reflected in the final `foo`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -173,6 +228,11 @@ baz : Text baz = "old baz" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's updates: ``` unison :hide @@ -180,13 +240,20 @@ bar : Text bar = "alices bar" ``` +``` ucm :hide +scratch/alice> update +``` + ``` ucm scratch/alice> display foo - "foo - alices bar - old baz" ``` +``` ucm :hide +scratch/main> branch bob +``` + Bob's updates: ``` unison :hide @@ -194,9 +261,12 @@ baz : Text baz = "bobs baz" ``` +``` ucm :hide +scratch/bob> update +``` + ``` ucm scratch/bob> display foo - "foo - old bar - bobs baz" ``` @@ -205,11 +275,9 @@ Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz - bar : Text bar = "alices bar" @@ -222,15 +290,22 @@ scratch/alice> view foo bar baz "foo" ++ " - " ++ bar ++ " - " ++ baz scratch/alice> display foo - "foo - alices bar - bobs baz" ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Propagating an update to an update Of course, it's also possible for Alice's update to propagate to one of Bob's updates. In this example, `foo` depends on `bar` which depends on `baz`. Alice updates `baz`, propagating to `bar` and `foo`, while Bob updates `bar` (to something that still depends on `foo`), propagating to `baz`. The merged result will have Alice's update to `foo` incorporated into Bob's updated `bar`, and both updates will propagate to `baz`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -244,13 +319,20 @@ baz : Text baz = "old baz" ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> display foo - "old foo - old bar - old baz" ``` +``` ucm :hide +scratch/main> branch alice +``` + Alice's updates: ``` unison :hide @@ -258,13 +340,20 @@ baz : Text baz = "alices baz" ``` +``` ucm :hide +scratch/alice> update +``` + ``` ucm scratch/alice> display foo - "old foo - old bar - alices baz" ``` +``` ucm :hide +scratch/main> branch bob +``` + Bob's updates: ``` unison :hide @@ -272,9 +361,12 @@ bar : Text bar = "bobs bar" ++ " - " ++ baz ``` +``` ucm :hide +scratch/bob> update +``` + ``` ucm scratch/bob> display foo - "old foo - bobs bar - old baz" ``` @@ -283,11 +375,9 @@ Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz - bar : Text bar = use Text ++ @@ -302,15 +392,22 @@ scratch/alice> view foo bar baz "old foo" ++ " - " ++ bar scratch/alice> display foo - "old foo - bobs bar - alices baz" ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Update + delete isn't (currently) a conflict We don't currently consider "update + delete" a conflict like Git does. In this situation, the delete is just ignored, allowing the update to proceed. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -318,6 +415,11 @@ foo : Text foo = "old foo" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's updates: ``` unison :hide @@ -325,11 +427,15 @@ foo : Text foo = "alices foo" ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's changes: ``` ucm scratch/bob> delete.term foo - Done. ``` @@ -338,24 +444,34 @@ Merge result: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo - foo : Text foo = "alices foo" ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + In a future version, we'd like to give the user a warning at least. ## Library dependencies don't create merge conflicts Library dependencies don't cause merge conflicts, the library dependencies are just unioned together. If two library dependencies have the same name but different namespace hashes, then the merge algorithm makes up two fresh names. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Alice's adds: +``` ucm :hide +scratch/main> branch alice +``` + ``` unison :hide lib.alice.foo : Nat lib.alice.foo = 17 @@ -367,6 +483,11 @@ lib.bothDifferent.baz : Nat lib.bothDifferent.baz = 19 ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's adds: ``` unison :hide @@ -380,15 +501,17 @@ lib.bothDifferent.baz : Nat lib.bothDifferent.baz = 21 ``` +``` ucm :hide +scratch/bob> add +``` + Merge result: ``` ucm scratch/alice> merge bob - I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz - lib.alice.foo : Nat lib.alice.foo = 17 @@ -406,47 +529,58 @@ scratch/alice> view foo bar baz ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## No-op merge (Bob = Alice) If Bob is equals Alice, then merging Bob into Alice looks like this. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` ucm scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/alice> merge /bob - 😶 scratch/alice was already up-to-date with scratch/bob. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## No-op merge (Bob \< Alice) If Bob is behind Alice, then merging Bob into Alice looks like this. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` ucm scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -463,33 +597,37 @@ foo = "foo" ``` ucm scratch/alice> add - ⍟ I've added these definitions: foo : Text scratch/alice> merge /bob - 😶 scratch/alice was already up-to-date with scratch/bob. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Fast-forward merge (Bob \> Alice) If Bob is ahead of Alice, then merging Bob into Alice looks like this. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` ucm scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -506,35 +644,39 @@ foo = "foo" ``` ucm scratch/bob> add - ⍟ I've added these definitions: foo : Text scratch/alice> merge /bob - I fast-forward merged scratch/bob into scratch/alice. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## No-op merge: merge empty namespace into empty namespace ``` ucm scratch/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`. scratch/main> merge /topic - 😶 scratch/main was already up-to-date with scratch/topic. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: someone deleted something If either Alice or Bob delete something, so long as the other person didn't update it (in which case we ignore the delete, as explained above), then the delete goes through. @@ -543,6 +685,10 @@ This can cause merge failures due to out-of-scope identifiers, and the user may In this example, Alice deletes `foo`, while Bob adds a new dependent of `foo`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -550,15 +696,23 @@ foo : Text foo = "foo" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's delete: ``` ucm scratch/alice> delete.term foo - Done. ``` +``` ucm :hide +scratch/main> branch bob +``` + Bob's new code that depends on `foo`: ``` unison :hide @@ -568,13 +722,11 @@ bar = foo ++ " - " ++ foo ``` ucm :error scratch/bob> add - ⍟ I've added these definitions: bar : Text scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -601,12 +753,20 @@ bar = ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: type error It may be Alice's and Bob's changes merge together cleanly in the sense that there's no textual conflicts, yet the resulting namespace doesn't typecheck. In this example, Alice updates a `Text` to a `Nat`, while Bob adds a new dependent of the `Text`. Upon merging, propagating Alice's update to Bob's dependent causes a typechecking failure. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -614,6 +774,11 @@ foo : Text foo = "foo" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's update: ``` unison :hide @@ -621,6 +786,11 @@ foo : Nat foo = 100 ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's new definition: ``` unison :hide @@ -628,9 +798,12 @@ bar : Text bar = foo ++ " - " ++ foo ``` +``` ucm :hide +scratch/bob> update +``` + ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -657,11 +830,19 @@ bar = ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: simple term conflict Alice and Bob may disagree about the definition of a term. In this case, the conflicted term and all of its dependents are presented to the user to resolve. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -672,6 +853,11 @@ bar : Text bar = "old bar" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's changes: ``` unison :hide @@ -685,6 +871,11 @@ qux : Text qux = "alices qux depends on alices foo" ++ foo ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's changes: ``` unison :hide @@ -695,9 +886,12 @@ baz : Text baz = "bobs baz" ``` +``` ucm :hide +scratch/bob> update +``` + ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -737,7 +931,6 @@ qux = ``` ucm scratch/merge-bob-into-alice> view bar baz - bar : Text bar = "alices bar" @@ -746,31 +939,52 @@ scratch/merge-bob-into-alice> view bar baz ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: simple type conflict Ditto for types; if the hashes don't match, it's a conflict. In this example, Alice and Bob do different things to the same constructor. However, any explicit changes to the same type will result in a conflict, including changes that could concievably be merged (e.g. Alice and Bob both add a new constructor, or edit different constructors). +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide unique type Foo = MkFoo Nat ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's changes: ``` unison :hide unique type Foo = MkFoo Nat Nat ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's changes: ``` unison :hide unique type Foo = MkFoo Nat Text ``` +``` ucm :hide +scratch/bob> update +``` + ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -798,34 +1012,50 @@ type Foo = MkFoo Nat Text ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: type-update + constructor-rename conflict We model the renaming of a type's constructor as an update, so if Alice updates a type and Bob renames one of its constructors (even without changing its structure), we consider it a conflict. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide unique type Foo = Baz Nat | Qux Text ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's changes `Baz Nat` to `Baz Nat Nat` ``` unison :hide unique type Foo = Baz Nat Nat | Qux Text ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's renames `Qux` to `BobQux`: ``` ucm scratch/bob> move.term Foo.Qux Foo.BobQux - Done. ``` ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -853,37 +1083,51 @@ type Foo = BobQux Text | Baz Nat ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: constructor-rename conflict Here is another example demonstrating that constructor renames are modeled as updates. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide unique type Foo = Baz Nat | Qux Text ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's rename: ``` ucm scratch/alice> move.term Foo.Baz Foo.Alice - Done. ``` +``` ucm :hide +scratch/main> branch bob +``` + Bob's rename: ``` ucm scratch/bob> move.term Foo.Qux Foo.Bob - Done. ``` ``` ucm :error scratch/alice> merge bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -911,10 +1155,22 @@ type Foo = Bob Text | Baz Nat ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: non-constructor/constructor conflict A constructor on one side can conflict with a regular term definition on the other. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/main> branch alice +``` + Alice's additions: ``` unison :hide @@ -922,6 +1178,11 @@ my.cool.thing : Nat my.cool.thing = 17 ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's additions: ``` unison :hide @@ -929,9 +1190,12 @@ unique ability my.cool where thing : Nat -> Nat ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -960,10 +1224,18 @@ ability my.cool where thing : Nat ->{cool} Nat ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge failure: type/type conflict with term/constructor conflict Here's a subtle situation where a new type is added on each side of the merge, and an existing term is replaced with a constructor of one of the types. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -971,17 +1243,26 @@ Foo.Bar : Nat Foo.Bar = 17 ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice adds this type `Foo` with constructor `Foo.Alice`: ``` unison :hide unique type Foo = Alice Nat ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob adds the type `Foo` with constructor `Foo.Bar`, replacing the original `Foo.Bar` term: ``` ucm scratch/bob> delete.term Foo.Bar - Done. ``` @@ -990,11 +1271,14 @@ scratch/bob> delete.term Foo.Bar unique type Foo = Bar Nat Nat ``` +``` ucm :hide +scratch/bob> add +``` + These won't cleanly merge. ``` ucm :error scratch/alice> merge bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1026,8 +1310,16 @@ type Foo = Bar Nat Nat ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + Here's a more involved example that demonstrates the same idea. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + In the LCA, we have a type with two constructors, and some term. ``` unison :hide @@ -1039,11 +1331,25 @@ Foo.Bar.Hello : Nat Foo.Bar.Hello = 17 ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice deletes this type entirely, and repurposes its constructor names for other terms. She also updates the term. +``` ucm :hide +scratch/alice> delete.type Foo +scratch/alice> delete.term Foo.Bar.Baz +scratch/alice> delete.term Foo.Bar.Qux +``` + +``` ucm :hide +scratch/alice> update +``` + ``` ucm scratch/alice> view Foo.Bar.Baz Foo.Bar.Qux Foo.Bar.Hello - Foo.Bar.Baz : Nat Foo.Bar.Baz = 100 @@ -1057,9 +1363,15 @@ scratch/alice> view Foo.Bar.Baz Foo.Bar.Qux Foo.Bar.Hello Bob, meanwhile, first deletes the term, then sort of deletes the type and re-adds it under another name, but one constructor's fully qualified names doesn't actually change. The other constructor reuses the name of the deleted term. +``` ucm :hide +scratch/main> branch bob +scratch/bob> delete.term Foo.Bar.Hello +scratch/bob> move.type Foo Foo.Bar +scratch/bob> move.term Foo.Bar.Qux Foo.Bar.Hello +``` + ``` ucm scratch/bob> view Foo.Bar - type Foo.Bar = Baz Nat | Hello Nat Nat ``` @@ -1070,7 +1382,6 @@ Notably, Alice's "unconflicted" update on the name "Foo.Bar.Baz" (because she ch ``` ucm :error scratch/alice> merge bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1103,6 +1414,10 @@ type Foo.Bar = Baz Nat | Hello Nat Nat ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Merge algorithm quirk: add/add unique types Currently, two unique types created by Alice and Bob will be considered in conflict, even if they "look the same". @@ -1111,6 +1426,14 @@ which is a parse error. We will resolve this situation automatically in a future version. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/main> branch alice +``` + Alice's additions: ``` unison :hide @@ -1120,6 +1443,11 @@ alice : Foo -> Nat alice _ = 18 ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's additions: ``` unison :hide @@ -1129,9 +1457,12 @@ bob : Foo -> Nat bob _ = 19 ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1170,11 +1501,19 @@ bob _ = 19 ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## `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 +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -1182,6 +1521,11 @@ foo : Text foo = "old foo" ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's changes: ``` unison :hide @@ -1189,6 +1533,11 @@ foo : Text foo = "alices foo" ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's changes: ``` unison :hide @@ -1198,9 +1547,12 @@ foo = "bobs foo" Attempt to merge: +``` ucm :hide +scratch/bob> update +``` + ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1237,7 +1589,7 @@ foo : Text foo = "alice and bobs foo" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1253,24 +1605,20 @@ foo = "alice and bobs foo" ``` ucm scratch/merge-bob-into-alice> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/merge-bob-into-alice> merge.commit - I fast-forward merged scratch/merge-bob-into-alice into scratch/alice. scratch/alice> view foo - foo : Text foo = "alice and bobs foo" scratch/alice> branches - Branch Remote branch 1. alice 2. bob @@ -1278,13 +1626,20 @@ scratch/alice> branches ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## `merge.commit` example (failure) `merge.commit` can only be run on a "merge branch". +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` ucm scratch/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 @@ -1294,11 +1649,14 @@ scratch/main> branch topic ``` ucm :error scratch/topic> merge.commit - It doesn't look like there's a merge in progress. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## 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. @@ -1307,6 +1665,10 @@ There are a number of conditions under which we can't perform a merge, and the u 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 +scratch/main> builtins.mergeio lib.builtins +``` + Original branch: ``` unison :hide @@ -1317,6 +1679,11 @@ bar : Nat bar = 100 ``` +``` ucm :hide +scratch/main> add +scratch/main> branch alice +``` + Alice's updates: ``` unison :hide @@ -1327,6 +1694,11 @@ bar : Nat bar = 300 ``` +``` ucm :hide +scratch/alice> update +scratch/main> branch bob +``` + Bob's addition: ``` unison :hide @@ -1334,9 +1706,12 @@ baz : Text baz = "baz" ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - Sorry, I wasn't able to perform the merge: On the merge ancestor, bar and foo were aliases for the same @@ -1356,6 +1731,10 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Conflict involving builtin We don't have a way of rendering a builtin in a scratch file, where users resolve merge conflicts. Thus, if there is a @@ -1363,24 +1742,38 @@ conflict involving a builtin, we can't perform a merge. One way to fix this in the future would be to introduce a syntax for defining aliases in the scratch file. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/main> branch alice +``` + Alice's branch: ``` ucm scratch/alice> alias.type lib.builtins.Nat MyNat - Done. ``` Bob's branch: +``` ucm :hide +scratch/main> branch bob +``` + ``` unison :hide unique type MyNat = MyNat Nat ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - Sorry, I wasn't able to perform the merge: There's a merge conflict on type MyNat, but it's a builtin on @@ -1393,33 +1786,55 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Constructor alias Each naming of a decl may not have more than one name for each constructor, within the decl's namespace. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + +``` ucm :hide +scratch/main> branch alice +``` + Alice's branch: ``` unison :hide unique type Foo = Bar ``` +``` ucm :hide +scratch/alice> add +``` + ``` ucm scratch/alice> alias.term Foo.Bar Foo.some.other.Alias - Done. ``` Bob's branch: +``` ucm :hide +scratch/main> branch bob +``` + ``` unison :hide bob : Nat bob = 100 ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - Sorry, I wasn't able to perform the merge: On scratch/alice, the type Foo has a constructor with multiple @@ -1433,33 +1848,55 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Missing constructor name Each naming of a decl must have a name for each constructor, within the decl's namespace. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Alice's branch: +``` ucm :hide +scratch/main> branch alice +``` + ``` unison :hide unique type Foo = Bar ``` +``` ucm :hide +scratch/alice> add +``` + ``` ucm scratch/alice> delete.term Foo.Bar - Done. ``` Bob's branch: +``` ucm :hide +scratch/main> branch /bob +``` + ``` unison :hide bob : Nat bob = 100 ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - Sorry, I wasn't able to perform the merge: On scratch/alice, the type Foo has some constructors with @@ -1471,20 +1908,35 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Nested decl alias A decl cannot be aliased within the namespace of another of its aliased. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Alice's branch: +``` ucm :hide +scratch/main> branch alice +``` + ``` unison :hide structural type A = B Nat | C Nat Nat structural type A.inner.X = Y Nat | Z Nat Nat ``` +``` ucm :hide +scratch/alice> add +``` + ``` ucm scratch/alice> names A - Type Hash: #65mdg7015r Names: A A.inner.X @@ -1493,14 +1945,21 @@ scratch/alice> names A Bob's branch: +``` ucm :hide +scratch/main> branch bob +``` + ``` unison :hide bob : Nat bob = 100 ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - On scratch/alice, the type A.inner.X is an alias of A. I'm not able to perform a merge when a type exists nested under an alias of itself. Please separate them or delete one copy, and @@ -1508,30 +1967,43 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Stray constructor alias Constructors may only exist within the corresponding decl's namespace. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Alice's branch: +``` ucm :hide +scratch/main> branch alice +``` + ``` ucm scratch/alice> add - ⍟ I've added these definitions: type Foo scratch/alice> alias.term Foo.Bar AliasOutsideFooNamespace - Done. ``` Bob's branch: +``` ucm :hide +scratch/main> branch bob +``` + ``` ucm scratch/bob> add - ⍟ I've added these definitions: bob : Nat @@ -1540,7 +2012,6 @@ scratch/bob> add ``` ucm :error scratch/alice> merge bob - Sorry, I wasn't able to perform the merge, because I need all constructor names to be nested somewhere beneath the corresponding type name. @@ -1552,17 +2023,34 @@ scratch/alice> merge bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Term or type in `lib` By convention, `lib` can only namespaces; each of these represents a library dependencies. Individual terms and types are not allowed at the top level of `lib`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + Alice's branch: +``` ucm :hide +scratch/main> branch alice +``` + ``` unison :hide lib.foo : Nat lib.foo = 1 ``` +``` ucm :hide +scratch/alice> add +scratch/main> branch bob +``` + Bob's branch: ``` unison :hide @@ -1570,9 +2058,12 @@ bob : Nat bob = 100 ``` +``` ucm :hide +scratch/bob> add +``` + ``` ucm :error scratch/alice> merge /bob - Sorry, I wasn't able to perform the merge: On scratch/alice, there's a type or term at the top level of @@ -1583,6 +2074,10 @@ scratch/alice> merge /bob ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## LCA precondition violations The LCA is not subject to most precondition violations, which is good, because the user can't easily manipulate it\! @@ -1590,13 +2085,17 @@ The LCA is not subject to most precondition violations, which is good, because t Here's an example. We'll delete a constructor name from the LCA and still be able to merge Alice and Bob's stuff together. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + LCA: ``` unison structural type Foo = Bar Nat | Baz Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1611,13 +2110,11 @@ structural type Foo = Bar Nat | Baz Nat Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo scratch/main> delete.term Foo.Baz - Done. ``` @@ -1626,18 +2123,15 @@ Alice's branch: ``` ucm scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> delete.type Foo - Done. scratch/alice> delete.term Foo.Bar - Done. ``` @@ -1647,7 +2141,7 @@ alice : Nat alice = 100 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1662,7 +2156,6 @@ alice = 100 ``` ucm scratch/alice> add - ⍟ I've added these definitions: alice : Nat @@ -1673,18 +2166,15 @@ Bob's branch: ``` ucm scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/bob> delete.type Foo - Done. scratch/bob> delete.term Foo.Bar - Done. ``` @@ -1694,7 +2184,7 @@ bob : Nat bob = 101 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1709,7 +2199,6 @@ bob = 101 ``` ucm scratch/bob> add - ⍟ I've added these definitions: bob : Nat @@ -1720,21 +2209,28 @@ Now we merge: ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ## Regression tests ### Delete one alias and update the other +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison foo = 17 bar = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1750,21 +2246,18 @@ bar = 17 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> delete.term bar - Done. ``` @@ -1773,7 +2266,7 @@ scratch/alice> delete.term bar foo = 18 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1789,14 +2282,12 @@ foo = 18 ``` ucm scratch/alice> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -1808,7 +2299,7 @@ scratch/main> branch bob bob = 101 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1823,7 +2314,6 @@ bob = 101 ``` ucm scratch/bob> add - ⍟ I've added these definitions: bob : Nat @@ -1832,18 +2322,25 @@ scratch/bob> add ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Delete a constructor +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison type Foo = Bar | Baz ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1858,13 +2355,11 @@ type Foo = Bar | Baz ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/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 @@ -1876,7 +2371,7 @@ scratch/main> branch topic boop = "boop" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1891,7 +2386,6 @@ boop = "boop" ``` ucm scratch/topic> add - ⍟ I've added these definitions: boop : Text @@ -1902,7 +2396,7 @@ scratch/topic> add type Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1918,7 +2412,6 @@ type Foo = Bar ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -1928,19 +2421,25 @@ scratch/main> update ``` ucm scratch/main> merge topic - I merged scratch/topic into scratch/main. scratch/main> view Foo - type Foo = Bar ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Dependent that doesn't need to be in the file This test demonstrates a bug. +``` ucm :hide +scratch/alice> builtins.mergeio lib.builtins +``` + In the LCA, we have `foo` with dependent `bar`, and `baz`. ``` unison @@ -1954,7 +2453,7 @@ baz : Text baz = "lca" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1971,7 +2470,6 @@ baz = "lca" ``` ucm scratch/alice> add - ⍟ I've added these definitions: bar : Nat @@ -1979,7 +2477,6 @@ scratch/alice> add foo : Nat scratch/alice> branch bob - Done. I've created the bob branch based off of alice. Tip: To merge your work back into the alice branch, first @@ -1994,7 +2491,7 @@ baz : Text baz = "bob" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2010,7 +2507,6 @@ baz = "bob" ``` ucm scratch/bob> update - Okay, I'm searching the branch for code that needs to be updated... @@ -2028,7 +2524,7 @@ baz : Text baz = "alice" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2045,7 +2541,6 @@ baz = "alice" ``` ucm scratch/alice> update - Okay, I'm searching the branch for code that needs to be updated... @@ -2062,7 +2557,6 @@ the underlying namespace. ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -2102,6 +2596,10 @@ bar = But `bar` was put into the scratch file instead. +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Merge loop test This tests for regressions of https://github.com/unisonweb/unison/issues/1276 where trivial merges cause loops in the @@ -2113,7 +2611,7 @@ Let's make three identical namespaces with different histories: a = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2128,7 +2626,6 @@ a = 1 ``` ucm scratch/alice> add - ⍟ I've added these definitions: a : ##Nat @@ -2139,7 +2636,7 @@ scratch/alice> add b = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2154,7 +2651,6 @@ b = 2 ``` ucm scratch/alice> add - ⍟ I've added these definitions: b : ##Nat @@ -2165,7 +2661,7 @@ scratch/alice> add b = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2175,7 +2671,6 @@ b = 2 ``` ucm scratch/bob> add - ⍟ I've added these definitions: b : ##Nat @@ -2186,7 +2681,7 @@ scratch/bob> add a = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2201,7 +2696,6 @@ a = 1 ``` ucm scratch/bob> add - ⍟ I've added these definitions: a : ##Nat @@ -2213,7 +2707,7 @@ a = 1 b = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2223,22 +2717,18 @@ b = 2 ``` ucm scratch/carol> add - ⍟ I've added these definitions: a : ##Nat b : ##Nat scratch/bob> merge /alice - I merged scratch/alice into scratch/bob. scratch/carol> merge /bob - I merged scratch/bob into scratch/carol. scratch/carol> history - Note: The most recent namespace hash is immediately below this message. @@ -2255,11 +2745,19 @@ scratch/carol> history ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Variables named `_` This test demonstrates a change in syntactic hashing that fixed a bug due to auto-generated variable names for ignored results. +``` ucm :hide +scratch/alice> builtins.mergeio lib.builtins +``` + ``` unison ignore : a -> () ignore _ = () @@ -2273,7 +2771,7 @@ bar = foo + foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2290,7 +2788,6 @@ bar = ``` ucm scratch/alice> add - ⍟ I've added these definitions: bar : Nat @@ -2298,7 +2795,6 @@ scratch/alice> add ignore : a -> () scratch/alice> branch bob - Done. I've created the bob branch based off of alice. Tip: To merge your work back into the alice branch, first @@ -2313,7 +2809,7 @@ bar = foo + foo + foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2329,7 +2825,6 @@ bar = ``` ucm scratch/bob> update - Okay, I'm searching the branch for code that needs to be updated... @@ -2345,7 +2840,7 @@ foo : Nat foo = 19 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2361,7 +2856,6 @@ foo = 19 ``` ucm scratch/alice> update - Okay, I'm searching the branch for code that needs to be updated... @@ -2375,22 +2869,29 @@ scratch/alice> update ``` ucm scratch/alice> merge /bob - I merged scratch/bob into scratch/alice. ``` +``` ucm :hide +scratch/main> project.delete scratch +``` + ### Unique type GUID reuse Previously, a merge branch would not include any dependents in the namespace, but that resulted in dependent unique types' GUIDs being regenerated. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison type Foo = Lca type Bar = MkBar Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2406,39 +2907,33 @@ type Bar = MkBar Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Bar type Foo scratch/main> branch alice - Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> move.term Foo.Lca Foo.Alice - Done. scratch/main> branch bob - Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/bob> move.term Foo.Lca Foo.Bob - Done. ``` ``` ucm :error scratch/alice> merge /bob - I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -2482,7 +2977,7 @@ type Foo = Merged type Bar = MkBar Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2492,22 +2987,23 @@ type Bar = MkBar Foo ``` ucm scratch/merge-bob-into-alice> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/merge-bob-into-alice> names Bar - Type Hash: #h3af39sae7 Names: Bar scratch/alice> names Bar - Type Hash: #h3af39sae7 Names: Bar ``` + +``` ucm :hide +scratch/main> project.delete scratch +``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index a34ce03be3..4c7b372a23 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -1,5 +1,9 @@ # Tests for `move` +``` ucm :hide +scratch/main> builtins.merge +``` + ## Happy Path - namespace, term, and type Create a term, type, and namespace with history @@ -11,7 +15,7 @@ Foo.termInA = 1 unique type Foo.T = T ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +33,6 @@ unique type Foo.T = T ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -44,7 +47,7 @@ Foo.termInA = 2 unique type Foo.T = T1 | T2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -62,7 +65,6 @@ unique type Foo.T = T1 | T2 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -74,25 +76,21 @@ Should be able to move the term, type, and namespace, including its types, terms ``` ucm scratch/main> move Foo Bar - Done. scratch/main> ls - 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) scratch/main> ls Bar - 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) scratch/main> history Bar - Note: The most recent namespace hash is immediately below this message. @@ -116,7 +114,7 @@ scratch/main> history Bar bonk = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -131,21 +129,17 @@ bonk = 5 ``` ucm z/main> builtins.merge - Done. z/main> add - ⍟ I've added these definitions: bonk : Nat z/main> move bonk zonk - Done. z/main> ls - 1. builtin/ (469 terms, 74 types) 2. zonk (Nat) @@ -157,7 +151,7 @@ z/main> ls bonk.zonk = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -173,26 +167,21 @@ bonk.zonk = 5 ``` ucm a/main> builtins.merge - Done. a/main> add - ⍟ I've added these definitions: bonk.zonk : Nat a/main> move bonk zonk - Done. a/main> ls - 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) a/main> view zonk.zonk - zonk.zonk : Nat zonk.zonk = 5 @@ -202,7 +191,6 @@ a/main> view zonk.zonk ``` ucm :error scratch/main> move doesntexist foo - ⚠️ There is no term, type, or namespace at doesntexist. diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index 665e0dcc98..d27123b0dd 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -10,29 +10,24 @@ foo = 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : ##Nat -- 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 - 1. root/ (1 term) scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -44,11 +39,9 @@ scratch/main> history ``` ucm scratch/main> ls .root.at.path - 1. foo (##Nat) scratch/main> history .root.at.path - Note: The most recent namespace hash is immediately below this message. @@ -63,22 +56,18 @@ I should be able to move a sub namespace *over* the root. ``` 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 - 1. foo (##Nat) scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -91,11 +80,9 @@ scratch/main> history ``` ucm :error -- should be empty scratch/main> ls .root.at.path - nothing to show scratch/main> history .root.at.path - Note: The most recent namespace hash is immediately below this message. @@ -105,6 +92,10 @@ scratch/main> history .root.at.path ``` +``` ucm :hide +scratch/happy> builtins.merge lib.builtins +``` + ## Happy path Create a namespace and add some history to it @@ -114,7 +105,7 @@ a.termInA = 1 unique type a.T = T ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -130,7 +121,6 @@ unique type a.T = T ``` ucm scratch/happy> add - ⍟ I've added these definitions: type a.T @@ -143,7 +133,7 @@ a.termInA = 2 unique type a.T = T1 | T2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -160,7 +150,6 @@ unique type a.T = T1 | T2 ``` ucm scratch/happy> update - Okay, I'm searching the branch for code that needs to be updated... @@ -172,17 +161,14 @@ Should be able to move the namespace, including its types, terms, and sub-namesp ``` ucm scratch/happy> move.namespace a b - Done. scratch/happy> ls b - 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) scratch/happy> history b - Note: The most recent namespace hash is immediately below this message. @@ -202,6 +188,10 @@ scratch/happy> history b ## Namespace history +``` ucm :hide +scratch/history> builtins.merge lib.builtins +``` + Create some namespaces and add some history to them ``` unison @@ -209,7 +199,7 @@ a.termInA = 1 b.termInB = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -225,7 +215,6 @@ b.termInB = 10 ``` ucm scratch/history> add - ⍟ I've added these definitions: a.termInA : Nat @@ -238,7 +227,7 @@ a.termInA = 2 b.termInB = 11 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -255,7 +244,6 @@ b.termInB = 11 ``` ucm scratch/history> update - Okay, I'm searching the branch for code that needs to be updated... @@ -269,16 +257,13 @@ of the moved namespace. ``` ucm scratch/history> delete.namespace b - Done. scratch/history> move.namespace a b - Done. -- Should be the history from 'a' scratch/history> history b - Note: The most recent namespace hash is immediately below this message. @@ -292,7 +277,6 @@ scratch/history> history b -- Should be empty scratch/history> history a - Note: The most recent namespace hash is immediately below this message. @@ -304,6 +288,10 @@ 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 @@ -311,7 +299,7 @@ a.termInA = 1 b.termInB = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -327,7 +315,6 @@ b.termInB = 10 ``` ucm scratch/existing> add - ⍟ I've added these definitions: a.termInA : Nat @@ -340,7 +327,7 @@ a.termInA = 2 b.termInB = 11 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -357,14 +344,12 @@ b.termInB = 11 ``` ucm scratch/existing> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/existing> move.namespace a b - ⚠️ A branch existed at the destination: b so I over-wrote it. diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md index 9724895aa2..feb6ca0f8a 100644 --- a/unison-src/transcripts/name-resolution.output.md +++ b/unison-src/transcripts/name-resolution.output.md @@ -5,7 +5,6 @@ ambiguous. A reference to `Namespace.Foo` or `File.Foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -14,7 +13,7 @@ scratch/main> builtins.mergeio lib.builtins type Namespace.Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ type Namespace.Foo = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: type Namespace.Foo @@ -41,7 +39,7 @@ type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. @@ -65,7 +63,7 @@ type File.Foo = Baz type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -81,7 +79,6 @@ type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` ucm scratch/main> project.delete scratch - ``` # Example 2 @@ -91,7 +88,6 @@ it refers to the namespace type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -100,7 +96,7 @@ scratch/main> builtins.mergeio lib.builtins type Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -115,7 +111,6 @@ type Foo = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -127,7 +122,7 @@ type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -143,21 +138,18 @@ type UsesFoo = UsesFoo Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type File.Foo type UsesFoo scratch/main> view UsesFoo - type UsesFoo = UsesFoo Foo ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 3 @@ -167,7 +159,6 @@ it refers to the file type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -176,7 +167,7 @@ scratch/main> builtins.mergeio lib.builtins type Namespace.Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -191,7 +182,6 @@ type Namespace.Foo = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: type Namespace.Foo @@ -203,7 +193,7 @@ type Foo = Baz type UsesFoo = UsesFoo Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -219,21 +209,18 @@ type UsesFoo = UsesFoo Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo type UsesFoo scratch/main> view UsesFoo - type UsesFoo = UsesFoo Foo ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -243,7 +230,6 @@ but resolves to `ns.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -253,7 +239,7 @@ ns.foo : Nat ns.foo = 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -268,7 +254,6 @@ ns.foo = 42 ``` ucm scratch/main> add - ⍟ I've added these definitions: ns.foo : Nat @@ -283,7 +268,7 @@ bar : Text bar = foo ++ "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -299,7 +284,6 @@ bar = foo ++ "bar" ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -309,7 +293,6 @@ but resolves to `file.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -319,7 +302,7 @@ ns.foo : Nat ns.foo = 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -334,7 +317,6 @@ ns.foo = 42 ``` ucm scratch/main> add - ⍟ I've added these definitions: ns.foo : Nat @@ -349,7 +331,7 @@ bar : Nat bar = foo + 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -365,7 +347,6 @@ bar = foo + 42 ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -375,7 +356,6 @@ A reference to `ns.foo` or `file.foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -385,7 +365,7 @@ ns.foo : Nat ns.foo = 42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -400,7 +380,6 @@ ns.foo = 42 ``` ucm scratch/main> add - ⍟ I've added these definitions: ns.foo : Nat @@ -415,7 +394,7 @@ bar : Nat bar = foo + 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what foo refers to here: @@ -440,7 +419,7 @@ bar : Nat bar = file.foo + ns.foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -456,14 +435,12 @@ bar = file.foo + ns.foo ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat file.foo : Nat scratch/main> view bar - bar : Nat bar = use Nat + @@ -473,5 +450,4 @@ scratch/main> view bar ``` ucm scratch/main> project.delete scratch - ``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 157efa93a6..8057804ade 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -2,14 +2,12 @@ You can use a keyword or reserved operator as a name segment if you surround it ``` ucm :error scratch/main> view `match` - ⚠️ The following names were not found in the codebase. Check your spelling. `match` scratch/main> view `=` - ⚠️ The following names were not found in the codebase. Check your spelling. @@ -23,14 +21,12 @@ This allows you to spell `.` or `()` as name segments (which historically have a ``` ucm :error scratch/main> view `.` - ⚠️ The following names were not found in the codebase. Check your spelling. `.` scratch/main> view `()` - ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index 399630d347..d8aaa5d22d 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -4,6 +4,11 @@ This transcript shows how the pretty-printer picks names for a hash when multipl 2. Shorter names (in terms of segment count) come before longer ones, for instance `base.List.map` comes before `somelibrary.external.base.List.map`. 3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. +``` ucm :hide +scratch/main> builtins.merge lib.builtins +scratch/biasing> builtins.merge lib.builtins +``` + ``` unison :hide a.a = a.b + 1 a.b = 0 + 1 @@ -14,7 +19,6 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment ``` ucm scratch/main> add - ⍟ I've added these definitions: a.a : Nat @@ -22,7 +26,6 @@ scratch/main> add a.b : Nat scratch/main> view a.a - a.a : Nat a.a = use Nat + @@ -50,7 +53,6 @@ a3.long.name.but.shortest.suffixification = 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: a2.a : Nat @@ -73,11 +75,9 @@ scratch/main> add a3.long.name.but.shortest.suffixification : Nat scratch/main> debug.alias.term.force a2.c a3.c - Done. scratch/main> debug.alias.term.force a2.d a3.d - Done. ``` @@ -88,7 +88,6 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but ``` ucm scratch/main> view a b c d - a.a : Nat a.a = use Nat + @@ -128,7 +127,7 @@ deeply.nested.num = 10 a = 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -145,7 +144,6 @@ a = 10 ``` ucm scratch/biasing> add - ⍟ I've added these definitions: a : Nat @@ -156,7 +154,6 @@ scratch/biasing> add -- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'. -- It's closer to the term being printed. scratch/biasing> view deeply.nested.term - deeply.nested.term : Nat deeply.nested.term = use Nat + @@ -170,7 +167,7 @@ Add another term with `num` suffix to force longer suffixification of `deeply.ne other.num = 20 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -185,7 +182,6 @@ other.num = 20 ``` ucm scratch/biasing> add - ⍟ I've added these definitions: other.num : Nat @@ -193,7 +189,6 @@ scratch/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. scratch/biasing> view deeply.nested.term - deeply.nested.term : Nat deeply.nested.term = use Nat + diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index 1a0c841a2c..935b45c706 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -2,7 +2,6 @@ ``` ucm scratch/main> builtins.merge lib.builtins - Done. ``` @@ -19,7 +18,7 @@ somewhere.z = 1 somewhere.y = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +37,6 @@ somewhere.y = 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: some.otherplace.x : Nat @@ -54,7 +52,6 @@ scratch/main> add ``` ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. scratch/main> names x - Terms Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z @@ -64,14 +61,12 @@ scratch/main> names x -- We can search by hash, and see all aliases of that hash scratch/main> names #gjmq673r1v - Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z -- Works with absolute names too scratch/main> names .some.place.x - Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z @@ -83,7 +78,6 @@ scratch/main> names .some.place.x ``` ucm -- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively. scratch/other> debug.names.global x - Found results in scratch/main Terms @@ -95,7 +89,6 @@ scratch/other> debug.names.global x -- We can search by hash, and see all aliases of that hash in the codebase scratch/other> debug.names.global #gjmq673r1v - Found results in scratch/main Term @@ -104,7 +97,6 @@ scratch/other> debug.names.global #gjmq673r1v -- We can search using an absolute name scratch/other> debug.names.global .some.place.x - Found results in scratch/main Term diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index 1730897d3e..f503abf95d 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -9,23 +9,18 @@ unexpectedly 😬. ``` ucm scratch/main> alias.term ##Nat.+ Nat.+ - Done. scratch/main> ls Nat - 1. + (##Nat -> ##Nat -> ##Nat) scratch/main> move.namespace Nat Nat.operators - Done. scratch/main> ls Nat - 1. operators/ (1 term) scratch/main> ls Nat.operators - 1. + (##Nat -> ##Nat -> ##Nat) ``` diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md index d7e75a87cf..709a20c1f5 100644 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -2,7 +2,6 @@ ``` ucm scratch/main> builtins.merge lib.builtins - Done. ``` @@ -15,7 +14,6 @@ mynamespace.dependsOnText = const external.mynat 10 ``` ucm scratch/main> add - ⍟ I've added these definitions: const : a -> b -> a @@ -23,7 +21,6 @@ scratch/main> add mynamespace.dependsOnText : Nat scratch/main> namespace.dependencies mynamespace - External dependency Dependents in scratch/main:.mynamespace lib.builtins.Nat 1. dependsOnText diff --git a/unison-src/transcripts/namespace-directive.output.md b/unison-src/transcripts/namespace-directive.output.md index 45cd5b4ad3..b5246436f8 100644 --- a/unison-src/transcripts/namespace-directive.output.md +++ b/unison-src/transcripts/namespace-directive.output.md @@ -7,7 +7,6 @@ It affects the contents of the file as follows: ``` ucm scratch/main> builtins.mergeio lib.builtins - Done. ``` @@ -19,7 +18,7 @@ baz : Nat baz = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +46,7 @@ longer.evil.factorial : Int -> Int longer.evil.factorial n = n ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -63,14 +62,12 @@ longer.evil.factorial n = n ``` ucm scratch/main> add - ⍟ I've added these definitions: foo.factorial : Int -> Int foo.longer.evil.factorial : Int -> Int scratch/main> view factorial - foo.factorial : Int -> Int foo.factorial = cases +0 -> +1 @@ -94,7 +91,7 @@ type longer.foo.Foo = Bar type longer.foo.Baz = { qux : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -115,7 +112,6 @@ type longer.foo.Baz = { qux : Nat } ``` ucm scratch/main> add - ⍟ I've added these definitions: type longer.foo.Baz @@ -144,7 +140,7 @@ hasTypeLink = {{ {type Foo} }} ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,7 +165,6 @@ hasTypeLink = ``` ucm scratch/main> add - ⍟ I've added these definitions: type foo.Baz @@ -185,7 +180,6 @@ scratch/main> add foo.refersToQux : foo.Baz -> Nat scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink - type foo.RefersToFoo = RefersToFoo foo.Foo foo.hasTypeLink : Doc2 @@ -201,7 +195,6 @@ scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink qux baz + qux baz scratch/main> todo - You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index 9f7fa75aba..1d71312a06 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -1,5 +1,9 @@ # Using numbered arguments in UCM +``` ucm :hide +scratch/main> alias.type ##Text Text +``` + First lets add some contents to our codebase. ``` unison @@ -11,7 +15,7 @@ quux = "quux" corge = "corge" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,7 +35,6 @@ corge = "corge" ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Text @@ -48,7 +51,6 @@ list: ``` ucm scratch/main> find - 1. bar : Text 2. baz : Text 3. corge : Text @@ -64,7 +66,6 @@ We can ask to `view` the second element of this list: ``` ucm scratch/main> find - 1. bar : Text 2. baz : Text 3. corge : Text @@ -75,7 +76,6 @@ scratch/main> find scratch/main> view 2 - baz : Text baz = "baz" @@ -85,7 +85,6 @@ And we can `view` multiple elements by separating with spaces: ``` ucm scratch/main> find - 1. bar : Text 2. baz : Text 3. corge : Text @@ -96,7 +95,6 @@ scratch/main> find scratch/main> view 2 3 5 - baz : Text baz = "baz" @@ -112,7 +110,6 @@ We can also ask for a range: ``` ucm scratch/main> find - 1. bar : Text 2. baz : Text 3. corge : Text @@ -123,7 +120,6 @@ scratch/main> find scratch/main> view 2-4 - baz : Text baz = "baz" @@ -139,7 +135,6 @@ And we can ask for multiple ranges and use mix of ranges and numbers: ``` ucm scratch/main> find - 1. bar : Text 2. baz : Text 3. corge : Text @@ -150,7 +145,6 @@ scratch/main> find scratch/main> view 1-3 4 5-6 - bar : Text bar = "bar" diff --git a/unison-src/transcripts/old-fold-right.output.md b/unison-src/transcripts/old-fold-right.output.md index 6deffe6809..8a7cb2b977 100644 --- a/unison-src/transcripts/old-fold-right.output.md +++ b/unison-src/transcripts/old-fold-right.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison oldRight: (b ->{e} a ->{e} b) -> [a] ->{e} [b] oldRight f la = bug "out" @@ -11,7 +15,7 @@ pecan = 'let oldRight f la ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index d0329085f6..89059cc080 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + # Basics ## non-exhaustive patterns @@ -10,7 +14,7 @@ test = cases A -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -36,7 +40,7 @@ test = cases (B, None) -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -65,7 +69,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -86,7 +90,7 @@ test = cases (A, Some A) -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -108,7 +112,7 @@ test = cases Some None -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -132,7 +136,7 @@ test0 = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -151,7 +155,7 @@ test = cases Some _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -170,7 +174,7 @@ test = cases () | false -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -191,7 +195,7 @@ test = cases | isEven x -> x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -217,7 +221,7 @@ test = cases | otherwise -> 0 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -244,7 +248,7 @@ test = cases Some None -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -268,7 +272,7 @@ test = cases Some (Some A) -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -297,7 +301,7 @@ test = cases 0 -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -318,7 +322,7 @@ test = cases true -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -342,7 +346,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -364,7 +368,7 @@ test = cases false -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -389,7 +393,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -408,7 +412,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -428,7 +432,7 @@ test = cases x +: xs -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -449,7 +453,7 @@ test = cases [] -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -468,7 +472,7 @@ test = cases x +: xs -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -487,7 +491,7 @@ test = cases xs :+ x -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -507,7 +511,7 @@ test = cases [] -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -528,7 +532,7 @@ test = cases x0 +: [] -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -554,7 +558,7 @@ test = cases [] -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -586,7 +590,7 @@ test = cases true +: xs -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -611,7 +615,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -636,7 +640,7 @@ test = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -655,7 +659,7 @@ unit2t = cases () -> A ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -671,7 +675,6 @@ unit2t = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: type T @@ -693,7 +696,7 @@ witht = match unit2t () with x -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -713,7 +716,7 @@ evil : Unit -> V evil = bug "" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -729,7 +732,6 @@ evil = bug "" ``` ucm scratch/main> add - ⍟ I've added these definitions: type V @@ -743,7 +745,7 @@ withV = match evil () with x -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -756,7 +758,7 @@ withV = match evil () with unique type SomeType = A ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -771,7 +773,6 @@ unique type SomeType = A ``` ucm scratch/main> add - ⍟ I've added these definitions: type SomeType @@ -785,7 +786,7 @@ get x = match x with R y -> y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -803,7 +804,7 @@ get x = match x with unique type R = { someType : SomeType } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -834,7 +835,7 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -861,7 +862,7 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -892,7 +893,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -922,7 +923,7 @@ handleMulti c = handle !c with impl [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -950,7 +951,7 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -977,7 +978,7 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1003,7 +1004,7 @@ result f = handle !f with cases { give T.A -> resume } -> result resume ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1033,7 +1034,7 @@ handleMulti c = handle !c with impl [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1062,7 +1063,7 @@ result f = handle !f with cases { give T.A -> resume } -> result resume ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1086,7 +1087,7 @@ result f = handle !f with cases { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1114,7 +1115,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1142,7 +1143,7 @@ result f = handle !f with cases { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1182,7 +1183,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1211,7 +1212,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1239,7 +1240,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1268,7 +1269,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1298,7 +1299,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1326,7 +1327,7 @@ result f = handle !f with impl ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index 39edc94d09..f62205ae69 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -1,5 +1,9 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison structural ability Ab where a: Nat -> () @@ -59,7 +63,7 @@ doc = cases _ -> () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -88,7 +92,6 @@ doc = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: structural ability Ab @@ -108,94 +111,80 @@ scratch/main> add tremulous : (Nat, Nat) -> () scratch/main> view dopey - dopey : Char -> () dopey = cases ?0 -> () _ -> () scratch/main> view grumpy - grumpy : ff284oqf651 -> () grumpy = cases d -> () scratch/main> view happy - happy : Boolean -> () happy = cases true -> () false -> () scratch/main> view sneezy - sneezy : Int -> () sneezy = cases +1 -> () _ -> () scratch/main> view bashful - bashful : Optional a -> () bashful = cases Some a -> () _ -> () scratch/main> view mouthy - mouthy : [t] -> () mouthy = cases [] -> () _ -> () scratch/main> view pokey - pokey : [t] -> () pokey = cases h +: t -> () _ -> () scratch/main> view sleepy - sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () scratch/main> view demure - demure : [Nat] -> () demure = cases [0] -> () _ -> () scratch/main> view angry - angry : [t] -> () angry = cases a ++ [] -> () scratch/main> view tremulous - tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () scratch/main> view throaty - throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () scratch/main> view agitated - agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () scratch/main> view doc - doc : Nat -> () doc = cases y@4 -> () diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index dbcc1fac51..21626c7aa8 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + We had bugs in the calling conventions for both send and terminate which would cause pattern matching on the resulting (Right ()) would cause a runtime error. @@ -20,7 +24,7 @@ assertRight = cases Left _ -> bug "expected a right but got a left" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,14 +40,12 @@ assertRight = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: assertRight : Either a b -> b frank : '{IO} () scratch/main> run frank - () ``` diff --git a/unison-src/transcripts/patterns.output.md b/unison-src/transcripts/patterns.output.md index f3b8a97672..6a40c38db7 100644 --- a/unison-src/transcripts/patterns.output.md +++ b/unison-src/transcripts/patterns.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Some tests of pattern behavior. ``` unison @@ -7,7 +11,7 @@ p1 = join [literal "blue", literal "frog"] > Pattern.run (many.corrected p1) "bluefrogbluegoat" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index 03e2029592..42d4140f6c 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -1,5 +1,9 @@ # Propagating type edits +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + We introduce a type `Foo` with a function dependent `fooToInt`. ``` unison @@ -9,7 +13,7 @@ fooToInt : Foo -> Int fooToInt _ = +42 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,14 +31,12 @@ And then we add it. ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo fooToInt : Foo -> Int scratch/main> find.verbose - 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo type Foo @@ -47,7 +49,6 @@ scratch/main> find.verbose scratch/main> view fooToInt - fooToInt : Foo -> Int fooToInt _ = +42 @@ -59,7 +60,7 @@ Then if we change the type `Foo`... unique type Foo = Foo | Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,7 +78,6 @@ and update the codebase to use the new type `Foo`... ``` ucm scratch/main> update.old - ⍟ I've updated these names to your new definition: type Foo @@ -88,7 +88,6 @@ scratch/main> update.old ``` ucm scratch/main> view fooToInt - fooToInt : Foo -> Int fooToInt _ = +42 @@ -107,7 +106,7 @@ preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -125,7 +124,6 @@ Add that to the codebase: ``` ucm scratch/main> add - ⍟ I've added these definitions: preserve.otherTerm : Optional baz -> Optional baz @@ -140,7 +138,7 @@ preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -158,7 +156,6 @@ Update... ``` ucm scratch/main> update.old - ⍟ I've updated these names to your new definition: preserve.someTerm : Optional x -> Optional x @@ -170,12 +167,10 @@ type of `otherTerm` should remain the same. ``` ucm scratch/main> view preserve.someTerm - preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None scratch/main> view preserve.otherTerm - preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md index c7f37ad11d..32c9568003 100644 --- a/unison-src/transcripts/pull-errors.output.md +++ b/unison-src/transcripts/pull-errors.output.md @@ -1,6 +1,5 @@ ``` ucm :error test/main> pull @aryairani/test-almost-empty/main lib.base_latest - The use of `pull` to install libraries is now deprecated. Going forward, you can use `lib.install @aryairani/test-almost-empty/main`. @@ -11,31 +10,28 @@ test/main> pull @aryairani/test-almost-empty/main lib.base_latest aryairani_test_almost_empty_main. test/main> pull @aryairani/test-almost-empty/main a.b - -⚠️ - -Sorry, I wasn’t sure how to process your request: - - I think you want to merge @aryairani/test-almost-empty/main - into the a.b namespace, but the `pull` command only supports - merging into the top level of a local project branch. - -You can run `help pull` for more information on using `pull`. + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I think you want to merge @aryairani/test-almost-empty/main + into the a.b namespace, but the `pull` command only supports + merging into the top level of a local project branch. + + You can run `help pull` for more information on using `pull`. test/main> pull @aryairani/test-almost-empty/main a - I think you want to merge @aryairani/test-almost-empty/main into the a branch, but it doesn't exist. If you want, you can create it with `branch.empty a`, and then `pull` again. test/main> pull @aryairani/test-almost-empty/main .a - -⚠️ - -Sorry, I wasn’t sure how to process your request: - - I think you want to merge @aryairani/test-almost-empty/main - into the .a namespace, but the `pull` command only supports - merging into the top level of a local project branch. - -You can run `help pull` for more information on using `pull`. + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I think you want to merge @aryairani/test-almost-empty/main + into the .a namespace, but the `pull` command only supports + merging into the top level of a local project branch. + + You can run `help pull` for more information on using `pull`. ``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index caa8a381b8..107a05fc62 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -1,14 +1,22 @@ Ensure that Records keep their syntax after being added to the codebase +``` ucm :hide +scratch/main> builtins.merge +scratch/main> load unison-src/transcripts-using-base/base.u +``` + ## Record with 1 field ``` unison :hide unique type Record1 = { a : Text } ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view Record1 - type Record1 = { a : Text } ``` @@ -19,9 +27,12 @@ scratch/main> view Record1 unique type Record2 = { a : Text, b : Int } ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view Record2 - type Record2 = { a : Text, b : Int } ``` @@ -32,9 +43,12 @@ scratch/main> view Record2 unique type Record3 = { a : Text, b : Int, c : Nat } ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view Record3 - type Record3 = { a : Text, b : Int, c : Nat } ``` @@ -53,9 +67,12 @@ unique type Record4 = } ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view Record4 - type Record4 = { a : Text, b : Int, @@ -95,9 +112,12 @@ unique type Record5 = { } ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> view Record5 - type Record5 = { zero : Nat, one : [Nat], @@ -133,11 +153,14 @@ unique type UserType = UserType Nat unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` +``` ucm :hide +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 scratch/main> view RecordWithUserType - type RecordWithUserType = { a : Text, b : Record4, c : UserType } @@ -154,7 +177,7 @@ unique type Record5 = } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index 84b70ba8e3..cc1cb364f2 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -1,10 +1,14 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + First we make some changes to the codebase so there's data in the reflog. ``` unison x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ x = 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: x : Nat @@ -30,7 +33,7 @@ scratch/main> add y = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,28 +48,23 @@ y = 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: y : Nat scratch/main> branch /other - Done. I've created the other branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /other`. scratch/other> alias.term y z - Done. newproject/main> builtins.merge lib.builtins - Done. newproject/main> alias.type lib.builtins.Nat MyNat - Done. ``` @@ -75,7 +73,6 @@ Should see reflog entries from the current branch ``` ucm scratch/main> reflog - Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -95,7 +92,6 @@ Should see reflog entries from the current project ``` ucm scratch/main> project.reflog - Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -117,7 +113,6 @@ Should see reflog entries from all projects ``` ucm scratch/main> reflog.global - Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md index 4edbf6fc3e..2e3e992bb0 100644 --- a/unison-src/transcripts/release-draft-command.output.md +++ b/unison-src/transcripts/release-draft-command.output.md @@ -1,12 +1,16 @@ The `release.draft` command drafts a release from the current branch. +``` ucm :hide +foo/main> builtins.merge +``` + Some setup: ``` unison someterm = 18 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ someterm = 18 ``` ucm foo/main> add - ⍟ I've added these definitions: someterm : Nat @@ -34,7 +37,6 @@ Now, the `release.draft` demo: ``` ucm foo/main> release.draft 1.2.3 - 😎 Great! I've created a draft release for you at /releases/drafts/1.2.3. @@ -55,7 +57,6 @@ It's an error to try to create a `releases/drafts/x.y.z` branch that already exi ``` ucm :error foo/main> release.draft 1.2.3 - foo/releases/drafts/1.2.3 already exists. You can switch to it with `switch foo/releases/drafts/1.2.3`. diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index a7b492d207..bcda4ec2a0 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison def = "first value" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -15,6 +19,10 @@ def = "first value" ``` +``` ucm :hide +scratch/main> update +``` + ``` unison :hide def = "second value" ``` @@ -23,14 +31,12 @@ Can reset to a value from history by number. ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -49,16 +55,13 @@ scratch/main> history □ 3. #4bigcpnl7t (start of history) scratch/main> reset 2 - Done. scratch/main> view def - def : Text def = "first value" scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -76,7 +79,6 @@ Can reset to a value from reflog by number. ``` ucm scratch/main> reflog - Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -93,16 +95,13 @@ scratch/main> reflog -- Reset the current branch to the first history element scratch/main> reset 2 - Done. scratch/main> view def - def : Text def = "second value" scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -126,7 +125,6 @@ scratch/main> history ``` ucm foo/main> history - Note: The most recent namespace hash is immediately below this message. @@ -142,23 +140,19 @@ a = 5 ``` ucm foo/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. foo/empty> reset /main: - Done. foo/empty> view a - a : ##Nat a = 5 foo/empty> history - Note: The most recent namespace hash is immediately below this message. @@ -176,14 +170,12 @@ main.a = 3 ``` ucm foo/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. foo/main> history - Note: The most recent namespace hash is immediately below this message. @@ -196,7 +188,6 @@ foo/main> history □ 2. #5l94rduvel (start of history) foo/main> reset 2 main - Done. ``` diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index 96292f22bb..3f6c1ccc24 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -6,7 +6,6 @@ This transcript tests the errors printed to the user when a name cannot be resol ``` ucm scratch/main> builtins.merge lib.builtins - Done. ``` @@ -21,7 +20,7 @@ one.ambiguousTerm = "term one" two.ambiguousTerm = "term two" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,7 +38,6 @@ two.ambiguousTerm = "term two" ``` ucm scratch/main> add - ⍟ I've added these definitions: type one.AmbiguousType @@ -73,7 +71,7 @@ separateAmbiguousTypeUsage : AmbiguousType -> () separateAmbiguousTypeUsage _ = () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. @@ -108,7 +106,7 @@ but expect it to eventually be handled by the above machinery. useAmbiguousTerm = ambiguousTerm ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what ambiguousTerm refers to here: diff --git a/unison-src/transcripts/rsa.output.md b/unison-src/transcripts/rsa.output.md index 8f7e28e824..677ce08bf8 100644 --- a/unison-src/transcripts/rsa.output.md +++ b/unison-src/transcripts/rsa.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison up = 0xs0123456789abcdef @@ -31,7 +35,7 @@ sigKo = match signature with > sigKo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/scope-ref.output.md b/unison-src/transcripts/scope-ref.output.md index 2975b6c9fc..b441a5c62d 100644 --- a/unison-src/transcripts/scope-ref.output.md +++ b/unison-src/transcripts/scope-ref.output.md @@ -1,5 +1,9 @@ A short script to test mutable references with local scope. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison test = Scope.run 'let r = Scope.ref 0 @@ -13,7 +17,7 @@ test = Scope.run 'let > test ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 909af16e6b..4f770bb281 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -1,5 +1,9 @@ # Suffix-based resolution of names +``` ucm :hide +scratch/main> builtins.merge +``` + Any unique name suffix can be used to refer to a definition. For instance: ``` unison :hide @@ -17,14 +21,12 @@ This also affects commands like find. Notice lack of qualified names in output: ``` ucm scratch/main> add - ⍟ I've added these definitions: foo.bar.a : Int optional.isNone : Optional a -> Boolean scratch/main> find take - 1. builtin.Bytes.take : Nat -> Bytes -> Bytes 2. builtin.List.take : Nat -> [a] -> [a] 3. builtin.Text.take : Nat -> Text -> Text @@ -38,11 +40,9 @@ The `view` and `display` commands also benefit from this: ``` ucm scratch/main> view List.drop - builtin builtin.List.drop : builtin.Nat -> [a] -> [a] scratch/main> display bar.a - +99 ``` @@ -53,7 +53,6 @@ Type-based search also benefits from this, we can just say `Nat` rather than `.b ``` ucm scratch/main> find : Nat -> [a] -> [a] - 1. builtin.List.drop : Nat -> [a] -> [a] 2. builtin.List.take : Nat -> [a] -> [a] @@ -71,7 +70,7 @@ lib.distributed.baz.qux = "direct dependency 2" lib.distributed.lib.baz.qux = "indirect dependency" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -89,7 +88,6 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ucm scratch/main> add - ⍟ I've added these definitions: cool.abra.cadabra : Text @@ -103,7 +101,7 @@ scratch/main> add > abra.cadabra ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I couldn't figure out what abra.cadabra refers to here: @@ -125,7 +123,7 @@ scratch/main> add > baz.qux ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -143,7 +141,6 @@ scratch/main> add ``` ucm scratch/main> view abra.cadabra - cool.abra.cadabra : Text cool.abra.cadabra = "my project" @@ -151,7 +148,6 @@ scratch/main> view abra.cadabra lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> view baz.qux - lib.distributed.baz.qux : Text lib.distributed.baz.qux = "direct dependency 2" @@ -161,12 +157,10 @@ Note that we can always still view indirect dependencies by using more name segm ``` ucm scratch/main> view distributed.abra.cadabra - lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> names distributed.lib.baz.qux - Term Hash: #nhup096n2s Names: lib.distributed.lib.baz.qux diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index 580633e211..bcd86a40ab 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -2,13 +2,17 @@ https://github.com/unisonweb/unison/issues/2786 +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + First we add a sum-type to the codebase. ``` unison structural type X = x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,7 +28,6 @@ structural type X = x ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type X @@ -44,7 +47,7 @@ X.x = "some text that's not in the codebase" dependsOnX = Text.size X.x ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -69,7 +72,6 @@ is removed in the same update that the new term is being added. ``` ucm scratch/main> update.old - ⍟ I've added these definitions: X.x : Text diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index 0ffa141f94..9ccfc0f251 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -1,12 +1,17 @@ The `switch` command switches to an existing project or branch. +``` ucm :hide +foo/main> builtins.merge +bar/main> builtins.merge +``` + Setup stuff. ``` unison someterm = 18 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,20 +26,17 @@ someterm = 18 ``` ucm foo/main> add - ⍟ I've added these definitions: someterm : Nat foo/main> branch bar - Done. I've created the bar branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bar`. foo/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 @@ -48,22 +50,16 @@ forward slash (which makes it unambiguous). ``` ucm scratch/main> switch foo - scratch/main> switch foo/topic - foo/main> switch topic - foo/main> switch /topic - foo/main> switch bar/ - ``` It's an error to try to switch to something ambiguous. ``` ucm :error foo/main> switch bar - I'm not sure if you wanted to switch to the branch foo/bar or the project bar. Could you be more specific? @@ -78,14 +74,12 @@ It's an error to try to switch to something that doesn't exist, of course. ``` ucm :error scratch/main> switch foo/no-such-branch - foo/no-such-branch does not exist. ``` ``` ucm :error scratch/main> switch no-such-project - Neither project no-such-project nor branch /no-such-project exists. @@ -93,7 +87,6 @@ scratch/main> switch no-such-project ``` ucm :error foo/main> switch no-such-project-or-branch - Neither project no-such-project-or-branch nor branch /no-such-project-or-branch exists. diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 8adee96ccf..12700f3adc 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -6,12 +6,10 @@ Test that tab completion works as expected. ``` ucm scratch/main> debug.tab-complete vi - view view.global scratch/main> debug.tab-complete delete. - delete.branch delete.namespace delete.namespace.force @@ -35,7 +33,7 @@ othernamespace.someName = 4 unique type subnamespace.AType = A | B ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,22 +50,23 @@ unique type subnamespace.AType = A | B ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm -- Should tab complete namespaces since they may contain terms/types 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 scratch/main> debug.tab-complete view subnamespace - subnamespace. subnamespace2. -- Should complete things from child namespaces of the current query if it's dot-suffixed scratch/main> debug.tab-complete view subnamespace. - * subnamespace.AType subnamespace.AType. * subnamespace.someName @@ -75,18 +74,15 @@ 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. scratch/main> debug.tab-complete view subnamespace2 - subnamespace2. * subnamespace2.thing -- Should prefix-filter by query suffix scratch/main> debug.tab-complete view subnamespace.some - * subnamespace.someName * subnamespace.someOtherName scratch/main> debug.tab-complete view subnamespace.someOther - * subnamespace.someOtherName ``` @@ -97,14 +93,12 @@ absolute.term = "absolute" ``` ucm scratch/main> add - ⍟ I've added these definitions: absolute.term : ##Text -- Should tab complete absolute names scratch/main> debug.tab-complete view .absolute.te - * .absolute.term ``` @@ -114,31 +108,25 @@ scratch/main> debug.tab-complete view .absolute.te ``` ucm -- Should tab complete namespaces scratch/main> debug.tab-complete find-in sub - subnamespace subnamespace2 scratch/main> debug.tab-complete find-in subnamespace - subnamespace subnamespace2 scratch/main> debug.tab-complete find-in subnamespace. - subnamespace.AType scratch/main> debug.tab-complete io.test sub - subnamespace. subnamespace2. scratch/main> debug.tab-complete io.test subnamespace - subnamespace. subnamespace2. scratch/main> debug.tab-complete io.test subnamespace. - subnamespace.AType. * subnamespace.someName * subnamespace.someOtherName @@ -153,7 +141,7 @@ add : a -> a add b = b ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,19 +157,16 @@ add b = b ``` ucm scratch/main> update.old - ⍟ I've added these definitions: type Foo add : a -> a scratch/main> debug.tab-complete delete.type Foo - * Foo Foo. scratch/main> debug.tab-complete delete.term add - * add ``` @@ -190,18 +175,15 @@ scratch/main> debug.tab-complete delete.term add ``` ucm 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`. myproject/main> debug.tab-complete branch.delete /mybr - /mybranch myproject/main> debug.tab-complete project.rename my - myproject ``` @@ -212,7 +194,7 @@ Commands which complete namespaces OR branches should list both mybranchsubnamespace.term = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -227,13 +209,11 @@ mybranchsubnamespace.term = 1 ``` ucm myproject/main> add - ⍟ I've added these definitions: mybranchsubnamespace.term : ##Nat myproject/main> debug.tab-complete merge mybr - /mybranch ``` diff --git a/unison-src/transcripts/tdnr.output.md b/unison-src/transcripts/tdnr.output.md index bf602d4629..dc3668b85e 100644 --- a/unison-src/transcripts/tdnr.output.md +++ b/unison-src/transcripts/tdnr.output.md @@ -1,12 +1,16 @@ TDNR selects local term (in file) that typechecks over local term (in file) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 bad.foo = "bar" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,13 +25,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in file) that typechecks over local term (in namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,7 +54,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -54,7 +65,7 @@ good.foo = 17 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,13 +79,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in file) that typechecks over local term (shadowing namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -89,7 +108,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -102,7 +120,7 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -121,13 +139,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in namespace) that typechecks over local term (in file) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -142,7 +168,6 @@ good.foo = 17 ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -154,7 +179,7 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -168,14 +193,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in namespace) that typechecks over local term (in namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -191,7 +224,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -203,7 +235,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -216,14 +248,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in namespace) that typechecks over local term (shadowing namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -239,7 +279,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -252,7 +291,7 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -270,13 +309,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (shadowing namespace) that typechecks over local term (in file) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -291,7 +338,6 @@ good.foo = 17 ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -304,7 +350,7 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -323,14 +369,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (shadowing namespace) that typechecks over local term (in namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -346,7 +400,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -359,7 +412,7 @@ good.foo = 18 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -377,14 +430,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (shadowing namespace) that typechecks over local term (shadowing namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -400,7 +461,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -414,7 +474,7 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -433,15 +493,23 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + \=== start local over direct dep TDNR selects local term (in file) that typechecks over direct dependency that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -456,7 +524,6 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.bad.foo : Text @@ -468,7 +535,7 @@ good.foo = 17 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -482,14 +549,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (in namespace) that typechecks over direct dependency that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 lib.bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -505,7 +580,6 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -517,7 +591,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -530,14 +604,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects local term (shadowing namespace) that typechecks over direct dependency that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 lib.bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -553,7 +635,6 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -566,7 +647,7 @@ good.foo = 18 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -584,13 +665,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR not used to select local term (in file) that typechecks over indirect dependency that also typechecks. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.dep.lib.dep.foo = 217 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -605,7 +694,6 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.dep.lib.dep.foo : Nat @@ -617,7 +705,7 @@ good.foo = 17 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -631,14 +719,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR not used to select local term (in namespace) that typechecks over indirect dependency that also typechecks. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 lib.dep.lib.dep.foo = 217 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -654,7 +750,6 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -666,7 +761,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -679,14 +774,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR not used to select local term (shadowing namespace) that typechecks over indirect dependency that also typechecks. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison good.foo = 17 lib.dep.lib.dep.foo = 217 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -702,7 +805,6 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add - ⍟ I've added these definitions: good.foo : Nat @@ -715,7 +817,7 @@ good.foo = 18 thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -733,13 +835,21 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects direct dependency that typechecks over local term (in file) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.good.foo = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -754,7 +864,6 @@ lib.good.foo = 17 ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.good.foo : Nat @@ -766,7 +875,7 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -780,14 +889,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects direct dependency that typechecks over local term (in namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -803,7 +920,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -815,7 +931,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -828,14 +944,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects direct dependency that typechecks over local term (shadowing namespace) that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.good.foo = 17 bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -851,7 +975,6 @@ bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: bad.foo : Text @@ -864,7 +987,7 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -882,14 +1005,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects direct dependency that typechecks over direct dependency that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.good.foo = 17 lib.bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -905,7 +1036,6 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.bad.foo : Text @@ -917,7 +1047,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -930,14 +1060,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR not used to select direct dependency that typechecks over indirect dependency that also typechecks. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.good.foo = 17 lib.dep.lib.dep.foo = 217 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -953,7 +1091,6 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.dep.lib.dep.foo : Nat @@ -965,7 +1102,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -978,14 +1115,22 @@ thing = foo Nat.+ foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + TDNR selects indirect dependency that typechecks over indirect dependency that doesn't. +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison lib.dep.lib.good.foo = 17 lib.dep.lib.bad.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1001,7 +1146,6 @@ lib.dep.lib.bad.foo = "bar" ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.dep.lib.bad.foo : Text @@ -1013,7 +1157,7 @@ scratch/main> add thing = foo Nat.+ foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1025,3 +1169,7 @@ thing = foo Nat.+ foo thing : Nat ``` + +``` ucm :hide +scratch/main> delete.project scratch +``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index 486b3861fe..74c27f98cc 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -1,5 +1,9 @@ Merge builtins so we get enough names for the testing stuff. +``` ucm :hide +scratch/main> builtins.merge +``` + The `test` command should run all of the tests in the current directory. ``` unison @@ -10,7 +14,7 @@ foo.test2 : [Result] foo.test2 = [Ok "test2"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -24,9 +28,12 @@ foo.test2 = [Ok "test2"] ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> test - ✅ @@ -52,7 +59,6 @@ Tests should be cached if unchanged. ``` ucm scratch/main> test - Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 @@ -71,7 +77,7 @@ lib.dep.testInLib : [Result] lib.dep.testInLib = [Ok "testInLib"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -84,9 +90,12 @@ lib.dep.testInLib = [Ok "testInLib"] ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> test - Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 @@ -97,7 +106,6 @@ scratch/main> test Tip: Use view 1 to view the source of a test. scratch/main> test.all - Cached test results (`help testcache` to learn more) @@ -126,7 +134,6 @@ scratch/main> test.all ``` ucm scratch/main> test lib.dep - Cached test results (`help testcache` to learn more) 1. lib.dep.testInLib ◉ testInLib @@ -141,7 +148,6 @@ scratch/main> test lib.dep ``` ucm scratch/main> test foo - Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index 5e5e1164e7..47bbaf8f54 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + This transcript shows some syntax for raw text literals. ``` unison @@ -31,7 +35,7 @@ lit2 = """" > Some lit2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,14 +91,12 @@ lit2 = """" ``` ucm scratch/main> add - ⍟ I've added these definitions: lit1 : Text lit2 : Text scratch/main> view lit1 lit2 - lit1 : Text lit1 = """ diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md index 562b704ba7..5b684ca49c 100644 --- a/unison-src/transcripts/textfind.output.md +++ b/unison-src/transcripts/textfind.output.md @@ -1,10 +1,13 @@ # The `text.find` command +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + The `text.find` (or `grep`) command can be used to search for text or numeric literals appearing anywhere in your project. Just supply one or more tokens to search for. Unlike regular grep over the text of your code, this ignores local variables and function names that happen to match your search tokens (use `dependents` or `find` for that purpose). It's only searching for text or numeric literals that match. ``` ucm scratch/main> help grep - text.find (or grep) `text.find token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. @@ -18,7 +21,6 @@ scratch/main> help grep ``` ucm scratch/main> help text.find.all - text.find.all (or grep.all) `text.find.all token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. @@ -49,7 +51,7 @@ lib.foo = [Any 46, Any "hi", Any "zoink"] lib.bar = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,9 +69,12 @@ lib.bar = 3 ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm scratch/main> grep hi - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -79,7 +84,6 @@ scratch/main> grep hi Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 - bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -87,7 +91,6 @@ scratch/main> view 1 _ -> 0 scratch/main> grep "hi" - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -97,7 +100,6 @@ scratch/main> grep "hi" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> text.find.all hi - 🔎 These definitions from the current namespace have matches: @@ -109,7 +111,6 @@ scratch/main> text.find.all hi scratch file. scratch/main> view 1-5 - bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -120,7 +121,6 @@ scratch/main> view 1-5 lib.foo = [Any 46, Any "hi", Any "zoink"] scratch/main> grep oog - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -130,7 +130,6 @@ scratch/main> grep oog Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 - bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -141,7 +140,6 @@ scratch/main> view 1 ``` ucm scratch/main> grep quaffle - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -151,12 +149,10 @@ scratch/main> grep quaffle Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 - baz : [Text] baz = ["an", "quaffle", "tres"] scratch/main> text.find "interesting const" - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -166,14 +162,12 @@ scratch/main> text.find "interesting const" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 - foo : Nat foo = _ = "an interesting constant" 1 scratch/main> text.find "99" "23" - 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -183,7 +177,6 @@ scratch/main> text.find "99" "23" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 - bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -196,7 +189,6 @@ Now some failed searches: ``` ucm :error scratch/main> grep lsdkfjlskdjfsd - 😶 I couldn't find any matches. Tip: `text.find.all` will search `lib` as well. @@ -207,7 +199,6 @@ Notice it gives the tip about `text.find.all`. But not here: ``` ucm :error scratch/main> grep.all lsdkfjlskdjfsd - 😶 I couldn't find any matches. ``` diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md index 25b45e9ece..c6b1eb12b0 100644 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ b/unison-src/transcripts/todo-bug-builtins.output.md @@ -1,12 +1,16 @@ # The `todo` and `bug` builtin +``` ucm :hide +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. ``` unison :error > todo "implement me later" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -33,7 +37,7 @@ > bug "there's a bug in my code" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -64,7 +68,7 @@ complicatedMathStuff x = todo "Come back and to something with x here" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,7 +91,7 @@ test = match true with false -> bug "Wow, that's unexpected" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index 436e543b65..fedcb16255 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -4,7 +4,6 @@ When there's nothing to do, `todo` says this: ``` ucm scratch/main> todo - You have no pending todo items. Good work! ✅ ``` @@ -13,6 +12,10 @@ scratch/main> todo The `todo` command shows local (outside `lib`) terms that directly call `todo`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison foo : Nat foo = todo "implement foo" @@ -21,7 +24,7 @@ bar : Nat bar = foo + foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,31 +40,37 @@ bar = foo + foo ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> todo - These terms call `todo`: 1. foo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Direct dependencies without names The `todo` command shows hashes of direct dependencies of local (outside `lib`) definitions that don't have names in the current namespace. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison foo.bar = 15 baz = foo.bar + foo.bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,14 +86,12 @@ baz = foo.bar + foo.bar ``` ucm scratch/main> add - ⍟ I've added these definitions: baz : Nat foo.bar : Nat scratch/main> delete.namespace.force foo - Done. ⚠️ @@ -96,23 +103,30 @@ scratch/main> delete.namespace.force foo bar 1. baz scratch/main> todo - These terms do not have any names in the current namespace: 1. #1jujb8oelv ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Conflicted names The `todo` command shows conflicted names. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison foo = 16 bar = 17 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -128,18 +142,15 @@ bar = 17 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> debug.alias.term.force foo bar - Done. scratch/main> todo - ❓ The term bar has conflicting definitions: @@ -152,15 +163,23 @@ scratch/main> todo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Definitions in lib The `todo` command complains about terms and types directly in `lib`. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison lib.foo = 16 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -175,28 +194,34 @@ lib.foo = 16 ``` ucm scratch/main> add - ⍟ I've added these definitions: lib.foo : Nat scratch/main> todo - There's a type or term at the top level of the `lib` namespace, where I only expect to find subnamespaces representing library dependencies. Please move or remove it. ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Constructor aliases The `todo` command complains about constructor aliases. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison type Foo = One ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -211,17 +236,14 @@ type Foo = One ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.One Foo.Two - Done. scratch/main> todo - The type Foo has a constructor with multiple names. 1. Foo.One @@ -231,15 +253,23 @@ scratch/main> todo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Missing constructor names The `todo` command complains about missing constructor names. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison type Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -254,17 +284,14 @@ type Foo = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> delete.term Foo.Bar - Done. scratch/main> todo - These types have some constructors with missing names. 1. Foo @@ -275,16 +302,24 @@ scratch/main> todo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Nested decl aliases The `todo` command complains about nested decl aliases. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison structural type Foo a = One a | Two a a structural type Foo.inner.Bar a = Uno a | Dos a a ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -300,14 +335,12 @@ structural type Foo.inner.Bar a = Uno a | Dos a a ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type Foo a structural type Foo.inner.Bar a scratch/main> todo - These types are aliases, but one is nested under the other. Please separate them or delete one copy. @@ -316,15 +349,23 @@ scratch/main> todo ``` +``` ucm :hide +scratch/main> delete.project scratch +``` + # Stray constructors The `todo` command complains about stray constructors. +``` ucm :hide +scratch/main> builtins.mergeio lib.builtins +``` + ``` unison type Foo = Bar ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -339,17 +380,14 @@ type Foo = Bar ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Baz - Done. scratch/main> todo - These constructors are not nested beneath their corresponding type names: @@ -359,3 +397,7 @@ scratch/main> todo an extra copy, you can simply `delete` it. ``` + +``` ucm :hide +scratch/main> delete.project scratch +``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 59d77b9904..7750101acb 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -1,10 +1,13 @@ A simple transcript to test the use of exceptions that bubble to the top level. +``` ucm :hide +scratch/main> builtins.merge +``` + FYI, here are the `Exception` and `Failure` types: ``` ucm scratch/main> view Exception Failure - structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x @@ -25,7 +28,7 @@ mytest : '{IO, Exception} [Test.Result] mytest _ = [Ok "Great"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,18 +44,15 @@ mytest _ = [Ok "Great"] ``` ucm scratch/main> run main - () scratch/main> add - ⍟ I've added these definitions: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] scratch/main> io.test mytest - New test results: 1. mytest ◉ Great @@ -75,7 +75,7 @@ error msg a = unique type RuntimeError = ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -92,7 +92,6 @@ unique type RuntimeError = ``` ucm :error scratch/main> run main2 - 💔💥 The program halted with an unhandled exception: diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md index 288028ade0..7afd0a91d8 100644 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ b/unison-src/transcripts/transcript-parser-commands.output.md @@ -1,12 +1,16 @@ ### Transcript parser operations +``` ucm :hide +scratch/main> builtins.merge +``` + The transcript parser is meant to parse `ucm` and `unison` blocks. ``` unison x = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ x = 1 ``` ucm scratch/main> add - ⍟ I've added these definitions: x : Nat @@ -34,7 +37,6 @@ z ``` ucm :error scratch/main> delete foo - ⚠️ The following names were not found in the codebase. Check your spelling. @@ -44,7 +46,6 @@ scratch/main> delete foo ``` ucm :error scratch/main> delete lineToken.call - ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index 5ea2ba55e7..130ae5ddc4 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -2,12 +2,20 @@ https://github.com/unisonweb/unison/pull/2821 +``` ucm :hide +scratch/main> builtins.merge +``` + Define a type. ``` unison :hide structural type Y = Y ``` +``` ucm :hide +scratch/main> add +``` + Now, we update `Y`, and add a new type `Z` which depends on it. ``` unison @@ -15,7 +23,7 @@ structural type Z = Z Y structural type Y = Y Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +46,6 @@ Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked ``` ucm :error scratch/main> add - x These definitions failed: Reason @@ -49,7 +56,6 @@ scratch/main> add -- This shouldn't exist, because it should've been blocked. scratch/main> view Z - ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md index 8632e2433c..128e62d7f9 100644 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -1,5 +1,9 @@ # Type modifiers are optional, `unique` is the default. +``` ucm :hide +scratch/main> builtins.merge +``` + Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. ``` unison @@ -12,7 +16,7 @@ unique ability MyAbilityU where const : a structural ability MyAbilityS where const : a ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/undo.output.md b/unison-src/transcripts/undo.output.md index 542daa3b95..89982b2749 100644 --- a/unison-src/transcripts/undo.output.md +++ b/unison-src/transcripts/undo.output.md @@ -8,32 +8,26 @@ x = 1 ``` ucm scratch/main> builtins.merge lib.builtins - Done. scratch/main> add - ⍟ I've added these definitions: x : Nat scratch/main> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> alias.term x y - Done. scratch/main> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -57,7 +51,6 @@ scratch/main> history □ 3. #ms9lggs2rg (start of history) scratch/main> undo - Here are the changes I undid Name changes: @@ -66,12 +59,10 @@ scratch/main> undo 1. x 2. y (added) scratch/main> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> history - Note: The most recent namespace hash is immediately below this message. @@ -95,32 +86,26 @@ x = 1 ``` ucm scratch/branch1> builtins.merge lib.builtins - Done. scratch/branch1> add - ⍟ I've added these definitions: x : Nat scratch/branch1> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/branch1> alias.term x y - Done. scratch/branch1> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) scratch/branch1> history - Note: The most recent namespace hash is immediately below this message. @@ -145,15 +130,12 @@ scratch/branch1> history -- Make some changes on an unrelated branch scratch/branch2> builtins.merge lib.builtins - Done. scratch/branch2> delete.namespace lib - Done. scratch/branch1> undo - Here are the changes I undid Name changes: @@ -162,12 +144,10 @@ scratch/branch1> undo 1. x 2. y (added) scratch/branch1> ls - 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/branch1> history - Note: The most recent namespace hash is immediately below this message. @@ -187,13 +167,11 @@ Undo should be a no-op on a newly created branch ``` ucm :error scratch/main> branch.create-empty new - Done. I've created an empty branch scratch/new. Tip: Use `merge /somebranch` to initialize this branch. scratch/new> undo - ⚠️ Nothing more to undo. diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index bcf46b0480..e5a7967ffb 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -8,7 +8,7 @@ unique type B = B C unique type C = C B ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +25,6 @@ unique type C = C B ``` ucm scratch/main> add - ⍟ I've added these definitions: type A @@ -41,7 +40,7 @@ unique type B = B C unique type C = C B ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -53,7 +52,6 @@ If the name stays the same, the churn is even prevented if the type is updated a ``` ucm scratch/main> names A - Type Hash: #uj8oalgadr Names: A @@ -68,7 +66,7 @@ scratch/main> names A unique type A = A () ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -84,14 +82,12 @@ unique type A = A () ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names A - Type Hash: #ufo5tuc7ho Names: A @@ -106,7 +102,7 @@ scratch/main> names A unique type A = A ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -124,14 +120,12 @@ Note that `A` is back to its original hash. ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names A - Type Hash: #uj8oalgadr Names: A diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index b1b0b42cc2..3f0d2e9407 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -2,7 +2,7 @@ `()`.foo = "bar" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,23 +17,19 @@ ``` ucm scratch/main> add - ⍟ I've added these definitions: `()`.foo : ##Text scratch/main> find - 1. `()`.foo : ##Text scratch/main> find-in `()` - 1. foo : ##Text scratch/main> delete.namespace `()` - Done. ``` diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index da469556c2..c87cc2b940 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -1,6 +1,10 @@ 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 +scratch/main> builtins.merge +``` + ``` unison unique type A = A @@ -10,7 +14,7 @@ threadEyeDeez _ = (t1 == t2, t1 < t2) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,14 +30,12 @@ threadEyeDeez _ = ``` ucm scratch/main> add - ⍟ I've added these definitions: type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) scratch/main> run threadEyeDeez - (false, true) ``` @@ -45,7 +47,7 @@ scratch/main> run threadEyeDeez > termLink threadEyeDeez == termLink threadEyeDeez ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index cf4f74665a..0bc39e1fe8 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison f : '{} Nat f _ = 5 @@ -11,7 +15,7 @@ main _ = if n == 5 then [Ok ""] else [Fail ""] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,12 +32,10 @@ main _ = ``` ucm scratch/main> find unsafe.coerceAbilities - 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b scratch/main> add - ⍟ I've added these definitions: f : 'Nat @@ -41,7 +43,6 @@ scratch/main> add main : '{IO, Exception} [Result] scratch/main> io.test main - New test results: 1. main ◉ diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index eef9da9e73..d5b1d1ae08 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -2,12 +2,16 @@ the project organization convention that dependencies are put in "lib"; it's much easier to apply a patch to all of one's own code if the "lib" namespace is simply ignored. +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison foo = 100 lib.foo = 100 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +27,6 @@ lib.foo = 100 ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : Nat @@ -35,7 +38,7 @@ scratch/main> add foo = 200 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,14 +55,12 @@ foo = 200 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names foo - Term Hash: #9ntnotdp87 Names: foo diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 29973394aa..94e4660457 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -2,12 +2,16 @@ Conflicted definitions prevent `update` from succeeding. +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + ``` unison x = 1 temp = 2 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,18 +27,15 @@ temp = 2 ``` ucm scratch/main> add - ⍟ I've added these definitions: temp : Nat x : Nat scratch/main> debug.alias.term.force temp x - Done. scratch/main> delete.term temp - Done. ``` @@ -43,7 +44,7 @@ scratch/main> delete.term temp x = 3 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,7 +60,6 @@ x = 3 ``` ucm :error scratch/main> update - This branch has more than one term with the name `x`. Please delete or rename all but one of them, then try the update again. diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md index c721773abc..07b370d4ab 100644 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ b/unison-src/transcripts/update-suffixifies-properly.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +myproject/main> builtins.merge lib.builtin +``` + ``` unison a.x.x.x.x = 100 b.x.x.x.x = 100 @@ -7,7 +11,7 @@ d.y.y.y.y = foo + 10 bar = a.x.x.x.x + c.y.y.y.y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -27,7 +31,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ucm myproject/main> add - ⍟ I've added these definitions: a.x.x.x.x : Nat @@ -43,7 +46,7 @@ myproject/main> add foo = +30 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,7 +62,6 @@ foo = +30 ``` ucm :error myproject/main> update - Okay, I'm searching the branch for code that needs to be updated... 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 75e422593c..c78199984d 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,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ bar : Nat bar = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ bar = 5 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -45,7 +43,7 @@ bar : Nat bar = 7 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -64,14 +62,12 @@ bar = 7 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo bar - bar : Nat bar = 7 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 ad78aa32fd..a45e555c93 100644 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ b/unison-src/transcripts/update-term-to-different-type.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -10,7 +9,7 @@ foo : Nat foo = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +24,6 @@ foo = 5 ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : Nat @@ -37,7 +35,7 @@ foo : Int foo = +5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,14 +51,12 @@ foo = +5 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo - foo : Int foo = +5 diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index b8e08459f4..7764b6b240 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ bar : Nat bar = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ bar = 5 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -42,7 +40,7 @@ foo : Nat foo = 6 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,14 +57,12 @@ foo = 6 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo bar - bar : Nat bar = 5 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 767b272378..9e7189dd87 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,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ bar : Nat bar = foo + 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ bar = foo + 10 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -42,7 +40,7 @@ foo : Int foo = +5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,7 +56,6 @@ foo = +5 ``` ucm :error 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.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index 10024a9d3c..9961f5af9d 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -13,7 +12,7 @@ bar : Nat bar = foo + 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +28,6 @@ bar = foo + 10 ``` ucm scratch/main> add - ⍟ I've added these definitions: bar : Nat @@ -42,7 +40,7 @@ foo : Nat foo = 6 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,7 +56,6 @@ foo = 6 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -69,7 +66,6 @@ scratch/main> update Done. scratch/main> view bar - bar : Nat bar = use Nat + diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index d96c9e3c75..15c8fdeb47 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -10,7 +9,7 @@ foo : Nat foo = 5 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +24,6 @@ foo = 5 ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : Nat @@ -37,7 +35,7 @@ foo : Nat foo = 6 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,14 +51,12 @@ foo = 6 ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo - foo : Nat foo = 6 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 5b308c7d48..6730a8f5f2 100644 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ b/unison-src/transcripts/update-test-to-non-test.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.merge - Done. ``` @@ -9,7 +8,7 @@ scratch/main> builtins.merge test> foo = [] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,13 +31,11 @@ After adding the test `foo`, we expect `view` to render it like a test. (Bug: It ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : [Result] scratch/main> view foo - foo : [Result] foo = [] @@ -48,7 +45,7 @@ scratch/main> view foo foo = 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,14 +63,12 @@ After updating `foo` to not be a test, we expect `view` to not render it like a ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo - foo : Nat foo = 1 diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index 33d0a52d58..f59e5b9e33 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge +``` + Given a test that depends on another definition, ``` unison :hide @@ -10,7 +14,6 @@ test> mynamespace.foo.test = ``` ucm scratch/main> add - ⍟ I've added these definitions: foo : Nat -> Nat @@ -24,7 +27,7 @@ if we change the type of the dependency, the test should show in the scratch fil foo n = "hello, world!" ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,7 +43,6 @@ foo n = "hello, world!" ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index c0e6a4c38b..1044de8db5 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -18,7 +22,6 @@ unique type Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -31,7 +34,7 @@ unique type Foo | Baz Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,18 +50,15 @@ unique type Foo ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = Bar Nat | Baz Nat Nat scratch/main> find.verbose - 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog type Foo diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 78f3d63c07..42e9f1773c 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,7 +21,6 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -28,7 +31,7 @@ scratch/main> add unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,18 +47,15 @@ unique type Foo = Bar Nat Nat ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = Bar Nat Nat scratch/main> find.verbose - 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type 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 c17c2fd579..e6ee681c27 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtins +``` + ``` unison unique type Foo = { bar : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,14 +24,12 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = { bar : Nat } ``` 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 ad48e9e36c..8ec0ca19ea 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = { bar : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,7 +24,6 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -34,7 +37,7 @@ scratch/main> add unique type Foo = { bar : Nat, baz : Int } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,18 +62,15 @@ unique type Foo = { bar : Nat, baz : Int } ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose - 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 9db935e039..345b6ab209 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,13 +21,11 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Foo.BarAlias - Done. ``` @@ -32,7 +34,7 @@ scratch/main> alias.term Foo.Bar Foo.BarAlias unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +50,6 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update - Sorry, I wasn't able to perform the update: The type Foo has a constructor with multiple names, and I 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 c20be2868f..179543e0d8 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 @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat @@ -9,7 +13,7 @@ foo = cases Baz n m -> n + m ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,7 +29,6 @@ foo = cases ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -38,7 +41,7 @@ unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,7 +57,6 @@ unique type Foo ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index c849cd5c54..f9857f4f62 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -1,10 +1,14 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat | Baz Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ unique type Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -31,7 +34,7 @@ unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,18 +50,15 @@ unique type Foo ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = Bar Nat scratch/main> find.verbose - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 c7ab5fc2dc..df7e717b46 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = { bar : Nat, baz : Int } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,7 +27,6 @@ unique type Foo = { bar : Nat, baz : Int } ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -40,7 +43,7 @@ scratch/main> add unique type Foo = { bar : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -61,7 +64,6 @@ We want the field accessors to go away; but for now they are here, causing the u ``` ucm :error scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -72,11 +74,9 @@ scratch/main> update `update` again. scratch/main> view Foo - type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose - 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index 8bbbbadd37..c7b290d00c 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,13 +21,11 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> delete.term Foo.Bar - Done. ``` @@ -34,7 +36,7 @@ Now we've set up a situation where the original constructor missing. unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,11 +52,9 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> view Foo - type Foo = #b509v3eg4k#0 Nat scratch/main> update - Sorry, I wasn't able to perform the update: The type Foo has some constructors with missing names, and I 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 403eb17062..57baafdd88 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat @@ -5,7 +9,7 @@ structural type A.B = OneAlias Foo structural type A = B.TheOtherAlias Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -22,7 +26,6 @@ structural type A = B.TheOtherAlias Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: structural type A @@ -35,7 +38,7 @@ scratch/main> add unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,7 +54,6 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update - The type A.B is an alias of A. I'm not able to perform an update when a type exists nested under an alias of itself. Please separate them or delete one copy, and then try updating 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 378ba50337..e377f7a9a8 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = { bar : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -20,7 +24,6 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -34,7 +37,6 @@ Bug: this no-op update should (of course) succeed. ``` ucm 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.output.md b/unison-src/transcripts/update-type-stray-constructor-alias.output.md index c8f3538f2c..8808921bb9 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,13 +21,11 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Stray.BarAlias - Done. ``` @@ -32,7 +34,7 @@ scratch/main> alias.term Foo.Bar Stray.BarAlias unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +50,6 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update - Sorry, I wasn't able to perform the update, because I need all constructor names to be nested somewhere beneath the corresponding type name. diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index 7bb13fa262..af341488d8 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,13 +21,11 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo scratch/main> move.term Foo.Bar Stray.Bar - Done. ``` @@ -34,7 +36,7 @@ Now we've set up a situation where the constructor is not where it's supposed to unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,11 +54,9 @@ Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) ``` ucm :error scratch/main> view Foo - type Foo = Stray.Bar Nat scratch/main> update - Sorry, I wasn't able to perform the update: The type Foo has some constructors with missing names, and I 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 f1d4c00556..fa8a48f72d 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 @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat @@ -5,7 +9,7 @@ makeFoo : Nat -> Foo makeFoo n = Bar (n+10) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ makeFoo n = Bar (n+10) ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -36,7 +39,7 @@ Foo.Bar : Nat -> Foo Foo.Bar n = internal.Bar n ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +56,6 @@ Foo.Bar n = internal.Bar n ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -64,11 +66,9 @@ scratch/main> update Done. scratch/main> view Foo - type Foo = internal.Bar Nat scratch/main> find.verbose - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 907ad1097e..20766aa079 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 @@ -1,8 +1,12 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -17,7 +21,6 @@ unique type Foo = Nat ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -28,7 +31,7 @@ scratch/main> add unique type Foo = { bar : Nat } ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -50,18 +53,15 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo - type Foo = { bar : Nat } scratch/main> find.verbose - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 427bc7758b..e90d3afa95 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat @@ -5,7 +9,7 @@ incrFoo : Foo -> Foo incrFoo = cases Bar n -> Bar (n+1) ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ucm scratch/main> add - ⍟ I've added these definitions: type Foo @@ -33,7 +36,7 @@ scratch/main> add unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,7 +52,6 @@ unique type Foo = Bar Nat Nat ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md index 0f69b2fa4b..94759f2593 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 @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat unique type Baz = Qux Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ unique type Baz = Qux Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Baz @@ -31,7 +34,7 @@ scratch/main> add unique type Foo a = Bar Nat a ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +50,6 @@ unique type Foo a = Bar Nat a ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-with-dependent-type.output.md index 50a8a73d3c..978bba4c73 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -1,9 +1,13 @@ +``` ucm :hide +scratch/main> builtins.merge lib.builtin +``` + ``` unison unique type Foo = Bar Nat unique type Baz = Qux Foo ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -19,7 +23,6 @@ unique type Baz = Qux Foo ``` ucm scratch/main> add - ⍟ I've added these definitions: type Baz @@ -31,7 +34,7 @@ scratch/main> add unique type Foo = Bar Nat Nat ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +50,6 @@ unique type Foo = Bar Nat Nat ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... @@ -58,15 +60,12 @@ scratch/main> update Done. scratch/main> view Foo - type Foo = Bar Nat Nat scratch/main> view Baz - type Baz = Qux Foo scratch/main> find.verbose - 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 type Baz diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index ad222483f8..23984b651c 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -2,7 +2,7 @@ > 1 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ @@ -20,7 +20,6 @@ ``` ucm scratch/main> update - Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/upgrade-happy-path.output.md b/unison-src/transcripts/upgrade-happy-path.output.md index baf8c9fe7e..bae72e23f7 100644 --- a/unison-src/transcripts/upgrade-happy-path.output.md +++ b/unison-src/transcripts/upgrade-happy-path.output.md @@ -1,10 +1,14 @@ +``` ucm :hide +proj/main> builtins.merge lib.builtin +``` + ``` unison lib.old.foo = 17 lib.new.foo = 18 thingy = lib.old.foo + 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ thingy = lib.old.foo + 10 ``` ucm proj/main> add - ⍟ I've added these definitions: lib.new.foo : Nat @@ -34,18 +37,15 @@ Test tab completion and fzf options of upgrade command. ``` ucm proj/main> debug.tab-complete upgrade ol - old proj/main> debug.fuzzy-options upgrade _ - Select a dependency to upgrade: * builtin * new * old proj/main> debug.fuzzy-options upgrade old _ - Select a dependency to upgrade to: * builtin * new @@ -55,16 +55,13 @@ proj/main> debug.fuzzy-options upgrade old _ ``` ucm proj/main> upgrade old new - I upgraded old to new, and removed old. proj/main> ls lib - 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) proj/main> view thingy - thingy : Nat thingy = use Nat + diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md index 9a8d511c12..33ac600eb3 100644 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ b/unison-src/transcripts/upgrade-sad-path.output.md @@ -1,10 +1,14 @@ +``` ucm :hide +proj/main> builtins.merge lib.builtin +``` + ``` unison lib.old.foo = 17 lib.new.foo = +18 thingy = lib.old.foo + 10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,7 +25,6 @@ thingy = lib.old.foo + 10 ``` ucm proj/main> add - ⍟ I've added these definitions: lib.new.foo : Int @@ -32,7 +35,6 @@ proj/main> add ``` ucm :error proj/main> upgrade old new - I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. @@ -64,7 +66,7 @@ Resolve the error and commit the upgrade. thingy = foo + +10 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -80,30 +82,25 @@ thingy = foo + +10 ``` ucm proj/upgrade-old-to-new> update - Okay, I'm searching the branch for code that needs to be updated... Done. proj/upgrade-old-to-new> upgrade.commit - I fast-forward merged proj/upgrade-old-to-new into proj/main. proj/main> view thingy - thingy : Int thingy = use Int + foo + +10 proj/main> ls lib - 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) proj/main> branches - Branch Remote branch 1. main diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md index e06538148f..70b28300e4 100644 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ b/unison-src/transcripts/upgrade-suffixifies-properly.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +myproject/main> builtins.merge lib.builtin +``` + ``` unison lib.old.foo = 25 lib.new.foo = +30 @@ -8,7 +12,7 @@ d.y.y.y.y = lib.old.foo + 10 bar = a.x.x.x.x + c.y.y.y.y ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,7 +33,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ucm myproject/main> add - ⍟ I've added these definitions: a.x.x.x.x : Nat @@ -44,7 +47,6 @@ myproject/main> add ``` ucm :error myproject/main> upgrade old new - I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. diff --git a/unison-src/transcripts/upgrade-with-old-alias.output.md b/unison-src/transcripts/upgrade-with-old-alias.output.md index 3b4dea9bae..0af15f3749 100644 --- a/unison-src/transcripts/upgrade-with-old-alias.output.md +++ b/unison-src/transcripts/upgrade-with-old-alias.output.md @@ -1,3 +1,7 @@ +``` ucm :hide +myproject/main> builtins.merge lib.builtin +``` + ``` unison lib.old.foo = 141 lib.new.foo = 142 @@ -5,7 +9,7 @@ bar = 141 mything = lib.old.foo + 100 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -23,25 +27,21 @@ mything = lib.old.foo + 100 ``` ucm myproject/main> update - Okay, I'm searching the branch for code that needs to be updated... Done. myproject/main> upgrade old new - I upgraded old to new, and removed old. myproject/main> view mything - mything : Nat mything = use Nat + foo + 100 myproject/main> view bar - bar : Nat bar = 141 diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index 2520387f7c..a3ace04d42 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -1,14 +1,21 @@ # View commands +``` ucm :hide +scratch/main> builtins.merge +``` + ``` unison :hide a.thing = "a" b.thing = "b" ``` +``` ucm :hide +scratch/main> add +``` + ``` ucm -- Should suffix-search and find values in sub-namespaces scratch/main> view thing - a.thing : Text a.thing = "a" @@ -17,7 +24,6 @@ scratch/main> view thing -- Should support absolute paths scratch/main> view .b.thing - .b.thing : Text .b.thing = "b" diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 7472367008..480245a977 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -1,6 +1,5 @@ ``` ucm scratch/main> builtins.mergeio - Done. ``` @@ -9,7 +8,7 @@ scratch/main> builtins.mergeio test> pass = [Ok "Passed"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,7 +30,6 @@ test> pass = [Ok "Passed"] ``` ucm scratch/main> add - ⍟ I've added these definitions: pass : [Result] @@ -42,7 +40,7 @@ scratch/main> add test> pass = [Ok "Passed"] ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -59,11 +57,9 @@ test> pass = [Ok "Passed"] ``` ucm scratch/main> add - ⊡ Ignored previously added definitions: pass scratch/main> test - Cached test results (`help testcache` to learn more) 1. pass ◉ Passed @@ -79,7 +75,7 @@ scratch/main> test > ImmutableByteArray.fromBytes 0xs123456 ``` -``` ucm +``` ucm :added-by-ucm Loading changes detected in scratch.u. ✅ From 39e51b63c0bf35eaf920d815292d22e75e28381a Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 08:09:49 -0600 Subject: [PATCH 05/15] Correct spacing after UCM command --- .../IntegrationTests/transcript.output.md | 5 + .../src/Unison/Codebase/Transcript/Parser.hs | 2 +- .../transcripts-manual/docs.to-html.output.md | 3 + .../transcripts-manual/rewrites.output.md | 24 ++ .../transcripts-round-trip/main.output.md | 26 ++ .../transcripts-using-base/_base.output.md | 6 + .../all-base-hashes.output.md | 1 + .../binary-encoding-nats.output.md | 2 + .../transcripts-using-base/codeops.output.md | 8 + .../transcripts-using-base/doc.output.md | 19 ++ .../failure-tests.output.md | 3 + .../transcripts-using-base/fix2358.output.md | 1 + .../transcripts-using-base/fix3939.output.md | 3 + .../transcripts-using-base/fix5129.output.md | 1 + .../transcripts-using-base/hashing.output.md | 6 + .../transcripts-using-base/mvar.output.md | 2 + .../nat-coersion.output.md | 2 + .../transcripts-using-base/net.output.md | 5 + .../random-deserial.output.md | 2 + .../ref-promise.output.md | 9 + .../serial-test-00.output.md | 2 + .../serial-test-01.output.md | 2 + .../serial-test-02.output.md | 2 + .../serial-test-03.output.md | 2 + .../serial-test-04.output.md | 2 + .../transcripts-using-base/stm.output.md | 3 + .../test-watch-dependencies.output.md | 3 + .../transcripts-using-base/thread.output.md | 6 + .../transcripts-using-base/tls.output.md | 7 + .../transcripts-using-base/utf8.output.md | 1 + unison-src/transcripts/abilities.output.md | 2 + ...ability-order-doesnt-affect-hash.output.md | 2 + ...ability-term-conflicts-on-update.output.md | 10 + unison-src/transcripts/add-run.output.md | 20 ++ .../add-test-watch-roundtrip.output.md | 3 + .../transcripts/addupdatemessages.output.md | 5 + unison-src/transcripts/alias-many.output.md | 4 + unison-src/transcripts/alias-term.output.md | 7 + unison-src/transcripts/alias-type.output.md | 7 + unison-src/transcripts/anf-tests.output.md | 2 + unison-src/transcripts/any-extract.output.md | 4 + .../transcripts/api-doc-rendering.output.md | 3 + unison-src/transcripts/api-find.output.md | 1 + .../transcripts/api-getDefinition.output.md | 3 + .../api-list-projects-branches.output.md | 6 + .../api-namespace-details.output.md | 2 + .../transcripts/api-namespace-list.output.md | 2 + .../transcripts/api-summaries.output.md | 4 + .../block-on-required-update.output.md | 3 + unison-src/transcripts/blocks.output.md | 1 + .../boolean-op-pretty-print-2819.output.md | 3 + .../transcripts/branch-command.output.md | 28 ++ .../branch-relative-path.output.md | 10 + unison-src/transcripts/bug-fix-4354.output.md | 1 + .../transcripts/bug-strange-closure.output.md | 9 + .../transcripts/builtins-merge.output.md | 2 + unison-src/transcripts/builtins.output.md | 15 + .../transcripts/bytesFromList.output.md | 1 + unison-src/transcripts/check763.output.md | 4 + unison-src/transcripts/check873.output.md | 2 + .../constructor-applied-to-unit.output.md | 2 + .../transcripts/contrabilities.output.md | 1 + .../transcripts/create-author.output.md | 3 + .../transcripts/cycle-update-1.output.md | 4 + .../transcripts/cycle-update-2.output.md | 4 + .../transcripts/cycle-update-3.output.md | 4 + .../transcripts/cycle-update-4.output.md | 4 + .../transcripts/debug-definitions.output.md | 9 + .../transcripts/debug-name-diffs.output.md | 6 + unison-src/transcripts/deep-names.output.md | 20 ++ .../transcripts/definition-diff-api.output.md | 6 + ...elete-namespace-dependents-check.output.md | 5 + .../transcripts/delete-namespace.output.md | 11 + .../delete-project-branch.output.md | 12 + .../transcripts/delete-project.output.md | 11 + .../transcripts/delete-silent.output.md | 5 + unison-src/transcripts/delete.output.md | 34 ++ ...ependents-dependencies-debugfile.output.md | 8 + .../transcripts/destructuring-binds.output.md | 7 + .../transcripts/diff-namespace.output.md | 51 +++ .../transcripts/doc-formatting.output.md | 28 ++ .../doc-type-link-keywords.output.md | 6 + unison-src/transcripts/doc1.output.md | 6 + unison-src/transcripts/doc2.output.md | 2 + unison-src/transcripts/doc2markdown.output.md | 3 + ...t-upgrade-refs-that-exist-in-old.output.md | 4 + .../transcripts/duplicate-names.output.md | 3 + .../duplicate-term-detection.output.md | 1 + unison-src/transcripts/ed25519.output.md | 1 + unison-src/transcripts/edit-command.output.md | 5 + .../transcripts/edit-namespace.output.md | 4 + .../transcripts/empty-namespaces.output.md | 16 + .../transcripts/emptyCodebase.output.md | 5 + .../transcripts/error-messages.output.md | 1 + .../dont-hide-unexpected-ucm-errors.output.md | 7 +- .../errors/missing-result-typed.output.md | 1 + .../errors/ucm-hide-error.output.md | 1 + unison-src/transcripts/find-by-type.output.md | 6 + unison-src/transcripts/find-command.output.md | 14 + .../fix-1381-excess-propagate.output.md | 4 + .../fix-2258-if-as-list-element.output.md | 1 + unison-src/transcripts/fix-5267.output.md | 5 + unison-src/transcripts/fix-5301.output.md | 1 + unison-src/transcripts/fix-5312.output.md | 3 + unison-src/transcripts/fix-5320.output.md | 1 + unison-src/transcripts/fix-5323.output.md | 3 + unison-src/transcripts/fix-5326.output.md | 10 + unison-src/transcripts/fix-5340.output.md | 2 + unison-src/transcripts/fix-5357.output.md | 4 + unison-src/transcripts/fix-5369.output.md | 2 + unison-src/transcripts/fix-5374.output.md | 4 + unison-src/transcripts/fix-5380.output.md | 4 + .../transcripts/fix-big-list-crash.output.md | 1 + unison-src/transcripts/fix-ls.output.md | 4 + unison-src/transcripts/fix1063.output.md | 3 + unison-src/transcripts/fix1327.output.md | 3 + unison-src/transcripts/fix1334.output.md | 2 + unison-src/transcripts/fix1390.output.md | 3 + unison-src/transcripts/fix1421.output.md | 2 + unison-src/transcripts/fix1532.output.md | 7 + unison-src/transcripts/fix1696.output.md | 1 + unison-src/transcripts/fix1709.output.md | 1 + unison-src/transcripts/fix1731.output.md | 2 + unison-src/transcripts/fix1800.output.md | 13 + unison-src/transcripts/fix1926.output.md | 1 + unison-src/transcripts/fix2026.output.md | 2 + unison-src/transcripts/fix2027.output.md | 2 + unison-src/transcripts/fix2049.output.md | 3 + unison-src/transcripts/fix2053.output.md | 2 + unison-src/transcripts/fix2156.output.md | 1 + unison-src/transcripts/fix2167.output.md | 1 + unison-src/transcripts/fix2187.output.md | 1 + unison-src/transcripts/fix2231.output.md | 2 + unison-src/transcripts/fix2238.output.md | 2 + unison-src/transcripts/fix2244.output.md | 3 + unison-src/transcripts/fix2254.output.md | 11 + unison-src/transcripts/fix2268.output.md | 1 + unison-src/transcripts/fix2334.output.md | 1 + unison-src/transcripts/fix2344.output.md | 1 + unison-src/transcripts/fix2353.output.md | 1 + unison-src/transcripts/fix2354.output.md | 1 + unison-src/transcripts/fix2355.output.md | 1 + unison-src/transcripts/fix2378.output.md | 1 + unison-src/transcripts/fix2423.output.md | 1 + unison-src/transcripts/fix2474.output.md | 1 + unison-src/transcripts/fix2628.output.md | 3 + unison-src/transcripts/fix2663.output.md | 1 + unison-src/transcripts/fix2693.output.md | 2 + unison-src/transcripts/fix2712.output.md | 2 + unison-src/transcripts/fix2795.output.md | 3 + unison-src/transcripts/fix2822.output.md | 1 + unison-src/transcripts/fix2826.output.md | 4 + unison-src/transcripts/fix2840.output.md | 3 + unison-src/transcripts/fix2970.output.md | 1 + unison-src/transcripts/fix3037.output.md | 1 + unison-src/transcripts/fix3171.output.md | 1 + unison-src/transcripts/fix3196.output.md | 1 + unison-src/transcripts/fix3215.output.md | 1 + unison-src/transcripts/fix3244.output.md | 1 + unison-src/transcripts/fix3265.output.md | 1 + unison-src/transcripts/fix3424.output.md | 5 + unison-src/transcripts/fix3634.output.md | 3 + unison-src/transcripts/fix3678.output.md | 1 + unison-src/transcripts/fix3752.output.md | 1 + unison-src/transcripts/fix3773.output.md | 1 + unison-src/transcripts/fix3977.output.md | 4 + unison-src/transcripts/fix4172.output.md | 5 + unison-src/transcripts/fix4280.output.md | 1 + unison-src/transcripts/fix4424.output.md | 3 + unison-src/transcripts/fix4482.output.md | 3 + unison-src/transcripts/fix4498.output.md | 3 + unison-src/transcripts/fix4515.output.md | 3 + unison-src/transcripts/fix4528.output.md | 3 + unison-src/transcripts/fix4556.output.md | 3 + unison-src/transcripts/fix4592.output.md | 1 + unison-src/transcripts/fix4618.output.md | 3 + unison-src/transcripts/fix4711.output.md | 4 + unison-src/transcripts/fix4722.output.md | 1 + unison-src/transcripts/fix4731.output.md | 1 + unison-src/transcripts/fix4780.output.md | 1 + unison-src/transcripts/fix4898.output.md | 4 + unison-src/transcripts/fix5055.output.md | 4 + unison-src/transcripts/fix5076.output.md | 1 + unison-src/transcripts/fix5080.output.md | 5 + unison-src/transcripts/fix5349.output.md | 1 + unison-src/transcripts/fix614.output.md | 2 + unison-src/transcripts/fix689.output.md | 1 + unison-src/transcripts/fix693.output.md | 2 + unison-src/transcripts/fix845.output.md | 2 + unison-src/transcripts/fix849.output.md | 1 + unison-src/transcripts/fix942.output.md | 6 + unison-src/transcripts/fix987.output.md | 3 + unison-src/transcripts/formatter.output.md | 3 + .../transcripts/fuzzy-options.output.md | 8 + unison-src/transcripts/hello.output.md | 4 + unison-src/transcripts/help.output.md | 8 + unison-src/transcripts/higher-rank.output.md | 5 + .../transcripts/input-parse-errors.output.md | 8 + .../transcripts/io-test-command.output.md | 6 + unison-src/transcripts/io.output.md | 36 ++ .../transcripts/kind-inference.output.md | 1 + unison-src/transcripts/lambdacase.output.md | 7 + .../transcripts/lsp-fold-ranges.output.md | 2 + .../transcripts/lsp-name-completion.output.md | 4 + unison-src/transcripts/merge.output.md | 312 ++++++++++++++++++ unison-src/transcripts/move-all.output.md | 17 + .../transcripts/move-namespace.output.md | 30 ++ .../transcripts/name-resolution.output.md | 24 ++ .../transcripts/name-segment-escape.output.md | 4 + .../transcripts/name-selection.output.md | 12 + unison-src/transcripts/names.output.md | 8 + .../namespace-deletion-regression.output.md | 5 + .../namespace-dependencies.output.md | 3 + .../transcripts/namespace-directive.output.md | 7 + .../transcripts/numbered-args.output.md | 11 + .../transcripts/old-fold-right.output.md | 1 + .../pattern-match-coverage.output.md | 4 + .../pattern-pretty-print-2345.output.md | 16 + .../transcripts/patternMatchTls.output.md | 3 + unison-src/transcripts/patterns.output.md | 1 + unison-src/transcripts/propagate.output.md | 10 + unison-src/transcripts/pull-errors.output.md | 4 + unison-src/transcripts/records.output.md | 14 + unison-src/transcripts/reflog.output.md | 10 + .../release-draft-command.output.md | 4 + unison-src/transcripts/reset.output.md | 19 ++ .../transcripts/resolution-failures.output.md | 2 + unison-src/transcripts/rsa.output.md | 1 + unison-src/transcripts/scope-ref.output.md | 1 + unison-src/transcripts/suffixes.output.md | 11 + .../sum-type-update-conflicts.output.md | 3 + .../transcripts/switch-command.output.md | 14 + .../transcripts/tab-completion.output.md | 25 ++ unison-src/transcripts/tdnr.output.md | 62 ++++ unison-src/transcripts/test-command.output.md | 9 + .../transcripts/text-literals.output.md | 3 + unison-src/transcripts/textfind.output.md | 19 ++ .../transcripts/todo-bug-builtins.output.md | 1 + unison-src/transcripts/todo.output.md | 38 +++ .../top-level-exceptions.output.md | 6 + .../transcript-parser-commands.output.md | 4 + unison-src/transcripts/type-deps.output.md | 4 + .../type-modifier-are-optional.output.md | 1 + unison-src/transcripts/undo.output.md | 22 ++ .../transcripts/unique-type-churn.output.md | 6 + .../transcripts/unitnamespace.output.md | 4 + .../transcripts/universal-cmp.output.md | 3 + .../transcripts/unsafe-coerce.output.md | 4 + .../update-ignores-lib-namespace.output.md | 4 + .../transcripts/update-on-conflict.output.md | 5 + .../update-suffixifies-properly.output.md | 3 + ...e-term-aliases-in-different-ways.output.md | 4 + .../update-term-to-different-type.output.md | 4 + .../update-term-with-alias.output.md | 4 + ...with-dependent-to-different-type.output.md | 3 + .../update-term-with-dependent.output.md | 4 + unison-src/transcripts/update-term.output.md | 4 + .../update-test-to-non-test.output.md | 5 + .../update-test-watch-roundtrip.output.md | 3 + .../update-type-add-constructor.output.md | 5 + .../update-type-add-field.output.md | 5 + .../update-type-add-new-record.output.md | 3 + .../update-type-add-record-field.output.md | 5 + .../update-type-constructor-alias.output.md | 4 + ...elete-constructor-with-dependent.output.md | 3 + .../update-type-delete-constructor.output.md | 5 + .../update-type-delete-record-field.output.md | 5 + .../update-type-missing-constructor.output.md | 5 + .../update-type-nested-decl-aliases.output.md | 3 + .../update-type-no-op-record.output.md | 3 + ...ate-type-stray-constructor-alias.output.md | 4 + .../update-type-stray-constructor.output.md | 5 + ...nstructor-into-smart-constructor.output.md | 5 + ...type-turn-non-record-into-record.output.md | 5 + .../update-type-with-dependent-term.output.md | 3 + ...dependent-type-to-different-kind.output.md | 3 + .../update-type-with-dependent-type.output.md | 6 + unison-src/transcripts/update-watch.output.md | 1 + .../transcripts/upgrade-happy-path.output.md | 8 + .../transcripts/upgrade-sad-path.output.md | 8 + .../upgrade-suffixifies-properly.output.md | 3 + .../upgrade-with-old-alias.output.md | 5 + unison-src/transcripts/view.output.md | 4 + .../transcripts/watch-expressions.output.md | 4 + 284 files changed, 1886 insertions(+), 2 deletions(-) diff --git a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md index 99ce54eff4..90c54f796a 100644 --- a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md +++ b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md @@ -2,8 +2,11 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/main> load ./unison-src/transcripts-using-base/base.u + scratch/main> add + ``` ``` unison @@ -51,6 +54,7 @@ main = do ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability Break @@ -59,4 +63,5 @@ scratch/main> add resume : Request {g, Break} x -> x scratch/main> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main + ``` diff --git a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs index b5fdda6de5..172bf4aa73 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs @@ -36,7 +36,7 @@ formatAPIRequest = \case formatUcmLine :: UcmLine -> Text formatUcmLine = \case - UcmCommand context txt -> formatContext context <> "> " <> txt + UcmCommand context txt -> formatContext context <> "> " <> txt <> "\n" UcmComment txt -> "--" <> txt where formatContext (UcmContextProject projectAndBranch) = into @Text projectAndBranch diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index c8e04727eb..7bd98a5beb 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -1,5 +1,6 @@ ``` ucm test-html-docs/main> builtins.mergeio lib.builtins + Done. ``` @@ -35,6 +36,7 @@ some.outside = 3 ``` ucm test-html-docs/main> add + ⍟ I've added these definitions: some.ns.direct : Nat @@ -45,4 +47,5 @@ test-html-docs/main> add some.outside.doc : Doc2 test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html + ``` diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index d5012ef1d9..76fd61a73c 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -1,7 +1,10 @@ ``` ucm :hide scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add + ``` ## Structural find and replace @@ -37,6 +40,7 @@ Let's rewrite these: ``` ucm scratch/main> rewrite rule1 + ☝️ I found and replaced matches in these definitions: ex1 @@ -44,6 +48,7 @@ scratch/main> rewrite rule1 The rewritten file has been added to the top of scratch.u scratch/main> rewrite eitherToOptional + ☝️ I found and replaced matches in these definitions: @@ -115,13 +120,16 @@ rule2 x = @rewrite signature Optional ==> Optional2 ``` ucm :hide scratch/main> load + scratch/main> add + ``` After adding to the codebase, here's the rewritten source: ``` ucm scratch/main> view ex1 Either.mapRight rule1 + Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b Either.mapRight f = cases None -> None @@ -168,6 +176,7 @@ Let's apply the rewrite `woot1to2`: ``` ucm scratch/main> rewrite woot1to2 + ☝️ I found and replaced matches in these definitions: wootEx @@ -202,13 +211,16 @@ blah2 = 456 ``` ucm :hide scratch/main> load + scratch/main> add + ``` After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ``` ucm scratch/main> view wootEx + wootEx : Nat ->{Woot2} Nat wootEx a = _ = woot2() @@ -239,14 +251,18 @@ sameFileEx = ``` ucm :hide scratch/main> rewrite rule + scratch/main> load + scratch/main> add + ``` After adding the rewritten form to the codebase, here's the rewritten definitions: ``` ucm scratch/main> view foo1 foo2 sameFileEx + foo1 : Nat foo1 = b = "b" @@ -288,6 +304,7 @@ In the above example, `bar2` is locally bound by the rule, so when applied, it s ``` ucm scratch/main> rewrite rule + ☝️ I found and replaced matches in these definitions: sameFileEx @@ -322,6 +339,7 @@ Instead, it should be an unbound free variable, which doesn't typecheck: ``` ucm :error scratch/main> load + Loading changes detected in scratch.u. I couldn't figure out what bar21 refers to here: @@ -353,6 +371,7 @@ rule a = @rewrite ``` ucm scratch/main> rewrite rule + ☝️ I found and replaced matches in these definitions: bar2 @@ -379,6 +398,7 @@ The `a` introduced will be freshened to not capture the `a` in scope, so it rema ``` ucm :error scratch/main> load + Loading changes detected in scratch.u. I couldn't figure out what a1 refers to here: @@ -404,6 +424,7 @@ eitherEx = Left ("hello", "there") ``` ucm :hide scratch/main> add + ``` ``` unison :hide @@ -413,6 +434,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ucm scratch/main> sfind findEitherEx + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -422,6 +444,7 @@ scratch/main> sfind findEitherEx Tip: Try `edit 1` to bring this into your scratch file. scratch/main> sfind findEitherFailure + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -436,6 +459,7 @@ scratch/main> sfind findEitherFailure scratch file. scratch/main> find 1-5 + 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a 2. Exception.reraise : Either Failure a ->{Exception} a 3. Exception.toEither : '{ε, Exception} a diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index ddb1b1cd20..90992afc7b 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -2,13 +2,18 @@ This transcript verifies that the pretty-printer produces code that can be succe ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/a1> builtins.mergeio lib.builtins + scratch/a2> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/a1> load unison-src/transcripts-round-trip/reparses-with-same-hash.u + scratch/a1> add + ``` ``` unison @@ -30,12 +35,14 @@ x = () ``` ucm :hide scratch/a1> find + ``` So we can see the pretty-printed output: ``` ucm scratch/a1> edit 1-1000 + ☝️ I added 111 definitions to the top of scratch.u @@ -825,21 +832,26 @@ a |> f = f a ``` ucm :hide scratch/a1> delete.namespace.force lib.builtins + ``` ``` ucm :hide scratch/a2> load + ``` ``` ucm :hide scratch/a2> add + scratch/a2> delete.namespace.force lib.builtins + ``` 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: + The namespaces are identical. ``` @@ -848,8 +860,11 @@ Now check that definitions in 'reparses.u' at least parse on round trip: ``` ucm :hide scratch/a3> builtins.mergeio lib.builtins + scratch/a3> load unison-src/transcripts-round-trip/reparses.u + scratch/a3> add + ``` This just makes 'roundtrip.u' the latest scratch file. @@ -860,10 +875,12 @@ x = () ``` ucm :hide scratch/a3> find + ``` ``` ucm scratch/a3> edit 1-5000 + ☝️ I added 2 definitions to the top of scratch.u @@ -897,16 +914,22 @@ sloppyDocEval = ``` ucm :hide scratch/a3_new> builtins.mergeio lib.builtins + scratch/a3_new> load + scratch/a3_new> add + scratch/a3> delete.namespace.force lib.builtins + scratch/a3_new> delete.namespace.force lib.builtins + ``` These are currently all expected to have different hashes on round trip. ``` ucm scratch/main> diff.namespace /a3_new: /a3: + Updates: 1. sloppyDocEval : Doc2 @@ -923,9 +946,11 @@ Regression test for https://github.com/unisonweb/unison/pull/3548 ``` ucm scratch/regressions> alias.term ##Nat.+ plus + Done. scratch/regressions> edit plus + ☝️ I added 1 definitions to the top of scratch.u @@ -934,6 +959,7 @@ scratch/regressions> edit plus definitions currently in this namespace. scratch/regressions> load + Loading changes detected in scratch.u. I loaded scratch.u and didn't find anything. diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index 4589924176..74bc300c04 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -11,8 +11,11 @@ transcripts which contain less boilerplate. ``` ucm :hide 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. @@ -25,6 +28,7 @@ test> hex.tests.ex1 = checks let ``` ucm :hide scratch/main> test + ``` Lets do some basic testing of our test harness to make sure its @@ -64,11 +68,13 @@ testAutoClean _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testAutoClean : '{IO} [Result] scratch/main> io.test testAutoClean + New test results: 1. testAutoClean ◉ our temporary directory should exist 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 0f4e66a4c7..0b656ef0c3 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -2,6 +2,7 @@ This transcript is intended to make visible accidental changes to the hashing al ``` ucm scratch/main> find.verbose + 1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo <| : (i ->{g} o) -> i ->{g} o 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 dca5ffce15..898e014c72 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -77,6 +77,7 @@ testABunchOfNats _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: type EncDec @@ -91,6 +92,7 @@ scratch/main> add testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () scratch/main> io.test testABunchOfNats + New test results: 1. testABunchOfNats ◉ successfully decoded 4294967295 using 64 bit Big Endian diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index 772386b90f..f6eaa2ee9d 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -200,6 +200,7 @@ swapped name link = ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Three a b c @@ -344,6 +345,7 @@ to actual show that the serialization works. ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability Zap @@ -359,6 +361,7 @@ scratch/main> add zapper : Three Nat Nat Nat -> Request {Zap} r -> r scratch/main> io.test tests + New test results: 1. tests ◉ (ext f) passed @@ -380,6 +383,7 @@ scratch/main> io.test tests Tip: Use view 1 to view the source of a test. scratch/main> io.test badLoad + New test results: 1. badLoad ◉ serialized77 @@ -441,11 +445,13 @@ codeTests = ``` ucm scratch/main> add + ⍟ I've added these definitions: codeTests : '{IO} [Result] scratch/main> io.test codeTests + New test results: 1. codeTests ◉ (idem f) passed @@ -527,12 +533,14 @@ vtests _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] scratch/main> io.test vtests + New test results: 1. vtests ◉ validated diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index 043e62c57d..ef33a50ffe 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -52,12 +52,15 @@ You can preview what docs will look like when rendered to the console using the ``` ucm scratch/main> display d1 + Hello there Alice! scratch/main> docs ImportantConstant + An important constant, equal to `42` scratch/main> docs DayOfWeek + The 7 days of the week, defined as: type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat @@ -72,6 +75,7 @@ First, we'll load the `syntax.u` file which has examples of all the syntax: ``` ucm 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. @@ -95,6 +99,7 @@ scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u ``` ucm :hide scratch/main> add + ``` Now we can review different portions of the guide. @@ -103,6 +108,7 @@ and the rendered output using `display`: ```` ucm scratch/main> view basicFormatting + basicFormatting : Doc2 basicFormatting = {{ @@ -132,6 +138,7 @@ scratch/main> view basicFormatting }} scratch/main> display basicFormatting + # Basic formatting Paragraphs are separated by one or more blanklines. Sections @@ -156,6 +163,7 @@ scratch/main> display basicFormatting *Next up:* lists scratch/main> view lists + lists : Doc2 lists = {{ @@ -198,6 +206,7 @@ scratch/main> view lists }} scratch/main> display lists + # Lists # Bulleted lists @@ -236,6 +245,7 @@ scratch/main> display lists 3. Get dressed. scratch/main> view evaluation + evaluation : Doc2 evaluation = use Nat * + @@ -270,6 +280,7 @@ scratch/main> view evaluation }} scratch/main> display evaluation + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -297,6 +308,7 @@ scratch/main> display evaluation cube x = x * x * x scratch/main> view includingSource + includingSource : Doc2 includingSource = use Nat + @@ -337,6 +349,7 @@ scratch/main> view includingSource }} scratch/main> display includingSource + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -382,6 +395,7 @@ scratch/main> display includingSource so: `sqr x`. This is equivalent to `sqr x`. scratch/main> view nonUnisonCodeBlocks + nonUnisonCodeBlocks : Doc2 nonUnisonCodeBlocks = {{ @@ -414,6 +428,7 @@ scratch/main> view nonUnisonCodeBlocks }} scratch/main> display nonUnisonCodeBlocks + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -442,6 +457,7 @@ scratch/main> display nonUnisonCodeBlocks ``` scratch/main> view otherElements + otherElements : Doc2 otherElements = {{ @@ -498,6 +514,7 @@ scratch/main> view otherElements }} scratch/main> display otherElements + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -541,6 +558,7 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub ```` ucm scratch/main> view doc.guide + doc.guide : Doc2 doc.guide = {{ @@ -560,6 +578,7 @@ scratch/main> view doc.guide }} scratch/main> display doc.guide + # Unison computable documentation # Basic formatting diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index 049fae655b..9ddb245700 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -34,6 +34,7 @@ test2 = do ``` ucm scratch/main> add + ⍟ I've added these definitions: test1 : '{IO, Exception} [Result] @@ -43,6 +44,7 @@ scratch/main> add ``` ucm :error scratch/main> io.test test1 + 💔💥 The program halted with an unhandled exception: @@ -59,6 +61,7 @@ scratch/main> io.test test1 ``` ucm :error scratch/main> io.test test2 + 💔💥 The program halted with an unhandled exception: diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index 76d9c701db..d5e50b53e5 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -23,6 +23,7 @@ timingApp2 _ = ``` ucm scratch/main> run timingApp2 + () ``` diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 96e26ccc2c..214a35e1a8 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -21,17 +21,20 @@ meh = 9 ``` ucm scratch/main> add + ⍟ I've added these definitions: meh : Nat meh.doc : Doc2 scratch/main> find meh + 1. meh : Nat 2. meh.doc : Doc2 scratch/main> docs 1 + A simple doc. ``` diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index e9164960b3..9a219a428f 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Checks for some bad type checking behavior. Some ability subtyping was diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index a89d066a46..8b491e619c 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -4,6 +4,7 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.w ``` ucm scratch/main> ls builtin.Bytes + 1. ++ (Bytes -> Bytes -> Bytes) 2. at (Nat -> Bytes -> Optional Nat) 3. decodeNat16be (Bytes -> Optional (Nat, Bytes)) @@ -121,6 +122,7 @@ And here's the full API: ``` ucm scratch/main> find-in builtin.crypto + 1. type CryptoFailure 2. Ed25519.sign.impl : Bytes -> Bytes @@ -313,10 +315,12 @@ test> crypto.hash.numTests = ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> test + Cached test results (`help testcache` to learn more) 1. blake2b_512.tests.ex1 ◉ Passed @@ -479,10 +483,12 @@ test> md5.tests.ex3 = ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> test + Cached test results (`help testcache` to learn more) 1. blake2b_512.tests.ex1 ◉ Passed diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index da94449851..acb4f83d34 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -66,12 +66,14 @@ testMvars _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] scratch/main> io.test testMvars + New test results: 1. testMvars ◉ ma should not be empty diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index 8b36d3f1d9..c75235a002 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -51,6 +51,7 @@ test = 'let ``` ucm scratch/main> add + ⍟ I've added these definitions: test : '{IO} [Result] @@ -60,6 +61,7 @@ scratch/main> add ->{Stream Result} () scratch/main> io.test test + New test results: 1. test ◉ expected 0.0 got 0.0 diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 46f2c954c2..3268f6ca36 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -11,6 +11,7 @@ socketAccept = compose reraise socketAccept.impl ``` ucm :hide scratch/main> add + ``` # Tests for network related builtins @@ -113,6 +114,7 @@ testDefaultPort _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testDefaultHost : '{IO} [Result] @@ -120,6 +122,7 @@ scratch/main> add testExplicitHost : '{IO} [Result] scratch/main> io.test testDefaultPort + New test results: 1. testDefaultPort ◉ successfully created socket @@ -200,6 +203,7 @@ testTcpConnect = 'let ``` ucm scratch/main> add + ⍟ I've added these definitions: clientThread : MVar Nat -> MVar Text -> '{IO} () @@ -207,6 +211,7 @@ scratch/main> add testTcpConnect : '{IO} [Result] scratch/main> io.test testTcpConnect + New test results: 1. testTcpConnect ◉ should have reaped what we've sown diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 3ff0fbd0f3..70fad1260e 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -82,6 +82,7 @@ serialTests = do ``` ucm scratch/main> add + ⍟ I've added these definitions: availableCases : '{IO, Exception} [Text] @@ -92,6 +93,7 @@ scratch/main> add shuffle : Nat -> [a] -> [a] scratch/main> io.test serialTests + New test results: 1. serialTests ◉ case-00 diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index e69104a161..f2f86c204b 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -33,11 +33,13 @@ casTest = do ``` ucm scratch/main> add + ⍟ I've added these definitions: casTest : '{IO} [Result] scratch/main> io.test casTest + New test results: 1. casTest ◉ CAS is successful is there were no conflicting writes @@ -95,12 +97,14 @@ promiseConcurrentTest = do ``` ucm scratch/main> add + ⍟ I've added these definitions: promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] scratch/main> io.test promiseSequentialTest + New test results: 1. promiseSequentialTest ◉ Should read a value that's been written @@ -111,6 +115,7 @@ scratch/main> io.test promiseSequentialTest Tip: Use view 1 to view the source of a test. scratch/main> io.test promiseConcurrentTest + New test results: 1. promiseConcurrentTest ◉ Reads awaits for completion of the Promise @@ -146,6 +151,7 @@ atomicUpdate ref f = ``` ucm scratch/main> add + ⍟ I've added these definitions: atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () @@ -185,6 +191,7 @@ spawnN n fa = ``` ucm scratch/main> add + ⍟ I've added these definitions: spawnN : Nat -> '{IO} a ->{IO} [a] @@ -234,11 +241,13 @@ fullTest = do ``` ucm scratch/main> add + ⍟ I've added these definitions: fullTest : '{IO} [Result] scratch/main> io.test fullTest + New test results: 1. fullTest ◉ The state of the counter is consistent 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 38a0daa03b..1908ec408c 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -96,6 +96,7 @@ mkTestCase = do ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Tree a @@ -115,6 +116,7 @@ scratch/main> add tree3 : Tree Text 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 6935196651..e2dd1265f9 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -34,6 +34,7 @@ mkTestCase = do ``` ucm scratch/main> add + ⍟ I've added these definitions: combines : ([Float], [Int], [Char]) -> Text @@ -43,6 +44,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () 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 df2d6d47b7..663027dd31 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -50,6 +50,7 @@ mkTestCase = do ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability Exit a @@ -61,6 +62,7 @@ scratch/main> add products : ([Nat], [Nat], [Nat]) -> Text 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 03d2a3e5c3..d464bf27d7 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -69,6 +69,7 @@ mkTestCase = do ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability DC r @@ -84,6 +85,7 @@ scratch/main> add suspSum : [Nat] -> Delayed Nat 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 a1afc95405..c08e80301b 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -30,6 +30,7 @@ mkTestCase = do ``` ucm scratch/main> add + ⍟ I've added these definitions: mkTestCase : '{IO, Exception} () @@ -37,6 +38,7 @@ scratch/main> add mutual1 : Nat -> Text scratch/main> run mkTestCase + () ``` diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index 1e97076515..d5adfe83b9 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -46,6 +46,7 @@ body k out v = ``` ucm scratch/main> add + ⍟ I've added these definitions: body : Nat -> TVar (Optional Nat) -> TVar Nat ->{IO} () @@ -108,6 +109,7 @@ tests = '(map spawn nats) ``` ucm scratch/main> add + ⍟ I've added these definitions: display : Nat -> Nat -> Nat -> Text @@ -116,6 +118,7 @@ scratch/main> add tests : '{IO} [Result] scratch/main> io.test tests + New test results: 1. tests ◉ verified 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 a556d9c217..7d53a6d910 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -10,6 +10,7 @@ x = 999 ``` ucm :hide scratch/main> add + ``` Now, we update that definition and define a test-watch which depends on it. @@ -48,6 +49,7 @@ We expect this 'add' to fail because the test is blocked by the update to `x`. ``` ucm :error scratch/main> add + x These definitions failed: Reason @@ -90,6 +92,7 @@ This should correctly identify `y` as a dependency and add that too. ``` ucm scratch/main> add useY + ⍟ I've added these definitions: useY : [Result] diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index a954f648a4..f92f3a645e 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -34,7 +34,9 @@ See if we can get another thread to stuff a value into a MVar ``` ucm :hide scratch/main> add + scratch/main> io.test testBasicFork + ``` ``` unison @@ -77,12 +79,14 @@ testBasicMultiThreadMVar = 'let ``` ucm scratch/main> add + ⍟ I've added these definitions: testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () scratch/main> io.test testBasicMultiThreadMVar + New test results: 1. testBasicMultiThreadMVar ◉ other thread should have incremented @@ -149,6 +153,7 @@ testTwoThreads = 'let ``` ucm scratch/main> add + ⍟ I've added these definitions: receivingThread : MVar Nat -> MVar Text -> '{IO} () @@ -157,6 +162,7 @@ scratch/main> add testTwoThreads : '{IO} [Result] scratch/main> io.test testTwoThreads + New test results: 1. testTwoThreads ◉ diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 79a283f214..f7d5796b03 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -13,6 +13,7 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----" ``` ucm :hide scratch/main> add + ``` # Using an alternative certificate store @@ -48,6 +49,7 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ucm scratch/main> add + ⍟ I've added these definitions: this_should_not_work : [Result] @@ -55,6 +57,7 @@ scratch/main> add what_should_work : ∀ _. _ -> [Result] scratch/main> io.test what_should_work + New test results: 1. what_should_work ◉ succesfully decoded self_signed_pem @@ -242,6 +245,7 @@ testCNReject _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: serverThread : MVar Nat -> Text -> '{IO} () @@ -254,6 +258,7 @@ scratch/main> add testConnectSelfSigned : '{IO} [Result] scratch/main> io.test testConnectSelfSigned + New test results: 1. testConnectSelfSigned ◉ should have reaped what we've sown @@ -263,6 +268,7 @@ scratch/main> io.test testConnectSelfSigned Tip: Use view 1 to view the source of a test. scratch/main> io.test testCAReject + New test results: 1. testCAReject ◉ correctly rejected self-signed cert @@ -272,6 +278,7 @@ scratch/main> io.test testCAReject Tip: Use view 1 to view the source of a test. scratch/main> io.test testCNReject + New test results: 1. testCNReject ◉ correctly rejected self-signed cert diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index f4eaedd2b5..41d0dfe015 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -4,6 +4,7 @@ Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding o ``` ucm scratch/main> find Utf8 + 1. builtin.Text.toUtf8 : Text -> Bytes 2. Text.fromUtf8 : Bytes ->{Exception} Text 3. builtin.Text.fromUtf8.impl : Bytes -> Either Failure Text diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index 914389b163..ef403eb433 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Some random ability stuff to ensure things work. @@ -37,6 +38,7 @@ ha = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: ability A 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 2ac5ea6698..bf0ef6187c 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -32,6 +32,7 @@ term2 _ = () ``` ucm scratch/main> add + ⍟ I've added these definitions: ability Bar @@ -40,6 +41,7 @@ scratch/main> add term2 : '{Bar, Foo} () scratch/main> names term1 + Term Hash: #8hum58rlih Names: term1 term2 diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md index 2ba38b7735..7bf617bbab 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -4,6 +4,7 @@ https://github.com/unisonweb/unison/issues/2786 ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` First we add an ability to the codebase. @@ -29,6 +30,7 @@ unique ability Channels where ``` ucm scratch/main> add + ⍟ I've added these definitions: ability Channels @@ -73,6 +75,7 @@ These should fail with a term/ctor conflict since we exclude the ability from th ``` ucm :error scratch/main> update.old patch Channels.send + x These definitions failed: Reason @@ -81,6 +84,7 @@ scratch/main> update.old patch Channels.send Tip: Use `help filestatus` to learn more. scratch/main> update.old patch thing + ⍟ I've added these definitions: Channels.send : a -> () @@ -126,6 +130,7 @@ These updates should succeed since `Channels` is a dependency. ``` ucm scratch/main> update.old.preview patch Channels.send + I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: @@ -138,6 +143,7 @@ scratch/main> update.old.preview patch Channels.send Channels.send : a ->{Channels} () scratch/main> update.old.preview patch thing + I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: @@ -156,6 +162,7 @@ We should also be able to successfully update the whole thing. ``` ucm scratch/main> update.old + ⊡ Ignored previously added definitions: Channels ⍟ I've updated these names to your new definition: @@ -169,6 +176,7 @@ scratch/main> update.old ``` ucm :hide scratch/main2> builtins.merge lib.builtins + ``` ``` unison @@ -190,6 +198,7 @@ X.x = 1 ``` ucm scratch/main2> add + ⍟ I've added these definitions: X.x : Nat @@ -222,6 +231,7 @@ This should fail with a ctor/term conflict. ``` ucm :error scratch/main2> add + x These definitions failed: Reason diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index c4ba8b15b6..ac8190a9dd 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -4,6 +4,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -36,6 +37,7 @@ it errors if there isn't a previous run ``` ucm :error scratch/main> add.run foo + ⚠️ There is no previous evaluation to save. Use `run` to evaluate @@ -45,6 +47,7 @@ scratch/main> add.run foo ``` ucm scratch/main> run is2even + true ``` @@ -54,6 +57,7 @@ unison file ``` ucm :error scratch/main> add.run is2even + ⚠️ Cannot save the last run result into `is2even` because that @@ -65,6 +69,7 @@ otherwise, the result is successfully persisted ``` ucm scratch/main> add.run foo.bar.baz + ⍟ I've added these definitions: foo.bar.baz : Boolean @@ -73,6 +78,7 @@ scratch/main> add.run foo.bar.baz ``` ucm scratch/main> view foo.bar.baz + foo.bar.baz : Boolean foo.bar.baz = true @@ -108,9 +114,11 @@ main _ = y ``` ucm scratch/main> run main + a b -> a Nat.+ b Nat.+ z 10 scratch/main> add.run result + ⍟ I've added these definitions: result : Nat -> Nat -> Nat @@ -140,6 +148,7 @@ inc x = x + 1 ``` ucm scratch/main> add inc + ⍟ I've added these definitions: inc : Nat -> Nat @@ -166,14 +175,17 @@ main _ x = inc x ``` ucm scratch/main> run main + inc scratch/main> add.run natfoo + ⍟ I've added these definitions: natfoo : Nat -> Nat scratch/main> view natfoo + natfoo : Nat -> Nat natfoo = inc @@ -204,6 +216,7 @@ main = 'y ``` ucm scratch/main> run main + 2 ``` @@ -229,11 +242,13 @@ this saves 2 to xres, rather than 100 ``` ucm scratch/main> add.run xres + ⍟ I've added these definitions: xres : Nat scratch/main> view xres + xres : Nat xres = 2 @@ -260,9 +275,11 @@ main = '5 ``` ucm :error scratch/main> run main + 5 scratch/main> add.run xres + x These definitions failed: Reason @@ -293,14 +310,17 @@ main = '5 ``` ucm scratch/main> run main + 5 scratch/main> add.run .an.absolute.name + ⍟ I've added these definitions: .an.absolute.name : Nat scratch/main> view .an.absolute.name + .an.absolute.name : Nat .an.absolute.name = 5 diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 62a80f5483..2fc25852dd 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -11,11 +12,13 @@ Apparently when we add a test watch, we add a type annotation to it, even if it ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : [Result] scratch/main> view foo + foo : [Result] foo : [Result] foo = [] diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index fade80c1d9..350620247f 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -4,6 +4,7 @@ Let's set up some definitions to start: ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -34,6 +35,7 @@ Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type X @@ -72,6 +74,7 @@ Also, `Z` is an alias for `X`. ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Z @@ -109,6 +112,7 @@ Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -148,6 +152,7 @@ Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index f4677577fe..abf29c5f7b 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -1,9 +1,11 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` ``` ucm :hide scratch/main> add + ``` The `alias.many` command can be used to copy definitions from the current namespace into your curated one. @@ -22,6 +24,7 @@ Let's try it\! ``` ucm 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 + Here's what changed in mylib : Added definitions: @@ -50,6 +53,7 @@ scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.ch 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 diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md index 9bc37bcd8f..9696a15c6c 100644 --- a/unison-src/transcripts/alias-term.output.md +++ b/unison-src/transcripts/alias-term.output.md @@ -2,13 +2,16 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtins + ``` ``` ucm project/main> alias.term lib.builtins.bug foo + Done. project/main> ls + 1. foo (a -> b) 2. lib/ (643 terms, 92 types) @@ -18,6 +21,7 @@ It won't create a conflicted name, though. ``` ucm :error project/main> alias.term lib.builtins.todo foo + ⚠️ A term by that name already exists. @@ -26,6 +30,7 @@ project/main> alias.term lib.builtins.todo foo ``` ucm project/main> ls + 1. foo (a -> b) 2. lib/ (643 terms, 92 types) @@ -35,9 +40,11 @@ You can use `debug.alias.term.force` for that. ``` ucm project/main> debug.alias.term.force lib.builtins.todo foo + Done. project/main> ls + 1. foo (a -> b) 2. foo (a -> b) 3. lib/ (643 terms, 92 types) diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md index 1767f2874f..0d8009a6a5 100644 --- a/unison-src/transcripts/alias-type.output.md +++ b/unison-src/transcripts/alias-type.output.md @@ -2,13 +2,16 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtins + ``` ``` ucm project/main> alias.type lib.builtins.Nat Foo + Done. project/main> ls + 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) @@ -18,6 +21,7 @@ It won't create a conflicted name, though. ``` ucm :error project/main> alias.type lib.builtins.Int Foo + ⚠️ A type by that name already exists. @@ -26,6 +30,7 @@ project/main> alias.type lib.builtins.Int Foo ``` ucm project/main> ls + 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) @@ -35,9 +40,11 @@ You can use `debug.alias.type.force` for that. ``` ucm project/main> debug.alias.type.force lib.builtins.Int Foo + Done. project/main> ls + 1. Foo (builtin type) 2. Foo (builtin type) 3. lib/ (643 terms, 92 types) diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index 56b28b2730..162c1b4d7e 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` This tests a variable related bug in the ANF compiler. @@ -51,6 +52,7 @@ foo _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : ∀ _. _ -> Nat diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index e611635370..557c6449b8 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -2,8 +2,11 @@ ``` ucm :hide 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. @@ -40,6 +43,7 @@ test> Any.unsafeExtract.works = ``` ucm scratch/main> add + ⍟ I've added these definitions: Any.unsafeExtract.works : [Result] diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index 76b2386517..fda7995acd 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -83,10 +84,12 @@ term = 42 ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> display term.doc + # Heading # Heading 2 diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 3c5c18dcfc..f82870e93a 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -25,6 +25,7 @@ joey.yaml.zz = 45 ``` ucm scratch/main> add + ⍟ I've added these definitions: joey.httpServer.z : ##Nat diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 531f94d3cd..5611327b52 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison :hide @@ -11,6 +12,7 @@ nested.names.x = 42 ``` ucm :hide scratch/main> add + ``` ``` api @@ -226,6 +228,7 @@ doctest.otherstuff.thing = "A different thing" ``` ucm :hide scratch/main> 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/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 4b2c0cacf8..2a427b2bf6 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -2,11 +2,17 @@ ``` ucm :hide 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 + ``` ``` api diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 8cdd90e36a..bdb963b33d 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison @@ -30,6 +31,7 @@ Here's a *README*! ``` ucm scratch/main> add + ⍟ I've added these definitions: nested.names.readme : Doc2 diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index 7477221289..f8785e9124 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison @@ -28,6 +29,7 @@ nested.names.readme = {{ I'm a readme! }} ``` ucm scratch/main> add + ⍟ I've added these definitions: nested.names.readme : Doc2 diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index e5a34881b5..89d2d0c618 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -25,8 +26,11 @@ structural ability Stream s where ``` ucm :hide 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.output.md b/unison-src/transcripts/block-on-required-update.output.md index d89fcc0cb4..63e1100021 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -4,6 +4,7 @@ Should block an `add` if it requires an update on an in-file dependency. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -25,6 +26,7 @@ x = 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: x : Nat @@ -60,6 +62,7 @@ Try to add only the new `y`. This should fail because it requires an update to ` ``` ucm :error scratch/main> add y + x These definitions failed: Reason diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md index d90a91e574..342b2c4aa0 100644 --- a/unison-src/transcripts/blocks.output.md +++ b/unison-src/transcripts/blocks.output.md @@ -2,6 +2,7 @@ ``` ucm :hide 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.output.md b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md index 89239ef01e..b4099d0cc3 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -2,6 +2,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2819 ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -26,11 +27,13 @@ hangExample = ``` ucm scratch/main> add + ⍟ I've added these definitions: hangExample : Boolean scratch/main> view hangExample + hangExample : Boolean hangExample = "a long piece of text to hang the line" == "" diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index 942980eff3..3df4f1b08b 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -2,7 +2,9 @@ The `branch` command creates a new branch. ``` ucm :hide scratch/main> project.create-empty foo + scratch/main> project.create-empty bar + ``` First, we'll create a term to include in the branches. @@ -13,9 +15,11 @@ someterm = 18 ``` ucm scratch/main> builtins.merge lib.builtins + Done. scratch/main> add + ⍟ I've added these definitions: someterm : Nat @@ -29,105 +33,125 @@ project. It can also create an empty branch. ``` ucm foo/main> branch topic1 + Done. I've created the topic1 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic1`. foo/main> branch /topic2 + Done. I've created the topic2 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic2`. foo/main> branch foo/topic3 + Done. I've created the topic3 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic3`. foo/main> branch main topic4 + Done. I've created the topic4 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic4`. foo/main> branch main /topic5 + Done. I've created the topic5 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic5`. foo/main> branch main foo/topic6 + Done. I've created the topic6 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic6`. foo/main> branch /main topic7 + Done. I've created the topic7 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic7`. foo/main> branch /main /topic8 + Done. I've created the topic8 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic8`. foo/main> branch /main foo/topic9 + Done. I've created the topic9 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic9`. foo/main> branch foo/main topic10 + Done. I've created the topic10 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic10`. foo/main> branch foo/main /topic11 + Done. I've created the topic11 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. scratch/main> branch foo/main foo/topic12 + Done. I've created the topic12 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic12`. foo/main> branch bar/topic + Done. I've created the bar/topic branch based off foo/main. bar/main> branch foo/main topic2 + Done. I've created the bar/topic2 branch based off foo/main. bar/main> branch foo/main /topic3 + Done. I've created the bar/topic3 branch based off foo/main. scratch/main> branch foo/main bar/topic4 + Done. I've created the bar/topic4 branch based off foo/main. foo/main> branch.empty empty1 + Done. I've created an empty branch foo/empty1. Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty /empty2 + Done. I've created an empty branch foo/empty2. Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty foo/empty3 + Done. I've created an empty branch foo/empty3. Tip: Use `merge /somebranch` to initialize this branch. scratch/main> branch.empty foo/empty4 + Done. I've created an empty branch foo/empty4. Tip: Use `merge /somebranch` to initialize this branch. @@ -138,6 +162,7 @@ The `branch` command can create branches named `releases/drafts/*` (because why ``` ucm foo/main> branch releases/drafts/1.2.3 + Done. I've created the releases/drafts/1.2.3 branch based off of main. @@ -145,12 +170,14 @@ foo/main> branch releases/drafts/1.2.3 `switch /main` then `merge /releases/drafts/1.2.3`. foo/main> switch /releases/drafts/1.2.3 + ``` The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. ``` ucm :error foo/main> branch releases/1.2.3 + Branch names like releases/1.2.3 are reserved for releases. Tip: to download an existing release, try @@ -159,6 +186,7 @@ foo/main> branch releases/1.2.3 Tip: to draft a new release, try `release.draft 1.2.3`. foo/main> switch /releases/1.2.3 + foo/releases/1.2.3 does not exist. ``` diff --git a/unison-src/transcripts/branch-relative-path.output.md b/unison-src/transcripts/branch-relative-path.output.md index 76b5a78c07..57773637a9 100644 --- a/unison-src/transcripts/branch-relative-path.output.md +++ b/unison-src/transcripts/branch-relative-path.output.md @@ -19,6 +19,7 @@ foo.bar = 1 ``` ucm p0/main> add + ⍟ I've added these definitions: foo : ##Nat @@ -49,40 +50,49 @@ donk.bonk = 1 ``` ucm p1/main> add + ⍟ I've added these definitions: bonk : ##Nat donk.bonk : ##Nat p1/main> fork p0/main: zzz + Done. p1/main> find zzz + 1. zzz.foo : ##Nat 2. zzz.foo.bar : ##Nat p1/main> fork p0/main:foo yyy + Done. p1/main> find yyy + 1. yyy.bar : ##Nat p0/main> fork p1/main: p0/main:p1 + Done. p0/main> ls p1 + 1. bonk (##Nat) 2. donk/ (1 term) 3. yyy/ (1 term) 4. zzz/ (2 terms) p0/main> ls p1.zzz + 1. foo (##Nat) 2. foo/ (1 term) p0/main> ls p1.yyy + 1. bar (##Nat) ``` diff --git a/unison-src/transcripts/bug-fix-4354.output.md b/unison-src/transcripts/bug-fix-4354.output.md index faa66cafe9..4869f818cc 100644 --- a/unison-src/transcripts/bug-fix-4354.output.md +++ b/unison-src/transcripts/bug-fix-4354.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index 808eabf014..33b79c0bd3 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -1,12 +1,15 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + 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 scratch/main> display doc.guide + # Unison computable documentation # Basic formatting @@ -204,6 +207,7 @@ scratch/main> display doc.guide Some text More text Zounds! scratch/main> add + ⍟ I've added these definitions: basicFormatting : Doc2 @@ -216,6 +220,7 @@ scratch/main> add sqr : Nat -> Nat scratch/main> display doc.guide + # Unison computable documentation # Basic formatting @@ -435,6 +440,7 @@ rendered = Pretty.get (docFormatConsole doc.guide) ```` ucm scratch/main> display rendered + # Unison computable documentation # Basic formatting @@ -632,11 +638,13 @@ scratch/main> display rendered Some text More text Zounds! scratch/main> add + ⍟ I've added these definitions: rendered : Annotated () (Either SpecialForm ConsoleText) scratch/main> display rendered + # Unison computable documentation # Basic formatting @@ -834,6 +842,7 @@ scratch/main> display rendered Some text More text Zounds! scratch/main> undo + Here are the changes I undid Added definitions: diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md index 5f121260ef..8147375776 100644 --- a/unison-src/transcripts/builtins-merge.output.md +++ b/unison-src/transcripts/builtins-merge.output.md @@ -2,9 +2,11 @@ The `builtins.merge` command adds the known builtins to the specified subnamespa ``` ucm scratch/main> builtins.merge builtins + Done. scratch/main> ls builtins + 1. Any (builtin type) 2. Any/ (2 terms) 3. Boolean (builtin type) diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index 250ea54602..f551b0c1a3 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -2,8 +2,11 @@ ``` ucm :hide 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 `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. @@ -89,6 +92,7 @@ test> Int.tests.conversions = ``` ucm :hide scratch/main> add + ``` ## `Nat` functions @@ -164,6 +168,7 @@ test> Nat.tests.conversions = ``` ucm :hide scratch/main> add + ``` ## `Boolean` functions @@ -192,6 +197,7 @@ test> Boolean.tests.notTable = ``` ucm :hide scratch/main> add + ``` ## `Text` functions @@ -290,6 +296,7 @@ test> Text.tests.indexOfEmoji = ``` ucm :hide scratch/main> add + ``` ## `Bytes` functions @@ -354,6 +361,7 @@ test> Bytes.tests.indexOf = ``` ucm :hide scratch/main> add + ``` ## `List` comparison @@ -373,6 +381,7 @@ test> checks [ ``` ucm :hide scratch/main> add + ``` Other list functions @@ -424,6 +433,7 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ucm :hide scratch/main> add + ``` ## Sandboxing functions @@ -491,6 +501,7 @@ openFile] ``` ucm :hide scratch/main> add + ``` ``` unison @@ -521,11 +532,13 @@ openFilesIO = do ``` ucm scratch/main> add + ⍟ I've added these definitions: openFilesIO : '{IO} [Result] scratch/main> io.test openFilesIO + New test results: 1. openFilesIO ◉ Passed @@ -571,6 +584,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ucm :hide scratch/main> add + ``` ## Run the tests @@ -579,6 +593,7 @@ Now that all the tests have been added to the codebase, let's view the test repo ``` ucm scratch/main> test + Cached test results (`help testcache` to learn more) 1. Any.test1 ◉ Passed diff --git a/unison-src/transcripts/bytesFromList.output.md b/unison-src/transcripts/bytesFromList.output.md index 0342f1682c..c1902b3c85 100644 --- a/unison-src/transcripts/bytesFromList.output.md +++ b/unison-src/transcripts/bytesFromList.output.md @@ -1,5 +1,6 @@ ``` ucm :hide 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.output.md b/unison-src/transcripts/check763.output.md index a8247b27e7..edc983d7cb 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -2,6 +2,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -24,14 +25,17 @@ scratch/main> builtins.merge ``` ucm scratch/main> add + ⍟ I've added these definitions: +-+ : Nat -> Nat -> Nat scratch/main> move.term +-+ boppitybeep + Done. scratch/main> move.term boppitybeep +-+ + Done. ``` diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index 13c6fd4f37..d5a66446c6 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -2,6 +2,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -23,6 +24,7 @@ scratch/main> builtins.merge ``` ucm scratch/main> add + ⍟ I've added these definitions: - : Nat -> Nat -> Int diff --git a/unison-src/transcripts/constructor-applied-to-unit.output.md b/unison-src/transcripts/constructor-applied-to-unit.output.md index 2a05c185c0..e425384bae 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.output.md +++ b/unison-src/transcripts/constructor-applied-to-unit.output.md @@ -1,6 +1,8 @@ ``` ucm :hide scratch/main> alias.type ##Nat Nat + scratch/main> alias.term ##Any.Any Any + ``` ``` unison diff --git a/unison-src/transcripts/contrabilities.output.md b/unison-src/transcripts/contrabilities.output.md index a871895e4b..a7e9d31724 100644 --- a/unison-src/transcripts/contrabilities.output.md +++ b/unison-src/transcripts/contrabilities.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md index b71461cf4f..c44c5d8e3e 100644 --- a/unison-src/transcripts/create-author.output.md +++ b/unison-src/transcripts/create-author.output.md @@ -1,11 +1,13 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` Demonstrating `create.author`: ``` ucm scratch/main> create.author alicecoder "Alice McGee" + Added definitions: 1. metadata.authors.alicecoder : Author @@ -15,6 +17,7 @@ scratch/main> create.author alicecoder "Alice McGee" Tip: Add License values for alicecoder under metadata. scratch/main> find alicecoder + 1. metadata.authors.alicecoder : Author 2. metadata.copyrightHolders.alicecoder : CopyrightHolder 3. metadata.authors.alicecoder.guid : GUID diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index 9bd0a0ae22..913fef7321 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -2,6 +2,7 @@ Update a member of a cycle, but retain the cycle. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,6 +29,7 @@ pong _ = !ping + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: ping : 'Nat @@ -56,6 +58,7 @@ ping _ = !pong + 3 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -66,6 +69,7 @@ scratch/main> update Done. scratch/main> view ping pong + ping : 'Nat ping _ = use Nat + diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index f11c49bc27..ee51134917 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -2,6 +2,7 @@ Update a member of a cycle with a type-preserving update, but sever the cycle. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,6 +29,7 @@ pong _ = !ping + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: ping : 'Nat @@ -56,6 +58,7 @@ ping _ = 3 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -66,6 +69,7 @@ scratch/main> update Done. scratch/main> view ping pong + ping : 'Nat ping _ = 3 diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index fb5f1e78cf..54463a2b48 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -2,6 +2,7 @@ Update a member of a cycle with a type-changing update, thus severing the cycle. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,6 +29,7 @@ pong _ = !ping + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: ping : 'Nat @@ -56,11 +58,13 @@ ping = 3 ``` ucm scratch/main> update.old + ⍟ I've updated these names to your new definition: ping : Nat scratch/main> view ping pong + ping : Nat ping = 3 diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index a9a7d17e0e..8823031601 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,6 +29,7 @@ pong _ = !ping + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: ping : 'Nat @@ -63,6 +65,7 @@ clang _ = !pong + 3 ``` ucm scratch/main> update.old ping + ⍟ I've added these definitions: clang : 'Nat @@ -73,6 +76,7 @@ scratch/main> update.old ping pong : 'Nat scratch/main> view ping pong clang + clang : 'Nat clang _ = use Nat + diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index 6b908ed7f1..0c3563708e 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide @@ -18,6 +19,7 @@ ability Ask a where ``` ucm scratch/main> add + ⍟ I've added these definitions: ability Ask a @@ -27,12 +29,15 @@ scratch/main> add y : Nat scratch/main> debug.term.abt Nat.+ + Builtin term: ##Nat.+ 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" scratch/main> debug.term.abt Some + Constructor #0 of the following type: DataDeclaration { modifier = Structural @@ -62,6 +67,7 @@ scratch/main> debug.term.abt Some } scratch/main> debug.term.abt ask + Constructor #0 of the following type: EffectDeclaration { toDataDecl = DataDeclaration @@ -90,9 +96,11 @@ scratch/main> debug.term.abt ask } scratch/main> debug.type.abt Nat + Builtin type: ##Nat scratch/main> debug.type.abt Optional + DataDeclaration { modifier = Structural , annotation = External @@ -121,6 +129,7 @@ scratch/main> debug.type.abt Optional } scratch/main> debug.type.abt Ask + EffectDeclaration { toDataDecl = DataDeclaration { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index 17fac9b18a..66c2f36ced 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -29,6 +29,7 @@ structural type a.b.Baz = Boo ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type a.b.Baz @@ -39,6 +40,7 @@ scratch/main> add a.x.three : ##Nat scratch/main> delete.term.verbose a.b.one + Removed definitions: 1. a.b.one : ##Nat @@ -47,12 +49,15 @@ scratch/main> delete.term.verbose a.b.one this change. scratch/main> alias.term a.two a.newtwo + Done. scratch/main> move.namespace a.x a.y + Done. scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -87,6 +92,7 @@ scratch/main> history □ 4. #gss5s88mo3 (start of history) scratch/main> debug.name-diff 4 1 + Kind Name Change Ref Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg Term a.y.four Added #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 1228bbe6bf..3d9fe361e3 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -14,29 +14,38 @@ 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 scratch/app1> fork text lib.text_v1 + Done. 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. ``` @@ -45,11 +54,13 @@ As such, we see two copies of `a` and two copies of `x` via these direct depende ``` ucm scratch/app1> names a + Term Hash: #gjmq673r1v Names: lib.text_v1.a lib.text_v2.a scratch/app1> names x + Term Hash: #nsmc4p1ra4 Names: lib.http_v3.x lib.http_v4.x @@ -61,24 +72,31 @@ 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 + Done. scratch/app2> delete.namespace text + Done. ``` @@ -88,11 +106,13 @@ We see neither the second indirect copy of `a` nor the indirect copy of `x` via ``` ucm scratch/app2> names a + Term Hash: #gjmq673r1v Names: lib.webutil.lib.text_v1.a scratch/app2> names x + Term Hash: #nsmc4p1ra4 Names: lib.http_v1.x lib.http_v2.x diff --git a/unison-src/transcripts/definition-diff-api.output.md b/unison-src/transcripts/definition-diff-api.output.md index b02aa136b4..bb9dba3378 100644 --- a/unison-src/transcripts/definition-diff-api.output.md +++ b/unison-src/transcripts/definition-diff-api.output.md @@ -1,11 +1,14 @@ ``` ucm diffs/main> builtins.mergeio lib.builtins + Done. diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> + Done. diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- + Done. ``` @@ -50,6 +53,7 @@ take n s = ``` ucm diffs/main> add + ⍟ I've added these definitions: ability Stream a @@ -58,6 +62,7 @@ diffs/main> add term : Nat diffs/main> branch.create new + Done. I've created the new branch based off of main. Tip: To merge your work back into the main branch, first @@ -109,6 +114,7 @@ take n s = ``` ucm diffs/new> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md index e72bab95d7..e39d8892a8 100644 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ b/unison-src/transcripts/delete-namespace-dependents-check.output.md @@ -6,6 +6,7 @@ This is a regression test, previously `delete.namespace` allowed a delete as lon ``` ucm :hide myproject/main> builtins.merge + ``` ``` unison @@ -30,18 +31,21 @@ dependent = dependency + 99 ``` ucm :error myproject/main> add + ⍟ I've added these definitions: dependent : Nat sub.dependency : Nat myproject/main> branch /new + Done. I've created the new branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /new`. myproject/new> delete.namespace sub + ⚠️ I didn't delete the namespace because the following @@ -54,6 +58,7 @@ myproject/new> delete.namespace sub without names, use delete.namespace.force myproject/new> view dependent + dependent : Nat dependent = use Nat + diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index cde3b2d81f..e27ee9f28f 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide @@ -16,12 +17,14 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 ``` ucm :hide scratch/main> add + ``` Deleting a namespace with no external dependencies should succeed. ``` ucm scratch/main> delete.namespace no_dependencies + Done. ``` @@ -30,6 +33,7 @@ Deleting a namespace with external dependencies should fail and list all depende ``` ucm :error scratch/main> delete.namespace dependencies + ⚠️ I didn't delete the namespace because the following @@ -51,6 +55,7 @@ Deleting a namespace with external dependencies should succeed when using `delet ``` ucm scratch/main> delete.namespace.force dependencies + Done. ⚠️ @@ -71,6 +76,7 @@ I should be able to view an affected dependency by number ``` ucm scratch/main> view 2 + dependents.usage2 : Nat dependents.usage2 = use Nat * @@ -82,6 +88,7 @@ Deleting the root namespace should require confirmation if not forced. ``` ucm scratch/main> delete.namespace . + ⚠️ Are you sure you want to clear away everything? @@ -89,12 +96,14 @@ scratch/main> delete.namespace . instead, or delete the current branch with `delete.branch` 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 scratch/main> history . + Note: The most recent namespace hash is immediately below this message. @@ -108,12 +117,14 @@ Deleting the root namespace shouldn't require confirmation if forced. ``` ucm 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 scratch/main> history . + Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index cba6fa8b50..3724341733 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -3,49 +3,58 @@ your working directory with each command). ``` ucm foo/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`. foo/topic> delete.branch /topic + ``` A branch need not be preceded by a forward slash. ``` ucm foo/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`. foo/topic> delete.branch topic + ``` You can precede the branch name by a project name. ``` ucm foo/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`. scratch/main> delete.branch foo/topic + ``` You can delete the only branch in a project. ``` ucm foo/main> delete.branch /main + ``` You can delete the last branch in the project, a new one will be created. ``` ucm scratch/main> delete.branch scratch/main + scratch/main> branches + Branch Remote branch 1. main 2. main2 @@ -56,8 +65,11 @@ If the the last branch isn't /main, then /main will be created. ``` ucm scratch/main2> delete.branch /main + scratch/main2> delete.branch /main2 + scratch/other> branches + Branch Remote branch 1. main 2. other diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md index 7af8d92aaa..37d8b2e350 100644 --- a/unison-src/transcripts/delete-project.output.md +++ b/unison-src/transcripts/delete-project.output.md @@ -2,6 +2,7 @@ ``` ucm scratch/main> project.create-empty foo + 🎉 I've created the project foo. 🎨 Type `ui` to explore this project's code in your browser. @@ -17,6 +18,7 @@ scratch/main> project.create-empty foo 🎉 🥳 Happy coding! scratch/main> project.create-empty bar + 🎉 I've created the project bar. 🎨 Type `ui` to explore this project's code in your browser. @@ -33,25 +35,34 @@ scratch/main> project.create-empty bar -- I can delete the project I'm currently on scratch/main> delete.project scratch + foo/main> projects + 1. bar 2. foo -- I can delete a different project foo/main> delete.project bar + foo/main> projects + 1. foo -- I can delete the last project, a new scratch project will be created foo/main> delete.project foo + project/main> projects + 1. project 2. scratch -- If the last project is scratch, a scratch2 project will be created. scratch/main> delete.project project + scratch/main> delete.project scratch + project/main> projects + 1. project 2. scratch2 diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index dbc0fd16e9..755c217dad 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -1,5 +1,6 @@ ``` ucm :error scratch/main> delete foo + ⚠️ The following names were not found in the codebase. Check your spelling. @@ -14,18 +15,22 @@ structural type Foo = Foo () ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo foo : ##Nat scratch/main> delete foo + Done. scratch/main> delete.type Foo + Done. scratch/main> delete.term Foo.Foo + Done. ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index 48f6802440..daaf290aa3 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` The delete command can delete both terms and types. @@ -11,6 +12,7 @@ exist. ``` ucm :error scratch/main> delete.verbose foo + ⚠️ The following names were not found in the codebase. Check your spelling. @@ -28,12 +30,14 @@ structural type Foo = Foo () ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo foo : Nat scratch/main> delete.verbose foo + Removed definitions: 1. foo : Nat @@ -42,6 +46,7 @@ scratch/main> delete.verbose foo this change. scratch/main> delete.verbose Foo + Removed definitions: 1. structural type Foo @@ -50,6 +55,7 @@ scratch/main> delete.verbose Foo this change. scratch/main> delete.verbose Foo.Foo + Removed definitions: 1. Foo.Foo : '#089vmor9c5 @@ -68,12 +74,14 @@ a.bar = 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: a.bar : Nat a.foo : Nat scratch/main> debug.alias.term.force a.bar a.foo + Done. ``` @@ -82,6 +90,7 @@ A delete should remove both versions of the term. ``` ucm scratch/main> delete.verbose a.foo + Removed definitions: 1. a.foo#gjmq673r1v : Nat @@ -96,6 +105,7 @@ scratch/main> delete.verbose a.foo this change. scratch/main> ls a + 1. bar (Nat) ``` @@ -109,6 +119,7 @@ structural type a.Bar = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type a.Bar @@ -116,9 +127,11 @@ scratch/main> add structural type a.Foo scratch/main> debug.alias.type.force a.Bar a.Foo + Done. scratch/main> delete.verbose a.Foo + Removed definitions: 1. structural type a.Foo#089vmor9c5 @@ -134,6 +147,7 @@ scratch/main> delete.verbose a.Foo this change. scratch/main> delete.verbose a.Foo.Foo + Removed definitions: 1. a.Foo.Foo : '#089vmor9c5 @@ -152,12 +166,14 @@ structural type foo = Foo () ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type foo foo : Nat scratch/main> delete.verbose foo + Removed definitions: 1. structural type foo @@ -178,6 +194,7 @@ c = "c" ``` ucm scratch/main> add + ⍟ I've added these definitions: a : Text @@ -185,6 +202,7 @@ scratch/main> add c : Text scratch/main> delete.verbose a b c + Removed definitions: 1. a : Text @@ -207,6 +225,7 @@ c = "c" ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo @@ -215,6 +234,7 @@ scratch/main> add c : Text scratch/main> delete.verbose a b c Foo + Removed definitions: 1. structural type Foo @@ -226,6 +246,7 @@ scratch/main> delete.verbose a b c Foo this change. scratch/main> delete.verbose Foo.Foo + Name changes: Original Changes @@ -245,11 +266,13 @@ structural type Foo = Foo () ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo scratch/main> delete.verbose Foo Foo.Foo + Removed definitions: 1. structural type Foo @@ -276,6 +299,7 @@ d = a + b + c ``` ucm :error scratch/main> add + ⍟ I've added these definitions: a : Nat @@ -285,6 +309,7 @@ scratch/main> add d : Nat scratch/main> delete.verbose a b c + ⚠️ I didn't delete the following definitions because they are @@ -308,6 +333,7 @@ h = e + f + g ``` ucm scratch/main> add + ⍟ I've added these definitions: e : Nat @@ -316,6 +342,7 @@ scratch/main> add h : Nat scratch/main> delete.verbose e f g h + Removed definitions: 1. e : Nat @@ -340,12 +367,14 @@ incrementFoo = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo incrementFoo : Foo -> Nat scratch/main> delete.verbose Foo Foo.Foo incrementFoo + Removed definitions: 1. structural type Foo @@ -368,6 +397,7 @@ h = e + f + g ``` ucm :error scratch/main> add + ⍟ I've added these definitions: e : Nat @@ -376,6 +406,7 @@ scratch/main> add h : Nat scratch/main> delete.verbose e f gg + ⚠️ The following names were not found in the codebase. Check your spelling. @@ -392,12 +423,14 @@ pong _ = 4 Nat.+ !ping ``` ucm scratch/main> add + ⍟ I've added these definitions: ping : 'Nat pong : 'Nat scratch/main> delete.verbose ping + Removed definitions: 1. ping : 'Nat @@ -406,6 +439,7 @@ scratch/main> delete.verbose ping this change. scratch/main> view pong + pong : 'Nat pong _ = use Nat + diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 4649c1c2a7..0a688cecbd 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ### `debug.file` @@ -22,6 +23,7 @@ inside.r = d ``` ucm scratch/main> debug.file + type inside.M#h37a56c5ep type outside.A#6l6krl7n4l type outside.B#eo6rj0lj1b @@ -41,6 +43,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type inside.M @@ -53,9 +56,11 @@ scratch/main> add outside.d : Boolean scratch/main> dependents q + q has no dependents. scratch/main> dependencies q + Dependencies of: q Types: @@ -72,6 +77,7 @@ scratch/main> dependencies q the above list. scratch/main> dependencies B + Dependencies of: type B, B Types: @@ -83,6 +89,7 @@ scratch/main> dependencies B the above list. scratch/main> dependencies d + Dependencies of: d Types: @@ -101,6 +108,7 @@ scratch/main> dependencies d the above list. scratch/main> dependents d + Dependents of: d Terms: diff --git a/unison-src/transcripts/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index c25e9ffb69..f1e203dd37 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Here's a couple examples: @@ -34,12 +35,14 @@ ex1 tup = ``` ucm scratch/main> add + ⍟ I've added these definitions: ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat scratch/main> view ex0 ex1 + ex0 : Nat -> Nat ex0 n = use Nat + @@ -135,12 +138,14 @@ ex5a _ = match (99 + 1, "hi") with ``` ucm scratch/main> add + ⍟ I've added these definitions: ex5 : 'Text ex5a : 'Text scratch/main> view ex5 ex5a + ex5 : 'Text ex5 _ = match 99 Nat.+ 1 with 12 -> "Hi" @@ -166,11 +171,13 @@ For clarity, the pretty-printer leaves this alone, even though in theory it coul ``` ucm scratch/main> add + ⍟ I've added these definitions: ex6 : (Nat, Nat) -> Nat scratch/main> view ex6 + ex6 : (Nat, Nat) -> Nat ex6 = cases (x, y) -> x Nat.+ y diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index a098da0639..d7154af257 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -1,9 +1,14 @@ ``` ucm :hide scratch/b1> builtins.merge lib.builtins + scratch/b2> builtins.merge lib.builtins + scratch/nsx> builtins.merge lib.builtins + scratch/main> builtins.merge lib.builtins + scratch/ns1> builtins.merge lib.builtins + ``` ``` unison :hide @@ -13,6 +18,7 @@ fslkdjflskdjflksjdf = 663 ``` ucm scratch/b1> add + ⍟ I've added these definitions: fslkdjflskdjflksjdf : Nat @@ -28,6 +34,7 @@ abc = 23 ``` ucm scratch/b2> add + ⍟ I've added these definitions: abc : Nat @@ -35,12 +42,14 @@ scratch/b2> add x : Nat scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf + Done. ``` ``` ucm scratch/main> diff.namespace /b1: /b2: + Resolved name conflicts: 1. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : Nat @@ -81,6 +90,7 @@ structural ability X a1 a2 where x : () ``` ucm scratch/ns1> add + ⍟ I've added these definitions: structural type A a @@ -92,12 +102,15 @@ scratch/ns1> add helloWorld : Text scratch/ns1> alias.term fromJust fromJust' + Done. scratch/ns1> alias.term helloWorld helloWorld2 + Done. scratch/ns1> branch /ns2 + Done. I've created the ns2 branch based off of ns1. Tip: To merge your work back into the ns1 branch, first @@ -109,6 +122,7 @@ Here's what we've done so far: ``` ucm :error scratch/main> diff.namespace .nothing /ns1: + ⚠️ The namespace scratch/main:.nothing is empty. Was there a typo? @@ -117,6 +131,7 @@ scratch/main> diff.namespace .nothing /ns1: ``` ucm :error scratch/main> diff.namespace /ns1: /ns2: + The namespaces are identical. ``` @@ -127,14 +142,17 @@ junk = "asldkfjasldkfj" ``` ucm scratch/ns1> add + ⍟ I've added these definitions: junk : Text scratch/ns1> debug.alias.term.force junk fromJust + Done. scratch/ns1> delete.term junk + Done. ``` @@ -150,6 +168,7 @@ unique type Y a b = Y a b ``` ucm scratch/ns2> update + Okay, I'm searching the branch for code that needs to be updated... @@ -160,6 +179,7 @@ scratch/ns2> update Done. scratch/main> diff.namespace /ns1: /ns2: + Resolved name conflicts: 1. ┌ fromJust#gjmq673r1v : Nat @@ -192,21 +212,27 @@ scratch/main> diff.namespace /ns1: /ns2: 15. fromJust#gjmq673r1v ┘ scratch/ns2> alias.term d d' + Done. scratch/ns2> alias.type A A' + Done. scratch/ns2> alias.term A.A A'.A + Done. scratch/ns2> alias.type X X' + Done. scratch/ns2> alias.term X.x X'.x + Done. scratch/main> diff.namespace /ns1: /ns2: + Resolved name conflicts: 1. ┌ fromJust#gjmq673r1v : Nat @@ -248,27 +274,34 @@ scratch/main> diff.namespace /ns1: /ns2: 23. X.x 24. X'.x (added) scratch/ns1> alias.type X X2 + Done. scratch/ns1> alias.term X.x X2.x + Done. scratch/ns2> alias.type A' A'' + Done. scratch/ns2> alias.term A'.A A''.A + Done. scratch/ns2> branch /ns3 + Done. I've created the ns3 branch based off of ns2. Tip: To merge your work back into the ns2 branch, first `switch /ns2` then `merge /ns3`. scratch/ns2> alias.term fromJust' yoohoo + Done. scratch/ns2> delete.term.verbose fromJust' + Name changes: Original Changes @@ -279,6 +312,7 @@ scratch/ns2> delete.term.verbose fromJust' this change. scratch/main> diff.namespace /ns3: /ns2: + Name changes: Original Changes @@ -293,12 +327,14 @@ bdependent = "banana" ``` ucm scratch/ns3> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> diff.namespace /ns2: /ns3: + Updates: 1. bdependent : Nat @@ -327,6 +363,7 @@ forconflicts = 777 ``` ucm scratch/nsx> add + ⍟ I've added these definitions: a : Nat @@ -334,12 +371,14 @@ scratch/nsx> add forconflicts : Nat scratch/nsx> branch /nsy + Done. I've created the nsy branch based off of nsx. Tip: To merge your work back into the nsx branch, first `switch /nsx` then `merge /nsy`. scratch/nsx> branch /nsz + Done. I've created the nsz branch based off of nsx. Tip: To merge your work back into the nsx branch, first @@ -353,6 +392,7 @@ a = 444 ``` ucm scratch/nsy> update + Okay, I'm searching the branch for code that needs to be updated... @@ -370,6 +410,7 @@ a = 555 ``` ucm scratch/nsz> update + Okay, I'm searching the branch for code that needs to be updated... @@ -380,21 +421,25 @@ scratch/nsz> update Done. scratch/nsy> branch /nsw + Done. I've created the nsw branch based off of nsy. Tip: To merge your work back into the nsy branch, first `switch /nsy` then `merge /nsw`. scratch/nsw> debug.alias.term.force .forconflicts .a + Done. scratch/nsw> debug.alias.term.force .forconflicts .b + Done. ``` ``` ucm scratch/main> diff.namespace /nsx: /nsw: + New name conflicts: 1. a#uiiiv8a86s : Nat @@ -414,6 +459,7 @@ scratch/main> diff.namespace /nsx: /nsw: 9. b#r3msrbpp1v (added) scratch/nsw> view a + a#mdl4vqtu00 : Nat a#mdl4vqtu00 = 444 @@ -421,6 +467,7 @@ scratch/nsw> view a a#r3msrbpp1v = 777 scratch/nsw> view b + b#r3msrbpp1v : Nat b#r3msrbpp1v = 777 @@ -452,6 +499,7 @@ x = 1 ``` ucm scratch/hashdiff> add + ⍟ I've added these definitions: x : ##Nat @@ -477,11 +525,13 @@ y = 2 ``` ucm scratch/hashdiff> add + ⍟ I've added these definitions: y : ##Nat scratch/hashdiff> history + Note: The most recent namespace hash is immediately below this message. @@ -494,6 +544,7 @@ scratch/hashdiff> history □ 2. #i52j9fd57b (start of history) scratch/hashdiff> diff.namespace 2 1 + Added definitions: 1. y : ##Nat diff --git a/unison-src/transcripts/doc-formatting.output.md b/unison-src/transcripts/doc-formatting.output.md index 5359e0921d..b9bd004682 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -4,6 +4,7 @@ Docs can be used as inline code comments. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,10 +29,12 @@ foo n = ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view foo + foo : Nat -> Nat foo n = use Nat + @@ -61,10 +64,12 @@ escaping = [: Docs look [: like \@this \:] :] ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view escaping + escaping : Doc escaping = [: Docs look [: like \@this \:] :] @@ -97,10 +102,12 @@ commented = [: ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view commented + commented : Doc commented = [: example: @@ -136,10 +143,12 @@ doc1 = [: hi :] ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc1 + doc1 : Doc doc1 = [: hi :] @@ -172,10 +181,12 @@ doc2 = [: hello ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc2 + doc2 : Doc doc2 = [: hello @@ -215,10 +226,12 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc3 + doc3 : Doc doc3 = [: When Unison identifies a paragraph, it removes any @@ -266,10 +279,12 @@ doc4 = [: Here's another example of some paragraphs. ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc4 + doc4 : Doc doc4 = [: Here's another example of some paragraphs. @@ -305,10 +320,12 @@ doc5 = [: - foo ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc5 + doc5 : Doc doc5 = [: - foo @@ -341,10 +358,12 @@ doc6 = [: ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view doc6 + doc6 : Doc doc6 = [: - foo @@ -379,10 +398,12 @@ expr = foo 1 ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view empty + empty : Doc empty = [: :] @@ -443,10 +464,12 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view test1 + test1 : Doc test1 = [: The internal logic starts to get hairy when you use the @@ -529,10 +552,12 @@ reg1363 = [: `@List.take foo` bar ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view reg1363 + reg1363 : Doc reg1363 = [: `@List.take foo` bar baz :] @@ -563,12 +588,14 @@ test2 = [: ``` ucm :hide scratch/main> add + ``` View is fine. ``` ucm scratch/main> view test2 + test2 : Doc test2 = [: Take a look at this: @@ -581,6 +608,7 @@ But note it's not obvious how display should best be handling this. At the mome ``` ucm scratch/main> display test2 + Take a look at this: foo : Nat -> Nat foo n = diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index f893a2811c..4b9affb78b 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -8,6 +8,7 @@ See https://github.com/unisonweb/unison/issues/2642 for an example. ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -29,21 +30,26 @@ docs.example4 = {{A doc that links to the {type Labels} type}} ``` ucm :hide scratch/main> add + ``` Now we check that each doc links to the object of the correct name: ``` ucm scratch/main> display docs.example1 + A doc that links to the abilityPatterns term scratch/main> display docs.example2 + A doc that links to the Patterns ability scratch/main> display docs.example3 + A doc that links to the typeLabels term scratch/main> display docs.example4 + A doc that links to the Labels type ``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 8c3a91633a..eccc38a17f 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -2,12 +2,14 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` Unison documentation is written in Unison. Documentation is a value of the following type: ``` ucm scratch/main> view lib.builtins.Doc + type lib.builtins.Doc = Blob Text | Link Link @@ -78,6 +80,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ucm scratch/main> add + ⍟ I've added these definitions: List.take.ex1 : [Nat] @@ -121,6 +124,7 @@ Let's add it to the codebase. ``` ucm scratch/main> add + ⍟ I've added these definitions: List.take.doc : Doc @@ -131,6 +135,7 @@ We can view it with `docs`, which shows the `Doc` value that is associated with ``` 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 @@ -156,6 +161,7 @@ Note that if we view the source of the documentation, the various references are ``` ucm scratch/main> view List.take + builtin lib.builtins.List.take : lib.builtins.Nat -> [a] -> [a] diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index 1e164c14ce..d8b9308728 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -115,6 +116,7 @@ Format it to check that everything pretty-prints in a valid way. ``` ucm scratch/main> debug.format + ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index e95aed2bcc..7708a8928b 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -87,10 +88,12 @@ Table ``` ucm :hide scratch/main> add + ``` ```` ucm scratch/main> debug.doc-to-markdown fulldoc + Heres some text with a soft line break hard line break diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md index d0c424546a..3efefe25d9 100644 --- a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md +++ b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md @@ -3,6 +3,7 @@ If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrad ``` ucm :hide foo/main> builtins.merge lib.builtin + ``` ``` unison @@ -30,6 +31,7 @@ mything = lib.old.foo + lib.old.foo ``` ucm foo/main> add + ⍟ I've added these definitions: lib.new.foo : Nat @@ -38,9 +40,11 @@ foo/main> add mything : Nat foo/main> upgrade old new + I upgraded old to new, and removed old. foo/main> view mything + mything : Nat mything = use Nat + diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 619288ac11..352aefb635 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Term and ability constructor collisions should cause a parse error. @@ -130,6 +131,7 @@ X = () ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type X @@ -137,6 +139,7 @@ scratch/main> add X : () scratch/main> view X + structural type X = Z X : () diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md index 12d8bbf32a..e1db509b28 100644 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ b/unison-src/transcripts/duplicate-term-detection.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Trivial duplicate terms should be detected: diff --git a/unison-src/transcripts/ed25519.output.md b/unison-src/transcripts/ed25519.output.md index bc9dbcad3d..17ce7c2215 100644 --- a/unison-src/transcripts/ed25519.output.md +++ b/unison-src/transcripts/ed25519.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index b3bd7c23ab..c9088e5c6c 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -29,6 +30,7 @@ mytest = [Ok "ok"] ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -36,6 +38,7 @@ scratch/main> add mytest : [Result] scratch/main> edit foo bar + ☝️ I added 2 definitions to the top of /private/tmp/scratch.u @@ -44,6 +47,7 @@ scratch/main> edit foo bar definitions currently in this namespace. scratch/main> edit mytest + ☝️ I added 1 definitions to the top of /private/tmp/scratch.u @@ -67,6 +71,7 @@ test> mytest = [Ok "ok"] ``` ucm :error scratch/main> edit missing + ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/edit-namespace.output.md b/unison-src/transcripts/edit-namespace.output.md index f82823a2a3..64f84fe80a 100644 --- a/unison-src/transcripts/edit-namespace.output.md +++ b/unison-src/transcripts/edit-namespace.output.md @@ -1,5 +1,6 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtin + ``` ``` unison @@ -50,6 +51,7 @@ unique type Foo = { bar : Nat, baz : Nat } ``` ucm project/main> add + ⍟ I've added these definitions: type Foo @@ -74,6 +76,7 @@ project/main> add ``` ucm project/main> edit.namespace + ☝️ I added 8 definitions to the top of scratch.u @@ -116,6 +119,7 @@ toplevel = "hi" ``` ucm project/main> edit.namespace nested simple + ☝️ I added 6 definitions to the top of scratch.u diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 6ba39dc79a..39511aec5b 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -6,19 +6,23 @@ mynamespace.x = 1 ``` ucm :hide scratch/main> add + scratch/main> delete.namespace mynamespace + ``` The deleted namespace shouldn't appear in `ls` output. ``` ucm :error scratch/main> ls + nothing to show ``` ``` ucm :error scratch/main> find.verbose + ☝️ I couldn't find matches in this namespace, searching in @@ -36,6 +40,7 @@ scratch/main> find.verbose ``` ucm :error scratch/main> find mynamespace + ☝️ I couldn't find matches in this namespace, searching in @@ -57,6 +62,7 @@ The history of the namespace should be empty. ``` ucm scratch/main> history mynamespace + Note: The most recent namespace hash is immediately below this message. @@ -75,7 +81,9 @@ stuff.thing = 2 ``` ucm :hide scratch/main> add + scratch/main> delete.namespace deleted + ``` ## fork @@ -84,6 +92,7 @@ I should be allowed to fork over a deleted namespace ``` ucm scratch/main> fork stuff deleted + Done. ``` @@ -92,6 +101,7 @@ The history from the `deleted` namespace should have been overwritten by the his ``` ucm scratch/main> history stuff + Note: The most recent namespace hash is immediately below this message. @@ -100,6 +110,7 @@ scratch/main> history stuff □ 1. #q2dq4tsno1 (start of history) scratch/main> history deleted + Note: The most recent namespace hash is immediately below this message. @@ -118,6 +129,7 @@ moveme.y = 2 ``` ucm :hide scratch/main> add + ``` I should be able to move a namespace over-top of a deleted namespace. @@ -125,9 +137,11 @@ The history should be that of the moved namespace. ``` ucm scratch/main> delete.namespace moveoverme + Done. scratch/main> history moveme + Note: The most recent namespace hash is immediately below this message. @@ -136,9 +150,11 @@ scratch/main> history moveme □ 1. #c5uisu4kll (start of history) scratch/main> move.namespace moveme moveoverme + Done. scratch/main> history moveoverme + Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index cb56e5e902..0aecd1406d 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -8,6 +8,7 @@ BEHOLD\!\!\! ``` ucm :error scratch/main> ls + nothing to show ``` @@ -16,9 +17,11 @@ Technically, the definitions all exist, but they have no names. `builtins.merge` ``` ucm scratch/main> builtins.merge lib.builtins + Done. scratch/main> ls lib + 1. builtins/ (469 terms, 74 types) ``` @@ -27,9 +30,11 @@ And for a limited time, you can get even more builtin goodies: ``` ucm scratch/main> builtins.mergeio lib.builtinsio + Done. scratch/main> ls lib + 1. builtins/ (469 terms, 74 types) 2. builtinsio/ (643 terms, 92 types) diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md index 903f8c0fcc..1721c8c699 100644 --- a/unison-src/transcripts/error-messages.output.md +++ b/unison-src/transcripts/error-messages.output.md @@ -1,5 +1,6 @@ ``` ucm :hide 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/dont-hide-unexpected-ucm-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md index 3eace7ffd1..8725a6e9a1 100644 --- a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md +++ b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md @@ -2,13 +2,16 @@ Since this code block is expecting an error, we still hide it. It seems unusual ``` ucm :hide:error scratch/main> help pull + scratch/main> not.a.command + ``` For comparison, here’s what we get without `:hide`. ``` ucm :error scratch/main> help pull + pull The `pull` command merges a remote namespace into a local branch @@ -33,6 +36,7 @@ scratch/main> help pull Project Release `@unison/base/releases/1.0.0` scratch/main> not.a.command + ⚠️ I don't know how to not.a.command. Type `help` or `?` to get help. @@ -41,7 +45,8 @@ scratch/main> not.a.command Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. But we should continue to hide the output *before* the error. ``` ucm :hide -scratch/main> help pullscratch/main> not.a.command +scratch/main> help pull +scratch/main> not.a.command ``` 🛑 diff --git a/unison-src/transcripts/errors/missing-result-typed.output.md b/unison-src/transcripts/errors/missing-result-typed.output.md index 67d150b507..2caf3b1b6c 100644 --- a/unison-src/transcripts/errors/missing-result-typed.output.md +++ b/unison-src/transcripts/errors/missing-result-typed.output.md @@ -6,6 +6,7 @@ and surface a helpful message. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide:all diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index e6415e1ab6..da84189a66 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -8,6 +8,7 @@ and surface a helpful message. ``` ucm :hide:error scratch/main> history + ``` ``` ucm :hide:error diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 55208ea082..b476e113d0 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> alias.type ##Text builtin.Text + ``` ``` unison :hide @@ -18,6 +19,7 @@ baz = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: type A @@ -26,15 +28,18 @@ scratch/main> add foo : A scratch/main> find : Text -> A + 1. bar : Text -> A 2. A.A : Text -> A scratch/main> find : A -> Text + 1. baz : A -> Text scratch/main> find : A + 1. foo : A @@ -42,6 +47,7 @@ scratch/main> find : A ``` ucm :error scratch/main> find : Text + ☝️ I couldn't find exact type matches, resorting to fuzzy diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index 0fce545203..c3eaca47e9 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison :hide @@ -14,19 +15,23 @@ somewhere.bar = 7 ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> find foo + 1. cat.foo : Nat 2. foo : Nat scratch/main> view 1 + cat.foo : Nat cat.foo = 4 scratch/main> find.all foo + 1. cat.foo : Nat 2. cat.lib.foo : Nat 3. lib.foo : Nat @@ -34,6 +39,7 @@ scratch/main> find.all foo scratch/main> view 1 + cat.foo : Nat cat.foo = 4 @@ -41,19 +47,23 @@ scratch/main> view 1 ``` ucm scratch/main> find-in cat foo + 1. foo : Nat scratch/main> view 1 + cat.foo : Nat cat.foo = 4 scratch/main> find-in.all cat foo + 1. lib.foo : Nat 2. foo : Nat scratch/main> view 1 + cat.lib.foo : Nat cat.lib.foo = 5 @@ -63,10 +73,12 @@ Finding within a namespace ``` ucm scratch/main> find bar + 1. somewhere.bar : Nat scratch/other> debug.find.global bar + Found results in scratch/main 1. .cat.lib.bar : Nat @@ -75,6 +87,7 @@ scratch/other> debug.find.global bar scratch/main> find-in somewhere bar + 1. bar : Nat @@ -82,6 +95,7 @@ scratch/main> find-in somewhere bar ``` ucm :error scratch/main> find baz + ☝️ I couldn't find matches in this namespace, searching in diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index 290b5f5154..d039c6255f 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -9,6 +9,7 @@ X.foo = "a namespace" ``` ucm scratch/main> add + ⍟ I've added these definitions: X.foo : ##Text @@ -24,6 +25,7 @@ a = "an update" ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -35,6 +37,7 @@ As of the time of this writing, the history for `X` should be a single node, `#4 ``` ucm scratch/main> history X + Note: The most recent namespace hash is immediately below this message. @@ -48,6 +51,7 @@ however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is ``` ucm :error scratch/main> history #7nl6ppokhg + 😶 I don't know of a namespace with that hash. diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md index 32224c32e3..aad592c765 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.output.md @@ -2,6 +2,7 @@ Tests that `if` statements can appear as list and tuple elements. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide diff --git a/unison-src/transcripts/fix-5267.output.md b/unison-src/transcripts/fix-5267.output.md index 8afd54082f..4000b2b315 100644 --- a/unison-src/transcripts/fix-5267.output.md +++ b/unison-src/transcripts/fix-5267.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -30,6 +31,7 @@ indirect dependency. It used to render as `direct.foo + direct.foo`. ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -37,6 +39,7 @@ scratch/main> add lib.direct.lib.indirect.foo : Nat scratch/main> view bar + bar : Nat bar = use Nat + @@ -70,6 +73,7 @@ type Bar = MkBar direct.Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Bar @@ -77,6 +81,7 @@ scratch/main> add type lib.direct.lib.indirect.Foo scratch/main> view Bar + type Bar = MkBar Foo ``` diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md index 735d96bab9..3d9010392d 100644 --- a/unison-src/transcripts/fix-5301.output.md +++ b/unison-src/transcripts/fix-5301.output.md @@ -3,6 +3,7 @@ letter) that is either not found or ambiguouus fails. Previously, it would be tr ``` ucm scratch/main> builtins.merge + Done. ``` diff --git a/unison-src/transcripts/fix-5312.output.md b/unison-src/transcripts/fix-5312.output.md index c26770f3d6..57f35a45d5 100644 --- a/unison-src/transcripts/fix-5312.output.md +++ b/unison-src/transcripts/fix-5312.output.md @@ -3,6 +3,7 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` @@ -34,6 +35,7 @@ c = b.y + 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: a.y : Nat @@ -63,6 +65,7 @@ x = 100 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md index c5fd690038..1d56f2e1c0 100644 --- a/unison-src/transcripts/fix-5320.output.md +++ b/unison-src/transcripts/fix-5320.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` diff --git a/unison-src/transcripts/fix-5323.output.md b/unison-src/transcripts/fix-5323.output.md index 5c2df6dc5c..38e8e4d729 100644 --- a/unison-src/transcripts/fix-5323.output.md +++ b/unison-src/transcripts/fix-5323.output.md @@ -3,6 +3,7 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` @@ -36,6 +37,7 @@ c = b.y + 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: a.y : Nat @@ -48,6 +50,7 @@ scratch/main> add ``` ucm scratch/main> upgrade old new + I upgraded old to new, and removed old. ``` diff --git a/unison-src/transcripts/fix-5326.output.md b/unison-src/transcripts/fix-5326.output.md index 34503a69fc..f92d88fb72 100644 --- a/unison-src/transcripts/fix-5326.output.md +++ b/unison-src/transcripts/fix-5326.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` @@ -23,12 +24,14 @@ x = 1 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch foo + Done. I've created the foo branch based off of main. Tip: To merge your work back into the main branch, first @@ -62,12 +65,14 @@ x = 2 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch bar + Done. I've created the bar branch based off of main. Tip: To merge your work back into the main branch, first @@ -103,6 +108,7 @@ x = 3 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -138,6 +144,7 @@ x = 4 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -172,6 +179,7 @@ y = 5 ``` ucm scratch/foo> update + Okay, I'm searching the branch for code that needs to be updated... @@ -193,6 +201,7 @@ D - C - B - A ``` ucm scratch/main> merge /foo + I merged scratch/foo into scratch/main. ``` @@ -211,6 +220,7 @@ F - D - C - B - A ``` ucm scratch/main> merge /bar + 😶 scratch/main was already up-to-date with scratch/bar. diff --git a/unison-src/transcripts/fix-5340.output.md b/unison-src/transcripts/fix-5340.output.md index 317f3cd506..2cecf8efc7 100644 --- a/unison-src/transcripts/fix-5340.output.md +++ b/unison-src/transcripts/fix-5340.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -28,6 +29,7 @@ lib.dep.lib.dep.foo = 18 ``` ucm scratch/main> add + ⍟ I've added these definitions: type lib.dep.lib.dep.Foo diff --git a/unison-src/transcripts/fix-5357.output.md b/unison-src/transcripts/fix-5357.output.md index 3a3a90b997..46277d2450 100644 --- a/unison-src/transcripts/fix-5357.output.md +++ b/unison-src/transcripts/fix-5357.output.md @@ -24,6 +24,7 @@ foo = ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : () @@ -52,12 +53,14 @@ lib.base.ignore _ = () ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.base.ignore : a -> () (also named util.ignore) scratch/main> edit.namespace + ☝️ I added 2 definitions to the top of scratch.u @@ -66,6 +69,7 @@ scratch/main> edit.namespace definitions currently in this namespace. scratch/main> load + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix-5369.output.md b/unison-src/transcripts/fix-5369.output.md index 48835c5043..7b9a4b51f7 100644 --- a/unison-src/transcripts/fix-5369.output.md +++ b/unison-src/transcripts/fix-5369.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,6 +29,7 @@ two.foo = "blah" ``` ucm scratch/main> add + ⍟ I've added these definitions: one.foo : Nat diff --git a/unison-src/transcripts/fix-5374.output.md b/unison-src/transcripts/fix-5374.output.md index 6d8babf064..0a19054d90 100644 --- a/unison-src/transcripts/fix-5374.output.md +++ b/unison-src/transcripts/fix-5374.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` @@ -28,6 +29,7 @@ thing = indirect.foo + indirect.foo ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.direct.foo : Nat @@ -35,6 +37,7 @@ scratch/main> add thing : Nat scratch/main> view thing + thing : Nat thing = use Nat + @@ -42,6 +45,7 @@ scratch/main> view thing foo + foo scratch/main> edit thing + ☝️ I added 1 definitions to the top of scratch.u diff --git a/unison-src/transcripts/fix-5380.output.md b/unison-src/transcripts/fix-5380.output.md index 4f24f830cd..842e4ce3a2 100644 --- a/unison-src/transcripts/fix-5380.output.md +++ b/unison-src/transcripts/fix-5380.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge lib.builtin + Done. ``` @@ -31,15 +32,18 @@ bar = ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> move.term foo qux + Done. scratch/main> view bar + bar : Nat bar = use Nat + diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md index 2d902fd498..b490a782ff 100644 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ b/unison-src/transcripts/fix-big-list-crash.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Big lists have been observed to crash, while in the garbage collection step. diff --git a/unison-src/transcripts/fix-ls.output.md b/unison-src/transcripts/fix-ls.output.md index d329b86713..3ac9a35ff7 100644 --- a/unison-src/transcripts/fix-ls.output.md +++ b/unison-src/transcripts/fix-ls.output.md @@ -1,5 +1,6 @@ ``` ucm test-ls/main> builtins.merge + Done. ``` @@ -26,15 +27,18 @@ foo.bar.subtract x y = x Int.- y ``` ucm test-ls/main> add + ⍟ I've added these definitions: foo.bar.add : Int -> Int -> Int foo.bar.subtract : Int -> Int -> Int test-ls/main> ls foo + 1. bar/ (2 terms) test-ls/main> ls 1 + 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index 22235d4814..dba0fa5e04 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -2,6 +2,7 @@ Tests that functions named `.` are rendered correctly. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,12 +29,14 @@ noop = not `.` not ``` ucm scratch/main> add + ⍟ I've added these definitions: `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean scratch/main> view noop + noop : Boolean -> Boolean noop = use Boolean not diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md index 1067f7c7ff..525943fa2e 100644 --- a/unison-src/transcripts/fix1327.output.md +++ b/unison-src/transcripts/fix1327.output.md @@ -24,16 +24,19 @@ Now `ls` returns a pair of the absolute search directory and the result relative ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : ##Nat foo : ##Nat scratch/main> ls + 1. bar (##Nat) 2. foo (##Nat) scratch/main> alias.many 1-2 .ns1_nohistory + Here's what changed in .ns1_nohistory : Added definitions: diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md index cea4e87f10..dfadcbe0ad 100644 --- a/unison-src/transcripts/fix1334.output.md +++ b/unison-src/transcripts/fix1334.output.md @@ -6,9 +6,11 @@ Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ``` ucm scratch/main> alias.type ##Nat Cat + Done. scratch/main> alias.term ##Nat.+ please_fix_763.+ + Done. ``` diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index ddf61e7518..bd8baf34bf 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,11 +29,13 @@ List.map f = ``` ucm scratch/main> add + ⍟ I've added these definitions: List.map : (i ->{g} o) -> [i] ->{g} [o] scratch/main> view List.map + List.map : (i ->{g} o) -> [i] ->{g} [o] List.map f = go acc = cases diff --git a/unison-src/transcripts/fix1421.output.md b/unison-src/transcripts/fix1421.output.md index 5e752640fe..c9db9ffe64 100644 --- a/unison-src/transcripts/fix1421.output.md +++ b/unison-src/transcripts/fix1421.output.md @@ -1,8 +1,10 @@ ``` ucm scratch/main> alias.type ##Nat Nat + Done. scratch/main> alias.term ##Nat.+ Nat.+ + Done. ``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index e3d01b3dd3..be4484f2b9 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -29,6 +30,7 @@ bar.z = x + y ``` ucm scratch/main> add + ⍟ I've added these definitions: bar.z : Nat @@ -41,6 +43,7 @@ Let's see what we have created... ``` ucm scratch/main> ls + 1. bar/ (1 term) 2. builtin/ (469 terms, 74 types) 3. foo/ (2 terms) @@ -51,6 +54,7 @@ Now, if we try deleting the namespace `foo`, we get an error, as expected. ``` ucm :error scratch/main> delete.namespace foo + ⚠️ I didn't delete the namespace because the following @@ -70,6 +74,7 @@ Any numbered arguments should refer to `bar.z`. ``` ucm scratch/main> debug.numberedArgs + 1. bar.z 2. bar.z @@ -79,9 +84,11 @@ We can then delete the dependent term, and then delete `foo`. ``` ucm scratch/main> delete.term 1 + Done. scratch/main> delete.namespace foo + Done. ``` diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index b4505a29bb..c6650efdd7 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :error diff --git a/unison-src/transcripts/fix1709.output.md b/unison-src/transcripts/fix1709.output.md index b4b1e6c579..f8f53f2e16 100644 --- a/unison-src/transcripts/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -22,6 +22,7 @@ id2 x = ``` ucm scratch/main> add + ⍟ I've added these definitions: id : x -> x diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md index 497c94f266..a9058a24a9 100644 --- a/unison-src/transcripts/fix1731.output.md +++ b/unison-src/transcripts/fix1731.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide @@ -10,6 +11,7 @@ structural ability CLI where ``` ucm :hide scratch/main> add + ``` The `input` here should parse as a wildcard, not as `CLI.input`. diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 0226cd01af..4478fa778c 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide @@ -26,15 +27,19 @@ Testing a few variations here: ``` ucm scratch/main> run main1 + () scratch/main> run main2 + () scratch/main> run main3 + () scratch/main> add + ⍟ I've added these definitions: main1 : '{IO} () @@ -43,12 +48,15 @@ scratch/main> add printLine : Text ->{IO} () scratch/main> rename.term main1 code.main1 + Done. scratch/main> rename.term main2 code.main2 + Done. scratch/main> rename.term main3 code.main3 + Done. ``` @@ -57,12 +65,15 @@ The renaming just ensures that when running `code.main1`, it has to get that mai ``` ucm scratch/main> run code.main1 + () scratch/main> run code.main2 + () scratch/main> run code.main3 + () ``` @@ -81,6 +92,7 @@ This shouldn't work since `main4` and `main5` don't have the right type. ``` ucm :error scratch/main> run main4 + 😶 I found this function: @@ -95,6 +107,7 @@ scratch/main> run main4 ``` ucm :error scratch/main> run main5 + 😶 I found this function: diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index 610ba4dc79..4d8cd94f8b 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index 3e885bc29a..f4a7b67693 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison @@ -69,6 +70,7 @@ Exception.unsafeRun! e _ = ``` ucm scratch/main> run ex + () ``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index 690309327f..5bc4be0887 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -83,6 +84,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ucm :error scratch/main> run myServer + 💔💥 I've encountered a call to builtin.bug with the following diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index a5eaf76460..7f7daecc2d 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -126,12 +127,14 @@ tests _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] scratch/main> io.test tests + New test results: 1. tests ◉ caught diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md index f33013e7c4..f6aff5c844 100644 --- a/unison-src/transcripts/fix2053.output.md +++ b/unison-src/transcripts/fix2053.output.md @@ -1,9 +1,11 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` ucm scratch/main> display List.map + f a -> let use Nat + diff --git a/unison-src/transcripts/fix2156.output.md b/unison-src/transcripts/fix2156.output.md index db73b9184d..8c0067e7c9 100644 --- a/unison-src/transcripts/fix2156.output.md +++ b/unison-src/transcripts/fix2156.output.md @@ -3,6 +3,7 @@ output/caching. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2167.output.md b/unison-src/transcripts/fix2167.output.md index 855705dddc..b4a5b52893 100644 --- a/unison-src/transcripts/fix2167.output.md +++ b/unison-src/transcripts/fix2167.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` This is just a simple transcript to regression check an ability diff --git a/unison-src/transcripts/fix2187.output.md b/unison-src/transcripts/fix2187.output.md index 0012feb4d2..819ea88d96 100644 --- a/unison-src/transcripts/fix2187.output.md +++ b/unison-src/transcripts/fix2187.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index aa93b11bd4..81fff1cc23 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -8,6 +8,7 @@ strategies. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -42,6 +43,7 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ucm scratch/main> add + ⍟ I've added these definitions: << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index fe084510ae..88cc9b13ca 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` This should not typecheck - the inline `@eval` expression uses abilities. @@ -24,6 +25,7 @@ This file should also not typecheck - it has a triple backticks block that uses ``` ucm :error scratch/main> load unison-src/transcripts/fix2238.u + Loading changes detected in unison-src/transcripts/fix2238.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md index f0c2251c95..d1932a85d6 100644 --- a/unison-src/transcripts/fix2244.output.md +++ b/unison-src/transcripts/fix2244.output.md @@ -1,11 +1,13 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` Ensure closing token is emitted by closing brace in doc eval block. ``` ucm scratch/main> load ./unison-src/transcripts/fix2244.u + Loading changes detected in ./unison-src/transcripts/fix2244.u. @@ -21,4 +23,5 @@ scratch/main> load ./unison-src/transcripts/fix2244.u ``` ucm :hide scratch/main> add + ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 9f7ae93737..073a1514ac 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -1,5 +1,6 @@ ``` ucm :hide 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: @@ -38,6 +39,7 @@ We'll make our edits in a new branch. ``` ucm scratch/a> add + ⍟ I've added these definitions: type A a b c d @@ -48,6 +50,7 @@ scratch/a> add g : A Nat Nat Nat Nat -> Nat 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 @@ -70,6 +73,7 @@ Let's do the update now, and verify that the definitions all look good and there ``` ucm scratch/a2> update + Okay, I'm searching the branch for code that needs to be updated... @@ -80,6 +84,7 @@ scratch/a2> update Done. scratch/a2> view A NeedsA f f2 f3 g + type A a b c d = A a | D d @@ -113,6 +118,7 @@ scratch/a2> view A NeedsA f f2 f3 g _ -> 43 scratch/a2> todo + You have no pending todo items. Good work! ✅ ``` @@ -123,6 +129,7 @@ Here's a test of updating a record: ``` ucm :hide scratch/r1> builtins.merge lib.builtins + ``` ``` unison @@ -153,6 +160,7 @@ combine r = uno r + dos r ``` ucm scratch/r1> add + ⍟ I've added these definitions: structural type Rec @@ -165,6 +173,7 @@ scratch/r1> add 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 @@ -206,6 +215,7 @@ And checking that after updating this record, there's nothing `todo`: ``` ucm scratch/r2> update + Okay, I'm searching the branch for code that needs to be updated... @@ -216,6 +226,7 @@ scratch/r2> update Done. scratch/r2> todo + You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md index 897cbbeec3..6d274b5d7b 100644 --- a/unison-src/transcripts/fix2268.output.md +++ b/unison-src/transcripts/fix2268.output.md @@ -4,6 +4,7 @@ a value weren't getting disambiguated. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2334.output.md b/unison-src/transcripts/fix2334.output.md index 0b1c79e8a9..c31d4d6a37 100644 --- a/unison-src/transcripts/fix2334.output.md +++ b/unison-src/transcripts/fix2334.output.md @@ -3,6 +3,7 @@ types was discarding default cases in some branches. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md index 8e6882afdb..686b0239ba 100644 --- a/unison-src/transcripts/fix2344.output.md +++ b/unison-src/transcripts/fix2344.output.md @@ -5,6 +5,7 @@ recursive. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md index 4d716911b2..55d89cf543 100644 --- a/unison-src/transcripts/fix2353.output.md +++ b/unison-src/transcripts/fix2353.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md index 99a876c556..7491255127 100644 --- a/unison-src/transcripts/fix2354.output.md +++ b/unison-src/transcripts/fix2354.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Tests that delaying an un-annotated higher-rank type gives a normal diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md index 3802986dde..98da1e1164 100644 --- a/unison-src/transcripts/fix2355.output.md +++ b/unison-src/transcripts/fix2355.output.md @@ -2,6 +2,7 @@ Tests for a loop that was previously occurring in the type checker. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :error diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md index d1a7ee435d..0e28a8d7f9 100644 --- a/unison-src/transcripts/fix2378.output.md +++ b/unison-src/transcripts/fix2378.output.md @@ -4,6 +4,7 @@ rows until a fixed point is reached. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2423.output.md b/unison-src/transcripts/fix2423.output.md index 5f8aaaef39..ca3eb4cf20 100644 --- a/unison-src/transcripts/fix2423.output.md +++ b/unison-src/transcripts/fix2423.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index 57a91cdff6..e63e29e2ad 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -20,6 +20,7 @@ should be typed in the following way: ``` ucm scratch/main> builtins.merge + Done. ``` diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index eec696ee74..647b525f40 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> alias.type ##Nat lib.base.Nat + ``` ``` unison :hide @@ -10,6 +11,7 @@ unique type foo.bar.baz.MyRecord = { ``` ucm scratch/main> add + ⍟ I've added these definitions: type foo.bar.baz.MyRecord @@ -22,6 +24,7 @@ scratch/main> add -> MyRecord scratch/main> find : Nat -> MyRecord + 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord diff --git a/unison-src/transcripts/fix2663.output.md b/unison-src/transcripts/fix2663.output.md index 87b7bbb5bd..5a0b876efe 100644 --- a/unison-src/transcripts/fix2663.output.md +++ b/unison-src/transcripts/fix2663.output.md @@ -10,6 +10,7 @@ and z would end up referring to the first p3 rather than the second. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index cb9d6b5f17..28e32ffe06 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,6 +29,7 @@ range = loop [] ``` ucm scratch/main> add + ⍟ I've added these definitions: loop : [Nat] -> Nat -> [Nat] diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index 347317ce3c..a92d386f07 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -25,6 +26,7 @@ mapWithKey f m = Tip ``` ucm scratch/main> add + ⍟ I've added these definitions: type Map k v diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md index 48c52dd339..39da527ba0 100644 --- a/unison-src/transcripts/fix2795.output.md +++ b/unison-src/transcripts/fix2795.output.md @@ -1,8 +1,10 @@ ``` ucm scratch/main> builtins.mergeio + Done. scratch/main> load unison-src/transcripts/fix2795/docs.u + Loading changes detected in unison-src/transcripts/fix2795/docs.u. @@ -16,6 +18,7 @@ scratch/main> load unison-src/transcripts/fix2795/docs.u test : Doc2 scratch/main> display test + t : Text t = "hi" t diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md index 40a907feac..84da8067a8 100644 --- a/unison-src/transcripts/fix2822.output.md +++ b/unison-src/transcripts/fix2822.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` There should be no issue having terms with an underscore-led component diff --git a/unison-src/transcripts/fix2826.output.md b/unison-src/transcripts/fix2826.output.md index 7100351042..2f78e31dc6 100644 --- a/unison-src/transcripts/fix2826.output.md +++ b/unison-src/transcripts/fix2826.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.mergeio + Done. ``` @@ -33,11 +34,13 @@ And round-trips properly. ``` ucm scratch/main> add + ⍟ I've added these definitions: doc : Doc2 scratch/main> edit doc + ☝️ I added 1 definitions to the top of scratch.u @@ -46,6 +49,7 @@ scratch/main> edit doc definitions currently in this namespace. scratch/main> load scratch.u + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index 141484ed98..39796b695d 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -2,12 +2,14 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to ``` ucm :hide scratch/main> builtins.merge + ``` First, a few \[hidden\] definitions necessary for typechecking a simple Doc2. ``` ucm scratch/main> add + ⍟ I've added these definitions: type Doc2 @@ -31,6 +33,7 @@ Hi ``` ucm scratch/main> display README + Hi ``` diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index ba59baae40..a38b21c4ec 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -2,6 +2,7 @@ Also fixes \#1519 (it's the same issue). ``` ucm scratch/main> builtins.merge + Done. ``` diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md index e9e55ee063..36fa022c82 100644 --- a/unison-src/transcripts/fix3037.output.md +++ b/unison-src/transcripts/fix3037.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Tests for an unsound case of ability checking that was erroneously being diff --git a/unison-src/transcripts/fix3171.output.md b/unison-src/transcripts/fix3171.output.md index 619479c3ee..c199b539bb 100644 --- a/unison-src/transcripts/fix3171.output.md +++ b/unison-src/transcripts/fix3171.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Tests an case where decompiling could cause function arguments to occur in the diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md index 75a972181e..b8ec85f206 100644 --- a/unison-src/transcripts/fix3196.output.md +++ b/unison-src/transcripts/fix3196.output.md @@ -1,5 +1,6 @@ ``` ucm :hide 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.output.md b/unison-src/transcripts/fix3215.output.md index 44be78ec30..ac5bf82d1a 100644 --- a/unison-src/transcripts/fix3215.output.md +++ b/unison-src/transcripts/fix3215.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Tests a case where concrete abilities were appearing multiple times in an diff --git a/unison-src/transcripts/fix3244.output.md b/unison-src/transcripts/fix3244.output.md index 75eb1e7d75..c62b6b6b10 100644 --- a/unison-src/transcripts/fix3244.output.md +++ b/unison-src/transcripts/fix3244.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` This tests an previously erroneous case in the pattern compiler. It was assuming diff --git a/unison-src/transcripts/fix3265.output.md b/unison-src/transcripts/fix3265.output.md index 1810711a41..8feb1f6a64 100644 --- a/unison-src/transcripts/fix3265.output.md +++ b/unison-src/transcripts/fix3265.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Tests cases that produced bad decompilation output previously. There diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md index ebec5bf745..937714613f 100644 --- a/unison-src/transcripts/fix3424.output.md +++ b/unison-src/transcripts/fix3424.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge lib.builtins + Done. ``` @@ -12,6 +13,7 @@ c = "World" ``` ucm scratch/main> add + ⍟ I've added these definitions: a : 'Text @@ -19,6 +21,7 @@ scratch/main> add c : Text scratch/main> run a + "Hello, World!" ``` @@ -30,6 +33,7 @@ c = "Unison" ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -40,6 +44,7 @@ scratch/main> update Done. scratch/main> run a + "Hello, Unison!" ``` diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index 4ed044b9ec..8c38248615 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison @@ -31,6 +32,7 @@ d = {{ ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type M a @@ -38,6 +40,7 @@ scratch/main> add d : Doc2 scratch/main> display d + `x -> J x` J diff --git a/unison-src/transcripts/fix3678.output.md b/unison-src/transcripts/fix3678.output.md index 81b585d867..926b65121b 100644 --- a/unison-src/transcripts/fix3678.output.md +++ b/unison-src/transcripts/fix3678.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Array comparison was indexing out of bounds. diff --git a/unison-src/transcripts/fix3752.output.md b/unison-src/transcripts/fix3752.output.md index 959a7701a3..7dce7688e1 100644 --- a/unison-src/transcripts/fix3752.output.md +++ b/unison-src/transcripts/fix3752.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` These were failing to type check before, because id was not diff --git a/unison-src/transcripts/fix3773.output.md b/unison-src/transcripts/fix3773.output.md index 737f262366..2916b94262 100644 --- a/unison-src/transcripts/fix3773.output.md +++ b/unison-src/transcripts/fix3773.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index 3667cc35dc..bd8bc7e150 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”. @@ -12,12 +13,14 @@ foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with ``` ucm scratch/main> add + ⍟ I've added these definitions: failure : Text -> context -> Failure foo : Either Failure b scratch/main> edit foo + ☝️ I added 1 definitions to the top of scratch.u @@ -26,6 +29,7 @@ scratch/main> edit foo definitions currently in this namespace. scratch/main> load scratch.u + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index 1bcbc9973f..d23edf6adf 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -40,6 +41,7 @@ allowDebug = debug [1,2,3] ``` ucm scratch/main> add + ⍟ I've added these definitions: allowDebug : Text @@ -48,6 +50,7 @@ scratch/main> add t1 : [Result] scratch/main> test + Cached test results (`help testcache` to learn more) 1. t1 ◉ Yay @@ -78,11 +81,13 @@ bool = false ``` ucm :error scratch/main> update.old + ⍟ I've updated these names to your new definition: bool : Boolean scratch/main> test + ✅ diff --git a/unison-src/transcripts/fix4280.output.md b/unison-src/transcripts/fix4280.output.md index c31afe0293..385bfd727f 100644 --- a/unison-src/transcripts/fix4280.output.md +++ b/unison-src/transcripts/fix4280.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index 23d4451d3d..014762f8d4 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Some basics: @@ -14,6 +15,7 @@ countCat = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: type Cat.Dog @@ -30,6 +32,7 @@ unique type Rat.Dog = Bird | Mouse ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index 638424a4b2..82a5314ea9 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -1,5 +1,6 @@ ``` ucm :hide myproj/main> builtins.merge + ``` ``` unison @@ -29,6 +30,7 @@ mybar = bar + bar ``` ucm :error myproj/main> add + ⍟ I've added these definitions: lib.foo0.baz : Nat @@ -38,6 +40,7 @@ myproj/main> add mybar : Nat myproj/main> upgrade foo0 foo1 + I couldn't automatically upgrade foo0 to foo1. However, I've added the definitions that need attention to the top of scratch.u. diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index 0f52664efd..e0fd544d15 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -27,6 +28,7 @@ myterm = foo + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.dep0.bonk.foo : Nat @@ -35,6 +37,7 @@ scratch/main> add myterm : Nat scratch/main> view myterm + myterm : Nat myterm = use Nat + diff --git a/unison-src/transcripts/fix4515.output.md b/unison-src/transcripts/fix4515.output.md index ec3a3f1b8a..9005c68261 100644 --- a/unison-src/transcripts/fix4515.output.md +++ b/unison-src/transcripts/fix4515.output.md @@ -1,5 +1,6 @@ ``` ucm :hide myproject/main> builtins.merge + ``` ``` unison @@ -30,6 +31,7 @@ useBar = cases ``` ucm myproject/main> add + ⍟ I've added these definitions: type Bar @@ -59,6 +61,7 @@ unique type Foo = Foo1 | Foo2 ``` ucm myproject/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4528.output.md b/unison-src/transcripts/fix4528.output.md index 8f044ba80e..3834e4ee19 100644 --- a/unison-src/transcripts/fix4528.output.md +++ b/unison-src/transcripts/fix4528.output.md @@ -1,5 +1,6 @@ ``` ucm :hide foo/main> builtins.merge + ``` ``` unison @@ -25,12 +26,14 @@ main _ = MkFoo 5 ``` ucm foo/main> add + ⍟ I've added these definitions: structural type Foo main : 'Foo foo/main> run main + MkFoo 5 ``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index 9f7508848b..3afaf86ddf 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -27,6 +28,7 @@ hey = foo.hello ``` ucm scratch/main> add + ⍟ I've added these definitions: bar.hello : Nat @@ -56,6 +58,7 @@ thing = 2 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md index 478612ee26..3746008bf4 100644 --- a/unison-src/transcripts/fix4592.output.md +++ b/unison-src/transcripts/fix4592.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index 353f1524c4..a197cd84e2 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -23,6 +24,7 @@ unique type Bugs.Zonk = Bugs ``` ucm scratch/main> add + ⍟ I've added these definitions: type Bugs.Zonk @@ -55,6 +57,7 @@ unique type Bugs = ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4711.output.md b/unison-src/transcripts/fix4711.output.md index 7e491c7c40..f74619e5f8 100644 --- a/unison-src/transcripts/fix4711.output.md +++ b/unison-src/transcripts/fix4711.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -28,12 +29,14 @@ Since this is fixed, `thisDoesNotWork` now does work. ``` ucm scratch/main> add + ⍟ I've added these definitions: thisDoesNotWork : ['{g} Int] thisWorks : 'Int scratch/main> edit thisWorks thisDoesNotWork + ☝️ I added 2 definitions to the top of scratch.u @@ -42,6 +45,7 @@ scratch/main> edit thisWorks thisDoesNotWork definitions currently in this namespace. scratch/main> load + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/fix4722.output.md b/unison-src/transcripts/fix4722.output.md index c7daf6f328..b1905abc8c 100644 --- a/unison-src/transcripts/fix4722.output.md +++ b/unison-src/transcripts/fix4722.output.md @@ -9,6 +9,7 @@ like annotations on each case. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md index 27152bee46..2101cc9cfe 100644 --- a/unison-src/transcripts/fix4731.output.md +++ b/unison-src/transcripts/fix4731.output.md @@ -17,6 +17,7 @@ structural type Void = ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Void diff --git a/unison-src/transcripts/fix4780.output.md b/unison-src/transcripts/fix4780.output.md index c5770aa455..e1aa5ae26b 100644 --- a/unison-src/transcripts/fix4780.output.md +++ b/unison-src/transcripts/fix4780.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Just a simple test case to see whether partially applied diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index 142a05a1c1..c2ff2614ba 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,12 +29,14 @@ redouble x = double x + double x ``` ucm scratch/main> add + ⍟ I've added these definitions: double : Int -> Int redouble : Int -> Int scratch/main> dependents double + Dependents of: double Terms: @@ -44,6 +47,7 @@ scratch/main> dependents double the above list. scratch/main> delete.term 1 + Done. ``` diff --git a/unison-src/transcripts/fix5055.output.md b/unison-src/transcripts/fix5055.output.md index 8cf0e386a6..31d75903ef 100644 --- a/unison-src/transcripts/fix5055.output.md +++ b/unison-src/transcripts/fix5055.output.md @@ -1,5 +1,6 @@ ``` ucm test-5055/main> builtins.merge + Done. ``` @@ -26,16 +27,19 @@ foo.subtract x y = x Int.- y ``` ucm test-5055/main> add + ⍟ I've added these definitions: foo.add : Int -> Int -> Int foo.subtract : Int -> Int -> Int test-5055/main> ls foo + 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) test-5055/main> view 1 + foo.add : Int -> Int -> Int foo.add x y = use Int + diff --git a/unison-src/transcripts/fix5076.output.md b/unison-src/transcripts/fix5076.output.md index 97536bc208..d6d992ee63 100644 --- a/unison-src/transcripts/fix5076.output.md +++ b/unison-src/transcripts/fix5076.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` Nested call to code lexer wasn’t terminating inline examples containing blocks properly. diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index 275bfba4bd..4bd68dcd66 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` ``` unison @@ -34,12 +35,14 @@ test> fix5080.tests.failure = [Fail "fail"] ``` ucm :error scratch/main> add + ⍟ I've added these definitions: fix5080.tests.failure : [Result] fix5080.tests.success : [Result] scratch/main> test + Cached test results (`help testcache` to learn more) 1. fix5080.tests.success ◉ success @@ -54,9 +57,11 @@ scratch/main> test ``` ucm scratch/main> delete.term 2 + Done. scratch/main> test + Cached test results (`help testcache` to learn more) 1. fix5080.tests.success ◉ success diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md index 9111ef9bef..8b8f135fa4 100644 --- a/unison-src/transcripts/fix5349.output.md +++ b/unison-src/transcripts/fix5349.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` Empty code blocks are invalid in Unison, but shouldn’t crash the parser. diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md index 74c60e9838..cda55d61bc 100644 --- a/unison-src/transcripts/fix614.output.md +++ b/unison-src/transcripts/fix614.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. @@ -31,6 +32,7 @@ ex1 = do ``` ucm :hide scratch/main> add + ``` This does not typecheck, we've accidentally underapplied `Stream.emit`: diff --git a/unison-src/transcripts/fix689.output.md b/unison-src/transcripts/fix689.output.md index f3247263ac..e2fb83039f 100644 --- a/unison-src/transcripts/fix689.output.md +++ b/unison-src/transcripts/fix689.output.md @@ -2,6 +2,7 @@ Tests the fix for https://github.com/unisonweb/unison/issues/689 ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 42eee96662..375c6031e5 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -26,6 +27,7 @@ structural ability Abort where ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability Abort diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md index 02bab5c080..17915b7555 100644 --- a/unison-src/transcripts/fix845.output.md +++ b/unison-src/transcripts/fix845.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Add `List.zonk` to the codebase: @@ -28,6 +29,7 @@ Text.zonk txt = txt ++ "!! " ``` ucm :hide 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.output.md b/unison-src/transcripts/fix849.output.md index 750dc80402..7d725d160a 100644 --- a/unison-src/transcripts/fix849.output.md +++ b/unison-src/transcripts/fix849.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` See [this ticket](https://github.com/unisonweb/unison/issues/849). diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index 41ac3175d7..50731c9293 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` First we add some code: @@ -27,6 +28,7 @@ z = y + 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: x : Nat @@ -57,6 +59,7 @@ x = 7 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -67,6 +70,7 @@ scratch/main> update Done. scratch/main> view x y z + x : Nat x = 7 @@ -110,11 +114,13 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ucm scratch/main> add + ⍟ I've added these definitions: t1 : [Result] scratch/main> test + Cached test results (`help testcache` to learn more) 1. t1 ◉ great diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index 54ef23c45b..4fb18e42c0 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` First we'll add a definition: @@ -32,6 +33,7 @@ Add it to the codebase: ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability DeathStar @@ -63,6 +65,7 @@ spaceAttack2 x = ``` ucm scratch/main> add + ⍟ I've added these definitions: spaceAttack2 : x ->{DeathStar} Text diff --git a/unison-src/transcripts/formatter.output.md b/unison-src/transcripts/formatter.output.md index b02f196653..aac9cba15e 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -89,6 +90,7 @@ with a strike-through block~ ``` ucm scratch/main> debug.format + ``` ``` unison :added-by-ucm scratch.u @@ -205,4 +207,5 @@ brokenDoc = {{ hello }} + 1 ``` ucm scratch/main> debug.format + ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index c86d65c76b..1642a95bf3 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -5,6 +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 scratch/main> move.term + `move.term foo bar` renames `foo` to `bar`. ``` @@ -13,6 +14,7 @@ opening an empty fuzzy-select. ``` ucm :error scratch/empty> view + ⚠️ Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 @@ -28,12 +30,14 @@ Definition args ``` ucm scratch/main> add + ⍟ I've added these definitions: nested.optionTwo : ##Nat optionOne : ##Nat scratch/main> debug.fuzzy-options view _ + Select a definition to view: * optionOne * nested.optionTwo @@ -44,10 +48,12 @@ Namespace args ``` ucm scratch/main> add + ⊡ Ignored previously added definitions: nested.optionTwo optionOne scratch/main> debug.fuzzy-options find-in _ + Select a namespace: * nested @@ -57,12 +63,14 @@ Project Branch args ``` ucm 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`. scratch/main> debug.fuzzy-options switch _ + Select a project or branch to switch to: * myproject/main * myproject/mybranch diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index e062fa24fd..ab3c7d4fe9 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -2,6 +2,7 @@ ``` ucm :hide 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. @@ -46,11 +47,13 @@ Let's go ahead and add that to the codebase, then make sure it's there: ``` ucm scratch/main> add + ⍟ I've added these definitions: x : Nat scratch/main> view x + x : Nat x = 42 @@ -70,6 +73,7 @@ This works for `ucm` blocks as well. ``` ucm :hide 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/help.output.md b/unison-src/transcripts/help.output.md index 1d3c1e6e59..914d727c47 100644 --- a/unison-src/transcripts/help.output.md +++ b/unison-src/transcripts/help.output.md @@ -2,6 +2,7 @@ ``` ucm scratch/main> help + add `add` adds to the codebase all the definitions from the most recently typechecked file. @@ -880,6 +881,7 @@ scratch/main> help `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. scratch/main> help-topics + 🌻 Here's a list of topics I can tell you more about: @@ -894,6 +896,7 @@ scratch/main> help-topics Example: use `help-topics filestatus` to learn more about that topic. scratch/main> help-topic filestatus + 📓 Here's a list of possible status messages you might see for @@ -924,6 +927,7 @@ scratch/main> help-topic filestatus selected. scratch/main> help-topic messages.disallowedAbsolute + 🤖 Although I can understand absolute (ex: .foo.bar) or relative @@ -935,6 +939,7 @@ scratch/main> help-topic messages.disallowedAbsolute temporarily (like `exports.blah.foo`) and then use `move.*`. scratch/main> help-topic namespaces + 🧐 There are two kinds of namespaces, absolute, such as (.foo.bar @@ -960,6 +965,7 @@ scratch/main> help-topic namespaces answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 scratch/main> help-topic projects + A project is a versioned collection of code that can be edited, published, and depended on other projects. Unison projects are analogous to Git repositories. @@ -980,6 +986,7 @@ scratch/main> help-topic projects https://unison-lang.org/learn/projects scratch/main> help-topic remotes + 🤖 Local projects may be associated with at most one remote @@ -994,6 +1001,7 @@ scratch/main> help-topic remotes the relationship will be established on the first `push`. scratch/main> help-topic testcache + 🎈 Unison caches the results of test> watch expressions. Since diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index b6f8225015..0a7b54486d 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -2,8 +2,11 @@ This transcript does some testing of higher-rank types. Regression tests related ``` ucm :hide 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: @@ -147,11 +150,13 @@ We should be able to add and view records with higher-rank fields. ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type HigherRanked scratch/main> view HigherRanked + structural type HigherRanked = HigherRanked (∀ a. a -> a) ``` diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md index d75ff85e69..4be7bfc8b4 100644 --- a/unison-src/transcripts/input-parse-errors.output.md +++ b/unison-src/transcripts/input-parse-errors.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison :hide @@ -10,12 +11,14 @@ x = 55 ``` ucm :hide scratch/main> add + ``` `handleNameArg` parse error in `add` ``` ucm :error scratch/main> add . + ⚠️ Sorry, I wasn’t sure how to process your request: @@ -30,17 +33,21 @@ scratch/main> add . You can run `help add` for more information on using `add`. scratch/main> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> add 1 + scratch/main> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> add 2 + ⊡ Ignored previously added definitions: x ``` @@ -66,6 +73,7 @@ aliasMany: skipped -- similar to `add` ``` ucm :error scratch/main> update arg + ⚠️ Sorry, I wasn’t sure how to process your request: diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index 66cae88e83..f079c525e4 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` The `io.test` command should run all of the tests within the current namespace, excluding libs. @@ -21,12 +22,14 @@ lib.ioAndExceptionTestInLib = do ``` ucm :hide scratch/main> add + ``` Run a IO tests one by one ``` ucm scratch/main> io.test ioAndExceptionTest + New test results: 1. ioAndExceptionTest ◉ Success @@ -36,6 +39,7 @@ scratch/main> io.test ioAndExceptionTest Tip: Use view 1 to view the source of a test. scratch/main> io.test ioTest + New test results: 1. ioTest ◉ Success @@ -50,6 +54,7 @@ scratch/main> io.test ioTest ``` ucm scratch/main> io.test ioAndExceptionTest + New test results: 1. ioAndExceptionTest ◉ Success @@ -64,6 +69,7 @@ scratch/main> io.test ioAndExceptionTest ``` ucm scratch/main> io.test.all + diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index dc5af467e5..ef5a8e5c85 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -2,9 +2,13 @@ ``` ucm :hide 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. @@ -18,6 +22,7 @@ create a scratch directory which will automatically get cleaned up. ``` ucm :hide scratch/main> add + ``` ## Basic File Functions @@ -73,11 +78,13 @@ testCreateRename _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testCreateRename : '{IO} [Result] scratch/main> io.test testCreateRename + New test results: 1. testCreateRename ◉ create a foo directory @@ -156,11 +163,13 @@ testOpenClose _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testOpenClose : '{IO} [Result] scratch/main> io.test testOpenClose + New test results: 1. testOpenClose ◉ file should be open @@ -247,11 +256,13 @@ testGetSomeBytes _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testGetSomeBytes : '{IO} [Result] scratch/main> io.test testGetSomeBytes + New test results: 1. testGetSomeBytes ◉ chunk size splits data into 2 uneven sides @@ -356,12 +367,14 @@ testAppend _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testAppend : '{IO} [Result] testSeek : '{IO} [Result] scratch/main> io.test testSeek + New test results: 1. testSeek ◉ seeked @@ -377,6 +390,7 @@ scratch/main> io.test testSeek Tip: Use view 1 to view the source of a test. scratch/main> io.test testAppend + New test results: 1. testAppend ◉ should be able to read our temporary file @@ -414,11 +428,13 @@ testSystemTime _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testSystemTime : '{IO} [Result] scratch/main> io.test testSystemTime + New test results: 1. testSystemTime ◉ systemTime should be sane @@ -443,11 +459,13 @@ testGetTempDirectory _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testGetTempDirectory : '{IO} [Result] scratch/main> io.test testGetTempDirectory + New test results: 1. testGetTempDirectory ◉ Temp directory is directory @@ -473,11 +491,13 @@ testGetCurrentDirectory _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testGetCurrentDirectory : '{IO} [Result] scratch/main> io.test testGetCurrentDirectory + New test results: 1. testGetCurrentDirectory ◉ Current directory is directory @@ -505,11 +525,13 @@ testDirContents _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testDirContents : '{IO} [Result] scratch/main> io.test testDirContents + New test results: 1. testDirContents ◉ directory size should be @@ -537,11 +559,13 @@ testGetEnv _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: testGetEnv : '{IO} [Result] scratch/main> io.test testGetEnv + New test results: 1. testGetEnv ◉ PATH environent variable should be set @@ -591,6 +615,7 @@ Test that they can be run with the right number of args. ``` ucm scratch/main> add + ⍟ I've added these definitions: testGetArgs.fail : Text -> Failure @@ -599,12 +624,15 @@ scratch/main> add testGetArgs.runMeWithTwoArgs : '{IO, Exception} () scratch/main> run runMeWithNoArgs + () scratch/main> run runMeWithOneArg foo + () scratch/main> run runMeWithTwoArgs foo bar + () ``` @@ -613,6 +641,7 @@ Calling our examples with the wrong number of args will error. ``` ucm :error scratch/main> run runMeWithNoArgs foo + 💔💥 The program halted with an unhandled exception: @@ -626,6 +655,7 @@ scratch/main> run runMeWithNoArgs foo ``` ucm :error scratch/main> run runMeWithOneArg + 💔💥 The program halted with an unhandled exception: @@ -639,6 +669,7 @@ scratch/main> run runMeWithOneArg ``` ucm :error scratch/main> run runMeWithOneArg foo bar + 💔💥 The program halted with an unhandled exception: @@ -653,6 +684,7 @@ scratch/main> run runMeWithOneArg foo bar ``` ucm :error scratch/main> run runMeWithTwoArgs + 💔💥 The program halted with an unhandled exception: @@ -675,11 +707,13 @@ testTimeZone = do ``` ucm scratch/main> add + ⍟ I've added these definitions: testTimeZone : '{IO} () scratch/main> run testTimeZone + () ``` @@ -697,11 +731,13 @@ testRandom = do ``` ucm scratch/main> add + ⍟ I've added these definitions: testRandom : '{IO} [Result] scratch/main> io.test testGetEnv + New test results: 1. testGetEnv ◉ PATH environent variable should be set diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index 1168182888..df826609c7 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ## A type param cannot have conflicting kind constraints within a single decl diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index 4a33b8c37e..36446ea285 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -2,6 +2,7 @@ ``` ucm :hide 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: @@ -27,6 +28,7 @@ isEmpty x = match x with ``` ucm :hide scratch/main> add + ``` Here's the same function written using `cases` syntax: @@ -55,6 +57,7 @@ Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpt ``` ucm scratch/main> view isEmpty + isEmpty : [t] -> Boolean isEmpty = cases [] -> true @@ -80,6 +83,7 @@ merge xs ys = match (xs, ys) with ``` ucm scratch/main> add + ⍟ I've added these definitions: merge : [a] -> [a] -> [a] @@ -116,6 +120,7 @@ Notice that Unison detects this as an alias of `merge`, and if we view `merge` ``` ucm scratch/main> view merge + merge : [a] -> [a] -> [a] merge = cases [], ys -> ys @@ -203,11 +208,13 @@ merge3 = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: merge3 : [a] -> [a] -> [a] scratch/main> view merge3 + merge3 : [a] -> [a] -> [a] merge3 = cases [], ys -> ys diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index a8fc578c98..e0b06117df 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio + ``` ``` unison :hide @@ -30,6 +31,7 @@ test> z = let ``` ucm scratch/main> debug.lsp.fold-ranges + 《{{ Type doc }}》 《structural type Optional a = diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md index 0040e7316f..2d2d58eb2f 100644 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ b/unison-src/transcripts/lsp-name-completion.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` ``` unison :hide @@ -17,6 +18,7 @@ other = "other" ``` ucm :hide scratch/main> add + ``` Completion should find all the `foldMap` definitions in the codebase, @@ -27,6 +29,7 @@ prioritizing exact matches over partial matches. We don't have any control over ``` ucm scratch/main> debug.lsp-name-completion foldMap + Matching Path Name Hash foldMap foldMap #o38ps8p4q6 foldMapWith foldMapWith #r9rs4mcb0m @@ -40,6 +43,7 @@ Should still find the term which has a matching hash to a better name if the bet ``` ucm scratch/main> debug.lsp-name-completion transitive_same_hash.foldMap + Matching Path Name Hash transitive_same_hash.foldMap lib.dep.lib.transitive_same_hash.foldMap #o38ps8p4q6 diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index a450e8a4b7..037bef8309 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -5,10 +5,12 @@ branch. For example, to merge `topic` into `main`, switch to `main` and run `mer ``` ucm scratch/main> help merge + merge `merge /branch` merges `branch` into the current branch scratch/main> help merge.commit + merge.commit (or commit.merge) `merge.commit` merges a temporary branch created by the `merge` command back into its parent branch, and removes the @@ -30,10 +32,12 @@ contains both additions. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's adds: @@ -45,7 +49,9 @@ foo = "alices foo" ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's adds: @@ -57,15 +63,18 @@ bar = "bobs bar" ``` ucm :hide scratch/bob> add + ``` Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar + bar : Text bar = "bobs bar" @@ -76,6 +85,7 @@ scratch/alice> view foo bar ``` ucm :hide scratch/main> project.delete scratch + ``` ## Basic merge: two identical adds @@ -84,7 +94,9 @@ If Alice and Bob also happen to add the same definition, that's not a conflict. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/main> branch alice + ``` Alice's adds: @@ -96,7 +108,9 @@ foo = "alice and bobs foo" ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's adds: @@ -111,15 +125,18 @@ bar = "bobs bar" ``` ucm :hide scratch/bob> add + ``` Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar + bar : Text bar = "bobs bar" @@ -130,6 +147,7 @@ scratch/alice> view foo bar ``` ucm :hide scratch/main> project.delete scratch + ``` ## Simple update propagation @@ -138,6 +156,7 @@ Updates that occur in one branch are propagated to the other. In this example, A ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -149,7 +168,9 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's updates: @@ -161,7 +182,9 @@ foo = "new foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's adds: @@ -173,21 +196,25 @@ bar = foo ++ " - " ++ foo ``` ucm scratch/bob> display bar + "old foo - old foo" ``` ``` ucm :hide scratch/bob> add + ``` Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar + bar : Text bar = use Text ++ @@ -197,12 +224,14 @@ scratch/alice> view foo bar foo = "new foo" scratch/alice> display bar + "old foo - old foo" ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## Update propagation with common dependent @@ -213,6 +242,7 @@ Let's see an example. We have `foo`, which depends on `bar` and `baz`. Alice upd ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -230,7 +260,9 @@ baz = "old baz" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's updates: @@ -242,16 +274,19 @@ bar = "alices bar" ``` ucm :hide scratch/alice> update + ``` ``` ucm scratch/alice> display foo + "foo - alices bar - old baz" ``` ``` ucm :hide scratch/main> branch bob + ``` Bob's updates: @@ -263,10 +298,12 @@ baz = "bobs baz" ``` ucm :hide scratch/bob> update + ``` ``` ucm scratch/bob> display foo + "foo - old bar - bobs baz" ``` @@ -275,9 +312,11 @@ Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz + bar : Text bar = "alices bar" @@ -290,12 +329,14 @@ scratch/alice> view foo bar baz "foo" ++ " - " ++ bar ++ " - " ++ baz scratch/alice> display foo + "foo - alices bar - bobs baz" ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## Propagating an update to an update @@ -304,6 +345,7 @@ Of course, it's also possible for Alice's update to propagate to one of Bob's up ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -321,16 +363,19 @@ baz = "old baz" ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> display foo + "old foo - old bar - old baz" ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's updates: @@ -342,16 +387,19 @@ baz = "alices baz" ``` ucm :hide scratch/alice> update + ``` ``` ucm scratch/alice> display foo + "old foo - old bar - alices baz" ``` ``` ucm :hide scratch/main> branch bob + ``` Bob's updates: @@ -363,10 +411,12 @@ bar = "bobs bar" ++ " - " ++ baz ``` ucm :hide scratch/bob> update + ``` ``` ucm scratch/bob> display foo + "old foo - bobs bar - old baz" ``` @@ -375,9 +425,11 @@ Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz + bar : Text bar = use Text ++ @@ -392,12 +444,14 @@ scratch/alice> view foo bar baz "old foo" ++ " - " ++ bar scratch/alice> display foo + "old foo - bobs bar - alices baz" ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## Update + delete isn't (currently) a conflict @@ -406,6 +460,7 @@ We don't currently consider "update + delete" a conflict like Git does. In this ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -417,7 +472,9 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's updates: @@ -429,13 +486,16 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's changes: ``` ucm scratch/bob> delete.term foo + Done. ``` @@ -444,9 +504,11 @@ Merge result: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo + foo : Text foo = "alices foo" @@ -454,6 +516,7 @@ scratch/alice> view foo ``` ucm :hide scratch/main> project.delete scratch + ``` In a future version, we'd like to give the user a warning at least. @@ -464,12 +527,14 @@ Library dependencies don't cause merge conflicts, the library dependencies are j ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Alice's adds: ``` ucm :hide scratch/main> branch alice + ``` ``` unison :hide @@ -485,7 +550,9 @@ lib.bothDifferent.baz = 19 ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's adds: @@ -503,15 +570,18 @@ lib.bothDifferent.baz = 21 ``` ucm :hide scratch/bob> add + ``` Merge result: ``` ucm scratch/alice> merge bob + I merged scratch/bob into scratch/alice. scratch/alice> view foo bar baz + lib.alice.foo : Nat lib.alice.foo = 17 @@ -531,6 +601,7 @@ scratch/alice> view foo bar baz ``` ucm :hide scratch/main> project.delete scratch + ``` ## No-op merge (Bob = Alice) @@ -539,22 +610,26 @@ If Bob is equals Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/alice> merge /bob + 😶 scratch/alice was already up-to-date with scratch/bob. @@ -563,6 +638,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ## No-op merge (Bob \< Alice) @@ -571,16 +647,19 @@ If Bob is behind Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -597,11 +676,13 @@ foo = "foo" ``` ucm scratch/alice> add + ⍟ I've added these definitions: foo : Text scratch/alice> merge /bob + 😶 scratch/alice was already up-to-date with scratch/bob. @@ -610,6 +691,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ## Fast-forward merge (Bob \> Alice) @@ -618,16 +700,19 @@ If Bob is ahead of Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -644,29 +729,34 @@ foo = "foo" ``` ucm scratch/bob> add + ⍟ I've added these definitions: foo : Text scratch/alice> merge /bob + I fast-forward merged scratch/bob into scratch/alice. ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## No-op merge: merge empty namespace into empty namespace ``` ucm scratch/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`. scratch/main> merge /topic + 😶 scratch/main was already up-to-date with scratch/topic. @@ -675,6 +765,7 @@ scratch/main> merge /topic ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: someone deleted something @@ -687,6 +778,7 @@ In this example, Alice deletes `foo`, while Bob adds a new dependent of `foo`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -698,19 +790,23 @@ foo = "foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's delete: ``` ucm scratch/alice> delete.term foo + Done. ``` ``` ucm :hide scratch/main> branch bob + ``` Bob's new code that depends on `foo`: @@ -722,11 +818,13 @@ bar = foo ++ " - " ++ foo ``` ucm :error scratch/bob> add + ⍟ I've added these definitions: bar : Text scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -755,6 +853,7 @@ bar = ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: type error @@ -765,6 +864,7 @@ In this example, Alice updates a `Text` to a `Nat`, while Bob adds a new depende ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -776,7 +876,9 @@ foo = "foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's update: @@ -788,7 +890,9 @@ foo = 100 ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's new definition: @@ -800,10 +904,12 @@ bar = foo ++ " - " ++ foo ``` ucm :hide scratch/bob> update + ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -832,6 +938,7 @@ bar = ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: simple term conflict @@ -841,6 +948,7 @@ are presented to the user to resolve. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -855,7 +963,9 @@ bar = "old bar" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's changes: @@ -873,7 +983,9 @@ qux = "alices qux depends on alices foo" ++ foo ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's changes: @@ -888,10 +1000,12 @@ baz = "bobs baz" ``` ucm :hide scratch/bob> update + ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -931,6 +1045,7 @@ qux = ``` ucm scratch/merge-bob-into-alice> view bar baz + bar : Text bar = "alices bar" @@ -941,6 +1056,7 @@ scratch/merge-bob-into-alice> view bar baz ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: simple type conflict @@ -949,6 +1065,7 @@ Ditto for types; if the hashes don't match, it's a conflict. In this example, Al ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -959,7 +1076,9 @@ unique type Foo = MkFoo Nat ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's changes: @@ -970,7 +1089,9 @@ unique type Foo = MkFoo Nat Nat ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's changes: @@ -981,10 +1102,12 @@ unique type Foo = MkFoo Nat Text ``` ucm :hide scratch/bob> update + ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1014,6 +1137,7 @@ type Foo = MkFoo Nat Text ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: type-update + constructor-rename conflict @@ -1022,6 +1146,7 @@ We model the renaming of a type's constructor as an update, so if Alice updates ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -1032,7 +1157,9 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's changes `Baz Nat` to `Baz Nat Nat` @@ -1043,19 +1170,23 @@ unique type Foo = Baz Nat Nat | Qux Text ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's renames `Qux` to `BobQux`: ``` ucm scratch/bob> move.term Foo.Qux Foo.BobQux + Done. ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1085,6 +1216,7 @@ type Foo = BobQux Text | Baz Nat ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: constructor-rename conflict @@ -1093,6 +1225,7 @@ Here is another example demonstrating that constructor renames are modeled as up ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -1103,31 +1236,37 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's rename: ``` ucm scratch/alice> move.term Foo.Baz Foo.Alice + Done. ``` ``` ucm :hide scratch/main> branch bob + ``` Bob's rename: ``` ucm scratch/bob> move.term Foo.Qux Foo.Bob + Done. ``` ``` ucm :error scratch/alice> merge bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1157,6 +1296,7 @@ type Foo = Bob Text | Baz Nat ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: non-constructor/constructor conflict @@ -1165,10 +1305,12 @@ A constructor on one side can conflict with a regular term definition on the oth ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's additions: @@ -1180,7 +1322,9 @@ my.cool.thing = 17 ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's additions: @@ -1192,10 +1336,12 @@ unique ability my.cool where ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1226,6 +1372,7 @@ ability my.cool where thing : Nat ->{cool} Nat ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge failure: type/type conflict with term/constructor conflict @@ -1234,6 +1381,7 @@ Here's a subtle situation where a new type is added on each side of the merge, a ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -1245,7 +1393,9 @@ Foo.Bar = 17 ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice adds this type `Foo` with constructor `Foo.Alice`: @@ -1256,13 +1406,16 @@ unique type Foo = Alice Nat ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob adds the type `Foo` with constructor `Foo.Bar`, replacing the original `Foo.Bar` term: ``` ucm scratch/bob> delete.term Foo.Bar + Done. ``` @@ -1273,12 +1426,14 @@ unique type Foo = Bar Nat Nat ``` ucm :hide scratch/bob> add + ``` These won't cleanly merge. ``` ucm :error scratch/alice> merge bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1312,12 +1467,14 @@ type Foo = Bar Nat Nat ``` ucm :hide scratch/main> project.delete scratch + ``` Here's a more involved example that demonstrates the same idea. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` In the LCA, we have a type with two constructors, and some term. @@ -1333,23 +1490,30 @@ Foo.Bar.Hello = 17 ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice deletes this type entirely, and repurposes its constructor names for other terms. She also updates the term. ``` ucm :hide scratch/alice> delete.type Foo + scratch/alice> delete.term Foo.Bar.Baz + scratch/alice> delete.term Foo.Bar.Qux + ``` ``` ucm :hide scratch/alice> update + ``` ``` ucm scratch/alice> view Foo.Bar.Baz Foo.Bar.Qux Foo.Bar.Hello + Foo.Bar.Baz : Nat Foo.Bar.Baz = 100 @@ -1365,13 +1529,18 @@ Bob, meanwhile, first deletes the term, then sort of deletes the type and re-add ``` ucm :hide scratch/main> branch bob + scratch/bob> delete.term Foo.Bar.Hello + scratch/bob> move.type Foo Foo.Bar + scratch/bob> move.term Foo.Bar.Qux Foo.Bar.Hello + ``` ``` ucm scratch/bob> view Foo.Bar + type Foo.Bar = Baz Nat | Hello Nat Nat ``` @@ -1382,6 +1551,7 @@ Notably, Alice's "unconflicted" update on the name "Foo.Bar.Baz" (because she ch ``` ucm :error scratch/alice> merge bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1416,6 +1586,7 @@ type Foo.Bar = Baz Nat | Hello Nat Nat ``` ucm :hide scratch/main> project.delete scratch + ``` ## Merge algorithm quirk: add/add unique types @@ -1428,10 +1599,12 @@ We will resolve this situation automatically in a future version. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's additions: @@ -1445,7 +1618,9 @@ alice _ = 18 ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's additions: @@ -1459,10 +1634,12 @@ bob _ = 19 ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1503,6 +1680,7 @@ bob _ = 19 ``` ucm :hide scratch/main> project.delete scratch + ``` ## `merge.commit` example (success) @@ -1512,6 +1690,7 @@ After merge conflicts are resolved, you can use `merge.commit` rather than `swit ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -1523,7 +1702,9 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's changes: @@ -1535,7 +1716,9 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's changes: @@ -1549,10 +1732,12 @@ Attempt to merge: ``` ucm :hide scratch/bob> update + ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -1605,20 +1790,24 @@ foo = "alice and bobs foo" ``` ucm scratch/merge-bob-into-alice> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/merge-bob-into-alice> merge.commit + I fast-forward merged scratch/merge-bob-into-alice into scratch/alice. scratch/alice> view foo + foo : Text foo = "alice and bobs foo" scratch/alice> branches + Branch Remote branch 1. alice 2. bob @@ -1628,6 +1817,7 @@ scratch/alice> branches ``` ucm :hide scratch/main> project.delete scratch + ``` ## `merge.commit` example (failure) @@ -1636,10 +1826,12 @@ scratch/main> project.delete scratch ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm scratch/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 @@ -1649,12 +1841,14 @@ scratch/main> branch topic ``` ucm :error scratch/topic> merge.commit + It doesn't look like there's a merge in progress. ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## Precondition violations @@ -1667,6 +1861,7 @@ If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice' ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Original branch: @@ -1681,7 +1876,9 @@ bar = 100 ``` ucm :hide scratch/main> add + scratch/main> branch alice + ``` Alice's updates: @@ -1696,7 +1893,9 @@ bar = 300 ``` ucm :hide scratch/alice> update + scratch/main> branch bob + ``` Bob's addition: @@ -1708,10 +1907,12 @@ baz = "baz" ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + Sorry, I wasn't able to perform the merge: On the merge ancestor, bar and foo were aliases for the same @@ -1733,6 +1934,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Conflict involving builtin @@ -1744,16 +1946,19 @@ One way to fix this in the future would be to introduce a syntax for defining al ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's branch: ``` ucm scratch/alice> alias.type lib.builtins.Nat MyNat + Done. ``` @@ -1762,6 +1967,7 @@ Bob's branch: ``` ucm :hide scratch/main> branch bob + ``` ``` unison :hide @@ -1770,10 +1976,12 @@ unique type MyNat = MyNat Nat ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + Sorry, I wasn't able to perform the merge: There's a merge conflict on type MyNat, but it's a builtin on @@ -1788,6 +1996,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Constructor alias @@ -1796,10 +2005,12 @@ Each naming of a decl may not have more than one name for each constructor, with ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` ucm :hide scratch/main> branch alice + ``` Alice's branch: @@ -1810,10 +2021,12 @@ unique type Foo = Bar ``` ucm :hide scratch/alice> add + ``` ``` ucm scratch/alice> alias.term Foo.Bar Foo.some.other.Alias + Done. ``` @@ -1822,6 +2035,7 @@ Bob's branch: ``` ucm :hide scratch/main> branch bob + ``` ``` unison :hide @@ -1831,10 +2045,12 @@ bob = 100 ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + Sorry, I wasn't able to perform the merge: On scratch/alice, the type Foo has a constructor with multiple @@ -1850,6 +2066,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Missing constructor name @@ -1858,12 +2075,14 @@ Each naming of a decl must have a name for each constructor, within the decl's n ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Alice's branch: ``` ucm :hide scratch/main> branch alice + ``` ``` unison :hide @@ -1872,10 +2091,12 @@ unique type Foo = Bar ``` ucm :hide scratch/alice> add + ``` ``` ucm scratch/alice> delete.term Foo.Bar + Done. ``` @@ -1884,6 +2105,7 @@ Bob's branch: ``` ucm :hide scratch/main> branch /bob + ``` ``` unison :hide @@ -1893,10 +2115,12 @@ bob = 100 ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + Sorry, I wasn't able to perform the merge: On scratch/alice, the type Foo has some constructors with @@ -1910,6 +2134,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Nested decl alias @@ -1918,12 +2143,14 @@ A decl cannot be aliased within the namespace of another of its aliased. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Alice's branch: ``` ucm :hide scratch/main> branch alice + ``` ``` unison :hide @@ -1933,10 +2160,12 @@ structural type A.inner.X = Y Nat | Z Nat Nat ``` ucm :hide scratch/alice> add + ``` ``` ucm scratch/alice> names A + Type Hash: #65mdg7015r Names: A A.inner.X @@ -1947,6 +2176,7 @@ Bob's branch: ``` ucm :hide scratch/main> branch bob + ``` ``` unison :hide @@ -1956,10 +2186,12 @@ bob = 100 ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + On scratch/alice, the type A.inner.X is an alias of A. I'm not able to perform a merge when a type exists nested under an alias of itself. Please separate them or delete one copy, and @@ -1969,6 +2201,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Stray constructor alias @@ -1977,21 +2210,25 @@ Constructors may only exist within the corresponding decl's namespace. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Alice's branch: ``` ucm :hide scratch/main> branch alice + ``` ``` ucm scratch/alice> add + ⍟ I've added these definitions: type Foo scratch/alice> alias.term Foo.Bar AliasOutsideFooNamespace + Done. ``` @@ -2000,10 +2237,12 @@ Bob's branch: ``` ucm :hide scratch/main> branch bob + ``` ``` ucm scratch/bob> add + ⍟ I've added these definitions: bob : Nat @@ -2012,6 +2251,7 @@ scratch/bob> add ``` ucm :error scratch/alice> merge bob + Sorry, I wasn't able to perform the merge, because I need all constructor names to be nested somewhere beneath the corresponding type name. @@ -2025,6 +2265,7 @@ scratch/alice> merge bob ``` ucm :hide scratch/main> project.delete scratch + ``` ### Term or type in `lib` @@ -2033,12 +2274,14 @@ By convention, `lib` can only namespaces; each of these represents a library dep ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` Alice's branch: ``` ucm :hide scratch/main> branch alice + ``` ``` unison :hide @@ -2048,7 +2291,9 @@ lib.foo = 1 ``` ucm :hide scratch/alice> add + scratch/main> branch bob + ``` Bob's branch: @@ -2060,10 +2305,12 @@ bob = 100 ``` ucm :hide scratch/bob> add + ``` ``` ucm :error scratch/alice> merge /bob + Sorry, I wasn't able to perform the merge: On scratch/alice, there's a type or term at the top level of @@ -2076,6 +2323,7 @@ scratch/alice> merge /bob ``` ucm :hide scratch/main> project.delete scratch + ``` ## LCA precondition violations @@ -2087,6 +2335,7 @@ together. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` LCA: @@ -2110,11 +2359,13 @@ structural type Foo = Bar Nat | Baz Nat Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo scratch/main> delete.term Foo.Baz + Done. ``` @@ -2123,15 +2374,18 @@ Alice's branch: ``` ucm scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> delete.type Foo + Done. scratch/alice> delete.term Foo.Bar + Done. ``` @@ -2156,6 +2410,7 @@ alice = 100 ``` ucm scratch/alice> add + ⍟ I've added these definitions: alice : Nat @@ -2166,15 +2421,18 @@ Bob's branch: ``` ucm scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/bob> delete.type Foo + Done. scratch/bob> delete.term Foo.Bar + Done. ``` @@ -2199,6 +2457,7 @@ bob = 101 ``` ucm scratch/bob> add + ⍟ I've added these definitions: bob : Nat @@ -2209,12 +2468,14 @@ Now we merge: ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ## Regression tests @@ -2223,6 +2484,7 @@ scratch/main> project.delete scratch ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -2246,18 +2508,21 @@ bar = 17 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> delete.term bar + Done. ``` @@ -2282,12 +2547,14 @@ foo = 18 ``` ucm scratch/alice> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first @@ -2314,6 +2581,7 @@ bob = 101 ``` ucm scratch/bob> add + ⍟ I've added these definitions: bob : Nat @@ -2322,18 +2590,21 @@ scratch/bob> add ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ### Delete a constructor ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -2355,11 +2626,13 @@ type Foo = Bar | Baz ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/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 @@ -2386,6 +2659,7 @@ boop = "boop" ``` ucm scratch/topic> add + ⍟ I've added these definitions: boop : Text @@ -2412,6 +2686,7 @@ type Foo = Bar ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -2421,15 +2696,18 @@ scratch/main> update ``` ucm scratch/main> merge topic + I merged scratch/topic into scratch/main. scratch/main> view Foo + type Foo = Bar ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ### Dependent that doesn't need to be in the file @@ -2438,6 +2716,7 @@ This test demonstrates a bug. ``` ucm :hide scratch/alice> builtins.mergeio lib.builtins + ``` In the LCA, we have `foo` with dependent `bar`, and `baz`. @@ -2470,6 +2749,7 @@ baz = "lca" ``` ucm scratch/alice> add + ⍟ I've added these definitions: bar : Nat @@ -2477,6 +2757,7 @@ scratch/alice> add foo : Nat scratch/alice> branch bob + Done. I've created the bob branch based off of alice. Tip: To merge your work back into the alice branch, first @@ -2507,6 +2788,7 @@ baz = "bob" ``` ucm scratch/bob> update + Okay, I'm searching the branch for code that needs to be updated... @@ -2541,6 +2823,7 @@ baz = "alice" ``` ucm scratch/alice> update + Okay, I'm searching the branch for code that needs to be updated... @@ -2557,6 +2840,7 @@ the underlying namespace. ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -2598,6 +2882,7 @@ But `bar` was put into the scratch file instead. ``` ucm :hide scratch/main> project.delete scratch + ``` ### Merge loop test @@ -2626,6 +2911,7 @@ a = 1 ``` ucm scratch/alice> add + ⍟ I've added these definitions: a : ##Nat @@ -2651,6 +2937,7 @@ b = 2 ``` ucm scratch/alice> add + ⍟ I've added these definitions: b : ##Nat @@ -2671,6 +2958,7 @@ b = 2 ``` ucm scratch/bob> add + ⍟ I've added these definitions: b : ##Nat @@ -2696,6 +2984,7 @@ a = 1 ``` ucm scratch/bob> add + ⍟ I've added these definitions: a : ##Nat @@ -2717,18 +3006,22 @@ b = 2 ``` ucm scratch/carol> add + ⍟ I've added these definitions: a : ##Nat b : ##Nat scratch/bob> merge /alice + I merged scratch/alice into scratch/bob. scratch/carol> merge /bob + I merged scratch/bob into scratch/carol. scratch/carol> history + Note: The most recent namespace hash is immediately below this message. @@ -2747,6 +3040,7 @@ scratch/carol> history ``` ucm :hide scratch/main> project.delete scratch + ``` ### Variables named `_` @@ -2756,6 +3050,7 @@ results. ``` ucm :hide scratch/alice> builtins.mergeio lib.builtins + ``` ``` unison @@ -2788,6 +3083,7 @@ bar = ``` ucm scratch/alice> add + ⍟ I've added these definitions: bar : Nat @@ -2795,6 +3091,7 @@ scratch/alice> add ignore : a -> () scratch/alice> branch bob + Done. I've created the bob branch based off of alice. Tip: To merge your work back into the alice branch, first @@ -2825,6 +3122,7 @@ bar = ``` ucm scratch/bob> update + Okay, I'm searching the branch for code that needs to be updated... @@ -2856,6 +3154,7 @@ foo = 19 ``` ucm scratch/alice> update + Okay, I'm searching the branch for code that needs to be updated... @@ -2869,12 +3168,14 @@ scratch/alice> update ``` ucm scratch/alice> merge /bob + I merged scratch/bob into scratch/alice. ``` ``` ucm :hide scratch/main> project.delete scratch + ``` ### Unique type GUID reuse @@ -2884,6 +3185,7 @@ types' GUIDs being regenerated. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -2907,33 +3209,39 @@ type Bar = MkBar Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Bar type Foo scratch/main> branch alice + Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. scratch/alice> move.term Foo.Lca Foo.Alice + Done. scratch/main> branch bob + Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. scratch/bob> move.term Foo.Lca Foo.Bob + Done. ``` ``` ucm :error scratch/alice> merge /bob + I couldn't automatically merge scratch/bob into scratch/alice. However, I've added the definitions that need attention to the top of scratch.u. @@ -2987,17 +3295,20 @@ type Bar = MkBar Foo ``` ucm scratch/merge-bob-into-alice> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/merge-bob-into-alice> names Bar + Type Hash: #h3af39sae7 Names: Bar scratch/alice> names Bar + Type Hash: #h3af39sae7 Names: Bar @@ -3006,4 +3317,5 @@ scratch/alice> names Bar ``` ucm :hide scratch/main> project.delete scratch + ``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index 4c7b372a23..6a9cf9de0f 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ## Happy Path - namespace, term, and type @@ -33,6 +34,7 @@ unique type Foo.T = T ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -65,6 +67,7 @@ unique type Foo.T = T1 | T2 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -76,21 +79,25 @@ Should be able to move the term, type, and namespace, including its types, terms ``` ucm scratch/main> move Foo Bar + Done. scratch/main> ls + 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) scratch/main> ls Bar + 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) scratch/main> history Bar + Note: The most recent namespace hash is immediately below this message. @@ -129,17 +136,21 @@ bonk = 5 ``` ucm z/main> builtins.merge + Done. z/main> add + ⍟ I've added these definitions: bonk : Nat z/main> move bonk zonk + Done. z/main> ls + 1. builtin/ (469 terms, 74 types) 2. zonk (Nat) @@ -167,21 +178,26 @@ bonk.zonk = 5 ``` ucm a/main> builtins.merge + Done. a/main> add + ⍟ I've added these definitions: bonk.zonk : Nat a/main> move bonk zonk + Done. a/main> ls + 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) a/main> view zonk.zonk + zonk.zonk : Nat zonk.zonk = 5 @@ -191,6 +207,7 @@ a/main> view zonk.zonk ``` ucm :error scratch/main> move doesntexist foo + ⚠️ There is no term, type, or namespace at doesntexist. diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index d27123b0dd..db14534288 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -10,24 +10,29 @@ foo = 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : ##Nat -- 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 + 1. root/ (1 term) scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -39,9 +44,11 @@ scratch/main> history ``` ucm scratch/main> ls .root.at.path + 1. foo (##Nat) scratch/main> history .root.at.path + Note: The most recent namespace hash is immediately below this message. @@ -56,18 +63,22 @@ I should be able to move a sub namespace *over* the root. ``` 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 + 1. foo (##Nat) scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -80,9 +91,11 @@ scratch/main> history ``` ucm :error -- should be empty scratch/main> ls .root.at.path + nothing to show scratch/main> history .root.at.path + Note: The most recent namespace hash is immediately below this message. @@ -94,6 +107,7 @@ scratch/main> history .root.at.path ``` ucm :hide scratch/happy> builtins.merge lib.builtins + ``` ## Happy path @@ -121,6 +135,7 @@ unique type a.T = T ``` ucm scratch/happy> add + ⍟ I've added these definitions: type a.T @@ -150,6 +165,7 @@ unique type a.T = T1 | T2 ``` ucm scratch/happy> update + Okay, I'm searching the branch for code that needs to be updated... @@ -161,14 +177,17 @@ Should be able to move the namespace, including its types, terms, and sub-namesp ``` ucm scratch/happy> move.namespace a b + Done. scratch/happy> ls b + 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) scratch/happy> history b + Note: The most recent namespace hash is immediately below this message. @@ -190,6 +209,7 @@ scratch/happy> history b ``` ucm :hide scratch/history> builtins.merge lib.builtins + ``` Create some namespaces and add some history to them @@ -215,6 +235,7 @@ b.termInB = 10 ``` ucm scratch/history> add + ⍟ I've added these definitions: a.termInA : Nat @@ -244,6 +265,7 @@ b.termInB = 11 ``` ucm scratch/history> update + Okay, I'm searching the branch for code that needs to be updated... @@ -257,13 +279,16 @@ of the moved namespace. ``` ucm scratch/history> delete.namespace b + Done. scratch/history> move.namespace a b + Done. -- Should be the history from 'a' scratch/history> history b + Note: The most recent namespace hash is immediately below this message. @@ -277,6 +302,7 @@ scratch/history> history b -- Should be empty scratch/history> history a + Note: The most recent namespace hash is immediately below this message. @@ -290,6 +316,7 @@ scratch/history> history a ``` ucm :hide scratch/existing> builtins.merge lib.builtins + ``` Create some namespace and add some history to them @@ -315,6 +342,7 @@ b.termInB = 10 ``` ucm scratch/existing> add + ⍟ I've added these definitions: a.termInA : Nat @@ -344,12 +372,14 @@ b.termInB = 11 ``` ucm scratch/existing> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/existing> move.namespace a b + ⚠️ A branch existed at the destination: b so I over-wrote it. diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md index feb6ca0f8a..b7e4adc618 100644 --- a/unison-src/transcripts/name-resolution.output.md +++ b/unison-src/transcripts/name-resolution.output.md @@ -5,6 +5,7 @@ ambiguous. A reference to `Namespace.Foo` or `File.Foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -28,6 +29,7 @@ type Namespace.Foo = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: type Namespace.Foo @@ -79,6 +81,7 @@ type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` ucm scratch/main> project.delete scratch + ``` # Example 2 @@ -88,6 +91,7 @@ it refers to the namespace type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -111,6 +115,7 @@ type Foo = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -138,18 +143,21 @@ type UsesFoo = UsesFoo Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type File.Foo type UsesFoo scratch/main> view UsesFoo + type UsesFoo = UsesFoo Foo ``` ``` ucm scratch/main> project.delete scratch + ``` # Example 3 @@ -159,6 +167,7 @@ it refers to the file type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -182,6 +191,7 @@ type Namespace.Foo = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: type Namespace.Foo @@ -209,18 +219,21 @@ type UsesFoo = UsesFoo Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo type UsesFoo scratch/main> view UsesFoo + type UsesFoo = UsesFoo Foo ``` ``` ucm scratch/main> project.delete scratch + ``` # Example 4 @@ -230,6 +243,7 @@ but resolves to `ns.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -254,6 +268,7 @@ ns.foo = 42 ``` ucm scratch/main> add + ⍟ I've added these definitions: ns.foo : Nat @@ -284,6 +299,7 @@ bar = foo ++ "bar" ``` ucm scratch/main> project.delete scratch + ``` # Example 4 @@ -293,6 +309,7 @@ but resolves to `file.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -317,6 +334,7 @@ ns.foo = 42 ``` ucm scratch/main> add + ⍟ I've added these definitions: ns.foo : Nat @@ -347,6 +365,7 @@ bar = foo + 42 ``` ucm scratch/main> project.delete scratch + ``` # Example 4 @@ -356,6 +375,7 @@ A reference to `ns.foo` or `file.foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -380,6 +400,7 @@ ns.foo = 42 ``` ucm scratch/main> add + ⍟ I've added these definitions: ns.foo : Nat @@ -435,12 +456,14 @@ bar = file.foo + ns.foo ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat file.foo : Nat scratch/main> view bar + bar : Nat bar = use Nat + @@ -450,4 +473,5 @@ scratch/main> view bar ``` ucm scratch/main> project.delete scratch + ``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 8057804ade..157efa93a6 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -2,12 +2,14 @@ You can use a keyword or reserved operator as a name segment if you surround it ``` ucm :error scratch/main> view `match` + ⚠️ The following names were not found in the codebase. Check your spelling. `match` scratch/main> view `=` + ⚠️ The following names were not found in the codebase. Check your spelling. @@ -21,12 +23,14 @@ This allows you to spell `.` or `()` as name segments (which historically have a ``` ucm :error scratch/main> view `.` + ⚠️ The following names were not found in the codebase. Check your spelling. `.` scratch/main> view `()` + ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index d8aaa5d22d..b6da125932 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -6,7 +6,9 @@ This transcript shows how the pretty-printer picks names for a hash when multipl ``` ucm :hide scratch/main> builtins.merge lib.builtins + scratch/biasing> builtins.merge lib.builtins + ``` ``` unison :hide @@ -19,6 +21,7 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment ``` ucm scratch/main> add + ⍟ I've added these definitions: a.a : Nat @@ -26,6 +29,7 @@ scratch/main> add a.b : Nat scratch/main> view a.a + a.a : Nat a.a = use Nat + @@ -53,6 +57,7 @@ a3.long.name.but.shortest.suffixification = 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: a2.a : Nat @@ -75,9 +80,11 @@ scratch/main> add a3.long.name.but.shortest.suffixification : Nat scratch/main> debug.alias.term.force a2.c a3.c + Done. scratch/main> debug.alias.term.force a2.d a3.d + Done. ``` @@ -88,6 +95,7 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but ``` ucm scratch/main> view a b c d + a.a : Nat a.a = use Nat + @@ -144,6 +152,7 @@ a = 10 ``` ucm scratch/biasing> add + ⍟ I've added these definitions: a : Nat @@ -154,6 +163,7 @@ scratch/biasing> add -- the pretty printer should prefer the suffixified 'deeply.nested.num name' over the shallow 'a'. -- It's closer to the term being printed. scratch/biasing> view deeply.nested.term + deeply.nested.term : Nat deeply.nested.term = use Nat + @@ -182,6 +192,7 @@ other.num = 20 ``` ucm scratch/biasing> add + ⍟ I've added these definitions: other.num : Nat @@ -189,6 +200,7 @@ scratch/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. scratch/biasing> view deeply.nested.term + deeply.nested.term : Nat deeply.nested.term = use Nat + diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index 935b45c706..dae9da040d 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -2,6 +2,7 @@ ``` ucm scratch/main> builtins.merge lib.builtins + Done. ``` @@ -37,6 +38,7 @@ somewhere.y = 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: some.otherplace.x : Nat @@ -52,6 +54,7 @@ scratch/main> add ``` ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. scratch/main> names x + Terms Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z @@ -61,12 +64,14 @@ scratch/main> names x -- We can search by hash, and see all aliases of that hash scratch/main> names #gjmq673r1v + Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z -- Works with absolute names too scratch/main> names .some.place.x + Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z @@ -78,6 +83,7 @@ scratch/main> names .some.place.x ``` ucm -- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively. scratch/other> debug.names.global x + Found results in scratch/main Terms @@ -89,6 +95,7 @@ scratch/other> debug.names.global x -- We can search by hash, and see all aliases of that hash in the codebase scratch/other> debug.names.global #gjmq673r1v + Found results in scratch/main Term @@ -97,6 +104,7 @@ scratch/other> debug.names.global #gjmq673r1v -- We can search using an absolute name scratch/other> debug.names.global .some.place.x + Found results in scratch/main Term diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index f503abf95d..1730897d3e 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -9,18 +9,23 @@ unexpectedly 😬. ``` ucm scratch/main> alias.term ##Nat.+ Nat.+ + Done. scratch/main> ls Nat + 1. + (##Nat -> ##Nat -> ##Nat) scratch/main> move.namespace Nat Nat.operators + Done. scratch/main> ls Nat + 1. operators/ (1 term) scratch/main> ls Nat.operators + 1. + (##Nat -> ##Nat -> ##Nat) ``` diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md index 709a20c1f5..d7e75a87cf 100644 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -2,6 +2,7 @@ ``` ucm scratch/main> builtins.merge lib.builtins + Done. ``` @@ -14,6 +15,7 @@ mynamespace.dependsOnText = const external.mynat 10 ``` ucm scratch/main> add + ⍟ I've added these definitions: const : a -> b -> a @@ -21,6 +23,7 @@ scratch/main> add mynamespace.dependsOnText : Nat scratch/main> namespace.dependencies mynamespace + External dependency Dependents in scratch/main:.mynamespace lib.builtins.Nat 1. dependsOnText diff --git a/unison-src/transcripts/namespace-directive.output.md b/unison-src/transcripts/namespace-directive.output.md index b5246436f8..26a664181f 100644 --- a/unison-src/transcripts/namespace-directive.output.md +++ b/unison-src/transcripts/namespace-directive.output.md @@ -7,6 +7,7 @@ It affects the contents of the file as follows: ``` ucm scratch/main> builtins.mergeio lib.builtins + Done. ``` @@ -62,12 +63,14 @@ longer.evil.factorial n = n ``` ucm scratch/main> add + ⍟ I've added these definitions: foo.factorial : Int -> Int foo.longer.evil.factorial : Int -> Int scratch/main> view factorial + foo.factorial : Int -> Int foo.factorial = cases +0 -> +1 @@ -112,6 +115,7 @@ type longer.foo.Baz = { qux : Nat } ``` ucm scratch/main> add + ⍟ I've added these definitions: type longer.foo.Baz @@ -165,6 +169,7 @@ hasTypeLink = ``` ucm scratch/main> add + ⍟ I've added these definitions: type foo.Baz @@ -180,6 +185,7 @@ scratch/main> add foo.refersToQux : foo.Baz -> Nat scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink + type foo.RefersToFoo = RefersToFoo foo.Foo foo.hasTypeLink : Doc2 @@ -195,6 +201,7 @@ scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink qux baz + qux baz scratch/main> todo + You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index 1d71312a06..44251bb5e1 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> alias.type ##Text Text + ``` First lets add some contents to our codebase. @@ -35,6 +36,7 @@ corge = "corge" ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Text @@ -51,6 +53,7 @@ list: ``` ucm scratch/main> find + 1. bar : Text 2. baz : Text 3. corge : Text @@ -66,6 +69,7 @@ We can ask to `view` the second element of this list: ``` ucm scratch/main> find + 1. bar : Text 2. baz : Text 3. corge : Text @@ -76,6 +80,7 @@ scratch/main> find scratch/main> view 2 + baz : Text baz = "baz" @@ -85,6 +90,7 @@ And we can `view` multiple elements by separating with spaces: ``` ucm scratch/main> find + 1. bar : Text 2. baz : Text 3. corge : Text @@ -95,6 +101,7 @@ scratch/main> find scratch/main> view 2 3 5 + baz : Text baz = "baz" @@ -110,6 +117,7 @@ We can also ask for a range: ``` ucm scratch/main> find + 1. bar : Text 2. baz : Text 3. corge : Text @@ -120,6 +128,7 @@ scratch/main> find scratch/main> view 2-4 + baz : Text baz = "baz" @@ -135,6 +144,7 @@ And we can ask for multiple ranges and use mix of ranges and numbers: ``` ucm scratch/main> find + 1. bar : Text 2. baz : Text 3. corge : Text @@ -145,6 +155,7 @@ scratch/main> find scratch/main> view 1-3 4 5-6 + bar : Text bar = "bar" diff --git a/unison-src/transcripts/old-fold-right.output.md b/unison-src/transcripts/old-fold-right.output.md index 8a7cb2b977..cfa3fe9d74 100644 --- a/unison-src/transcripts/old-fold-right.output.md +++ b/unison-src/transcripts/old-fold-right.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 89059cc080..7fc0ae7272 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` # Basics @@ -675,6 +676,7 @@ unit2t = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: type T @@ -732,6 +734,7 @@ evil = bug "" ``` ucm scratch/main> add + ⍟ I've added these definitions: type V @@ -773,6 +776,7 @@ unique type SomeType = A ``` ucm scratch/main> add + ⍟ I've added these definitions: type SomeType diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index f62205ae69..2e36ed984d 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -2,6 +2,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -92,6 +93,7 @@ doc = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: structural ability Ab @@ -111,80 +113,94 @@ scratch/main> add tremulous : (Nat, Nat) -> () scratch/main> view dopey + dopey : Char -> () dopey = cases ?0 -> () _ -> () scratch/main> view grumpy + grumpy : ff284oqf651 -> () grumpy = cases d -> () scratch/main> view happy + happy : Boolean -> () happy = cases true -> () false -> () scratch/main> view sneezy + sneezy : Int -> () sneezy = cases +1 -> () _ -> () scratch/main> view bashful + bashful : Optional a -> () bashful = cases Some a -> () _ -> () scratch/main> view mouthy + mouthy : [t] -> () mouthy = cases [] -> () _ -> () scratch/main> view pokey + pokey : [t] -> () pokey = cases h +: t -> () _ -> () scratch/main> view sleepy + sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () scratch/main> view demure + demure : [Nat] -> () demure = cases [0] -> () _ -> () scratch/main> view angry + angry : [t] -> () angry = cases a ++ [] -> () scratch/main> view tremulous + tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () scratch/main> view throaty + throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () scratch/main> view agitated + agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () scratch/main> view doc + doc : Nat -> () doc = cases y@4 -> () diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index 21626c7aa8..2b0fc39b79 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` We had bugs in the calling conventions for both send and terminate which would @@ -40,12 +41,14 @@ assertRight = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: assertRight : Either a b -> b frank : '{IO} () scratch/main> run frank + () ``` diff --git a/unison-src/transcripts/patterns.output.md b/unison-src/transcripts/patterns.output.md index 6a40c38db7..187ba50eaf 100644 --- a/unison-src/transcripts/patterns.output.md +++ b/unison-src/transcripts/patterns.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Some tests of pattern behavior. diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index 42d4140f6c..6fbc51332f 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` We introduce a type `Foo` with a function dependent `fooToInt`. @@ -31,12 +32,14 @@ And then we add it. ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo fooToInt : Foo -> Int scratch/main> find.verbose + 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo type Foo @@ -49,6 +52,7 @@ scratch/main> find.verbose scratch/main> view fooToInt + fooToInt : Foo -> Int fooToInt _ = +42 @@ -78,6 +82,7 @@ and update the codebase to use the new type `Foo`... ``` ucm scratch/main> update.old + ⍟ I've updated these names to your new definition: type Foo @@ -88,6 +93,7 @@ scratch/main> update.old ``` ucm scratch/main> view fooToInt + fooToInt : Foo -> Int fooToInt _ = +42 @@ -124,6 +130,7 @@ Add that to the codebase: ``` ucm scratch/main> add + ⍟ I've added these definitions: preserve.otherTerm : Optional baz -> Optional baz @@ -156,6 +163,7 @@ Update... ``` ucm scratch/main> update.old + ⍟ I've updated these names to your new definition: preserve.someTerm : Optional x -> Optional x @@ -167,10 +175,12 @@ type of `otherTerm` should remain the same. ``` ucm scratch/main> view preserve.someTerm + preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None scratch/main> view preserve.otherTerm + preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md index 32c9568003..c440fc536c 100644 --- a/unison-src/transcripts/pull-errors.output.md +++ b/unison-src/transcripts/pull-errors.output.md @@ -1,5 +1,6 @@ ``` ucm :error test/main> pull @aryairani/test-almost-empty/main lib.base_latest + The use of `pull` to install libraries is now deprecated. Going forward, you can use `lib.install @aryairani/test-almost-empty/main`. @@ -10,6 +11,7 @@ test/main> pull @aryairani/test-almost-empty/main lib.base_latest aryairani_test_almost_empty_main. test/main> pull @aryairani/test-almost-empty/main a.b + ⚠️ Sorry, I wasn’t sure how to process your request: @@ -20,11 +22,13 @@ test/main> pull @aryairani/test-almost-empty/main a.b You can run `help pull` for more information on using `pull`. test/main> pull @aryairani/test-almost-empty/main a + I think you want to merge @aryairani/test-almost-empty/main into the a branch, but it doesn't exist. If you want, you can create it with `branch.empty a`, and then `pull` again. test/main> pull @aryairani/test-almost-empty/main .a + ⚠️ Sorry, I wasn’t sure how to process your request: diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index 107a05fc62..b961461b63 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -2,7 +2,9 @@ Ensure that Records keep their syntax after being added to the codebase ``` ucm :hide scratch/main> builtins.merge + scratch/main> load unison-src/transcripts-using-base/base.u + ``` ## Record with 1 field @@ -13,10 +15,12 @@ unique type Record1 = { a : Text } ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view Record1 + type Record1 = { a : Text } ``` @@ -29,10 +33,12 @@ unique type Record2 = { a : Text, b : Int } ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view Record2 + type Record2 = { a : Text, b : Int } ``` @@ -45,10 +51,12 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view Record3 + type Record3 = { a : Text, b : Int, c : Nat } ``` @@ -69,10 +77,12 @@ unique type Record4 = ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view Record4 + type Record4 = { a : Text, b : Int, @@ -114,10 +124,12 @@ unique type Record5 = { ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> view Record5 + type Record5 = { zero : Nat, one : [Nat], @@ -155,12 +167,14 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` ucm :hide 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 scratch/main> view RecordWithUserType + type RecordWithUserType = { a : Text, b : Record4, c : UserType } diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index cc1cb364f2..aeca75dfed 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` First we make some changes to the codebase so there's data in the reflog. @@ -23,6 +24,7 @@ x = 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: x : Nat @@ -48,23 +50,28 @@ y = 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: y : Nat scratch/main> branch /other + Done. I've created the other branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /other`. scratch/other> alias.term y z + Done. newproject/main> builtins.merge lib.builtins + Done. newproject/main> alias.type lib.builtins.Nat MyNat + Done. ``` @@ -73,6 +80,7 @@ Should see reflog entries from the current branch ``` ucm scratch/main> reflog + Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -92,6 +100,7 @@ Should see reflog entries from the current project ``` ucm scratch/main> project.reflog + Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -113,6 +122,7 @@ Should see reflog entries from all projects ``` ucm scratch/main> reflog.global + Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md index 2e3e992bb0..1e2e3be6fd 100644 --- a/unison-src/transcripts/release-draft-command.output.md +++ b/unison-src/transcripts/release-draft-command.output.md @@ -2,6 +2,7 @@ The `release.draft` command drafts a release from the current branch. ``` ucm :hide foo/main> builtins.merge + ``` Some setup: @@ -25,6 +26,7 @@ someterm = 18 ``` ucm foo/main> add + ⍟ I've added these definitions: someterm : Nat @@ -37,6 +39,7 @@ Now, the `release.draft` demo: ``` ucm foo/main> release.draft 1.2.3 + 😎 Great! I've created a draft release for you at /releases/drafts/1.2.3. @@ -57,6 +60,7 @@ It's an error to try to create a `releases/drafts/x.y.z` branch that already exi ``` ucm :error foo/main> release.draft 1.2.3 + foo/releases/drafts/1.2.3 already exists. You can switch to it with `switch foo/releases/drafts/1.2.3`. diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index bcda4ec2a0..370f4851f3 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -21,6 +22,7 @@ def = "first value" ``` ucm :hide scratch/main> update + ``` ``` unison :hide @@ -31,12 +33,14 @@ Can reset to a value from history by number. ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -55,13 +59,16 @@ scratch/main> history □ 3. #4bigcpnl7t (start of history) scratch/main> reset 2 + Done. scratch/main> view def + def : Text def = "first value" scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -79,6 +86,7 @@ Can reset to a value from reflog by number. ``` ucm scratch/main> reflog + Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. @@ -95,13 +103,16 @@ scratch/main> reflog -- Reset the current branch to the first history element scratch/main> reset 2 + Done. scratch/main> view def + def : Text def = "second value" scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -125,6 +136,7 @@ scratch/main> history ``` ucm foo/main> history + Note: The most recent namespace hash is immediately below this message. @@ -140,19 +152,23 @@ a = 5 ``` ucm foo/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. foo/empty> reset /main: + Done. foo/empty> view a + a : ##Nat a = 5 foo/empty> history + Note: The most recent namespace hash is immediately below this message. @@ -170,12 +186,14 @@ main.a = 3 ``` ucm foo/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. foo/main> history + Note: The most recent namespace hash is immediately below this message. @@ -188,6 +206,7 @@ foo/main> history □ 2. #5l94rduvel (start of history) foo/main> reset 2 main + Done. ``` diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index 3f6c1ccc24..589607a44b 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -6,6 +6,7 @@ This transcript tests the errors printed to the user when a name cannot be resol ``` ucm scratch/main> builtins.merge lib.builtins + Done. ``` @@ -38,6 +39,7 @@ two.ambiguousTerm = "term two" ``` ucm scratch/main> add + ⍟ I've added these definitions: type one.AmbiguousType diff --git a/unison-src/transcripts/rsa.output.md b/unison-src/transcripts/rsa.output.md index 677ce08bf8..a97966bce9 100644 --- a/unison-src/transcripts/rsa.output.md +++ b/unison-src/transcripts/rsa.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/scope-ref.output.md b/unison-src/transcripts/scope-ref.output.md index b441a5c62d..4355968731 100644 --- a/unison-src/transcripts/scope-ref.output.md +++ b/unison-src/transcripts/scope-ref.output.md @@ -2,6 +2,7 @@ A short script to test mutable references with local scope. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 4f770bb281..55d99ee748 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Any unique name suffix can be used to refer to a definition. For instance: @@ -21,12 +22,14 @@ This also affects commands like find. Notice lack of qualified names in output: ``` ucm scratch/main> add + ⍟ I've added these definitions: foo.bar.a : Int optional.isNone : Optional a -> Boolean scratch/main> find take + 1. builtin.Bytes.take : Nat -> Bytes -> Bytes 2. builtin.List.take : Nat -> [a] -> [a] 3. builtin.Text.take : Nat -> Text -> Text @@ -40,9 +43,11 @@ The `view` and `display` commands also benefit from this: ``` ucm scratch/main> view List.drop + builtin builtin.List.drop : builtin.Nat -> [a] -> [a] scratch/main> display bar.a + +99 ``` @@ -53,6 +58,7 @@ Type-based search also benefits from this, we can just say `Nat` rather than `.b ``` ucm scratch/main> find : Nat -> [a] -> [a] + 1. builtin.List.drop : Nat -> [a] -> [a] 2. builtin.List.take : Nat -> [a] -> [a] @@ -88,6 +94,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ucm scratch/main> add + ⍟ I've added these definitions: cool.abra.cadabra : Text @@ -141,6 +148,7 @@ scratch/main> add ``` ucm scratch/main> view abra.cadabra + cool.abra.cadabra : Text cool.abra.cadabra = "my project" @@ -148,6 +156,7 @@ scratch/main> view abra.cadabra lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> view baz.qux + lib.distributed.baz.qux : Text lib.distributed.baz.qux = "direct dependency 2" @@ -157,10 +166,12 @@ Note that we can always still view indirect dependencies by using more name segm ``` ucm scratch/main> view distributed.abra.cadabra + lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> names distributed.lib.baz.qux + Term Hash: #nhup096n2s Names: lib.distributed.lib.baz.qux diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index bcd86a40ab..954a0c807f 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -4,6 +4,7 @@ https://github.com/unisonweb/unison/issues/2786 ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` First we add a sum-type to the codebase. @@ -28,6 +29,7 @@ structural type X = x ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type X @@ -72,6 +74,7 @@ is removed in the same update that the new term is being added. ``` ucm scratch/main> update.old + ⍟ I've added these definitions: X.x : Text diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index 9ccfc0f251..e9a036b6ca 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -2,7 +2,9 @@ The `switch` command switches to an existing project or branch. ``` ucm :hide foo/main> builtins.merge + bar/main> builtins.merge + ``` Setup stuff. @@ -26,17 +28,20 @@ someterm = 18 ``` ucm foo/main> add + ⍟ I've added these definitions: someterm : Nat foo/main> branch bar + Done. I've created the bar branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bar`. foo/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 @@ -50,16 +55,22 @@ forward slash (which makes it unambiguous). ``` ucm scratch/main> switch foo + scratch/main> switch foo/topic + foo/main> switch topic + foo/main> switch /topic + foo/main> switch bar/ + ``` It's an error to try to switch to something ambiguous. ``` ucm :error foo/main> switch bar + I'm not sure if you wanted to switch to the branch foo/bar or the project bar. Could you be more specific? @@ -74,12 +85,14 @@ It's an error to try to switch to something that doesn't exist, of course. ``` ucm :error scratch/main> switch foo/no-such-branch + foo/no-such-branch does not exist. ``` ``` ucm :error scratch/main> switch no-such-project + Neither project no-such-project nor branch /no-such-project exists. @@ -87,6 +100,7 @@ scratch/main> switch no-such-project ``` ucm :error foo/main> switch no-such-project-or-branch + Neither project no-such-project-or-branch nor branch /no-such-project-or-branch exists. diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 12700f3adc..3bf54aef2f 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -6,10 +6,12 @@ Test that tab completion works as expected. ``` ucm scratch/main> debug.tab-complete vi + view view.global scratch/main> debug.tab-complete delete. + delete.branch delete.namespace delete.namespace.force @@ -52,21 +54,25 @@ unique type subnamespace.AType = A | B ``` ucm :hide scratch/main> add + ``` ``` ucm -- Should tab complete namespaces since they may contain terms/types 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 scratch/main> debug.tab-complete view subnamespace + subnamespace. subnamespace2. -- Should complete things from child namespaces of the current query if it's dot-suffixed scratch/main> debug.tab-complete view subnamespace. + * subnamespace.AType subnamespace.AType. * subnamespace.someName @@ -74,15 +80,18 @@ 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. scratch/main> debug.tab-complete view subnamespace2 + subnamespace2. * subnamespace2.thing -- Should prefix-filter by query suffix scratch/main> debug.tab-complete view subnamespace.some + * subnamespace.someName * subnamespace.someOtherName scratch/main> debug.tab-complete view subnamespace.someOther + * subnamespace.someOtherName ``` @@ -93,12 +102,14 @@ absolute.term = "absolute" ``` ucm scratch/main> add + ⍟ I've added these definitions: absolute.term : ##Text -- Should tab complete absolute names scratch/main> debug.tab-complete view .absolute.te + * .absolute.term ``` @@ -108,25 +119,31 @@ scratch/main> debug.tab-complete view .absolute.te ``` ucm -- Should tab complete namespaces scratch/main> debug.tab-complete find-in sub + subnamespace subnamespace2 scratch/main> debug.tab-complete find-in subnamespace + subnamespace subnamespace2 scratch/main> debug.tab-complete find-in subnamespace. + subnamespace.AType scratch/main> debug.tab-complete io.test sub + subnamespace. subnamespace2. scratch/main> debug.tab-complete io.test subnamespace + subnamespace. subnamespace2. scratch/main> debug.tab-complete io.test subnamespace. + subnamespace.AType. * subnamespace.someName * subnamespace.someOtherName @@ -157,16 +174,19 @@ add b = b ``` ucm scratch/main> update.old + ⍟ I've added these definitions: type Foo add : a -> a scratch/main> debug.tab-complete delete.type Foo + * Foo Foo. scratch/main> debug.tab-complete delete.term add + * add ``` @@ -175,15 +195,18 @@ scratch/main> debug.tab-complete delete.term add ``` ucm 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`. myproject/main> debug.tab-complete branch.delete /mybr + /mybranch myproject/main> debug.tab-complete project.rename my + myproject ``` @@ -209,11 +232,13 @@ mybranchsubnamespace.term = 1 ``` ucm myproject/main> add + ⍟ I've added these definitions: mybranchsubnamespace.term : ##Nat myproject/main> debug.tab-complete merge mybr + /mybranch ``` diff --git a/unison-src/transcripts/tdnr.output.md b/unison-src/transcripts/tdnr.output.md index dc3668b85e..84389f48b0 100644 --- a/unison-src/transcripts/tdnr.output.md +++ b/unison-src/transcripts/tdnr.output.md @@ -2,6 +2,7 @@ TDNR selects local term (in file) that typechecks over local term (in file) that ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -27,12 +28,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in file) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -54,6 +57,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -81,12 +85,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in file) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -108,6 +114,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -141,12 +148,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in namespace) that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -168,6 +177,7 @@ good.foo = 17 ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -195,12 +205,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in namespace) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -224,6 +236,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -250,12 +263,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -279,6 +294,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -311,12 +327,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (shadowing namespace) that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -338,6 +356,7 @@ good.foo = 17 ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -371,12 +390,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (shadowing namespace) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -400,6 +421,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -432,12 +454,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (shadowing namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -461,6 +485,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -495,6 +520,7 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` \=== start local over direct dep @@ -503,6 +529,7 @@ TDNR selects local term (in file) that typechecks over direct dependency that do ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -524,6 +551,7 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.bad.foo : Text @@ -551,12 +579,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (in namespace) that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -580,6 +610,7 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -606,12 +637,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects local term (shadowing namespace) that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -635,6 +668,7 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -667,12 +701,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR not used to select local term (in file) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -694,6 +730,7 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.dep.lib.dep.foo : Nat @@ -721,12 +758,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR not used to select local term (in namespace) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -750,6 +789,7 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -776,12 +816,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR not used to select local term (shadowing namespace) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -805,6 +847,7 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add + ⍟ I've added these definitions: good.foo : Nat @@ -837,12 +880,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects direct dependency that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -864,6 +909,7 @@ lib.good.foo = 17 ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.good.foo : Nat @@ -891,12 +937,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects direct dependency that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -920,6 +968,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -946,12 +995,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects direct dependency that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -975,6 +1026,7 @@ bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: bad.foo : Text @@ -1007,12 +1059,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects direct dependency that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -1036,6 +1090,7 @@ lib.bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.bad.foo : Text @@ -1062,12 +1117,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR not used to select direct dependency that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -1091,6 +1148,7 @@ lib.dep.lib.dep.foo = 217 ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.dep.lib.dep.foo : Nat @@ -1117,12 +1175,14 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` TDNR selects indirect dependency that typechecks over indirect dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -1146,6 +1206,7 @@ lib.dep.lib.bad.foo = "bar" ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.dep.lib.bad.foo : Text @@ -1172,4 +1233,5 @@ thing = foo Nat.+ foo ``` ucm :hide scratch/main> delete.project scratch + ``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index 74c27f98cc..3ed4335ce0 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -2,6 +2,7 @@ Merge builtins so we get enough names for the testing stuff. ``` ucm :hide scratch/main> builtins.merge + ``` The `test` command should run all of the tests in the current directory. @@ -30,10 +31,12 @@ foo.test2 = [Ok "test2"] ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> test + ✅ @@ -59,6 +62,7 @@ Tests should be cached if unchanged. ``` ucm scratch/main> test + Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 @@ -92,10 +96,12 @@ lib.dep.testInLib = [Ok "testInLib"] ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> test + Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 @@ -106,6 +112,7 @@ scratch/main> test Tip: Use view 1 to view the source of a test. scratch/main> test.all + Cached test results (`help testcache` to learn more) @@ -134,6 +141,7 @@ scratch/main> test.all ``` ucm scratch/main> test lib.dep + Cached test results (`help testcache` to learn more) 1. lib.dep.testInLib ◉ testInLib @@ -148,6 +156,7 @@ scratch/main> test lib.dep ``` ucm scratch/main> test foo + Cached test results (`help testcache` to learn more) 1. foo.test2 ◉ test2 diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index 47bbaf8f54..db998f1095 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` This transcript shows some syntax for raw text literals. @@ -91,12 +92,14 @@ lit2 = """" ``` ucm scratch/main> add + ⍟ I've added these definitions: lit1 : Text lit2 : Text scratch/main> view lit1 lit2 + lit1 : Text lit1 = """ diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md index 5b684ca49c..e3e17133d7 100644 --- a/unison-src/transcripts/textfind.output.md +++ b/unison-src/transcripts/textfind.output.md @@ -2,12 +2,14 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` The `text.find` (or `grep`) command can be used to search for text or numeric literals appearing anywhere in your project. Just supply one or more tokens to search for. Unlike regular grep over the text of your code, this ignores local variables and function names that happen to match your search tokens (use `dependents` or `find` for that purpose). It's only searching for text or numeric literals that match. ``` ucm scratch/main> help grep + text.find (or grep) `text.find token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. @@ -21,6 +23,7 @@ scratch/main> help grep ``` ucm scratch/main> help text.find.all + text.find.all (or grep.all) `text.find.all token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. @@ -71,10 +74,12 @@ lib.bar = 3 ``` ucm :hide scratch/main> add + ``` ``` ucm scratch/main> grep hi + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -84,6 +89,7 @@ scratch/main> grep hi Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -91,6 +97,7 @@ scratch/main> view 1 _ -> 0 scratch/main> grep "hi" + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -100,6 +107,7 @@ scratch/main> grep "hi" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> text.find.all hi + 🔎 These definitions from the current namespace have matches: @@ -111,6 +119,7 @@ scratch/main> text.find.all hi scratch file. scratch/main> view 1-5 + bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -121,6 +130,7 @@ scratch/main> view 1-5 lib.foo = [Any 46, Any "hi", Any "zoink"] scratch/main> grep oog + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -130,6 +140,7 @@ scratch/main> grep oog Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -140,6 +151,7 @@ scratch/main> view 1 ``` ucm scratch/main> grep quaffle + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -149,10 +161,12 @@ scratch/main> grep quaffle Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 + baz : [Text] baz = ["an", "quaffle", "tres"] scratch/main> text.find "interesting const" + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -162,12 +176,14 @@ scratch/main> text.find "interesting const" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 + foo : Nat foo = _ = "an interesting constant" 1 scratch/main> text.find "99" "23" + 🔎 These definitions from the current namespace (excluding `lib`) have matches: @@ -177,6 +193,7 @@ scratch/main> text.find "99" "23" Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + bar : Nat bar = match "well hi there" with "ooga" -> 99 @@ -189,6 +206,7 @@ Now some failed searches: ``` ucm :error scratch/main> grep lsdkfjlskdjfsd + 😶 I couldn't find any matches. Tip: `text.find.all` will search `lib` as well. @@ -199,6 +217,7 @@ Notice it gives the tip about `text.find.all`. But not here: ``` ucm :error scratch/main> grep.all lsdkfjlskdjfsd + 😶 I couldn't find any matches. ``` diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md index c6b1eb12b0..82b22f84d1 100644 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ b/unison-src/transcripts/todo-bug-builtins.output.md @@ -2,6 +2,7 @@ ``` ucm :hide 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 fedcb16255..fdb0142df1 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -4,6 +4,7 @@ When there's nothing to do, `todo` says this: ``` ucm scratch/main> todo + You have no pending todo items. Good work! ✅ ``` @@ -14,6 +15,7 @@ The `todo` command shows local (outside `lib`) terms that directly call `todo`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -40,12 +42,14 @@ bar = foo + foo ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> todo + These terms call `todo`: 1. foo @@ -54,6 +58,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Direct dependencies without names @@ -63,6 +68,7 @@ the current namespace. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -86,12 +92,14 @@ baz = foo.bar + foo.bar ``` ucm scratch/main> add + ⍟ I've added these definitions: baz : Nat foo.bar : Nat scratch/main> delete.namespace.force foo + Done. ⚠️ @@ -103,6 +111,7 @@ scratch/main> delete.namespace.force foo bar 1. baz scratch/main> todo + These terms do not have any names in the current namespace: 1. #1jujb8oelv @@ -111,6 +120,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Conflicted names @@ -119,6 +129,7 @@ The `todo` command shows conflicted names. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -142,15 +153,18 @@ bar = 17 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat foo : Nat scratch/main> debug.alias.term.force foo bar + Done. scratch/main> todo + ❓ The term bar has conflicting definitions: @@ -165,6 +179,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Definitions in lib @@ -173,6 +188,7 @@ The `todo` command complains about terms and types directly in `lib`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -194,11 +210,13 @@ lib.foo = 16 ``` ucm scratch/main> add + ⍟ I've added these definitions: lib.foo : Nat scratch/main> todo + There's a type or term at the top level of the `lib` namespace, where I only expect to find subnamespaces representing library dependencies. Please move or remove it. @@ -207,6 +225,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Constructor aliases @@ -215,6 +234,7 @@ The `todo` command complains about constructor aliases. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -236,14 +256,17 @@ type Foo = One ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.One Foo.Two + Done. scratch/main> todo + The type Foo has a constructor with multiple names. 1. Foo.One @@ -255,6 +278,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Missing constructor names @@ -263,6 +287,7 @@ The `todo` command complains about missing constructor names. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -284,14 +309,17 @@ type Foo = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> delete.term Foo.Bar + Done. scratch/main> todo + These types have some constructors with missing names. 1. Foo @@ -304,6 +332,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Nested decl aliases @@ -312,6 +341,7 @@ The `todo` command complains about nested decl aliases. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -335,12 +365,14 @@ structural type Foo.inner.Bar a = Uno a | Dos a a ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type Foo a structural type Foo.inner.Bar a scratch/main> todo + These types are aliases, but one is nested under the other. Please separate them or delete one copy. @@ -351,6 +383,7 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` # Stray constructors @@ -359,6 +392,7 @@ The `todo` command complains about stray constructors. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + ``` ``` unison @@ -380,14 +414,17 @@ type Foo = Bar ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Baz + Done. scratch/main> todo + These constructors are not nested beneath their corresponding type names: @@ -400,4 +437,5 @@ scratch/main> todo ``` ucm :hide scratch/main> delete.project scratch + ``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 7750101acb..73ecbfbeac 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -2,12 +2,14 @@ A simple transcript to test the use of exceptions that bubble to the top level. ``` ucm :hide scratch/main> builtins.merge + ``` FYI, here are the `Exception` and `Failure` types: ``` ucm scratch/main> view Exception Failure + structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x @@ -44,15 +46,18 @@ mytest _ = [Ok "Great"] ``` ucm scratch/main> run main + () scratch/main> add + ⍟ I've added these definitions: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] scratch/main> io.test mytest + New test results: 1. mytest ◉ Great @@ -92,6 +97,7 @@ unique type RuntimeError = ``` ucm :error scratch/main> run main2 + 💔💥 The program halted with an unhandled exception: diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md index 7afd0a91d8..0127d05cab 100644 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ b/unison-src/transcripts/transcript-parser-commands.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` The transcript parser is meant to parse `ucm` and `unison` blocks. @@ -25,6 +26,7 @@ x = 1 ``` ucm scratch/main> add + ⍟ I've added these definitions: x : Nat @@ -37,6 +39,7 @@ z ``` ucm :error scratch/main> delete foo + ⚠️ The following names were not found in the codebase. Check your spelling. @@ -46,6 +49,7 @@ scratch/main> delete foo ``` ucm :error scratch/main> delete lineToken.call + ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index 130ae5ddc4..8f45a5b84b 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -4,6 +4,7 @@ https://github.com/unisonweb/unison/pull/2821 ``` ucm :hide scratch/main> builtins.merge + ``` Define a type. @@ -14,6 +15,7 @@ structural type Y = Y ``` ucm :hide scratch/main> add + ``` Now, we update `Y`, and add a new type `Z` which depends on it. @@ -46,6 +48,7 @@ Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked ``` ucm :error scratch/main> add + x These definitions failed: Reason @@ -56,6 +59,7 @@ scratch/main> add -- This shouldn't exist, because it should've been blocked. scratch/main> view Z + ⚠️ The following names were not found in the codebase. Check your spelling. diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md index 128e62d7f9..7adbbd15a0 100644 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -2,6 +2,7 @@ ``` ucm :hide 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/undo.output.md b/unison-src/transcripts/undo.output.md index 89982b2749..542daa3b95 100644 --- a/unison-src/transcripts/undo.output.md +++ b/unison-src/transcripts/undo.output.md @@ -8,26 +8,32 @@ x = 1 ``` ucm scratch/main> builtins.merge lib.builtins + Done. scratch/main> add + ⍟ I've added these definitions: x : Nat scratch/main> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> alias.term x y + Done. scratch/main> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -51,6 +57,7 @@ scratch/main> history □ 3. #ms9lggs2rg (start of history) scratch/main> undo + Here are the changes I undid Name changes: @@ -59,10 +66,12 @@ scratch/main> undo 1. x 2. y (added) scratch/main> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/main> history + Note: The most recent namespace hash is immediately below this message. @@ -86,26 +95,32 @@ x = 1 ``` ucm scratch/branch1> builtins.merge lib.builtins + Done. scratch/branch1> add + ⍟ I've added these definitions: x : Nat scratch/branch1> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/branch1> alias.term x y + Done. scratch/branch1> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) scratch/branch1> history + Note: The most recent namespace hash is immediately below this message. @@ -130,12 +145,15 @@ scratch/branch1> history -- Make some changes on an unrelated branch scratch/branch2> builtins.merge lib.builtins + Done. scratch/branch2> delete.namespace lib + Done. scratch/branch1> undo + Here are the changes I undid Name changes: @@ -144,10 +162,12 @@ scratch/branch1> undo 1. x 2. y (added) scratch/branch1> ls + 1. lib/ (469 terms, 74 types) 2. x (Nat) scratch/branch1> history + Note: The most recent namespace hash is immediately below this message. @@ -167,11 +187,13 @@ Undo should be a no-op on a newly created branch ``` ucm :error scratch/main> branch.create-empty new + Done. I've created an empty branch scratch/new. Tip: Use `merge /somebranch` to initialize this branch. scratch/new> undo + ⚠️ Nothing more to undo. diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index e5a7967ffb..abd2d44a8d 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -25,6 +25,7 @@ unique type C = C B ``` ucm scratch/main> add + ⍟ I've added these definitions: type A @@ -52,6 +53,7 @@ If the name stays the same, the churn is even prevented if the type is updated a ``` ucm scratch/main> names A + Type Hash: #uj8oalgadr Names: A @@ -82,12 +84,14 @@ unique type A = A () ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names A + Type Hash: #ufo5tuc7ho Names: A @@ -120,12 +124,14 @@ Note that `A` is back to its original hash. ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names A + Type Hash: #uj8oalgadr Names: A diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 3f0d2e9407..234ca32f89 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -17,19 +17,23 @@ ``` ucm scratch/main> add + ⍟ I've added these definitions: `()`.foo : ##Text scratch/main> find + 1. `()`.foo : ##Text scratch/main> find-in `()` + 1. foo : ##Text scratch/main> delete.namespace `()` + Done. ``` diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index c87cc2b940..a6fcf7d0d4 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -3,6 +3,7 @@ cases exist for built-in types. Just making sure they don't crash. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -30,12 +31,14 @@ threadEyeDeez _ = ``` ucm scratch/main> add + ⍟ I've added these definitions: type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) scratch/main> run threadEyeDeez + (false, true) ``` diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index 0bc39e1fe8..248a9a3b87 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -32,10 +33,12 @@ main _ = ``` ucm scratch/main> find unsafe.coerceAbilities + 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b scratch/main> add + ⍟ I've added these definitions: f : 'Nat @@ -43,6 +46,7 @@ scratch/main> add main : '{IO, Exception} [Result] scratch/main> io.test main + New test results: 1. main ◉ diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index d5b1d1ae08..068751c86f 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -4,6 +4,7 @@ one's own code if the "lib" namespace is simply ignored. ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison @@ -27,6 +28,7 @@ lib.foo = 100 ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : Nat @@ -55,12 +57,14 @@ foo = 200 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> names foo + Term Hash: #9ntnotdp87 Names: foo diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 94e4660457..075f0d7d51 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -4,6 +4,7 @@ Conflicted definitions prevent `update` from succeeding. ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` ``` unison @@ -27,15 +28,18 @@ temp = 2 ``` ucm scratch/main> add + ⍟ I've added these definitions: temp : Nat x : Nat scratch/main> debug.alias.term.force temp x + Done. scratch/main> delete.term temp + Done. ``` @@ -60,6 +64,7 @@ x = 3 ``` ucm :error scratch/main> update + This branch has more than one term with the name `x`. Please delete or rename all but one of them, then try the update again. diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md index 07b370d4ab..cca076ded2 100644 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ b/unison-src/transcripts/update-suffixifies-properly.output.md @@ -1,5 +1,6 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin + ``` ``` unison @@ -31,6 +32,7 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ucm myproject/main> add + ⍟ I've added these definitions: a.x.x.x.x : Nat @@ -62,6 +64,7 @@ foo = +30 ``` ucm :error myproject/main> update + Okay, I'm searching the branch for code that needs to be updated... 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 c78199984d..33363f22da 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,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,6 +29,7 @@ bar = 5 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -62,12 +64,14 @@ bar = 7 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo bar + bar : Nat bar = 7 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 a45e555c93..88b4665ced 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,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -24,6 +25,7 @@ foo = 5 ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : Nat @@ -51,12 +53,14 @@ foo = +5 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo + foo : Int foo = +5 diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index 7764b6b240..57e28e0dd9 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,6 +29,7 @@ bar = 5 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -57,12 +59,14 @@ foo = 6 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo bar + bar : Nat bar = 5 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 9e7189dd87..76a2a6dd64 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,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,6 +29,7 @@ bar = foo + 10 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -56,6 +58,7 @@ foo = +5 ``` ucm :error 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.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index 9961f5af9d..3a704ecafb 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -28,6 +29,7 @@ bar = foo + 10 ``` ucm scratch/main> add + ⍟ I've added these definitions: bar : Nat @@ -56,6 +58,7 @@ foo = 6 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -66,6 +69,7 @@ scratch/main> update Done. scratch/main> view bar + bar : Nat bar = use Nat + diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index 15c8fdeb47..f74e6fe586 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -24,6 +25,7 @@ foo = 5 ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : Nat @@ -51,12 +53,14 @@ foo = 6 ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo + foo : Nat foo = 6 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 6730a8f5f2..9625b5af3c 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,6 @@ ``` ucm scratch/main> builtins.merge + Done. ``` @@ -31,11 +32,13 @@ After adding the test `foo`, we expect `view` to render it like a test. (Bug: It ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : [Result] scratch/main> view foo + foo : [Result] foo = [] @@ -63,12 +66,14 @@ After updating `foo` to not be a test, we expect `view` to not render it like a ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view foo + foo : Nat foo = 1 diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index f59e5b9e33..617fb0efbe 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge + ``` Given a test that depends on another definition, @@ -14,6 +15,7 @@ test> mynamespace.foo.test = ``` ucm scratch/main> add + ⍟ I've added these definitions: foo : Nat -> Nat @@ -43,6 +45,7 @@ foo n = "hello, world!" ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index 1044de8db5..baa0adf2f7 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -22,6 +23,7 @@ unique type Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -50,15 +52,18 @@ unique type Foo ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = Bar Nat | Baz Nat Nat scratch/main> find.verbose + 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog type Foo diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 42e9f1773c..116143e4fe 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,6 +22,7 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -47,15 +49,18 @@ unique type Foo = Bar Nat Nat ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = Bar Nat Nat scratch/main> find.verbose + 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type 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 e6ee681c27..9a80bab106 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins + ``` ``` unison @@ -24,12 +25,14 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = { bar : Nat } ``` 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 8ec0ca19ea..23fa6982a6 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -24,6 +25,7 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -62,15 +64,18 @@ unique type Foo = { bar : Nat, baz : Int } ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose + 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 345b6ab209..7970e3b926 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,11 +22,13 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Foo.BarAlias + Done. ``` @@ -50,6 +53,7 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update + Sorry, I wasn't able to perform the update: The type Foo has a constructor with multiple names, and I 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 179543e0d8..4d6fe306be 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 @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -29,6 +30,7 @@ foo = cases ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -57,6 +59,7 @@ unique type Foo ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index f9857f4f62..e259f2a6c6 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -23,6 +24,7 @@ unique type Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -50,15 +52,18 @@ unique type Foo ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = Bar Nat scratch/main> find.verbose + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 df7e717b46..5ee6051f1a 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -27,6 +28,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -64,6 +66,7 @@ We want the field accessors to go away; but for now they are here, causing the u ``` ucm :error scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -74,9 +77,11 @@ scratch/main> update `update` again. scratch/main> view Foo + type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose + 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index c7b290d00c..56fcb8b8ce 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,11 +22,13 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> delete.term Foo.Bar + Done. ``` @@ -52,9 +55,11 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> view Foo + type Foo = #b509v3eg4k#0 Nat scratch/main> update + Sorry, I wasn't able to perform the update: The type Foo has some constructors with missing names, and I 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 57baafdd88..743a3bb8c0 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -26,6 +27,7 @@ structural type A = B.TheOtherAlias Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: structural type A @@ -54,6 +56,7 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update + The type A.B is an alias of A. I'm not able to perform an update when a type exists nested under an alias of itself. Please separate them or delete one copy, and then try updating 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 e377f7a9a8..4ab1a1af3e 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -24,6 +25,7 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -37,6 +39,7 @@ Bug: this no-op update should (of course) succeed. ``` ucm 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.output.md b/unison-src/transcripts/update-type-stray-constructor-alias.output.md index 8808921bb9..bb941f3ef9 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,11 +22,13 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> alias.term Foo.Bar Stray.BarAlias + Done. ``` @@ -50,6 +53,7 @@ unique type Foo = Bar Nat Nat ``` ucm :error scratch/main> update + Sorry, I wasn't able to perform the update, because I need all constructor names to be nested somewhere beneath the corresponding type name. diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index af341488d8..338b769122 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,11 +22,13 @@ unique type Foo = Bar Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo scratch/main> move.term Foo.Bar Stray.Bar + Done. ``` @@ -54,9 +57,11 @@ Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) ``` ucm :error scratch/main> view Foo + type Foo = Stray.Bar Nat scratch/main> update + Sorry, I wasn't able to perform the update: The type Foo has some constructors with missing names, and I 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 fa8a48f72d..0e47648e1f 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 @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -25,6 +26,7 @@ makeFoo n = Bar (n+10) ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -56,6 +58,7 @@ Foo.Bar n = internal.Bar n ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -66,9 +69,11 @@ scratch/main> update Done. scratch/main> view Foo + type Foo = internal.Bar Nat scratch/main> find.verbose + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 20766aa079..2ec99d8b5d 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 @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -21,6 +22,7 @@ unique type Foo = Nat ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -53,15 +55,18 @@ unique type Foo = { bar : Nat } ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. scratch/main> view Foo + type Foo = { bar : Nat } scratch/main> find.verbose + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo 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 e90d3afa95..115c871b2e 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -25,6 +26,7 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ucm scratch/main> add + ⍟ I've added these definitions: type Foo @@ -52,6 +54,7 @@ unique type Foo = Bar Nat Nat ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md index 94759f2593..5ff560bae8 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 @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -23,6 +24,7 @@ unique type Baz = Qux Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Baz @@ -50,6 +52,7 @@ unique type Foo a = Bar Nat a ``` ucm :error 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.output.md b/unison-src/transcripts/update-type-with-dependent-type.output.md index 978bba4c73..fed7c02ade 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin + ``` ``` unison @@ -23,6 +24,7 @@ unique type Baz = Qux Foo ``` ucm scratch/main> add + ⍟ I've added these definitions: type Baz @@ -50,6 +52,7 @@ unique type Foo = Bar Nat Nat ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... @@ -60,12 +63,15 @@ scratch/main> update Done. scratch/main> view Foo + type Foo = Bar Nat Nat scratch/main> view Baz + type Baz = Qux Foo scratch/main> find.verbose + 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 type Baz diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index 23984b651c..3de295bdcb 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -20,6 +20,7 @@ ``` ucm scratch/main> update + Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/upgrade-happy-path.output.md b/unison-src/transcripts/upgrade-happy-path.output.md index bae72e23f7..65c8727c83 100644 --- a/unison-src/transcripts/upgrade-happy-path.output.md +++ b/unison-src/transcripts/upgrade-happy-path.output.md @@ -1,5 +1,6 @@ ``` ucm :hide proj/main> builtins.merge lib.builtin + ``` ``` unison @@ -25,6 +26,7 @@ thingy = lib.old.foo + 10 ``` ucm proj/main> add + ⍟ I've added these definitions: lib.new.foo : Nat @@ -37,15 +39,18 @@ Test tab completion and fzf options of upgrade command. ``` ucm proj/main> debug.tab-complete upgrade ol + old proj/main> debug.fuzzy-options upgrade _ + Select a dependency to upgrade: * builtin * new * old proj/main> debug.fuzzy-options upgrade old _ + Select a dependency to upgrade to: * builtin * new @@ -55,13 +60,16 @@ proj/main> debug.fuzzy-options upgrade old _ ``` ucm proj/main> upgrade old new + I upgraded old to new, and removed old. proj/main> ls lib + 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) proj/main> view thingy + thingy : Nat thingy = use Nat + diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md index 33ac600eb3..1d3fc282cc 100644 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ b/unison-src/transcripts/upgrade-sad-path.output.md @@ -1,5 +1,6 @@ ``` ucm :hide proj/main> builtins.merge lib.builtin + ``` ``` unison @@ -25,6 +26,7 @@ thingy = lib.old.foo + 10 ``` ucm proj/main> add + ⍟ I've added these definitions: lib.new.foo : Int @@ -35,6 +37,7 @@ proj/main> add ``` ucm :error proj/main> upgrade old new + I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. @@ -82,25 +85,30 @@ thingy = foo + +10 ``` ucm proj/upgrade-old-to-new> update + Okay, I'm searching the branch for code that needs to be updated... Done. proj/upgrade-old-to-new> upgrade.commit + I fast-forward merged proj/upgrade-old-to-new into proj/main. proj/main> view thingy + thingy : Int thingy = use Int + foo + +10 proj/main> ls lib + 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) proj/main> branches + Branch Remote branch 1. main diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md index 70b28300e4..38ed75aaf2 100644 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ b/unison-src/transcripts/upgrade-suffixifies-properly.output.md @@ -1,5 +1,6 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin + ``` ``` unison @@ -33,6 +34,7 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ucm myproject/main> add + ⍟ I've added these definitions: a.x.x.x.x : Nat @@ -47,6 +49,7 @@ myproject/main> add ``` ucm :error myproject/main> upgrade old new + I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. diff --git a/unison-src/transcripts/upgrade-with-old-alias.output.md b/unison-src/transcripts/upgrade-with-old-alias.output.md index 0af15f3749..d512eea624 100644 --- a/unison-src/transcripts/upgrade-with-old-alias.output.md +++ b/unison-src/transcripts/upgrade-with-old-alias.output.md @@ -1,5 +1,6 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin + ``` ``` unison @@ -27,21 +28,25 @@ mything = lib.old.foo + 100 ``` ucm myproject/main> update + Okay, I'm searching the branch for code that needs to be updated... Done. myproject/main> upgrade old new + I upgraded old to new, and removed old. myproject/main> view mything + mything : Nat mything = use Nat + foo + 100 myproject/main> view bar + bar : Nat bar = 141 diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index a3ace04d42..a285626959 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -2,6 +2,7 @@ ``` ucm :hide scratch/main> builtins.merge + ``` ``` unison :hide @@ -11,11 +12,13 @@ b.thing = "b" ``` ucm :hide scratch/main> add + ``` ``` ucm -- Should suffix-search and find values in sub-namespaces scratch/main> view thing + a.thing : Text a.thing = "a" @@ -24,6 +27,7 @@ scratch/main> view thing -- Should support absolute paths scratch/main> view .b.thing + .b.thing : Text .b.thing = "b" diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 480245a977..9d39d34d2b 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -1,5 +1,6 @@ ``` ucm scratch/main> builtins.mergeio + Done. ``` @@ -30,6 +31,7 @@ test> pass = [Ok "Passed"] ``` ucm scratch/main> add + ⍟ I've added these definitions: pass : [Result] @@ -57,9 +59,11 @@ test> pass = [Ok "Passed"] ``` ucm scratch/main> add + ⊡ Ignored previously added definitions: pass scratch/main> test + Cached test results (`help testcache` to learn more) 1. pass ◉ Passed From a22f9a388c772045cf97a576ff219006963bbe9e Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 11:44:27 -0600 Subject: [PATCH 06/15] Make transcripts idempotent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This provides the final pieces to make transcripts idempotent enough that we can use transcript outputs as inputs. This simplifies bug reporting, as now the GitHub issue can be written _as_ a transcript, even if you want to include some of the output in the bug report. No need to wrap the entire transcript in ` ```` markdown`. The parser changes here also improve error messages in some existing cases. There are some caveats: - failing transcripts are not _yet_ idempotent. There are issues with how errors are reported (especially parse failures) that make them not round-trip - `:hide:all` almost always breaks idempotency. This is intentional – to just hide the output, use `:hide` instead. --- .github/ISSUE_TEMPLATE/bug_report.md | 23 +- .../IntegrationTests/transcript.output.md | 11 +- unison-cli/src/Unison/Codebase/Transcript.hs | 2 + .../src/Unison/Codebase/Transcript/Parser.hs | 81 +- .../src/Unison/Codebase/Transcript/Runner.hs | 48 +- .../transcripts-manual/docs.to-html.output.md | 9 +- .../transcripts-manual/rewrites.output.md | 77 +- .../transcripts-round-trip/main.output.md | 44 +- .../transcripts-using-base/_base.output.md | 18 +- .../all-base-hashes.output.md | 2 - .../binary-encoding-nats.output.md | 14 +- .../transcripts-using-base/codeops.output.md | 56 +- .../transcripts-using-base/doc.output.md | 119 +- .../failure-tests.output.md | 21 +- .../fix2158-1.output.md | 4 +- .../transcripts-using-base/fix2297.output.md | 5 +- .../transcripts-using-base/fix2358.output.md | 5 +- .../transcripts-using-base/fix3166.output.md | 20 +- .../transcripts-using-base/fix3542.output.md | 6 +- .../transcripts-using-base/fix3939.output.md | 10 +- .../transcripts-using-base/fix4746.output.md | 6 +- .../transcripts-using-base/fix5129.output.md | 19 +- .../transcripts-using-base/hashing.output.md | 61 +- .../transcripts-using-base/mvar.output.md | 14 +- .../nat-coersion.output.md | 14 +- .../transcripts-using-base/net.output.md | 29 +- .../random-deserial.output.md | 14 +- .../ref-promise.output.md | 63 +- .../serial-test-00.output.md | 8 +- .../serial-test-01.output.md | 8 +- .../serial-test-02.output.md | 8 +- .../serial-test-03.output.md | 8 +- .../serial-test-04.output.md | 8 +- .../transcripts-using-base/stm.output.md | 21 +- .../test-watch-dependencies.output.md | 21 +- .../transcripts-using-base/thread.output.md | 34 +- .../transcripts-using-base/tls.output.md | 43 +- .../transcripts-using-base/utf8.output.md | 26 +- unison-src/transcripts/abilities.output.md | 8 +- ...ability-order-doesnt-affect-hash.output.md | 8 +- ...ability-term-conflicts-on-update.output.md | 56 +- unison-src/transcripts/add-run.output.md | 72 +- .../add-test-watch-roundtrip.output.md | 5 +- .../transcripts/addupdatemessages.output.md | 25 +- unison-src/transcripts/alias-many.output.md | 11 +- unison-src/transcripts/alias-term.output.md | 9 +- unison-src/transcripts/alias-type.output.md | 9 +- unison-src/transcripts/anf-tests.output.md | 10 +- unison-src/transcripts/any-extract.output.md | 12 +- .../transcripts/api-doc-rendering.output.md | 1589 ++-- unison-src/transcripts/api-find.output.md | 433 +- .../transcripts/api-getDefinition.output.md | 965 ++- .../api-list-projects-branches.output.md | 102 +- .../api-namespace-details.output.md | 92 +- .../transcripts/api-namespace-list.output.md | 200 +- .../transcripts/api-summaries.output.md | 1574 ++-- .../block-on-required-update.output.md | 17 +- unison-src/transcripts/blocks.output.md | 60 +- .../boolean-op-pretty-print-2819.output.md | 9 +- .../transcripts/branch-command.output.md | 68 +- .../branch-relative-path.output.md | 24 +- unison-src/transcripts/bug-fix-4354.output.md | 5 +- .../transcripts/bug-strange-closure.output.md | 75 +- .../transcripts/builtins-merge.output.md | 2 - unison-src/transcripts/builtins.output.md | 61 +- .../transcripts/bytesFromList.output.md | 7 +- unison-src/transcripts/check763.output.md | 10 +- unison-src/transcripts/check873.output.md | 12 +- .../constructor-applied-to-unit.output.md | 10 +- .../transcripts/contrabilities.output.md | 5 +- .../transcripts/create-author.output.md | 8 +- .../transcripts/cycle-update-1.output.md | 16 +- .../transcripts/cycle-update-2.output.md | 16 +- .../transcripts/cycle-update-3.output.md | 18 +- .../transcripts/cycle-update-4.output.md | 24 +- .../transcripts/debug-definitions.output.md | 11 +- .../transcripts/debug-name-diffs.output.md | 30 +- unison-src/transcripts/deep-names.output.md | 20 - .../transcripts/definition-diff-api.output.md | 6944 ++++++++--------- ...elete-namespace-dependents-check.output.md | 19 +- .../transcripts/delete-namespace.output.md | 35 +- .../delete-project-branch.output.md | 18 +- .../transcripts/delete-project.output.md | 23 +- .../transcripts/delete-silent.output.md | 9 +- unison-src/transcripts/delete.output.md | 134 +- ...ependents-dependencies-debugfile.output.md | 42 +- .../transcripts/destructuring-binds.output.md | 39 +- .../transcripts/diff-namespace.output.md | 149 +- .../transcripts/doc-formatting.output.md | 81 +- .../doc-type-link-keywords.output.md | 6 - unison-src/transcripts/doc1.output.md | 31 +- unison-src/transcripts/doc2.output.md | 2 - unison-src/transcripts/doc2markdown.output.md | 78 +- ...t-upgrade-refs-that-exist-in-old.output.md | 10 +- .../transcripts/duplicate-names.output.md | 39 +- .../duplicate-term-detection.output.md | 33 +- unison-src/transcripts/ed25519.output.md | 9 +- unison-src/transcripts/edit-command.output.md | 21 +- .../transcripts/edit-namespace.output.md | 18 +- .../transcripts/empty-namespaces.output.md | 58 +- .../transcripts/emptyCodebase.output.md | 5 - .../transcripts/error-messages.output.md | 132 +- .../errors/code-block-parse-error.output.md | 7 +- .../dont-hide-unexpected-ucm-errors.output.md | 7 +- ...nt-hide-unexpected-unison-errors.output.md | 36 +- .../errors/info-string-parse-error.output.md | 7 +- .../errors/invalid-api-requests.output.md | 7 +- .../errors/missing-result-typed.output.md | 15 +- .../errors/missing-result.output.md | 12 +- .../errors/no-abspath-in-ucm.output.md | 7 +- .../transcripts/errors/ucm-hide-all.output.md | 6 +- .../errors/ucm-hide-error.output.md | 5 - .../transcripts/errors/ucm-hide.output.md | 6 +- .../errors/unison-hide-all.output.md | 25 +- .../transcripts/errors/unison-hide.output.md | 25 +- .../transcripts/escape-sequences.output.md | 10 +- unison-src/transcripts/find-by-type.output.md | 14 +- unison-src/transcripts/find-command.output.md | 29 +- .../fix-1381-excess-propagate.output.md | 14 +- .../fix-2258-if-as-list-element.output.md | 1 - unison-src/transcripts/fix-5267.output.md | 17 +- unison-src/transcripts/fix-5301.output.md | 11 +- unison-src/transcripts/fix-5312.output.md | 13 +- unison-src/transcripts/fix-5320.output.md | 6 +- unison-src/transcripts/fix-5323.output.md | 9 +- unison-src/transcripts/fix-5326.output.md | 36 +- unison-src/transcripts/fix-5340.output.md | 16 +- unison-src/transcripts/fix-5357.output.md | 20 +- unison-src/transcripts/fix-5369.output.md | 12 +- unison-src/transcripts/fix-5374.output.md | 14 +- unison-src/transcripts/fix-5380.output.md | 10 +- unison-src/transcripts/fix-5402.output.md | 8 +- .../transcripts/fix-big-list-crash.output.md | 5 +- unison-src/transcripts/fix-ls.output.md | 10 +- unison-src/transcripts/fix1063.output.md | 9 +- unison-src/transcripts/fix1327.output.md | 15 +- unison-src/transcripts/fix1334.output.md | 2 - unison-src/transcripts/fix1390.output.md | 13 +- unison-src/transcripts/fix1421.output.md | 6 +- unison-src/transcripts/fix1532.output.md | 19 +- unison-src/transcripts/fix1696.output.md | 6 +- unison-src/transcripts/fix1709.output.md | 13 +- unison-src/transcripts/fix1731.output.md | 6 +- unison-src/transcripts/fix1800.output.md | 31 +- unison-src/transcripts/fix1844.output.md | 6 +- unison-src/transcripts/fix1926.output.md | 13 +- unison-src/transcripts/fix2026.output.md | 6 +- unison-src/transcripts/fix2027.output.md | 12 +- unison-src/transcripts/fix2049.output.md | 21 +- unison-src/transcripts/fix2053.output.md | 2 - unison-src/transcripts/fix2156.output.md | 7 +- unison-src/transcripts/fix2167.output.md | 5 +- unison-src/transcripts/fix2187.output.md | 5 +- unison-src/transcripts/fix2231.output.md | 8 +- unison-src/transcripts/fix2238.output.md | 10 +- unison-src/transcripts/fix2244.output.md | 5 +- unison-src/transcripts/fix2254.output.md | 37 +- unison-src/transcripts/fix2268.output.md | 5 +- unison-src/transcripts/fix2334.output.md | 13 +- unison-src/transcripts/fix2344.output.md | 5 +- unison-src/transcripts/fix2350.output.md | 4 +- unison-src/transcripts/fix2353.output.md | 5 +- unison-src/transcripts/fix2354.output.md | 10 +- unison-src/transcripts/fix2355.output.md | 14 +- unison-src/transcripts/fix2378.output.md | 5 +- unison-src/transcripts/fix2423.output.md | 5 +- unison-src/transcripts/fix2474.output.md | 5 +- unison-src/transcripts/fix2628.output.md | 6 +- unison-src/transcripts/fix2663.output.md | 7 +- unison-src/transcripts/fix2693.output.md | 20 +- unison-src/transcripts/fix2712.output.md | 12 +- unison-src/transcripts/fix2795.output.md | 7 +- unison-src/transcripts/fix2822.output.md | 29 +- unison-src/transcripts/fix2826.output.md | 14 +- unison-src/transcripts/fix2840.output.md | 5 +- unison-src/transcripts/fix2970.output.md | 5 +- unison-src/transcripts/fix3037.output.md | 19 +- unison-src/transcripts/fix3171.output.md | 9 +- unison-src/transcripts/fix3196.output.md | 7 +- unison-src/transcripts/fix3215.output.md | 5 +- unison-src/transcripts/fix3244.output.md | 7 +- unison-src/transcripts/fix3265.output.md | 13 +- unison-src/transcripts/fix3424.output.md | 7 +- unison-src/transcripts/fix3634.output.md | 11 +- unison-src/transcripts/fix3678.output.md | 7 +- unison-src/transcripts/fix3752.output.md | 5 +- unison-src/transcripts/fix3773.output.md | 7 +- unison-src/transcripts/fix3977.output.md | 10 +- unison-src/transcripts/fix4172.output.md | 33 +- unison-src/transcripts/fix4280.output.md | 5 +- unison-src/transcripts/fix4397.output.md | 2 +- unison-src/transcripts/fix4415.output.md | 4 +- unison-src/transcripts/fix4424.output.md | 5 +- unison-src/transcripts/fix4482.output.md | 19 +- unison-src/transcripts/fix4498.output.md | 9 +- unison-src/transcripts/fix4515.output.md | 13 +- unison-src/transcripts/fix4528.output.md | 9 +- unison-src/transcripts/fix4556.output.md | 13 +- unison-src/transcripts/fix4592.output.md | 5 +- unison-src/transcripts/fix4618.output.md | 13 +- unison-src/transcripts/fix4711.output.md | 14 +- unison-src/transcripts/fix4722.output.md | 5 +- unison-src/transcripts/fix4731.output.md | 22 +- unison-src/transcripts/fix4780.output.md | 7 +- unison-src/transcripts/fix4898.output.md | 16 +- unison-src/transcripts/fix5055.output.md | 10 +- unison-src/transcripts/fix5076.output.md | 5 +- unison-src/transcripts/fix5080.output.md | 29 +- unison-src/transcripts/fix5168.output.md | 4 +- unison-src/transcripts/fix5349.output.md | 24 +- unison-src/transcripts/fix614.output.md | 30 +- unison-src/transcripts/fix689.output.md | 5 +- unison-src/transcripts/fix693.output.md | 45 +- unison-src/transcripts/fix845.output.md | 34 +- unison-src/transcripts/fix849.output.md | 7 +- unison-src/transcripts/fix942.output.md | 34 +- unison-src/transcripts/fix987.output.md | 15 +- unison-src/transcripts/formatter.output.md | 17 +- .../transcripts/fuzzy-options.output.md | 12 +- .../generic-parse-errors.output.md | 51 +- unison-src/transcripts/hello.output.md | 19 +- unison-src/transcripts/help.output.md | 316 +- unison-src/transcripts/higher-rank.output.md | 25 +- .../transcripts/input-parse-errors.output.md | 19 +- .../transcripts/io-test-command.output.md | 34 +- unison-src/transcripts/io.output.md | 170 +- .../transcripts/kind-inference.output.md | 45 +- unison-src/transcripts/lambdacase.output.md | 41 +- .../transcripts/lsp-fold-ranges.output.md | 10 +- .../transcripts/lsp-name-completion.output.md | 4 - unison-src/transcripts/merge.output.md | 676 +- unison-src/transcripts/move-all.output.md | 47 +- .../transcripts/move-namespace.output.md | 112 +- .../transcripts/name-resolution.output.md | 105 +- .../transcripts/name-segment-escape.output.md | 12 +- .../transcripts/name-selection.output.md | 38 +- unison-src/transcripts/names.output.md | 24 +- .../namespace-deletion-regression.output.md | 5 - .../namespace-dependencies.output.md | 5 +- .../transcripts/namespace-directive.output.md | 37 +- .../transcripts/numbered-args.output.md | 40 +- .../transcripts/old-fold-right.output.md | 5 +- .../pattern-match-coverage.output.md | 206 +- .../pattern-pretty-print-2345.output.md | 22 +- .../transcripts/patternMatchTls.output.md | 9 +- unison-src/transcripts/patterns.output.md | 9 +- unison-src/transcripts/propagate.output.md | 35 +- unison-src/transcripts/pull-errors.output.md | 14 +- unison-src/transcripts/records.output.md | 18 +- unison-src/transcripts/reflog.output.md | 36 +- .../release-draft-command.output.md | 16 +- unison-src/transcripts/reset.output.md | 71 +- .../transcripts/resolution-failures.output.md | 23 +- unison-src/transcripts/rsa.output.md | 11 +- unison-src/transcripts/scope-ref.output.md | 7 +- unison-src/transcripts/suffixes.output.md | 39 +- .../sum-type-update-conflicts.output.md | 19 +- .../transcripts/switch-command.output.md | 28 +- .../transcripts/tab-completion.output.md | 45 +- unison-src/transcripts/tdnr.output.md | 266 +- unison-src/transcripts/test-command.output.md | 59 +- .../transcripts/text-literals.output.md | 19 +- unison-src/transcripts/textfind.output.md | 77 +- .../transcripts/todo-bug-builtins.output.md | 33 +- unison-src/transcripts/todo.output.md | 114 +- .../top-level-exceptions.output.md | 30 +- .../transcript-parser-commands.output.md | 14 +- unison-src/transcripts/type-deps.output.md | 14 +- .../type-modifier-are-optional.output.md | 5 +- unison-src/transcripts/undo.output.md | 70 +- .../transcripts/unique-type-churn.output.md | 28 +- .../transcripts/unitnamespace.output.md | 12 +- .../transcripts/universal-cmp.output.md | 21 +- .../transcripts/unsafe-coerce.output.md | 17 +- .../update-ignores-lib-namespace.output.md | 14 +- .../transcripts/update-on-conflict.output.md | 15 +- .../update-suffixifies-properly.output.md | 13 +- ...e-term-aliases-in-different-ways.output.md | 16 +- .../update-term-to-different-type.output.md | 14 +- .../update-term-with-alias.output.md | 16 +- ...with-dependent-to-different-type.output.md | 13 +- .../update-term-with-dependent.output.md | 14 +- unison-src/transcripts/update-term.output.md | 14 +- .../update-test-to-non-test.output.md | 17 +- .../update-test-watch-roundtrip.output.md | 9 +- .../update-type-add-constructor.output.md | 16 +- .../update-type-add-field.output.md | 16 +- .../update-type-add-new-record.output.md | 7 +- .../update-type-add-record-field.output.md | 16 +- .../update-type-constructor-alias.output.md | 20 +- ...elete-constructor-with-dependent.output.md | 13 +- .../update-type-delete-constructor.output.md | 16 +- .../update-type-delete-record-field.output.md | 16 +- .../update-type-missing-constructor.output.md | 19 +- .../update-type-nested-decl-aliases.output.md | 13 +- .../update-type-no-op-record.output.md | 9 +- ...ate-type-stray-constructor-alias.output.md | 16 +- .../update-type-stray-constructor.output.md | 19 +- ...nstructor-into-smart-constructor.output.md | 16 +- ...type-turn-non-record-into-record.output.md | 16 +- .../update-type-with-dependent-term.output.md | 13 +- ...dependent-type-to-different-kind.output.md | 13 +- .../update-type-with-dependent-type.output.md | 17 +- unison-src/transcripts/update-watch.output.md | 7 +- .../transcripts/upgrade-happy-path.output.md | 14 +- .../transcripts/upgrade-sad-path.output.md | 28 +- .../upgrade-suffixifies-properly.output.md | 19 +- .../upgrade-with-old-alias.output.md | 9 +- unison-src/transcripts/view.output.md | 6 +- .../transcripts/watch-expressions.output.md | 30 +- 310 files changed, 8896 insertions(+), 10898 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f19a71acab..db744e89db 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,33 +8,18 @@ assignees: '' --- **Describe and demonstrate the bug** -Please attach a [ucm transcript](https://www.unison-lang.org/docs/tooling/transcripts/) if possible, calling out the unexpected behavior in the text. e.g. +This should be written as a [ucm transcript](https://www.unison-lang.org/docs/tooling/transcripts/) if possible, calling out the unexpected behavior in the text. e.g. -Input: -```` markdown -``` unison :hide -a = 1 -``` -Here I typo the next command and `ucm` silently does nothing. I would have expected an error message: -``` ucm -.> add b -``` -```` - -Output: -```` markdown -``` unison +``` unison :hidec a = 1 ``` Here I typo the next command and `ucm` silently does nothing, I would have expected an error message: -``` ucm -.> add b - +``` ucm +scratch/main> add b ``` -```` **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md index 90c54f796a..3e9f360894 100644 --- a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md +++ b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md @@ -2,11 +2,8 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - scratch/main> load ./unison-src/transcripts-using-base/base.u - scratch/main> add - ``` ``` unison @@ -37,31 +34,29 @@ main = do ``` ``` ucm :added-by-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 ability Break type MyBool main : '{IO, Exception} () resume : Request {g, Break} x -> x - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural ability Break type MyBool main : '{IO, Exception} () resume : Request {g, Break} x -> x - scratch/main> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main - ``` diff --git a/unison-cli/src/Unison/Codebase/Transcript.hs b/unison-cli/src/Unison/Codebase/Transcript.hs index f6e34642d6..81d56e7e8c 100644 --- a/unison-cli/src/Unison/Codebase/Transcript.hs +++ b/unison-cli/src/Unison/Codebase/Transcript.hs @@ -34,6 +34,7 @@ data UcmLine = UcmCommand UcmContext Text | -- | Text does not include the '--' prefix. UcmComment Text + | UcmOutputLine Text deriving (Eq, Show) -- | Where a command is run: a project branch (myproject/mybranch>). @@ -44,6 +45,7 @@ data UcmContext data APIRequest = GetRequest Text | APIComment Text + | APIResponseLine Text deriving (Eq, Show) pattern CMarkCodeBlock :: (Maybe CMark.PosInfo) -> Text -> Text -> CMark.Node diff --git a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs index 172bf4aa73..f186ae0e29 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs @@ -14,9 +14,6 @@ module Unison.Codebase.Transcript.Parser hidden, expectingError, language, - - -- * utilities - processedBlockToNode', ) where @@ -29,15 +26,20 @@ import Unison.Codebase.Transcript hiding (expectingError, generated, hidden) import Unison.Prelude import Unison.Project (fullyQualifiedProjectAndBranchNamesParser) +padIfNonEmpty :: Text -> Text +padIfNonEmpty line = if Text.null line then line else " " <> line + formatAPIRequest :: APIRequest -> Text formatAPIRequest = \case - GetRequest txt -> "GET " <> txt - APIComment txt -> "-- " <> txt + GetRequest txt -> "GET " <> txt <> "\n" + APIComment txt -> "--" <> txt <> "\n" + APIResponseLine txt -> Text.unlines . fmap padIfNonEmpty $ Text.lines txt formatUcmLine :: UcmLine -> Text formatUcmLine = \case UcmCommand context txt -> formatContext context <> "> " <> txt <> "\n" - UcmComment txt -> "--" <> txt + UcmComment txt -> "--" <> txt <> "\n" + UcmOutputLine txt -> Text.unlines . fmap padIfNonEmpty $ Text.lines txt where formatContext (UcmContextProject projectAndBranch) = into @Text projectAndBranch @@ -45,18 +47,13 @@ formatStanzas :: [Stanza] -> Text formatStanzas = CMark.nodeToCommonmark [] Nothing . CMark.Node Nothing CMark.DOCUMENT . fmap (either id processedBlockToNode) --- | --- --- __NB__: This convenience function is exposed until `ProcessedBlock` can store UCM command output and API responses. --- Until then, this is used by the `Unison.Codebase.Transcript.Runner`. This should change with #5199. -processedBlockToNode' :: (a -> Text) -> Text -> InfoTags a -> Text -> CMark.Node -processedBlockToNode' formatA lang tags body = CMarkCodeBlock Nothing (formatInfoString formatA lang tags) body - processedBlockToNode :: ProcessedBlock -> CMark.Node processedBlockToNode = \case - Ucm tags cmds -> processedBlockToNode' (\() -> "") "ucm" tags $ foldr ((<>) . formatUcmLine) "" cmds - Unison tags txt -> processedBlockToNode' (maybe "" (" " <>)) "unison" tags txt - API tags apiRequests -> processedBlockToNode' (\() -> "") "api" tags $ foldr ((<>) . formatAPIRequest) "" apiRequests + Ucm tags cmds -> mkNode (\() -> "") "ucm" tags $ foldr ((<>) . formatUcmLine) "" cmds + Unison tags txt -> mkNode (maybe "" (" " <>)) "unison" tags txt + API tags apiRequests -> mkNode (\() -> "") "api" tags $ foldr ((<>) . formatAPIRequest) "" apiRequests + where + mkNode formatA lang = CMarkCodeBlock Nothing . formatInfoString formatA lang type P = P.Parsec Void Text @@ -73,35 +70,30 @@ stanzas srcName = _ -> pure $ Left node ucmLine :: P UcmLine -ucmLine = ucmCommand <|> ucmComment +ucmLine = ucmOutputLine <|> ucmComment <|> ucmCommand where ucmCommand :: P UcmLine ucmCommand = UcmCommand - <$> fmap UcmContextProject (P.try $ fullyQualifiedProjectAndBranchNamesParser <* lineToken (word ">")) - <*> P.takeWhileP Nothing (/= '\n') - <* spaces + <$> fmap UcmContextProject (fullyQualifiedProjectAndBranchNamesParser <* lineToken (word ">") <* nonNewlineSpaces) + <*> restOfLine ucmComment :: P UcmLine ucmComment = P.label "comment (delimited with “--”)" $ - UcmComment <$> (word "--" *> P.takeWhileP Nothing (/= '\n')) <* spaces + UcmComment <$> (word "--" *> restOfLine) + + ucmOutputLine :: P UcmLine + ucmOutputLine = UcmOutputLine <$> (word " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") + +restOfLine :: P Text +restOfLine = P.takeWhileP Nothing (/= '\n') <* P.single '\n' apiRequest :: P APIRequest -apiRequest = do - apiComment <|> getRequest - where - getRequest = do - word "GET" - spaces - path <- P.takeWhile1P Nothing (/= '\n') - spaces - pure (GetRequest path) - apiComment = do - word "--" - comment <- P.takeWhileP Nothing (/= '\n') - spaces - pure (APIComment comment) +apiRequest = + GetRequest <$> (word "GET" *> spaces *> restOfLine) + <|> APIComment <$> (word "--" *> restOfLine) + <|> APIResponseLine <$> (word " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") formatInfoString :: (a -> Text) -> Text -> InfoTags a -> Text formatInfoString formatA language infoTags = @@ -119,29 +111,20 @@ infoTags p = <*> lineToken expectingError <*> lineToken generated <*> p + <* P.single '\n' -- | Parses the info string and contents of a fenced code block. fenced :: P (Maybe ProcessedBlock) fenced = do fenceType <- lineToken language case fenceType of - "ucm" -> do - it <- infoTags $ pure () - pure . Ucm it <$> (spaces *> P.manyTill ucmLine P.eof) - "unison" -> do - it <- infoTags $ optional untilSpace1 - P.single '\n' - pure . Unison it <$> P.getInput - "api" -> do - it <- infoTags $ pure () - pure . API it <$> (spaces *> P.manyTill apiRequest P.eof) + "ucm" -> fmap pure $ Ucm <$> infoTags (pure ()) <*> P.manyTill ucmLine P.eof + "unison" -> fmap pure $ Unison <$> infoTags (optional untilSpace1) <*> P.getInput + "api" -> fmap pure $ API <$> infoTags (pure ()) <*> P.manyTill apiRequest P.eof _ -> pure Nothing word :: Text -> P Text -word txt = P.try $ do - chs <- P.takeP (Just $ show txt) (Text.length txt) - guard (chs == txt) - pure txt +word = P.chunk lineToken :: P a -> P a lineToken p = p <* nonNewlineSpaces diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index cdf3189fb3..15b4182800 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -190,12 +190,16 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL outputEcho = output' True outputUcmLine :: UcmLine -> IO () - outputUcmLine line = modifyIORef' ucmOutput (<> pure (Transcript.formatUcmLine line)) + outputUcmLine line = modifyIORef' ucmOutput (<> pure line) - outputUcmResult :: String -> IO () + outputUcmResult :: Pretty.Pretty Pretty.ColorText -> IO () outputUcmResult line = do hide <- readIORef isHidden - unless (hideOutput False hide) $ modifyIORef' ucmOutput (<> pure (Text.pack line)) + unless (hideOutput False hide) $ + -- We shorten the terminal width, because "Transcript" manages a 2-space indent for output lines. + modifyIORef' + ucmOutput + (<> pure (UcmOutputLine . Text.pack $ Pretty.toPlain (terminalWidth - 2) $ "\n" <> line)) maybeDieWithMsg :: String -> IO () maybeDieWithMsg msg = do @@ -204,12 +208,13 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL then writeIORef hasErrors True else dieWithMsg msg - apiRequest :: APIRequest -> IO [Text] + apiRequest :: APIRequest -> IO [APIRequest] apiRequest req = do hide <- readIORef isHidden - let input = Transcript.formatAPIRequest req case req of - APIComment {} -> pure $ pure input + -- We just discard this, because the runner will produce new output lines. + APIResponseLine {} -> pure [] + APIComment {} -> pure $ pure req GetRequest path -> either (([] <$) . maybeDieWithMsg . show) @@ -218,10 +223,10 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL ( \(v :: Aeson.Value) -> pure $ if hide == HideOutput - then [input] + then [req] else - [ input, - Text.pack . BL.unpack $ + [ req, + APIResponseLine . Text.pack . BL.unpack $ Aeson.encodePretty' (Aeson.defConfig {Aeson.confCompare = compare}) v ] ) @@ -237,12 +242,8 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO $ do tags <- readIORef currentTags ucmOut <- readIORef ucmOutput - unless (null ucmOut && tags == Nothing) - . outputEcho - . Left - . Transcript.processedBlockToNode' (\() -> "") "ucm" (fromMaybe defaultInfoTags' {generated = True} tags) - $ Text.unlines ucmOut - + unless (null ucmOut && tags == Nothing) . outputEcho . pure $ + Ucm (fromMaybe defaultInfoTags' {generated = True} tags) ucmOut writeIORef ucmOutput [] dieUnexpectedSuccess atomically $ void $ do @@ -255,6 +256,8 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL processUcmLine p = case p of + -- We just discard this, because the runner will produce new output lines. + UcmOutputLine {} -> Cli.returnEarlyWithoutOutput UcmComment {} -> do liftIO $ outputUcmLine p Cli.returnEarlyWithoutOutput @@ -306,7 +309,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO $ writeIORef hasErrors True liftIO (readIORef allowErrors) >>= \case True -> do - liftIO . outputUcmResult . Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg + liftIO $ outputUcmResult msg Cli.returnEarlyWithoutOutput False -> liftIO . dieWithMsg $ Pretty.toPlain terminalWidth msg ) @@ -329,8 +332,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL liftIO do writeIORef isHidden $ hidden infoTags writeIORef allowErrors $ expectingError infoTags - outputEcho . Left . Transcript.processedBlockToNode' (\() -> "") "api" infoTags . Text.unlines . fold - =<< traverse apiRequest apiRequests + outputEcho . pure . API infoTags . fold =<< traverse apiRequest apiRequests Cli.returnEarlyWithoutOutput Ucm infoTags cmds -> do liftIO do @@ -405,23 +407,21 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL print o = do msg <- notifyUser dir o errOk <- readIORef allowErrors - let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" - outputUcmResult rendered + outputUcmResult msg when (Output.isFailure o) $ if errOk then writeIORef hasErrors True - else dieWithMsg rendered + else dieWithMsg $ Pretty.toPlain terminalWidth msg printNumbered :: Output.NumberedOutput -> IO Output.NumberedArgs printNumbered o = do let (msg, numberedArgs) = notifyNumbered o errOk <- readIORef allowErrors - let rendered = Pretty.toPlain terminalWidth $ Pretty.indentN 2 msg <> "\n" - outputUcmResult rendered + outputUcmResult msg when (Output.isNumberedFailure o) $ if errOk then writeIORef hasErrors True - else dieWithMsg rendered + else dieWithMsg $ Pretty.toPlain terminalWidth msg pure numberedArgs -- Looks at the current stanza and decides if it is contained in the diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index 7bd98a5beb..6da8205455 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -2,7 +2,6 @@ test-html-docs/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -17,12 +16,13 @@ some.outside = 3 ``` ``` ucm :added-by-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`: some.ns.direct : Nat @@ -31,21 +31,18 @@ some.outside = 3 some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat some.outside.doc : Doc2 - ``` ``` ucm test-html-docs/main> add ⍟ I've added these definitions: - + some.ns.direct : Nat some.ns.direct.doc : Doc2 some.ns.pretty.deeply.nested : Nat some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat some.outside.doc : Doc2 - test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html - ``` diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 76fd61a73c..55aeec3932 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -1,10 +1,7 @@ ``` ucm :hide scratch/main> builtins.mergeio - scratch/main> load unison-src/transcripts-using-base/base.u - scratch/main> add - ``` ## Structural find and replace @@ -42,20 +39,18 @@ Let's rewrite these: scratch/main> rewrite rule1 ☝️ - + I found and replaced matches in these definitions: ex1 - - The rewritten file has been added to the top of scratch.u + The rewritten file has been added to the top of scratch.u scratch/main> rewrite eitherToOptional ☝️ - + I found and replaced matches in these definitions: Either.mapRight - - The rewritten file has been added to the top of scratch.u + The rewritten file has been added to the top of scratch.u ``` ``` unison :added-by-ucm scratch.u @@ -120,9 +115,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 ``` ucm :hide scratch/main> load - scratch/main> add - ``` After adding to the codebase, here's the rewritten source: @@ -134,10 +127,10 @@ scratch/main> view ex1 Either.mapRight rule1 Either.mapRight f = cases None -> None Some a -> Some (f a) - + ex1 : [Nat] ex1 = List.map Nat.increment [1, 2, 3, 4, 5, 6, 7] - + rule1 : (i ->{g} o) -> Nat @@ -149,7 +142,6 @@ scratch/main> view ex1 Either.mapRight rule1 @rewrite term x + 1 ==> Nat.increment x term a -> f a ==> f - ``` Another example, showing that we can rewrite to definitions that only exist in the file: @@ -178,11 +170,10 @@ Let's apply the rewrite `woot1to2`: scratch/main> rewrite woot1to2 ☝️ - + I found and replaced matches in these definitions: wootEx - - The rewritten file has been added to the top of scratch.u + The rewritten file has been added to the top of scratch.u ``` ``` unison :added-by-ucm scratch.u @@ -211,9 +202,7 @@ blah2 = 456 ``` ucm :hide scratch/main> load - scratch/main> add - ``` After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: @@ -225,7 +214,6 @@ scratch/main> view wootEx wootEx a = _ = woot2() blah2 - ``` This example shows that rewrite rules can to refer to term definitions that only exist in the file: @@ -251,11 +239,8 @@ sameFileEx = ``` ucm :hide scratch/main> rewrite rule - scratch/main> load - scratch/main> add - ``` After adding the rewritten form to the codebase, here's the rewritten definitions: @@ -267,17 +252,16 @@ scratch/main> view foo1 foo2 sameFileEx foo1 = b = "b" 123 - + foo2 : Nat foo2 = a = "a" 233 - + sameFileEx : Nat sameFileEx = _ = "ex" foo2 - ``` ## Capture avoidance @@ -306,11 +290,10 @@ In the above example, `bar2` is locally bound by the rule, so when applied, it s scratch/main> rewrite rule ☝️ - + I found and replaced matches in these definitions: sameFileEx - - The rewritten file has been added to the top of scratch.u + The rewritten file has been added to the top of scratch.u ``` ``` unison :added-by-ucm scratch.u @@ -343,18 +326,17 @@ scratch/main> load Loading changes detected in scratch.u. I couldn't figure out what bar21 refers to here: - + 19 | bar21 - + I also don't know what type it should be. - + Some common causes of this error include: * Your current namespace is too deep to contain the definition in its subtree * The definition is part of a library which hasn't been added to this project * You have a typo in the name - ``` 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: @@ -373,11 +355,10 @@ rule a = @rewrite scratch/main> rewrite rule ☝️ - + I found and replaced matches in these definitions: bar2 - - The rewritten file has been added to the top of scratch.u + The rewritten file has been added to the top of scratch.u ``` ``` unison :added-by-ucm scratch.u @@ -402,18 +383,17 @@ scratch/main> load Loading changes detected in scratch.u. I couldn't figure out what a1 refers to here: - + 6 | a1 - + I also don't know what type it should be. - + Some common causes of this error include: * Your current namespace is too deep to contain the definition in its subtree * The definition is part of a library which hasn't been added to this project * You have a typo in the name - ``` ## Structural find @@ -424,7 +404,6 @@ eitherEx = Left ("hello", "there") ``` ucm :hide scratch/main> add - ``` ``` unison :hide @@ -436,28 +415,26 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () scratch/main> sfind findEitherEx 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. eitherEx - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> sfind findEitherFailure 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. catch 2. printText 3. reraise 4. toEither 5. toEither.handler - + Tip: Try `edit 1` or `edit 1-5` to bring these into your scratch file. - scratch/main> find 1-5 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a @@ -467,6 +444,4 @@ scratch/main> find 1-5 4. Exception.toEither.handler : Request {Exception} a -> Either Failure a 5. printText : Text ->{IO} Either Failure () - - ``` diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index 90992afc7b..27bb5efd38 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -2,18 +2,13 @@ This transcript verifies that the pretty-printer produces code that can be succe ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - scratch/a1> builtins.mergeio lib.builtins - scratch/a2> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/a1> load unison-src/transcripts-round-trip/reparses-with-same-hash.u - scratch/a1> add - ``` ``` unison @@ -21,21 +16,20 @@ x = () ``` ``` ucm :added-by-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 : () - ``` ``` ucm :hide scratch/a1> find - ``` So we can see the pretty-printed output: @@ -44,12 +38,11 @@ So we can see the pretty-printed output: scratch/a1> edit 1-1000 ☝️ - + I added 111 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ````` unison :added-by-ucm scratch.u @@ -832,19 +825,15 @@ a |> f = f a ``` ucm :hide scratch/a1> delete.namespace.force lib.builtins - ``` ``` ucm :hide scratch/a2> load - ``` ``` ucm :hide scratch/a2> add - scratch/a2> delete.namespace.force lib.builtins - ``` This diff should be empty if the two namespaces are equivalent. If it's nonempty, the diff will show us the hashes that differ. @@ -853,18 +842,14 @@ This diff should be empty if the two namespaces are equivalent. If it's nonempty scratch/main> diff.namespace /a1: /a2: The namespaces are identical. - ``` Now check that definitions in 'reparses.u' at least parse on round trip: ``` ucm :hide scratch/a3> builtins.mergeio lib.builtins - scratch/a3> load unison-src/transcripts-round-trip/reparses.u - scratch/a3> add - ``` This just makes 'roundtrip.u' the latest scratch file. @@ -875,19 +860,17 @@ x = () ``` ucm :hide scratch/a3> find - ``` ``` ucm scratch/a3> edit 1-5000 ☝️ - + I added 2 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ```` unison :added-by-ucm scratch.u @@ -914,15 +897,10 @@ sloppyDocEval = ``` ucm :hide scratch/a3_new> builtins.mergeio lib.builtins - scratch/a3_new> load - scratch/a3_new> add - scratch/a3> delete.namespace.force lib.builtins - scratch/a3_new> delete.namespace.force lib.builtins - ``` These are currently all expected to have different hashes on round trip. @@ -931,11 +909,10 @@ These are currently all expected to have different hashes on round trip. scratch/main> diff.namespace /a3_new: /a3: Updates: - + 1. sloppyDocEval : Doc2 ↓ 2. sloppyDocEval : Doc2 - ``` ## Other regression tests not covered by above @@ -948,22 +925,19 @@ Regression test for https://github.com/unisonweb/unison/pull/3548 scratch/regressions> alias.term ##Nat.+ plus Done. - scratch/regressions> edit plus ☝️ - + I added 1 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/regressions> load Loading changes detected in scratch.u. I loaded scratch.u and didn't find anything. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index 74bc300c04..c096ef5d74 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -11,11 +11,8 @@ transcripts which contain less boilerplate. ``` ucm :hide 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. @@ -28,7 +25,6 @@ test> hex.tests.ex1 = checks let ``` ucm :hide scratch/main> test - ``` Lets do some basic testing of our test harness to make sure its @@ -54,34 +50,32 @@ testAutoClean _ = ``` ``` ucm :added-by-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`: testAutoClean : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - testAutoClean : '{IO} [Result] + testAutoClean : '{IO} [Result] scratch/main> io.test testAutoClean New test results: - + 1. testAutoClean ◉ our temporary directory should exist ◉ our temporary directory should no longer exist - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` 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 0b656ef0c3..d60d5ae872 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -2982,6 +2982,4 @@ scratch/main> find.verbose 855. -- #lcmj2envm11lrflvvcl290lplhvbccv82utoej0lg0eomhmsf2vrv8af17k6if7ff98fp1b13rkseng3fng4stlr495c8dn3gn4k400 |> : a -> (a ->{g} t) ->{g} t - - ``` 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 898e014c72..265a56474b 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -54,12 +54,13 @@ testABunchOfNats _ = ``` ``` ucm :added-by-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 EncDec @@ -72,14 +73,13 @@ testABunchOfNats _ = testABunchOfNats : ∀ _. _ ->{IO} [Result] testNat : Nat -> '{IO, Stream Result} () testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type EncDec BE16 : EncDec BE32 : EncDec @@ -90,11 +90,10 @@ scratch/main> add testABunchOfNats : ∀ _. _ ->{IO} [Result] testNat : Nat -> '{IO, Stream Result} () testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () - scratch/main> io.test testABunchOfNats New test results: - + 1. testABunchOfNats ◉ successfully decoded 4294967295 using 64 bit Big Endian ◉ consumed all input ◉ successfully decoded 4294967295 using 64 bit Little Endian @@ -163,9 +162,8 @@ scratch/main> io.test testABunchOfNats ◉ consumed all input ◉ successfully decoded 0 using 16 bit Little Endian ◉ consumed all input - + ✅ 68 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index f6eaa2ee9d..16753f75ae 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -152,12 +152,13 @@ swapped name link = ``` ``` ucm :added-by-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 Three a b c @@ -195,14 +196,13 @@ swapped name link = verify : Text -> [(Link.Term, Code)] ->{Throw Text} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type Three a b c Code.get : Link.Term ->{IO, Throw Text} Code Code.load : Bytes ->{IO, Throw Text} Code @@ -238,7 +238,6 @@ scratch/main> add verify : Text -> [(Link.Term, Code)] ->{Throw Text} () - ``` ``` unison @@ -317,12 +316,13 @@ badLoad _ = ``` ``` ucm :added-by-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 ability Zap @@ -336,7 +336,6 @@ badLoad _ = rotate : Three Nat Nat Nat -> Three Nat Nat Nat tests : '{IO} [Result] zapper : Three Nat Nat Nat -> Request {Zap} r -> r - ``` This simply runs some functions to make sure there isn't a crash. Once @@ -347,7 +346,7 @@ to actual show that the serialization works. scratch/main> add ⍟ I've added these definitions: - + structural ability Zap badLoad : '{IO} [Result] bigFun : Nat -> Nat -> Nat -> Nat @@ -359,11 +358,10 @@ scratch/main> add rotate : Three Nat Nat Nat -> Three Nat Nat Nat tests : '{IO} [Result] zapper : Three Nat Nat Nat -> Request {Zap} r -> r - scratch/main> io.test tests New test results: - + 1. tests ◉ (ext f) passed ◉ (ext h) passed ◉ (ident compound) passed @@ -377,21 +375,19 @@ scratch/main> io.test tests ◉ (ident termlink) passed ◉ (ident bool) passed ◉ (ident bytes) passed - + ✅ 13 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test badLoad New test results: - + 1. badLoad ◉ serialized77 - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` unison @@ -431,29 +427,28 @@ codeTests = ``` ``` ucm :added-by-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`: codeTests : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - codeTests : '{IO} [Result] + codeTests : '{IO} [Result] scratch/main> io.test codeTests New test results: - + 1. codeTests ◉ (idem f) passed ◉ (idem h) passed ◉ (idem rotate) passed @@ -484,11 +479,10 @@ scratch/main> io.test codeTests ◉ (rejected swapped mututal0) passed ◉ (rejected swapped mututal1) passed ◉ (rejected swapped mututal2) passed - + ✅ 30 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` unison @@ -518,31 +512,30 @@ vtests _ = ``` ``` ucm :added-by-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`: validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] - scratch/main> io.test vtests New test results: - + 1. vtests ◉ validated ◉ validated ◉ validated @@ -551,9 +544,8 @@ scratch/main> io.test vtests ◉ validated ◉ validated ◉ validated - + ✅ 8 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index ef33a50ffe..420cbd8875 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -29,12 +29,13 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` ``` ucm :added-by-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 time.DayOfWeek @@ -43,7 +44,6 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat d1 : Doc2 name : Doc2 time.DayOfWeek.doc : Doc2 - ``` Notice that an anonymous documentation block `{{ ... }}` before a definition `ImportantConstant` is just syntax sugar for `ImportantConstant.doc = {{ ... }}`. @@ -54,17 +54,14 @@ You can preview what docs will look like when rendered to the console using the scratch/main> display d1 Hello there Alice! - scratch/main> docs ImportantConstant An important constant, equal to `42` - scratch/main> docs DayOfWeek The 7 days of the week, defined as: - - type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat + type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` 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. @@ -83,7 +80,7 @@ scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u ./unison-src/transcripts-using-base/doc.md.files/syntax.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: basicFormatting : Doc2 @@ -94,12 +91,10 @@ scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u nonUnisonCodeBlocks : Doc2 otherElements : Doc2 sqr : Nat -> Nat - ``` ``` ucm :hide scratch/main> add - ``` Now we can review different portions of the guide. @@ -136,32 +131,30 @@ scratch/main> view basicFormatting __Next up:__ {lists} }} - scratch/main> display basicFormatting # Basic formatting - + Paragraphs are separated by one or more blanklines. Sections have a title and 0 or more paragraphs or other section elements. - + Text can be bold, *italicized*, ~~strikethrough~~, or `monospaced` (or `monospaced`). - + You can link to Unison terms, types, and external URLs: - + * An external url * Some is a term link; Optional is a type link * A named type link and a named term link. Term links are handy for linking to other documents! - + You can use `{{ .. }}` to escape out to regular Unison syntax, for instance __not bold__. This is useful for creating documents programmatically or just including other documents. - - *Next up:* lists + *Next up:* lists scratch/main> view lists lists : Doc2 @@ -204,11 +197,10 @@ scratch/main> view lists 2. Take shower. 3. Get dressed. }} - scratch/main> display lists # Lists - + # Bulleted lists Bulleted lists can use `+`, `-`, or `*` for the bullets @@ -220,7 +212,7 @@ scratch/main> display lists * C * C1 * C2 - + # Numbered lists 1. A @@ -243,7 +235,6 @@ scratch/main> display lists * In this nested list. 2. Take shower. 3. Get dressed. - scratch/main> view evaluation evaluation : Doc2 @@ -278,35 +269,33 @@ scratch/main> view evaluation cube x = x * x * x ``` }} - scratch/main> display evaluation # Evaluation - + Expressions can be evaluated inline, for instance `2`. - + Blocks of code can be evaluated as well, for instance: - + id x = x id (sqr 10) ⧨ 100 - + also: - + match 1 with 1 -> "hi" _ -> "goodbye" ⧨ "hi" - + To include a typechecked snippet of code without evaluating it, you can do: - + use Nat * cube : Nat -> Nat cube x = x * x * x - scratch/main> view includingSource includingSource : Doc2 @@ -347,41 +336,40 @@ scratch/main> view includingSource so: ``sqr x``. This is equivalent to {{ docExample 1 do x -> sqr x }}. }} - scratch/main> display includingSource # Including Unison source code - + Unison definitions can be included in docs. For instance: - + structural type Optional a = Some a | None sqr : Nat -> Nat sqr x = use Nat * x * x - + Some rendering targets also support folded source: - + structural type Optional a = Some a | None sqr : Nat -> Nat sqr x = use Nat * x * x - + You can also include just a signature, inline, with `sqr : Nat -> Nat`, or you can include one or more signatures as a block: - + sqr : Nat -> Nat Nat.+ : Nat -> Nat -> Nat - + Or alternately: - + List.map : (a ->{e} b) -> [a] ->{e} [b] - + # Inline snippets You can include typechecked code snippets inline, for @@ -393,7 +381,6 @@ scratch/main> display includingSource * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - scratch/main> view nonUnisonCodeBlocks nonUnisonCodeBlocks : Doc2 @@ -426,14 +413,13 @@ scratch/main> view nonUnisonCodeBlocks xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` }} - scratch/main> display nonUnisonCodeBlocks # Non-Unison code blocks - + Use three or more single quotes to start a block with no syntax highlighting: - + ``` raw _____ _ | | |___|_|___ ___ ___ @@ -441,21 +427,20 @@ scratch/main> display nonUnisonCodeBlocks |_____|_|_|_|___|___|_|_| ``` - + You can use three or more backticks plus a language name for blocks with syntax highlighting: - + ``` Haskell -- A fenced code block which isn't parsed by Unison reverse = foldl (flip (:)) [] ``` - + ``` Scala // A fenced code block which isn't parsed by Unison def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - scratch/main> view otherElements otherElements : Doc2 @@ -512,46 +497,44 @@ scratch/main> view otherElements , [{{ Some text }}, {{ More text }}, {{ Zounds! }}] ] }} }} - scratch/main> display otherElements There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. - + docAside : Doc2 -> Doc2 - + docCallout : Optional Doc2 -> Doc2 -> Doc2 - + docBlockquote : Doc2 -> Doc2 - + docTooltip : Doc2 -> Doc2 -> Doc2 - + docTable : [[Doc2]] -> Doc2 - + This is an aside. ( Some extra detail that doesn't belong in main text. ) - + | This is an important callout, with no icon. - + | 🌻 | | This is an important callout, with an icon. The text wraps | onto multiple lines. - + > "And what is the use of a book," thought Alice, "without > pictures or conversation?" > > *Lewis Carroll, Alice's Adventures in Wonderland* - + Hover over me - + a b A longer paragraph that will split onto multiple lines, such that this row occupies multiple lines in the rendered table. Some text More text Zounds! - ```` Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: @@ -576,11 +559,10 @@ scratch/main> view doc.guide {{ otherElements }} }} - scratch/main> display doc.guide # Unison computable documentation - + # Basic formatting Paragraphs are separated by one or more blanklines. @@ -603,7 +585,7 @@ scratch/main> display doc.guide other documents. *Next up:* lists - + # Lists # Bulleted lists @@ -640,7 +622,7 @@ scratch/main> display doc.guide * In this nested list. 2. Take shower. 3. Get dressed. - + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -666,7 +648,7 @@ scratch/main> display doc.guide use Nat * cube : Nat -> Nat cube x = x * x * x - + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -710,7 +692,7 @@ scratch/main> display doc.guide * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -737,7 +719,7 @@ scratch/main> display doc.guide def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -774,7 +756,6 @@ scratch/main> display doc.guide row occupies multiple lines in the rendered table. Some text More text Zounds! - ```` 🌻 THE END diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index 9ddb245700..f60045f67d 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -19,56 +19,53 @@ test2 = do ``` ``` ucm :added-by-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`: test1 : '{IO, Exception} [Result] test2 : '{IO, Exception} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + test1 : '{IO, Exception} [Result] test2 : '{IO, Exception} [Result] - ``` ``` ucm :error scratch/main> io.test test1 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink IOFailure) "Cannot decode byte '\\xee': Data.Text.Encoding: Invalid UTF-8 stream" (Any ()) - + Stack trace: ##raise - ``` ``` ucm :error scratch/main> io.test test2 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink RuntimeFailure) "builtin.bug" (Any "whoa") - + Stack trace: ##raise - ``` diff --git a/unison-src/transcripts-using-base/fix2158-1.output.md b/unison-src/transcripts-using-base/fix2158-1.output.md index 1baf78a47e..28aa5997fd 100644 --- a/unison-src/transcripts-using-base/fix2158-1.output.md +++ b/unison-src/transcripts-using-base/fix2158-1.output.md @@ -12,19 +12,19 @@ Async.parMap f as = ``` ``` ucm :added-by-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 ability Async t g Async.parMap : (a ->{g, Async t g} b) -> [a] ->{Async t g} [b] - ``` The issue was that certain ability processing was happing in less diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index a02f6d34bb..f4225a9109 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -25,11 +25,10 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The expression in red needs the {IO} ability, but this location does not have access to any abilities. - - 19 | wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO - + 19 | wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO ``` diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index d5e50b53e5..cd119e6da0 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -9,21 +9,20 @@ timingApp2 _ = ``` ``` ucm :added-by-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`: timingApp2 : '{IO, Exception} () - ``` ``` ucm scratch/main> run timingApp2 () - ``` diff --git a/unison-src/transcripts-using-base/fix3166.output.md b/unison-src/transcripts-using-base/fix3166.output.md index 0973c3df99..1408f6c690 100644 --- a/unison-src/transcripts-using-base/fix3166.output.md +++ b/unison-src/transcripts-using-base/fix3166.output.md @@ -32,12 +32,13 @@ increment n = 1 + n ``` ``` ucm :added-by-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`: Stream.fromList : [a] -> '{Stream a} () @@ -48,18 +49,17 @@ increment n = 1 + n -> Request {Stream a} r -> '{Stream b} r increment : Nat -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 19 | > Stream.toList (Stream.map increment (Stream.fromList [1,2,3])) ⧩ [2, 3, 4] - + 22 | s1 = do emit 10 ⧩ [100, 200, 300, 400] - ``` ``` unison @@ -83,26 +83,26 @@ foo _ = ``` ``` ucm :added-by-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 ability E foo : '{E} (Nat -> Nat) h : '{E} (Nat -> r) -> Nat -> r hh : Request {E} (Nat -> r) -> Nat -> r - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 17 | > h foo 337 ⧩ 7 - ``` ``` unison @@ -127,24 +127,24 @@ hmm = ``` ``` ucm :added-by-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 ability Over delegated : ∀ _. _ -> Nat -> Nat hd : Request {g, Over} x -> x hmm : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 18 | > hmm ⧩ 16794 - ``` diff --git a/unison-src/transcripts-using-base/fix3542.output.md b/unison-src/transcripts-using-base/fix3542.output.md index d151cb33b1..38018f78f3 100644 --- a/unison-src/transcripts-using-base/fix3542.output.md +++ b/unison-src/transcripts-using-base/fix3542.output.md @@ -14,21 +14,21 @@ arrayList v n = do ``` ``` ucm :added-by-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`: arrayList : Nat -> Nat -> '{Exception, Scope s} [Nat] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 12 | > Scope.run '(catch (arrayList 7 8)) ⧩ Right [7, 7, 7, 7, 7, 7, 7, 7] - ``` diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 214a35e1a8..c28c8b089e 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -6,35 +6,31 @@ meh = 9 ``` ``` ucm :added-by-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`: meh : Nat meh.doc : Doc2 - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + meh : Nat meh.doc : Doc2 - scratch/main> find meh 1. meh : Nat 2. meh.doc : Doc2 - - scratch/main> docs 1 A simple doc. - ``` diff --git a/unison-src/transcripts-using-base/fix4746.output.md b/unison-src/transcripts-using-base/fix4746.output.md index eee5122dcd..36719b8539 100644 --- a/unison-src/transcripts-using-base/fix4746.output.md +++ b/unison-src/transcripts-using-base/fix4746.output.md @@ -36,24 +36,24 @@ run s = ``` ``` ucm :added-by-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`: ability Issue t run : '{Issue t} () -> '{Stream Text} () works : Nat -> Nat x : '{Issue t} () ->{Issue t} () - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 26 | > Stream.toList <| run do ⧩ ["one", "two", "three", "done"] - ``` diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index 9a219a428f..8510d11ec7 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Checks for some bad type checking behavior. Some ability subtyping was @@ -28,18 +27,17 @@ go = do ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found an ability mismatch when checking the application - + 18 | foreach forkIt [thunk] - - + + When trying to match [Unit ->{𝕖75, IO, Exception} Unit] with [Unit ->{IO} Unit] the left hand side contained extra abilities: {𝕖75, Exception} - - ``` @@ -62,16 +60,15 @@ fancyTryEval = reraise << catchAll.impl ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The expression in red - + needs the abilities: {g76} but was assumed to only require: {IO, Exception} - + This is likely a result of using an un-annotated function as an argument with concrete abilities. Try adding an annotation to the function definition whose body is red. - - 13 | fancyTryEval = reraise << catchAll.impl - + 13 | fancyTryEval = reraise << catchAll.impl ``` diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index 8b491e619c..33119da0d8 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -37,7 +37,6 @@ scratch/main> ls builtin.Bytes 30. toBase64UrlUnpadded (Bytes -> Bytes) 31. toList (Bytes -> [Nat]) 32. zlib/ (2 terms) - ``` Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`. @@ -76,12 +75,13 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex ``` ``` ucm :added-by-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`: ex1 : Text @@ -92,30 +92,29 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex f : x -> x (also named id) mysecret : Bytes - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 22 | > ex1 ⧩ "f3c342040674c50ab45cb1874b6dbc81447af5958201ed4127e03b56725664d7cc44b88b9afadb371898fcaf5d0adeff60837ef93b514f99da43539d79820c99" - + 23 | > ex2 ⧩ "84bb437497f26fc33c51e57e64c37958c3918d50dfe75b91c661a85c2f8f8304" - + 24 | > ex3 ⧩ "c692fc54df921f7fa51aad9178327c5a097784b02212d571fb40facdfff881fd" - + 25 | > ex4 ⧩ "764a6e91271bce6ce8d8f49d551ba0e586a1e20d8bc2df0dff3117fcd9a11d9a" - + 26 | > ex5 ⧩ "abd0e845a5544ced19b1c05df18a05c10b252a355957b18b99b33970d5217de6" - ``` And here's the full API: @@ -151,8 +150,6 @@ scratch/main> find-in builtin.crypto -> Bytes -> Bytes -> Either Failure Boolean - - ``` Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime: @@ -162,19 +159,19 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > hash Sha3_256 (fromHex "3849238492") ⧩ 0xs1259de8ec2c8b925dce24f591ed5cc1d1a5dc01cf88cf8f2343fc9728e124af4 - ``` ## Hashing tests @@ -315,14 +312,13 @@ test> crypto.hash.numTests = ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> test Cached test results (`help testcache` to learn more) - + 1. blake2b_512.tests.ex1 ◉ Passed 2. blake2b_512.tests.ex2 ◉ Passed 3. blake2b_512.tests.ex3 ◉ Passed @@ -348,11 +344,10 @@ scratch/main> test 23. sha3_512.tests.ex2 ◉ Passed 24. sha3_512.tests.ex3 ◉ Passed 25. sha3_512.tests.ex4 ◉ Passed - + ✅ 25 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ## HMAC tests @@ -387,12 +382,13 @@ test> hmac_sha2_512.tests.ex2 = ``` ``` ucm :added-by-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`: ex' : HashAlgorithm @@ -404,26 +400,25 @@ test> hmac_sha2_512.tests.ex2 = hmac_sha2_256.tests.ex2 : [Result] hmac_sha2_512.tests.ex1 : [Result] hmac_sha2_512.tests.ex2 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | ex' Sha2_256 ✅ Passed Passed - + 9 | ex' Sha2_512 ✅ Passed Passed - + 15 | ex' Sha2_256 ✅ Passed Passed - + 21 | ex' Sha2_512 ✅ Passed Passed - ``` ## MD5 tests @@ -450,12 +445,13 @@ test> md5.tests.ex3 = ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: ex ⍟ These new definitions are ok to `add`: @@ -463,34 +459,32 @@ test> md5.tests.ex3 = md5.tests.ex1 : [Result] md5.tests.ex2 : [Result] md5.tests.ex3 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | ex Md5 ✅ Passed Passed - + 9 | ex Md5 ✅ Passed Passed - + 14 | ex Md5 ✅ Passed Passed - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> test Cached test results (`help testcache` to learn more) - + 1. blake2b_512.tests.ex1 ◉ Passed 2. blake2b_512.tests.ex2 ◉ Passed 3. blake2b_512.tests.ex3 ◉ Passed @@ -519,9 +513,8 @@ scratch/main> test 26. sha3_512.tests.ex2 ◉ Passed 27. sha3_512.tests.ex3 ◉ Passed 28. sha3_512.tests.ex4 ◉ Passed - + ✅ 28 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index acb4f83d34..e4ffde23d5 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -51,31 +51,30 @@ testMvars _ = ``` ``` ucm :added-by-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`: eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] - scratch/main> io.test testMvars New test results: - + 1. testMvars ◉ ma should not be empty ◉ should read what you sow ◉ should reap what you sow @@ -89,9 +88,8 @@ scratch/main> io.test testMvars ◉ ma2 should be empty ◉ tryTake should fail when empty ◉ tryRead should fail when empty - + ✅ 13 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index c75235a002..dcc38b1778 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -33,12 +33,13 @@ test = 'let ``` ``` ucm :added-by-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`: test : '{IO} [Result] @@ -46,24 +47,22 @@ test = 'let -> Optional Int -> Optional Float ->{Stream Result} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + test : '{IO} [Result] testNat : Nat -> Optional Int -> Optional Float ->{Stream Result} () - scratch/main> io.test test New test results: - + 1. test ◉ expected 0.0 got 0.0 ◉ round trip though float, expected 0 got 0 ◉ expected 0 got 0 @@ -78,9 +77,8 @@ scratch/main> io.test test ◉ round trip though float, expected 4607182418800017409 got 4607182418800017409 ◉ expected 4607182418800017409 got 4607182418800017409 ◉ round trip though Int, expected 4607182418800017409 got 4607182418800017409 - + ✅ 14 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 3268f6ca36..78d568ad0d 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -11,7 +11,6 @@ socketAccept = compose reraise socketAccept.impl ``` ucm :hide scratch/main> add - ``` # Tests for network related builtins @@ -98,41 +97,39 @@ testDefaultPort _ = ``` ``` ucm :added-by-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`: testDefaultHost : '{IO} [Result] testDefaultPort : '{IO} [Result] testExplicitHost : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + testDefaultHost : '{IO} [Result] testDefaultPort : '{IO} [Result] testExplicitHost : '{IO} [Result] - scratch/main> io.test testDefaultPort New test results: - + 1. testDefaultPort ◉ successfully created socket ◉ port should be > 1024 ◉ port should be < 65536 - + ✅ 3 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` 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. @@ -187,37 +184,35 @@ testTcpConnect = 'let ``` ``` ucm :added-by-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`: clientThread : MVar Nat -> MVar Text -> '{IO} () serverThread : MVar Nat -> Text -> '{IO} () testTcpConnect : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + clientThread : MVar Nat -> MVar Text -> '{IO} () serverThread : MVar Nat -> Text -> '{IO} () testTcpConnect : '{IO} [Result] - scratch/main> io.test testTcpConnect New test results: - + 1. testTcpConnect ◉ should have reaped what we've sown - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 70fad1260e..e1d0667ef2 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -63,12 +63,13 @@ serialTests = do ``` ``` ucm :added-by-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`: availableCases : '{IO, Exception} [Text] @@ -77,33 +78,30 @@ serialTests = do runTestCase : Text ->{IO, Exception} (Text, Result) serialTests : '{IO, Exception} [Result] shuffle : Nat -> [a] -> [a] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + availableCases : '{IO, Exception} [Text] directory : Text gen : Nat -> Nat -> (Nat, Nat) runTestCase : Text ->{IO, Exception} (Text, Result) serialTests : '{IO, Exception} [Result] shuffle : Nat -> [a] -> [a] - scratch/main> io.test serialTests New test results: - + 1. serialTests ◉ case-00 ◉ case-01 ◉ case-02 ◉ case-03 ◉ case-04 - + ✅ 5 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index f2f86c204b..8cc4d2faa8 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -19,36 +19,34 @@ casTest = do ``` ``` ucm :added-by-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`: casTest : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - casTest : '{IO} [Result] + casTest : '{IO} [Result] scratch/main> io.test casTest New test results: - + 1. casTest ◉ CAS is successful is there were no conflicting writes ◉ CAS fails when there was an intervening write - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` Promise is a simple one-shot awaitable condition. @@ -82,48 +80,45 @@ promiseConcurrentTest = do ``` ``` ucm :added-by-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`: promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] - scratch/main> io.test promiseSequentialTest New test results: - + 1. promiseSequentialTest ◉ Should read a value that's been written ◉ Promise can only be written to once - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test promiseConcurrentTest New test results: - + 1. promiseConcurrentTest ◉ Reads awaits for completion of the Promise - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` CAS can be used to write an atomic update function. @@ -137,25 +132,24 @@ atomicUpdate ref f = ``` ``` ucm :added-by-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`: atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () + atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} () ``` Promise can be used to write an operation that spawns N concurrent @@ -177,25 +171,24 @@ spawnN n fa = ``` ``` ucm :added-by-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`: spawnN : Nat -> '{IO} a ->{IO} [a] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - spawnN : Nat -> '{IO} a ->{IO} [a] + spawnN : Nat -> '{IO} a ->{IO} [a] ``` We can use these primitives to write a more interesting example, where @@ -227,33 +220,31 @@ fullTest = do ``` ``` ucm :added-by-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`: fullTest : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - fullTest : '{IO} [Result] + fullTest : '{IO} [Result] scratch/main> io.test fullTest New test results: - + 1. fullTest ◉ The state of the counter is consistent - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` 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 1908ec408c..af35f7439f 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -68,12 +68,13 @@ mkTestCase = do ``` ``` ucm :added-by-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 Tree a @@ -91,14 +92,13 @@ mkTestCase = do tree1 : Tree Nat tree2 : Tree Nat tree3 : Tree Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type Tree a evaluate : (Tree Nat -> Nat) -> (Tree Text -> Text) @@ -114,9 +114,7 @@ scratch/main> add tree1 : Tree Nat tree2 : Tree Nat tree3 : Tree Text - 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 e2dd1265f9..f70c5cde01 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -16,12 +16,13 @@ mkTestCase = do ``` ``` ucm :added-by-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`: combines : ([Float], [Int], [Char]) -> Text @@ -29,22 +30,19 @@ mkTestCase = do l2 : [Int] l3 : [Char] mkTestCase : '{IO, Exception} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + combines : ([Float], [Int], [Char]) -> Text l1 : [Float] l2 : [Int] l3 : [Char] mkTestCase : '{IO, Exception} () - 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 663027dd31..540298453f 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -30,12 +30,13 @@ mkTestCase = do ``` ``` ucm :added-by-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 ability Exit a @@ -45,14 +46,13 @@ mkTestCase = do mkTestCase : '{IO, Exception} () prod : [Nat] -> Nat products : ([Nat], [Nat], [Nat]) -> Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural ability Exit a l1 : [Nat] l2 : [Nat] @@ -60,9 +60,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () prod : [Nat] -> Nat products : ([Nat], [Nat], [Nat]) -> Text - 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 d464bf27d7..4eb39f0839 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -44,12 +44,13 @@ mkTestCase = do ``` ``` ucm :added-by-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 ability DC r @@ -64,14 +65,13 @@ mkTestCase = do mkTestCase : '{IO, Exception} () reset : '{DC r} r -> r suspSum : [Nat] -> Delayed Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural ability DC r structural type Delayed r feed : Nat -> Delayed r -> r @@ -83,9 +83,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () reset : '{DC r} r -> r suspSum : [Nat] -> Delayed Nat - 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 c08e80301b..3e29b1e0e9 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -14,31 +14,29 @@ mkTestCase = do ``` ``` ucm :added-by-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`: mkTestCase : '{IO, Exception} () mutual0 : Nat -> Text mutual1 : Nat -> Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + mkTestCase : '{IO, Exception} () mutual0 : Nat -> Text mutual1 : Nat -> Text - scratch/main> run mkTestCase () - ``` diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index d5adfe83b9..0180e654c8 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -29,31 +29,30 @@ body k out v = ``` ``` ucm :added-by-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`: body : Nat -> TVar (Optional Nat) -> TVar Nat ->{IO} () count : Nat -> () inc : TVar Nat ->{IO} Nat loop : '{IO} Nat -> Nat -> Nat ->{IO} Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + body : Nat -> TVar (Optional Nat) -> TVar Nat ->{IO} () count : Nat -> () inc : TVar Nat ->{IO} Nat loop : '{IO} Nat -> Nat -> Nat ->{IO} Nat - ``` Test case. @@ -92,35 +91,34 @@ tests = '(map spawn nats) ``` ``` ucm :added-by-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`: display : Nat -> Nat -> Nat -> Text nats : [Nat] spawn : Nat ->{IO} Result tests : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + display : Nat -> Nat -> Nat -> Text nats : [Nat] spawn : Nat ->{IO} Result tests : '{IO} [Result] - scratch/main> io.test tests New test results: - + 1. tests ◉ verified ◉ verified ◉ verified @@ -131,9 +129,8 @@ scratch/main> io.test tests ◉ verified ◉ verified ◉ verified - + ✅ 10 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` 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 7d53a6d910..06592ae138 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -10,7 +10,6 @@ x = 999 ``` ucm :hide scratch/main> add - ``` Now, we update that definition and define a test-watch which depends on it. @@ -21,12 +20,13 @@ test> mytest = checks [x + 1 == 1001] ``` ``` ucm :added-by-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`: mytest : [Result] @@ -35,14 +35,13 @@ test> mytest = checks [x + 1 == 1001] new definition: x : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 2 | test> mytest = checks [x + 1 == 1001] ✅ Passed Passed - ``` We expect this 'add' to fail because the test is blocked by the update to `x`. @@ -51,13 +50,12 @@ We expect this 'add' to fail because the test is blocked by the update to `x`. scratch/main> add x These definitions failed: - + Reason needs update x : Nat blocked mytest : [Result] - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. ``` ----- @@ -68,24 +66,24 @@ test> useY = checks [y + 1 == 43] ``` ``` ucm :added-by-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`: useY : [Result] y : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 2 | test> useY = checks [y + 1 == 43] ✅ Passed Passed - ``` This should correctly identify `y` as a dependency and add that too. @@ -94,8 +92,7 @@ This should correctly identify `y` as a dependency and add that too. scratch/main> add useY ⍟ I've added these definitions: - + useY : [Result] y : Nat - ``` diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index f92f3a645e..c98eb4dbc1 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -17,26 +17,24 @@ testBasicFork = 'let ``` ``` ucm :added-by-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`: otherThread : '{IO} () testBasicFork : '{IO} [Result] - ``` See if we can get another thread to stuff a value into a MVar ``` ucm :hide scratch/main> add - scratch/main> io.test testBasicFork - ``` ``` unison @@ -64,37 +62,35 @@ testBasicMultiThreadMVar = 'let ``` ``` ucm :added-by-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`: testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () - scratch/main> io.test testBasicMultiThreadMVar New test results: - + 1. testBasicMultiThreadMVar ◉ other thread should have incremented - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` unison @@ -136,39 +132,37 @@ testTwoThreads = 'let ``` ``` ucm :added-by-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`: receivingThread : MVar Nat -> MVar Text -> '{IO} () sendingThread : Nat -> MVar Nat -> '{IO} () (also named thread1) testTwoThreads : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + receivingThread : MVar Nat -> MVar Text -> '{IO} () sendingThread : Nat -> MVar Nat -> '{IO} () (also named thread1) testTwoThreads : '{IO} [Result] - scratch/main> io.test testTwoThreads New test results: - + 1. testTwoThreads ◉ - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index f7d5796b03..0877987a09 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -13,7 +13,6 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----" ``` ucm :hide scratch/main> add - ``` # Using an alternative certificate store @@ -33,40 +32,38 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ``` ucm :added-by-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`: this_should_not_work : [Result] this_should_work : [Result] what_should_work : ∀ _. _ -> [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + this_should_not_work : [Result] this_should_work : [Result] what_should_work : ∀ _. _ -> [Result] - scratch/main> io.test what_should_work New test results: - + 1. what_should_work ◉ succesfully decoded self_signed_pem ◉ failed - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` Test handshaking a client/server a local TCP connection using our @@ -224,12 +221,13 @@ testCNReject _ = ``` ``` ucm :added-by-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`: serverThread : MVar Nat -> Text -> '{IO} () @@ -240,14 +238,13 @@ testCNReject _ = -> MVar Nat -> '{IO, Exception} Text testConnectSelfSigned : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + serverThread : MVar Nat -> Text -> '{IO} () testCAReject : '{IO} [Result] testCNReject : '{IO} [Result] @@ -256,35 +253,31 @@ scratch/main> add -> MVar Nat -> '{IO, Exception} Text testConnectSelfSigned : '{IO} [Result] - scratch/main> io.test testConnectSelfSigned New test results: - + 1. testConnectSelfSigned ◉ should have reaped what we've sown - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test testCAReject New test results: - + 1. testCAReject ◉ correctly rejected self-signed cert - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test testCNReject New test results: - + 1. testCNReject ◉ correctly rejected self-signed cert - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index 41d0dfe015..5f67d71f69 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -8,8 +8,6 @@ scratch/main> find Utf8 1. builtin.Text.toUtf8 : Text -> Bytes 2. Text.fromUtf8 : Bytes ->{Exception} Text 3. builtin.Text.fromUtf8.impl : Bytes -> Either Failure Text - - ``` ascii characters are encoded as single bytes (in the range 0-127). @@ -23,24 +21,24 @@ ascii = "ABCDE" ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: ascii : Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | > toUtf8 ascii ⧩ 0xs4142434445 - ``` non-ascii characters are encoded as multiple bytes. @@ -53,23 +51,23 @@ greek = "ΑΒΓΔΕ" ``` ``` ucm :added-by-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`: greek : Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | > toUtf8 greek ⧩ 0xsce91ce92ce93ce94ce95 - ``` We can check that encoding and then decoding should give us back the same `Text` we started with @@ -88,25 +86,25 @@ test> greekTest = checkRoundTrip greek ``` ``` ucm :added-by-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`: checkRoundTrip : Text -> [Result] greek : Text greekTest : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 10 | test> greekTest = checkRoundTrip greek ✅ Passed Passed - ``` If we try to decode an invalid set of bytes, we get back `Text` explaining the decoding error: @@ -123,21 +121,21 @@ greek_bytes = Bytes.fromList [206, 145, 206, 146, 206, 147, 206, 148, 206] ``` ``` ucm :added-by-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`: greek_bytes : Bytes - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 5 | > match fromUtf8.impl (drop 1 greek_bytes) with ⧩ "Cannot decode byte '\\x91': Data.Text.Encoding: Invalid UTF-8 stream" - ``` diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index ef403eb433..32c7116d98 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Some random ability stuff to ensure things work. @@ -23,25 +22,24 @@ ha = cases ``` ``` ucm :added-by-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`: ability A ha : Request {A} r -> r - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ability A ha : Request {A} r -> r - ``` 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 bf0ef6187c..9e34873a6e 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -15,35 +15,33 @@ term2 _ = () ``` ``` ucm :added-by-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`: ability Bar ability Foo term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ability Bar ability Foo term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () - scratch/main> names term1 Term Hash: #8hum58rlih Names: term1 term2 - ``` diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md index 7bf617bbab..0945af447a 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -4,7 +4,6 @@ https://github.com/unisonweb/unison/issues/2786 ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` First we add an ability to the codebase. @@ -16,25 +15,24 @@ unique ability Channels where ``` ``` ucm :added-by-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`: ability Channels - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - ability Channels + ability Channels ``` Now we update the ability, changing the name of the constructor, *but*, we simultaneously @@ -53,12 +51,13 @@ thing _ = send 1 ``` ``` ucm :added-by-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`: Channels.send : a -> () @@ -68,7 +67,6 @@ thing _ = send 1 new definition: ability Channels - ``` These should fail with a term/ctor conflict since we exclude the ability from the update. @@ -77,23 +75,21 @@ These should fail with a term/ctor conflict since we exclude the ability from th scratch/main> update.old patch Channels.send x These definitions failed: - + Reason term/ctor collision Channels.send : a -> () - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. scratch/main> update.old patch thing ⍟ I've added these definitions: - + Channels.send : a -> () thing : '{Channels} () - + ⍟ I've updated these names to your new definition: - - ability Channels + ability Channels ``` If however, `Channels.send` and `thing` *depend* on `Channels`, updating them should succeed since it pulls in the ability as a dependency. @@ -110,12 +106,13 @@ thing _ = send 1 ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: Channels ⍟ These names already exist. You can `update` them to your @@ -123,7 +120,6 @@ thing _ = send 1 Channels.send : a ->{Channels} () thing : '{Channels} () - ``` These updates should succeed since `Channels` is a dependency. @@ -134,20 +130,19 @@ scratch/main> update.old.preview patch Channels.send I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: - + ⊡ Previously added definitions will be ignored: Channels ⍟ These names already exist. You can `update` them to your new definition: Channels.send : a ->{Channels} () - scratch/main> update.old.preview patch thing I found and typechecked these definitions in scratch.u. If you do an `add` or `update`, here's how your codebase would change: - + ⊡ Previously added definitions will be ignored: Channels ⍟ These names already exist. You can `update` them to your @@ -155,7 +150,6 @@ scratch/main> update.old.preview patch thing Channels.send : a ->{Channels} () thing : '{Channels} () - ``` We should also be able to successfully update the whole thing. @@ -164,19 +158,17 @@ We should also be able to successfully update the whole thing. scratch/main> update.old ⊡ Ignored previously added definitions: Channels - + ⍟ I've updated these names to your new definition: - + Channels.send : a ->{Channels} () thing : '{Channels} () - ``` # Constructor-term conflict ``` ucm :hide scratch/main2> builtins.merge lib.builtins - ``` ``` unison @@ -184,25 +176,24 @@ X.x = 1 ``` ``` ucm :added-by-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.x : Nat - ``` ``` ucm scratch/main2> add ⍟ I've added these definitions: - - X.x : Nat + X.x : Nat ``` ``` unison @@ -211,12 +202,13 @@ structural ability X where ``` ``` ucm :added-by-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: - + x These definitions would fail on `add` or `update`: Reason @@ -224,7 +216,6 @@ structural ability X where ctor/term collision X.x Tip: Use `help filestatus` to learn more. - ``` This should fail with a ctor/term conflict. @@ -233,11 +224,10 @@ This should fail with a ctor/term conflict. scratch/main2> add x These definitions failed: - + Reason blocked structural ability X ctor/term collision X.x - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. ``` diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index ac8190a9dd..77b9559294 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -4,7 +4,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -19,18 +18,18 @@ is2even = '(even 2) ``` ``` ucm :added-by-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`: even : Nat -> Boolean is2even : 'Boolean odd : Nat -> Boolean - ``` it errors if there isn't a previous run @@ -39,17 +38,15 @@ it errors if there isn't a previous run scratch/main> add.run foo ⚠️ - + There is no previous evaluation to save. Use `run` to evaluate something before attempting to save it. - ``` ``` ucm scratch/main> run is2even true - ``` it errors if the desired result name conflicts with a name in the @@ -59,10 +56,9 @@ unison file scratch/main> add.run is2even ⚠️ - + Cannot save the last run result into `is2even` because that name conflicts with a name in the scratch file. - ``` otherwise, the result is successfully persisted @@ -71,9 +67,8 @@ otherwise, the result is successfully persisted scratch/main> add.run foo.bar.baz ⍟ I've added these definitions: - - foo.bar.baz : Boolean + foo.bar.baz : Boolean ``` ``` ucm @@ -81,7 +76,6 @@ scratch/main> view foo.bar.baz foo.bar.baz : Boolean foo.bar.baz = true - ``` ## It resolves references within the unison file @@ -98,32 +92,30 @@ main _ = y ``` ``` ucm :added-by-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`: main : '{IO, Exception} (Nat -> Nat -> Nat) y : Nat -> Nat -> Nat z : Nat -> Nat - ``` ``` ucm scratch/main> run main a b -> a Nat.+ b Nat.+ z 10 - scratch/main> add.run result ⍟ I've added these definitions: - + result : Nat -> Nat -> Nat z : Nat -> Nat - ``` ## It resolves references within the codebase @@ -134,25 +126,24 @@ inc x = x + 1 ``` ``` ucm :added-by-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`: inc : Nat -> Nat - ``` ``` ucm scratch/main> add inc ⍟ I've added these definitions: - - inc : Nat -> Nat + inc : Nat -> Nat ``` ``` unison @@ -161,34 +152,31 @@ main _ x = inc x ``` ``` ucm :added-by-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`: main : '(Nat -> Nat) - ``` ``` ucm scratch/main> run main inc - scratch/main> add.run natfoo ⍟ I've added these definitions: - - natfoo : Nat -> Nat + natfoo : Nat -> Nat scratch/main> view natfoo natfoo : Nat -> Nat natfoo = inc - ``` ## It captures scratch file dependencies at run time @@ -200,25 +188,24 @@ main = 'y ``` ``` ucm :added-by-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`: main : 'Nat x : Nat y : Nat - ``` ``` ucm scratch/main> run main 2 - ``` ``` unison @@ -226,16 +213,16 @@ x = 50 ``` ``` ucm :added-by-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 - ``` this saves 2 to xres, rather than 100 @@ -244,14 +231,12 @@ this saves 2 to xres, rather than 100 scratch/main> add.run xres ⍟ I've added these definitions: - - xres : Nat + xres : Nat scratch/main> view xres xres : Nat xres = 2 - ``` ## It fails with a message if add cannot complete cleanly @@ -261,32 +246,30 @@ main = '5 ``` ``` ucm :added-by-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`: main : 'Nat - ``` ``` ucm :error scratch/main> run main 5 - scratch/main> add.run xres x These definitions failed: - + Reason needs update xres : Nat - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. ``` ## It works with absolute names @@ -296,32 +279,29 @@ main = '5 ``` ``` ucm :added-by-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`: main : 'Nat - ``` ``` ucm scratch/main> run main 5 - scratch/main> add.run .an.absolute.name ⍟ I've added these definitions: - - .an.absolute.name : Nat + .an.absolute.name : Nat scratch/main> view .an.absolute.name .an.absolute.name : Nat .an.absolute.name = 5 - ``` diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 2fc25852dd..c2ce7b7fb3 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -14,13 +13,11 @@ Apparently when we add a test watch, we add a type annotation to it, even if it scratch/main> add ⍟ I've added these definitions: - - foo : [Result] + foo : [Result] scratch/main> view foo foo : [Result] foo : [Result] foo = [] - ``` diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index 350620247f..3cf4b245f2 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -4,7 +4,6 @@ Let's set up some definitions to start: ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -16,19 +15,19 @@ structural type Y = Two Nat Nat ``` ``` ucm :added-by-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 X structural type Y x : Nat y : Nat - ``` Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. @@ -37,12 +36,11 @@ Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. scratch/main> add ⍟ I've added these definitions: - + structural type X structural type Y x : Nat y : Nat - ``` Let's add an alias for `1` and `One`: @@ -54,19 +52,19 @@ structural type Z = One Nat ``` ``` ucm :added-by-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 Z (also named X) z : Nat (also named x) - ``` Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. @@ -76,12 +74,11 @@ Also, `Z` is an alias for `X`. scratch/main> add ⍟ I've added these definitions: - + structural type Z (also named X) z : Nat (also named x) - ``` Let's update something that has an alias (to a value that doesn't have a name already): @@ -92,12 +89,13 @@ structural type X = Three Nat Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: @@ -105,7 +103,6 @@ structural type X = Three Nat Nat Nat (The old definition is also named Z.) x : Nat (The old definition is also named z.) - ``` 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. @@ -121,7 +118,6 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - ``` Update it to something that already exists with a different name: @@ -132,12 +128,13 @@ structural type X = Two Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: @@ -145,7 +142,6 @@ structural type X = Two Nat Nat (also named Y) x : Nat (also named y) - ``` 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`. @@ -157,5 +153,4 @@ scratch/main> update updated... Done. - ``` diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index abf29c5f7b..118f196a68 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -1,11 +1,9 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` ``` ucm :hide scratch/main> add - ``` The `alias.many` command can be used to copy definitions from the current namespace into your curated one. @@ -26,9 +24,9 @@ Let's try it\! 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 Here's what changed in mylib : - + Added definitions: - + 1. List.adjacentPairs : [a] -> [(a, a)] 2. List.all : (a ->{g} Boolean) -> [a] @@ -48,10 +46,9 @@ scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.ch 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 use a hash from `reflog` to undo this change. - scratch/main> find-in mylib 1. List.adjacentPairs : [a] -> [(a, a)] @@ -69,8 +66,6 @@ scratch/main> find-in mylib 13. List.splitAt : Nat -> [a] -> ([a], [a]) 14. List.tail : [a] -> Optional [a] 15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] - - ``` Thanks, `alias.many`\! diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md index 9696a15c6c..5fde538677 100644 --- a/unison-src/transcripts/alias-term.output.md +++ b/unison-src/transcripts/alias-term.output.md @@ -2,19 +2,16 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtins - ``` ``` ucm project/main> alias.term lib.builtins.bug foo Done. - project/main> ls 1. foo (a -> b) 2. lib/ (643 terms, 92 types) - ``` It won't create a conflicted name, though. @@ -23,9 +20,8 @@ It won't create a conflicted name, though. project/main> alias.term lib.builtins.todo foo ⚠️ - - A term by that name already exists. + A term by that name already exists. ``` ``` ucm @@ -33,7 +29,6 @@ project/main> ls 1. foo (a -> b) 2. lib/ (643 terms, 92 types) - ``` You can use `debug.alias.term.force` for that. @@ -42,11 +37,9 @@ You can use `debug.alias.term.force` for that. project/main> debug.alias.term.force lib.builtins.todo foo Done. - project/main> ls 1. foo (a -> b) 2. foo (a -> b) 3. lib/ (643 terms, 92 types) - ``` diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md index 0d8009a6a5..2740753e46 100644 --- a/unison-src/transcripts/alias-type.output.md +++ b/unison-src/transcripts/alias-type.output.md @@ -2,19 +2,16 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtins - ``` ``` ucm project/main> alias.type lib.builtins.Nat Foo Done. - project/main> ls 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) - ``` It won't create a conflicted name, though. @@ -23,9 +20,8 @@ It won't create a conflicted name, though. project/main> alias.type lib.builtins.Int Foo ⚠️ - - A type by that name already exists. + A type by that name already exists. ``` ``` ucm @@ -33,7 +29,6 @@ project/main> ls 1. Foo (builtin type) 2. lib/ (643 terms, 92 types) - ``` You can use `debug.alias.type.force` for that. @@ -42,11 +37,9 @@ You can use `debug.alias.type.force` for that. project/main> debug.alias.type.force lib.builtins.Int Foo Done. - project/main> ls 1. Foo (builtin type) 2. Foo (builtin type) 3. lib/ (643 terms, 92 types) - ``` diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index 162c1b4d7e..9bd5080fe3 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This tests a variable related bug in the ANF compiler. @@ -31,30 +30,29 @@ foo _ = ``` ``` ucm :added-by-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 : ∀ _. _ -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 12 | > !foo ⧩ 5 - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - foo : ∀ _. _ -> Nat + foo : ∀ _. _ -> Nat ``` diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index 557c6449b8..b17ca9b6f1 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -2,11 +2,8 @@ ``` ucm :hide 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. @@ -22,30 +19,29 @@ test> Any.unsafeExtract.works = ``` ``` ucm :added-by-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`: Any.unsafeExtract.works : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | checks [1 == Any.unsafeExtract (Any 1), ✅ Passed Passed - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - Any.unsafeExtract.works : [Result] + Any.unsafeExtract.works : [Result] ``` diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index fda7995acd..a4ed862c42 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -84,14 +83,13 @@ term = 42 ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> display term.doc # Heading - + # Heading 2 Term Link: otherTerm @@ -154,801 +152,800 @@ scratch/main> display term.doc This doc should be embedded. message - ``` ``` api GET /api/projects/scratch/branches/main/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" - ] - } - }, - "typeDefinitions": {} -} + { + "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": {} + } ``` diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index f82870e93a..d08334aa0a 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -8,249 +8,248 @@ joey.yaml.zz = 45 ``` ``` ucm :added-by-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`: joey.httpServer.z : ##Nat joey.yaml.zz : ##Nat rachel.filesystem.x : ##Nat ross.httpClient.y : ##Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + joey.httpServer.z : ##Nat joey.yaml.zz : ##Nat rachel.filesystem.x : ##Nat ross.httpClient.y : ##Nat - ``` ``` api --- Namespace segment prefix search +-- Namespace segment prefix search GET /api/projects/scratch/branches/main/find?query=http -[ - [ - { - "result": { - "segments": [ - { - "contents": "ross.", - "tag": "Gap" - }, - { - "contents": "http", - "tag": "Match" - }, - { - "contents": "Client.y", - "tag": "Gap" - } - ] - }, - "score": 156 - }, - { - "contents": { - "bestFoundTermName": "y", - "namedTerm": { - "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", - "termName": "ross.httpClient.y", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ], - [ - { - "result": { - "segments": [ - { - "contents": "joey.", - "tag": "Gap" - }, - { - "contents": "http", - "tag": "Match" - }, - { - "contents": "Server.z", - "tag": "Gap" - } - ] - }, - "score": 156 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] -] --- Namespace segment suffix search + [ + [ + { + "result": { + "segments": [ + { + "contents": "ross.", + "tag": "Gap" + }, + { + "contents": "http", + "tag": "Match" + }, + { + "contents": "Client.y", + "tag": "Gap" + } + ] + }, + "score": 156 + }, + { + "contents": { + "bestFoundTermName": "y", + "namedTerm": { + "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", + "termName": "ross.httpClient.y", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ], + [ + { + "result": { + "segments": [ + { + "contents": "joey.", + "tag": "Gap" + }, + { + "contents": "http", + "tag": "Match" + }, + { + "contents": "Server.z", + "tag": "Gap" + } + ] + }, + "score": 156 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] +-- Namespace segment suffix search GET /api/projects/scratch/branches/main/find?query=Server -[ - [ - { - "result": { - "segments": [ - { - "contents": "joey.http", - "tag": "Gap" - }, - { - "contents": "Server", - "tag": "Match" - }, - { - "contents": ".z", - "tag": "Gap" - } - ] - }, - "score": 223 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] -] --- Substring search + [ + [ + { + "result": { + "segments": [ + { + "contents": "joey.http", + "tag": "Gap" + }, + { + "contents": "Server", + "tag": "Match" + }, + { + "contents": ".z", + "tag": "Gap" + } + ] + }, + "score": 223 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] +-- Substring search GET /api/projects/scratch/branches/main/find?query=lesys -[ - [ - { - "result": { - "segments": [ - { - "contents": "rachel.fi", - "tag": "Gap" - }, - { - "contents": "lesys", - "tag": "Match" - }, - { - "contents": "tem.x", - "tag": "Gap" - } - ] - }, - "score": 175 - }, - { - "contents": { - "bestFoundTermName": "x", - "namedTerm": { - "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "rachel.filesystem.x", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] -] --- Cross-segment search + [ + [ + { + "result": { + "segments": [ + { + "contents": "rachel.fi", + "tag": "Gap" + }, + { + "contents": "lesys", + "tag": "Match" + }, + { + "contents": "tem.x", + "tag": "Gap" + } + ] + }, + "score": 175 + }, + { + "contents": { + "bestFoundTermName": "x", + "namedTerm": { + "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "termName": "rachel.filesystem.x", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] +-- Cross-segment search GET /api/projects/scratch/branches/main/find?query=joey.http -[ - [ - { - "result": { - "segments": [ - { - "contents": "joey.http", - "tag": "Match" - }, - { - "contents": "Server.z", - "tag": "Gap" - } - ] - }, - "score": 300 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] -] + [ + [ + { + "result": { + "segments": [ + { + "contents": "joey.http", + "tag": "Match" + }, + { + "contents": "Server.z", + "tag": "Gap" + } + ] + }, + "score": 300 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] ``` diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 5611327b52..3093f55514 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison :hide @@ -12,209 +11,208 @@ nested.names.x = 42 ``` ucm :hide scratch/main> add - ``` ``` api --- Should NOT find names by suffix +-- Should NOT find names by suffix GET /api/projects/scratch/branches/main/getDefinition?names=x -{ - "missingDefinitions": [ - "x" - ], - "termDefinitions": {}, - "typeDefinitions": {} -} --- Term names should strip relativeTo prefix. + { + "missingDefinitions": [ + "x" + ], + "termDefinitions": {}, + "typeDefinitions": {} + } +-- Term names should strip relativeTo prefix. GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested -{ - "missingDefinitions": [], - "termDefinitions": { - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { - "bestTermName": "x", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doc", - "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", - { - "contents": [ - { - "contents": "Documentation", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "nested.names.x" - ] - } - }, - "typeDefinitions": {} -} --- Should find definitions by hash, names should be relative + { + "missingDefinitions": [], + "termDefinitions": { + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { + "bestTermName": "x", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doc", + "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", + { + "contents": [ + { + "contents": "Documentation", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "nested.names.x" + ] + } + }, + "typeDefinitions": {} + } +-- Should find definitions by hash, names should be relative GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested -{ - "missingDefinitions": [], - "termDefinitions": { - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { - "bestTermName": "x", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doc", - "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", - { - "contents": [ - { - "contents": "Documentation", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "nested.names.x" - ] - } - }, - "typeDefinitions": {} -} + { + "missingDefinitions": [], + "termDefinitions": { + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { + "bestTermName": "x", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doc", + "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", + { + "contents": [ + { + "contents": "Documentation", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "nested.names.x" + ] + } + }, + "typeDefinitions": {} + } ``` ``` unison :hide @@ -228,302 +226,301 @@ doctest.otherstuff.thing = "A different thing" ``` ucm :hide 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/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest -{ - "missingDefinitions": [], - "termDefinitions": { - "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { - "bestTermName": "doctest.thing", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "doctest.thing", - "tag": "HashQualifier" - }, - "segment": "doctest.thing" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "doctest.thing", - "tag": "HashQualifier" - }, - "segment": "doctest.thing" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"A thing\"" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doctest.thing.doc", - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", - { - "contents": [ - { - "contents": "The", - "tag": "Word" - }, - { - "contents": "correct", - "tag": "Word" - }, - { - "contents": "docs", - "tag": "Word" - }, - { - "contents": "for", - "tag": "Word" - }, - { - "contents": "the", - "tag": "Word" - }, - { - "contents": "thing", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "doctest.thing", - "doctest.thingalias" - ] - } - }, - "typeDefinitions": {} -} + { + "missingDefinitions": [], + "termDefinitions": { + "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { + "bestTermName": "doctest.thing", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "doctest.thing", + "tag": "HashQualifier" + }, + "segment": "doctest.thing" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "doctest.thing", + "tag": "HashQualifier" + }, + "segment": "doctest.thing" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"A thing\"" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doctest.thing.doc", + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", + { + "contents": [ + { + "contents": "The", + "tag": "Word" + }, + { + "contents": "correct", + "tag": "Word" + }, + { + "contents": "docs", + "tag": "Word" + }, + { + "contents": "for", + "tag": "Word" + }, + { + "contents": "the", + "tag": "Word" + }, + { + "contents": "thing", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "doctest.thing", + "doctest.thingalias" + ] + } + }, + "typeDefinitions": {} + } ``` 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/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest -{ - "missingDefinitions": [], - "termDefinitions": { - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { - "bestTermName": "doctest.thing.doc", - "defnTermTag": "Doc", - "signature": [ - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "doctest.thing.doc", - "tag": "HashQualifier" - }, - "segment": "doctest.thing.doc" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "doctest.thing.doc", - "tag": "HashQualifier" - }, - "segment": "doctest.thing.doc" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DocDelimiter" - }, - "segment": "{{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "The" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "correct" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "docs" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "for" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "the" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "thing" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DocDelimiter" - }, - "segment": "}}" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doctest.thing.doc", - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", - { - "contents": [ - { - "contents": "The", - "tag": "Word" - }, - { - "contents": "correct", - "tag": "Word" - }, - { - "contents": "docs", - "tag": "Word" - }, - { - "contents": "for", - "tag": "Word" - }, - { - "contents": "the", - "tag": "Word" - }, - { - "contents": "thing", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "doctest.thing.doc" - ] - } - }, - "typeDefinitions": {} -} + { + "missingDefinitions": [], + "termDefinitions": { + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { + "bestTermName": "doctest.thing.doc", + "defnTermTag": "Doc", + "signature": [ + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "doctest.thing.doc", + "tag": "HashQualifier" + }, + "segment": "doctest.thing.doc" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "doctest.thing.doc", + "tag": "HashQualifier" + }, + "segment": "doctest.thing.doc" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DocDelimiter" + }, + "segment": "{{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "The" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "correct" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "docs" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "for" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "the" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "thing" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DocDelimiter" + }, + "segment": "}}" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doctest.thing.doc", + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", + { + "contents": [ + { + "contents": "The", + "tag": "Word" + }, + { + "contents": "correct", + "tag": "Word" + }, + { + "contents": "docs", + "tag": "Word" + }, + { + "contents": "for", + "tag": "Word" + }, + { + "contents": "the", + "tag": "Word" + }, + { + "contents": "thing", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "doctest.thing.doc" + ] + } + }, + "typeDefinitions": {} + } ``` diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 2a427b2bf6..9d5952766b 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -2,70 +2,64 @@ ``` ucm :hide 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 - ``` ``` api --- Should list all projects +-- Should list all projects GET /api/projects -[ - { - "projectName": "project-one" - }, - { - "projectName": "project-three" - }, - { - "projectName": "project-two" - }, - { - "projectName": "scratch" - } -] --- Should list projects starting with project-t + [ + { + "projectName": "project-one" + }, + { + "projectName": "project-three" + }, + { + "projectName": "project-two" + }, + { + "projectName": "scratch" + } + ] +-- Should list projects starting with project-t GET /api/projects?prefix=project-t -[ - { - "projectName": "project-three" - }, - { - "projectName": "project-two" - } -] --- Should list all branches + [ + { + "projectName": "project-three" + }, + { + "projectName": "project-two" + } + ] +-- Should list all branches GET /api/projects/project-one/branches -[ - { - "branchName": "branch-one" - }, - { - "branchName": "branch-three" - }, - { - "branchName": "branch-two" - }, - { - "branchName": "main" - } -] --- Should list all branches beginning with branch-t + [ + { + "branchName": "branch-one" + }, + { + "branchName": "branch-three" + }, + { + "branchName": "branch-two" + }, + { + "branchName": "main" + } + ] +-- Should list all branches beginning with branch-t GET /api/projects/project-one/branches?prefix=branch-t -[ - { - "branchName": "branch-three" - }, - { - "branchName": "branch-two" - } -] + [ + { + "branchName": "branch-three" + }, + { + "branchName": "branch-two" + } + ] ``` diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index bdb963b33d..5e2db50a07 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison @@ -15,73 +14,72 @@ Here's a *README*! ``` ``` ucm :added-by-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`: nested.names.readme : Doc2 nested.names.x : Nat nested.names.x.doc : Doc2 - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + nested.names.readme : Doc2 nested.names.x : Nat nested.names.x.doc : Doc2 - ``` ``` api --- Should find names by suffix +-- Should find names by suffix GET /api/projects/scratch/branches/main/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" - } -} + { + "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" + } + } ``` diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index f8785e9124..5139f87319 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison @@ -13,128 +12,127 @@ nested.names.readme = {{ I'm a readme! }} ``` ``` ucm :added-by-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`: nested.names.readme : Doc2 nested.names.x : Nat nested.names.x.doc : Doc2 - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + nested.names.readme : Doc2 nested.names.x : Nat nested.names.x.doc : Doc2 - ``` ``` api GET /api/projects/scratch/branches/main/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" - } - ], - "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" -} + { + "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": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + } GET /api/projects/scratch/branches/main/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" - } - ], - "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" -} + { + "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": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + } ``` diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index 89d2d0c618..039efb04b9 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -26,817 +25,814 @@ structural ability Stream s where ``` ucm :hide scratch/main> add - scratch/main> alias.type ##Nat Nat - scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl - ``` ## Term Summary APIs ``` api --- term +-- term GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat -{ - "displayName": "nat", - "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" -} --- term without name uses hash + { + "displayName": "nat", + "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } +-- term without name uses hash GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary -{ - "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" -} --- doc + { + "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } +-- doc GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc -{ - "displayName": "doc", - "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", - "summary": { - "contents": [ - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - } - ], - "tag": "UserObject" - }, - "tag": "Doc" -} --- test + { + "displayName": "doc", + "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", + "summary": { + "contents": [ + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + } + ], + "tag": "UserObject" + }, + "tag": "Doc" + } +-- test GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest -{ - "displayName": "mytest", - "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "[" - }, - { - "annotation": { - "contents": "#aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0", - "tag": "TypeReference" - }, - "segment": "Result" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "]" - } - ], - "tag": "UserObject" - }, - "tag": "Test" -} --- function + { + "displayName": "mytest", + "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "[" + }, + { + "annotation": { + "contents": "#aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0", + "tag": "TypeReference" + }, + "segment": "Result" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "]" + } + ], + "tag": "UserObject" + }, + "tag": "Test" + } +-- function GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func -{ - "displayName": "func", - "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" -} --- constructor + { + "displayName": "func", + "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } +-- constructor GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This -{ - "displayName": "Thing.This", - "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", - "tag": "TypeReference" - }, - "segment": "Thing" - } - ], - "tag": "UserObject" - }, - "tag": "DataConstructor" -} --- Long type signature + { + "displayName": "Thing.This", + "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", + "tag": "TypeReference" + }, + "segment": "Thing" + } + ], + "tag": "UserObject" + }, + "tag": "DataConstructor" + } +-- Long type signature GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType -{ - "displayName": "funcWithLongType", - "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" -} --- Long type signature with render width + { + "displayName": "funcWithLongType", + "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } +-- Long type signature with render width GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType -{ - "displayName": "funcWithLongType", - "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" -} --- Builtin Term + { + "displayName": "funcWithLongType", + "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } +-- Builtin Term GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl -{ - "displayName": "putBytesImpl", - "hash": "##IO.putBytes.impl.v3", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Handle", - "tag": "TypeReference" - }, - "segment": "Handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Bytes", - "tag": "TypeReference" - }, - "segment": "Bytes" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "contents": "##IO", - "tag": "TypeReference" - }, - "segment": "IO" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#0o7mf021foma9acqdaibmlh1jidlijq08uf7f5se9tssttqs546pfunjpk6s31mqoq8s2o1natede8hkk6he45l95fibglidikt44v8", - "tag": "TypeReference" - }, - "segment": "Either" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8", - "tag": "TypeReference" - }, - "segment": "Failure" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "(" - }, - { - "annotation": null, - "segment": ")" - } - ], - "tag": "BuiltinObject" - }, - "tag": "Plain" -} + { + "displayName": "putBytesImpl", + "hash": "##IO.putBytes.impl.v3", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Handle", + "tag": "TypeReference" + }, + "segment": "Handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Bytes", + "tag": "TypeReference" + }, + "segment": "Bytes" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "contents": "##IO", + "tag": "TypeReference" + }, + "segment": "IO" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#0o7mf021foma9acqdaibmlh1jidlijq08uf7f5se9tssttqs546pfunjpk6s31mqoq8s2o1natede8hkk6he45l95fibglidikt44v8", + "tag": "TypeReference" + }, + "segment": "Either" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8", + "tag": "TypeReference" + }, + "segment": "Failure" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "(" + }, + { + "annotation": null, + "segment": ")" + } + ], + "tag": "BuiltinObject" + }, + "tag": "Plain" + } ``` ## Type Summary APIs ``` api --- data +-- data GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing -{ - "displayName": "Thing", - "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Thing", - "tag": "HashQualifier" - }, - "segment": "Thing" - } - ], - "tag": "UserObject" - }, - "tag": "Data" -} --- data with type args + { + "displayName": "Thing", + "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Thing", + "tag": "HashQualifier" + }, + "segment": "Thing" + } + ], + "tag": "UserObject" + }, + "tag": "Data" + } +-- data with type args GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe -{ - "displayName": "Maybe", - "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Maybe", - "tag": "HashQualifier" - }, - "segment": "Maybe" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - } - ], - "tag": "UserObject" - }, - "tag": "Data" -} --- ability + { + "displayName": "Maybe", + "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Maybe", + "tag": "HashQualifier" + }, + "segment": "Maybe" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + } + ], + "tag": "UserObject" + }, + "tag": "Data" + } +-- ability GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream -{ - "displayName": "Stream", - "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "ability" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Stream", - "tag": "HashQualifier" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "s" - } - ], - "tag": "UserObject" - }, - "tag": "Ability" -} --- builtin type + { + "displayName": "Stream", + "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "ability" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Stream", + "tag": "HashQualifier" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "s" + } + ], + "tag": "UserObject" + }, + "tag": "Ability" + } +-- builtin type GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat -{ - "displayName": "Nat", - "hash": "##Nat", - "summary": { - "contents": [ - { - "annotation": null, - "segment": "Nat" - } - ], - "tag": "BuiltinObject" - }, - "tag": "Data" -} + { + "displayName": "Nat", + "hash": "##Nat", + "summary": { + "contents": [ + { + "annotation": null, + "segment": "Nat" + } + ], + "tag": "BuiltinObject" + }, + "tag": "Data" + } ``` diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 63e1100021..be0e05764d 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -4,7 +4,6 @@ Should block an `add` if it requires an update on an in-file dependency. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -12,25 +11,24 @@ x = 1 ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - x : Nat + x : Nat ``` Update `x`, and add a new `y` which depends on the update @@ -41,12 +39,13 @@ y = x + 1 ``` ``` ucm :added-by-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 @@ -55,7 +54,6 @@ y = x + 1 new definition: x : Nat - ``` Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. @@ -64,11 +62,10 @@ Try to add only the new `y`. This should fail because it requires an update to ` scratch/main> add y x These definitions failed: - + Reason needs update x : Nat blocked y : Nat - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. ``` diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md index 342b2c4aa0..9645fffd9b 100644 --- a/unison-src/transcripts/blocks.output.md +++ b/unison-src/transcripts/blocks.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ### Names introduced by a block shadow names introduced in outer scopes @@ -21,23 +20,23 @@ ex thing = ``` ``` ucm :added-by-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`: ex : thing -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 8 | > ex "hello" ⧩ 43 - ``` ### Whether a block shadows outer names doesn't depend on the order of bindings in the block @@ -54,23 +53,23 @@ ex thing = ``` ``` ucm :added-by-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`: ex : thing -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 6 | > ex "hello" ⧩ 43 - ``` ### Blocks use lexical scoping and can only reference definitions in parent scopes or in the same block @@ -89,23 +88,23 @@ ex thing = ``` ``` ucm :added-by-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`: ex : (Nat ->{g} Nat) ->{g} Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 8 | > ex (x -> x * 100) ⧩ 4201 - ``` Here's another example, showing that bindings cannot reference bindings declared in blocks nested in the *body* (the final expression) of a block: @@ -121,23 +120,23 @@ ex thing = ``` ``` ucm :added-by-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`: ex : (Nat ->{g} Nat) ->{g} Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 7 | > ex (x -> x * 100) ⧩ 4201 - ``` ### Blocks can define one or more functions which are recursive or mutually recursive @@ -160,17 +159,17 @@ ex n = ``` ``` ucm :added-by-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`: ex : n -> r sumTo : Nat -> Nat - ``` The `go` function is a one-element cycle (it reference itself), and `ping` and `pong` form a two-element cycle. @@ -187,16 +186,16 @@ ex n = ``` ``` ucm :added-by-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`: ex : n -> Nat - ``` Since the forward reference to `pong` appears inside `ping`. @@ -211,13 +210,12 @@ ex n = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 2 | pong = ping + 1 3 | ping = 42 - - ``` This also won't compile; it's a cyclic reference that isn't guarded: @@ -229,12 +227,11 @@ ex n = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 2 | loop = loop - - ``` This, however, will compile. This also shows that `'expr` is another way of guarding a definition. @@ -246,16 +243,16 @@ ex n = ``` ``` ucm :added-by-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`: ex : n -> r - ``` Just don't try to run it as it's an infinite loop\! @@ -275,13 +272,12 @@ ex n = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. - - 5 | zap1 = launchMissiles "neptune" + zap2 - + 5 | zap1 = launchMissiles "neptune" + zap2 ``` ### The *body* of recursive functions can certainly access abilities @@ -299,17 +295,17 @@ ex n = ``` ``` ucm :added-by-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 ability SpaceAttack ex : n ->{SpaceAttack} Nat - ``` ### Unrelated definitions not part of a cycle and are moved after the cycle @@ -328,17 +324,17 @@ ex n = ``` ``` ucm :added-by-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 ability SpaceAttack ex : n ->{SpaceAttack} r - ``` This is actually parsed as if you moved `zap` after the cycle it find itself a part of: @@ -355,15 +351,15 @@ ex n = ``` ``` ucm :added-by-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 ability SpaceAttack ex : n ->{SpaceAttack} r - ``` 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 b4099d0cc3..4af3c7d061 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -2,7 +2,6 @@ Regression test for https://github.com/unisonweb/unison/pull/2819 ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -13,30 +12,28 @@ hangExample = ``` ``` ucm :added-by-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`: hangExample : Boolean - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - hangExample : Boolean + hangExample : Boolean scratch/main> view hangExample hangExample : Boolean hangExample = "a long piece of text to hang the line" == "" && "a long piece of text to hang the line" == "" - ``` diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index 3df4f1b08b..00ad35f4e5 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -2,9 +2,7 @@ The `branch` command creates a new branch. ``` ucm :hide scratch/main> project.create-empty foo - scratch/main> project.create-empty bar - ``` First, we'll create a term to include in the branches. @@ -17,13 +15,11 @@ someterm = 18 scratch/main> builtins.merge lib.builtins Done. - scratch/main> add ⍟ I've added these definitions: - - someterm : Nat + someterm : Nat ``` Now, the `branch` demo: @@ -35,127 +31,107 @@ project. It can also create an empty branch. foo/main> branch topic1 Done. I've created the topic1 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic1`. - foo/main> branch /topic2 Done. I've created the topic2 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic2`. - foo/main> branch foo/topic3 Done. I've created the topic3 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic3`. - foo/main> branch main topic4 Done. I've created the topic4 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic4`. - foo/main> branch main /topic5 Done. I've created the topic5 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic5`. - foo/main> branch main foo/topic6 Done. I've created the topic6 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic6`. - foo/main> branch /main topic7 Done. I've created the topic7 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic7`. - foo/main> branch /main /topic8 Done. I've created the topic8 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic8`. - foo/main> branch /main foo/topic9 Done. I've created the topic9 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic9`. - foo/main> branch foo/main topic10 Done. I've created the topic10 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic10`. - foo/main> branch foo/main /topic11 Done. I've created the topic11 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. - scratch/main> branch foo/main foo/topic12 Done. I've created the topic12 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic12`. - foo/main> branch bar/topic Done. I've created the bar/topic branch based off foo/main. - bar/main> branch foo/main topic2 Done. I've created the bar/topic2 branch based off foo/main. - bar/main> branch foo/main /topic3 Done. I've created the bar/topic3 branch based off foo/main. - scratch/main> branch foo/main bar/topic4 Done. I've created the bar/topic4 branch based off foo/main. - foo/main> branch.empty empty1 Done. I've created an empty branch foo/empty1. - - Tip: Use `merge /somebranch` to initialize this branch. + Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty /empty2 Done. I've created an empty branch foo/empty2. - - Tip: Use `merge /somebranch` to initialize this branch. + Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty foo/empty3 Done. I've created an empty branch foo/empty3. - - Tip: Use `merge /somebranch` to initialize this branch. + Tip: Use `merge /somebranch` to initialize this branch. scratch/main> branch.empty foo/empty4 Done. I've created an empty branch foo/empty4. - - Tip: Use `merge /somebranch` to initialize this branch. + Tip: Use `merge /somebranch` to initialize this branch. ``` The `branch` command can create branches named `releases/drafts/*` (because why not). @@ -165,12 +141,10 @@ foo/main> branch releases/drafts/1.2.3 Done. I've created the releases/drafts/1.2.3 branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /releases/drafts/1.2.3`. - foo/main> switch /releases/drafts/1.2.3 - ``` The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. @@ -179,14 +153,12 @@ The `branch` command can't create branches named `releases/*` nor `releases/draf foo/main> branch releases/1.2.3 Branch names like releases/1.2.3 are reserved for releases. - + Tip: to download an existing release, try `clone /releases/1.2.3`. - - Tip: to draft a new release, try `release.draft 1.2.3`. + Tip: to draft a new release, try `release.draft 1.2.3`. foo/main> switch /releases/1.2.3 foo/releases/1.2.3 does not exist. - ``` diff --git a/unison-src/transcripts/branch-relative-path.output.md b/unison-src/transcripts/branch-relative-path.output.md index 57773637a9..336d4c232b 100644 --- a/unison-src/transcripts/branch-relative-path.output.md +++ b/unison-src/transcripts/branch-relative-path.output.md @@ -4,27 +4,26 @@ foo.bar = 1 ``` ``` ucm :added-by-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 : ##Nat foo.bar : ##Nat - ``` ``` ucm p0/main> add ⍟ I've added these definitions: - + foo : ##Nat foo.bar : ##Nat - ``` ``` unison @@ -33,66 +32,55 @@ donk.bonk = 1 ``` ``` ucm :added-by-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 (also named foo) donk.bonk : ##Nat (also named foo.bar) - ``` ``` ucm p1/main> add ⍟ I've added these definitions: - + bonk : ##Nat donk.bonk : ##Nat - p1/main> fork p0/main: zzz Done. - p1/main> find zzz 1. zzz.foo : ##Nat 2. zzz.foo.bar : ##Nat - - p1/main> fork p0/main:foo yyy Done. - p1/main> find yyy 1. yyy.bar : ##Nat - - p0/main> fork p1/main: p0/main:p1 Done. - p0/main> ls p1 1. bonk (##Nat) 2. donk/ (1 term) 3. yyy/ (1 term) 4. zzz/ (2 terms) - p0/main> ls p1.zzz 1. foo (##Nat) 2. foo/ (1 term) - p0/main> ls p1.yyy 1. bar (##Nat) - ``` diff --git a/unison-src/transcripts/bug-fix-4354.output.md b/unison-src/transcripts/bug-fix-4354.output.md index 4869f818cc..d662783099 100644 --- a/unison-src/transcripts/bug-fix-4354.output.md +++ b/unison-src/transcripts/bug-fix-4354.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,14 +13,14 @@ bonk x = ``` ``` ucm :added-by-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 : a -> a - ``` diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md index 33b79c0bd3..23a5fc90db 100644 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ b/unison-src/transcripts/bug-strange-closure.output.md @@ -1,8 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - 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: @@ -11,7 +9,7 @@ We can display the guide before and after adding it to the codebase: scratch/main> display doc.guide # Unison computable documentation - + # Basic formatting Paragraphs are separated by one or more blanklines. @@ -34,7 +32,7 @@ scratch/main> display doc.guide other documents. *Next up:* lists - + # Lists # Bulleted lists @@ -71,7 +69,7 @@ scratch/main> display doc.guide * In this nested list. 2. Take shower. 3. Get dressed. - + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -97,7 +95,7 @@ scratch/main> display doc.guide use Nat * cube : Nat -> Nat cube x = x * x * x - + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -141,7 +139,7 @@ scratch/main> display doc.guide * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -168,7 +166,7 @@ scratch/main> display doc.guide def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -205,11 +203,10 @@ scratch/main> display doc.guide row occupies multiple lines in the rendered table. Some text More text Zounds! - scratch/main> add ⍟ I've added these definitions: - + basicFormatting : Doc2 doc.guide : Doc2 evaluation : Doc2 @@ -218,11 +215,10 @@ scratch/main> add nonUnisonCodeBlocks : Doc2 otherElements : Doc2 sqr : Nat -> Nat - scratch/main> display doc.guide # Unison computable documentation - + # Basic formatting Paragraphs are separated by one or more blanklines. @@ -245,7 +241,7 @@ scratch/main> display doc.guide other documents. *Next up:* lists - + # Lists # Bulleted lists @@ -282,7 +278,7 @@ scratch/main> display doc.guide * In this nested list. 2. Take shower. 3. Get dressed. - + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -308,7 +304,7 @@ scratch/main> display doc.guide use Nat * cube : Nat -> Nat cube x = x * x * x - + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -352,7 +348,7 @@ scratch/main> display doc.guide * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -379,7 +375,7 @@ scratch/main> display doc.guide def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -416,7 +412,6 @@ scratch/main> display doc.guide row occupies multiple lines in the rendered table. Some text More text Zounds! - ```` But we can't display this due to a decompilation problem. @@ -426,23 +421,23 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ``` ucm :added-by-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`: rendered : Annotated () (Either SpecialForm ConsoleText) - ``` ```` ucm scratch/main> display rendered # Unison computable documentation - + # Basic formatting Paragraphs are separated by one or more blanklines. @@ -465,7 +460,7 @@ scratch/main> display rendered other documents. *Next up:* lists - + # Lists # Bulleted lists @@ -502,7 +497,7 @@ scratch/main> display rendered * In this nested list. 2. Take shower. 3. Get dressed. - + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -528,7 +523,7 @@ scratch/main> display rendered use Nat * cube : Nat -> Nat cube x = x * x * x - + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -572,7 +567,7 @@ scratch/main> display rendered * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -599,7 +594,7 @@ scratch/main> display rendered def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -636,17 +631,15 @@ scratch/main> display rendered row occupies multiple lines in the rendered table. Some text More text Zounds! - scratch/main> add ⍟ I've added these definitions: - - rendered : Annotated () (Either SpecialForm ConsoleText) + rendered : Annotated () (Either SpecialForm ConsoleText) scratch/main> display rendered # Unison computable documentation - + # Basic formatting Paragraphs are separated by one or more blanklines. @@ -669,7 +662,7 @@ scratch/main> display rendered other documents. *Next up:* lists - + # Lists # Bulleted lists @@ -706,7 +699,7 @@ scratch/main> display rendered * In this nested list. 2. Take shower. 3. Get dressed. - + # Evaluation Expressions can be evaluated inline, for instance `2`. @@ -732,7 +725,7 @@ scratch/main> display rendered use Nat * cube : Nat -> Nat cube x = x * x * x - + # Including Unison source code Unison definitions can be included in docs. For instance: @@ -776,7 +769,7 @@ scratch/main> display rendered * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. - + # Non-Unison code blocks Use three or more single quotes to start a block with no @@ -803,7 +796,7 @@ scratch/main> display rendered def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` - + There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the `{{ }}` syntax to call these functions directly. @@ -840,15 +833,13 @@ scratch/main> display rendered row occupies multiple lines in the rendered table. Some text More text Zounds! - scratch/main> undo Here are the changes I undid - + Added definitions: - - 1. 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. @@ -860,16 +851,17 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```` ucm :added-by-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`: rendered : Annotated () (Either SpecialForm ConsoleText) - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -4527,5 +4519,4 @@ rendered = Pretty.get (docFormatConsole doc.guide) ])) ])))) ]) - ```` diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md index 8147375776..0c709fe1d3 100644 --- a/unison-src/transcripts/builtins-merge.output.md +++ b/unison-src/transcripts/builtins-merge.output.md @@ -4,7 +4,6 @@ The `builtins.merge` command adds the known builtins to the specified subnamespa scratch/main> builtins.merge builtins Done. - scratch/main> ls builtins 1. Any (builtin type) @@ -87,5 +86,4 @@ scratch/main> ls builtins 78. metadata/ (2 terms) 79. todo (a -> b) 80. unsafe/ (1 term) - ``` diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index f551b0c1a3..298ac7816e 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -2,11 +2,8 @@ ``` ucm :hide 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 `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. @@ -92,7 +89,6 @@ test> Int.tests.conversions = ``` ucm :hide scratch/main> add - ``` ## `Nat` functions @@ -168,7 +164,6 @@ test> Nat.tests.conversions = ``` ucm :hide scratch/main> add - ``` ## `Boolean` functions @@ -197,7 +192,6 @@ test> Boolean.tests.notTable = ``` ucm :hide scratch/main> add - ``` ## `Text` functions @@ -296,7 +290,6 @@ test> Text.tests.indexOfEmoji = ``` ucm :hide scratch/main> add - ``` ## `Bytes` functions @@ -361,7 +354,6 @@ test> Bytes.tests.indexOf = ``` ucm :hide scratch/main> add - ``` ## `List` comparison @@ -381,7 +373,6 @@ test> checks [ ``` ucm :hide scratch/main> add - ``` Other list functions @@ -403,37 +394,36 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ``` ucm :added-by-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`: Any.test1 : [Result] Any.test2 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > [Any "hi", Any (41 + 1)] ⧩ [Any "hi", Any 42] - + 3 | test> Any.test1 = checks [(Any "hi" == Any "hi")] ✅ Passed Passed - + 4 | test> Any.test2 = checks [(not (Any "hi" == Any 42))] ✅ Passed Passed - ``` ``` ucm :hide scratch/main> add - ``` ## Sandboxing functions @@ -460,12 +450,13 @@ openFile] ``` ``` ucm :added-by-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`: Sandbox.test1 : [Result] @@ -481,27 +472,25 @@ openFile] validateSandboxedSimpl : [Link.Term] -> Value ->{IO} Boolean - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 15 | test> Sandbox.test1 = checks [validateSandboxed [] "hello"] ✅ Passed Passed - + 16 | test> Sandbox.test2 = checks openFiles ✅ Passed Passed - + 17 | test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] ✅ Passed Passed - ``` ``` ucm :hide scratch/main> add - ``` ``` unison @@ -518,35 +507,33 @@ openFilesIO = do ``` ``` ucm :added-by-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`: openFilesIO : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - openFilesIO : '{IO} [Result] + openFilesIO : '{IO} [Result] scratch/main> io.test openFilesIO New test results: - + 1. openFilesIO ◉ Passed - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ## Universal hash functions @@ -559,32 +546,31 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ``` ucm :added-by-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`: Universal.murmurHash.tests : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > Universal.murmurHash 1 ⧩ 1208954131003843843 - + 2 | test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] ✅ Passed Passed - ``` ``` ucm :hide scratch/main> add - ``` ## Run the tests @@ -595,7 +581,7 @@ Now that all the tests have been added to the codebase, let's view the test repo scratch/main> test Cached test results (`help testcache` to learn more) - + 1. Any.test1 ◉ Passed 2. Any.test2 ◉ Passed 3. Boolean.tests.andTable ◉ Passed @@ -623,9 +609,8 @@ scratch/main> test 25. Text.tests.repeat ◉ Passed 26. Text.tests.takeDropAppend ◉ Passed 27. Universal.murmurHash.tests ◉ Passed - + ✅ 27 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/bytesFromList.output.md b/unison-src/transcripts/bytesFromList.output.md index c1902b3c85..664c9dff1b 100644 --- a/unison-src/transcripts/bytesFromList.output.md +++ b/unison-src/transcripts/bytesFromList.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`: @@ -10,17 +9,17 @@ This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > Bytes.fromList [1,2,3,4] ⧩ 0xs01020304 - ``` diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md index edc983d7cb..e7943b6b20 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -2,7 +2,6 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -11,31 +10,28 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-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`: +-+ : Nat -> Nat -> Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - +-+ : Nat -> Nat -> Nat + +-+ : Nat -> Nat -> Nat scratch/main> move.term +-+ boppitybeep Done. - scratch/main> move.term boppitybeep +-+ Done. - ``` diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index d5a66446c6..64b5b383be 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -2,7 +2,6 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -10,25 +9,24 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-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`: - : Nat -> Nat -> Int - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - - : Nat -> Nat -> Int + - : Nat -> Nat -> Int ``` ``` unison @@ -36,14 +34,14 @@ baz x = x - 1 ``` ``` ucm :added-by-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`: baz : Nat -> Int - ``` diff --git a/unison-src/transcripts/constructor-applied-to-unit.output.md b/unison-src/transcripts/constructor-applied-to-unit.output.md index e425384bae..875b92c07f 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.output.md +++ b/unison-src/transcripts/constructor-applied-to-unit.output.md @@ -1,8 +1,6 @@ ``` ucm :hide scratch/main> alias.type ##Nat Nat - scratch/main> alias.term ##Any.Any Any - ``` ``` unison @@ -13,23 +11,24 @@ structural type Zoink a b c = Zoink a b c ``` ``` ucm :added-by-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 Zoink a b c - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 3 | > Any () ⧩ Any () - + 4 | > [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] ⧩ [ Zoink @@ -58,5 +57,4 @@ structural type Zoink a b c = Zoink a b c ] () ] - ``` diff --git a/unison-src/transcripts/contrabilities.output.md b/unison-src/transcripts/contrabilities.output.md index a7e9d31724..0694f0e14a 100644 --- a/unison-src/transcripts/contrabilities.output.md +++ b/unison-src/transcripts/contrabilities.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -9,14 +8,14 @@ f x = 42 ``` ``` ucm :added-by-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`: f : '{g} a -> Nat - ``` diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md index c44c5d8e3e..c440dad44a 100644 --- a/unison-src/transcripts/create-author.output.md +++ b/unison-src/transcripts/create-author.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` Demonstrating `create.author`: @@ -9,18 +8,15 @@ Demonstrating `create.author`: scratch/main> create.author alicecoder "Alice McGee" Added definitions: - + 1. metadata.authors.alicecoder : Author 2. metadata.copyrightHolders.alicecoder : CopyrightHolder 3. metadata.authors.alicecoder.guid : GUID - - Tip: Add License values for alicecoder under metadata. + Tip: Add License values for alicecoder under metadata. scratch/main> find alicecoder 1. metadata.authors.alicecoder : Author 2. metadata.copyrightHolders.alicecoder : CopyrightHolder 3. metadata.authors.alicecoder.guid : GUID - - ``` diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index 913fef7321..84ecc32e3d 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -2,7 +2,6 @@ Update a member of a cycle, but retain the cycle. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,27 +13,26 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-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`: ping : 'Nat pong : 'Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ping : 'Nat pong : 'Nat - ``` ``` unison @@ -43,17 +41,17 @@ ping _ = !pong + 3 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: ping : 'Nat - ``` ``` ucm @@ -67,17 +65,15 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view ping pong ping : 'Nat ping _ = use Nat + pong() + 3 - + pong : 'Nat pong _ = use Nat + ping() + 2 - ``` diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index ee51134917..9e35071030 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -2,7 +2,6 @@ Update a member of a cycle with a type-preserving update, but sever the cycle. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,27 +13,26 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-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`: ping : 'Nat pong : 'Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ping : 'Nat pong : 'Nat - ``` ``` unison @@ -43,17 +41,17 @@ ping _ = 3 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: ping : 'Nat - ``` ``` ucm @@ -67,15 +65,13 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view ping pong ping : 'Nat ping _ = 3 - + pong : 'Nat pong _ = use Nat + ping() + 2 - ``` diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index 54463a2b48..3047e61a1e 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -2,7 +2,6 @@ Update a member of a cycle with a type-changing update, thus severing the cycle. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,27 +13,26 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-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`: ping : 'Nat pong : 'Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ping : 'Nat pong : 'Nat - ``` ``` unison @@ -43,34 +41,32 @@ ping = 3 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: ping : Nat - ``` ``` ucm scratch/main> update.old ⍟ I've updated these names to your new definition: - - ping : Nat + ping : Nat scratch/main> view ping pong ping : Nat ping = 3 - + pong : 'Nat pong _ = use Nat + #4t465jk908.1() + 2 - ``` diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index 8823031601..77b977c934 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,27 +13,26 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-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`: ping : 'Nat pong : 'Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ping : 'Nat pong : 'Nat - ``` ``` unison @@ -46,12 +44,13 @@ clang _ = !pong + 3 ``` ``` ucm :added-by-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`: clang : 'Nat @@ -60,36 +59,33 @@ clang _ = !pong + 3 new definition: ping : 'Nat - ``` ``` ucm scratch/main> update.old ping ⍟ I've added these definitions: - + clang : 'Nat - + ⍟ I've updated these names to your new definition: - + ping : 'Nat pong : 'Nat - scratch/main> view ping pong clang clang : 'Nat clang _ = use Nat + pong() + 3 - + ping : 'Nat ping _ = use Nat + clang() + 1 - + pong : 'Nat pong _ = use Nat + ping() + 2 - ``` diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index 0c3563708e..f6aa5a0228 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide @@ -21,21 +20,18 @@ ability Ask a where scratch/main> add ⍟ I've added these definitions: - + ability Ask a structural type Optional a (also named builtin.Optional) x : Nat y : Nat - scratch/main> debug.term.abt Nat.+ Builtin term: ##Nat.+ - 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" - scratch/main> debug.term.abt Some Constructor #0 of the following type: @@ -65,7 +61,6 @@ scratch/main> debug.term.abt Some ) ] } - scratch/main> debug.term.abt ask Constructor #0 of the following type: @@ -94,11 +89,9 @@ scratch/main> debug.term.abt ask ] } } - scratch/main> debug.type.abt Nat Builtin type: ##Nat - scratch/main> debug.type.abt Optional DataDeclaration @@ -127,7 +120,6 @@ scratch/main> debug.type.abt Optional ) ] } - scratch/main> debug.type.abt Ask EffectDeclaration @@ -155,5 +147,4 @@ scratch/main> debug.type.abt Ask ] } } - ``` diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index 66c2f36ced..6a452995f4 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -10,12 +10,13 @@ structural type a.b.Baz = Boo ``` ``` ucm :added-by-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 a.b.Baz @@ -24,45 +25,40 @@ structural type a.b.Baz = Boo a.two : ##Nat a.x.four : ##Nat a.x.three : ##Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type a.b.Baz structural type a.x.Foo a.b.one : ##Nat a.two : ##Nat a.x.four : ##Nat a.x.three : ##Nat - scratch/main> delete.term.verbose a.b.one Removed definitions: - + 1. a.b.one : ##Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> alias.term a.two a.newtwo Done. - scratch/main> move.namespace a.x a.y Done. - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #tteooc9j2d - + > Moves: Original name New name @@ -71,9 +67,9 @@ scratch/main> history a.x.Foo.Foo a.y.Foo.Foo a.x.four a.y.four a.x.three a.y.three - + ⊙ 2. #bicrtgqj12 - + + Adds / updates: a.newtwo @@ -82,15 +78,14 @@ scratch/main> history Original name New name(s) a.two a.newtwo - + ⊙ 3. #bofp4huk1j - + - Deletes: a.b.one - - □ 4. #gss5s88mo3 (start of history) + □ 4. #gss5s88mo3 (start of history) scratch/main> debug.name-diff 4 1 Kind Name Change Ref @@ -106,5 +101,4 @@ scratch/main> debug.name-diff 4 1 Term a.x.Foo.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d0 Type a.y.Foo Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 Type a.x.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 - ``` diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 3d9fe361e3..e40dda1c04 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -14,11 +14,8 @@ 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. @@ -27,27 +24,21 @@ Our `app1` project includes the text library twice and the http library twice as scratch/app1> fork text lib.text_v1 Done. - 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. @@ -58,13 +49,11 @@ scratch/app1> names a Term Hash: #gjmq673r1v Names: lib.text_v1.a lib.text_v2.a - scratch/app1> names x Term Hash: #nsmc4p1ra4 Names: lib.http_v3.x lib.http_v4.x - ``` Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. @@ -74,31 +63,24 @@ It also includes the `text` library twice as indirect dependencies via `webutil` 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 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`. @@ -110,11 +92,9 @@ scratch/app2> names a Term Hash: #gjmq673r1v Names: lib.webutil.lib.text_v1.a - scratch/app2> names x Term Hash: #nsmc4p1ra4 Names: lib.http_v1.x lib.http_v2.x - ``` diff --git a/unison-src/transcripts/definition-diff-api.output.md b/unison-src/transcripts/definition-diff-api.output.md index bb9dba3378..d8ecc6fb35 100644 --- a/unison-src/transcripts/definition-diff-api.output.md +++ b/unison-src/transcripts/definition-diff-api.output.md @@ -2,15 +2,12 @@ diffs/main> builtins.mergeio lib.builtins Done. - diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> Done. - diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- Done. - ``` ``` unison @@ -36,38 +33,36 @@ take n s = ``` ``` ucm :added-by-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`: ability Stream a type Type take : Nat -> '{g} t ->{g, Stream a} Optional t term : Nat - ``` ``` ucm diffs/main> add ⍟ I've added these definitions: - + ability Stream a type Type take : Nat -> '{g} t ->{g, Stream a} Optional t term : Nat - diffs/main> branch.create new Done. I've created the new branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /new`. - ``` ``` unison @@ -95,12 +90,13 @@ take n s = ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: Stream ⍟ These names already exist. You can `update` them to your @@ -109,7 +105,6 @@ take n s = type Type a take : Nat -> '{g} t ->{g, Stream a} Optional t term : Nat - ``` ``` ucm @@ -119,3486 +114,3485 @@ diffs/new> update updated... Done. - ``` Diff terms ``` api GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=term&newTerm=term -{ - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "diffTag": "segmentChange", - "fromSegment": "\"Here's some text\"", - "toSegment": "\"Here's some different text\"" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "diffTag": "segmentChange", - "fromSegment": "1", - "toSegment": "2" - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newTerm": { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"Here's some different text\"" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "2" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "term" - ] - }, - "oldBranchRef": "main", - "oldTerm": { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"Here's some text\"" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "term" - ] - }, - "project": "diffs" -} + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "diffTag": "segmentChange", + "fromSegment": "\"Here's some text\"", + "toSegment": "\"Here's some different text\"" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "diffTag": "segmentChange", + "fromSegment": "1", + "toSegment": "2" + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newTerm": { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"Here's some different text\"" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "2" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "term" + ] + }, + "oldBranchRef": "main", + "oldTerm": { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"Here's some text\"" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "term" + ] + }, + "project": "diffs" + } ``` More complex diff ``` api GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=take&newTerm=take -{ - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": "\n" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "Var" - }, - "diffTag": "segmentChange", - "fromSegment": "a", - "toSegment": "n" - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": " " - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": " " - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "diffTag": "segmentChange", - "fromSegment": "handle", - "toSegment": "if" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "Var" - }, - "diffTag": "segmentChange", - "fromSegment": "s", - "toSegment": "n" - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - } - ] - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newTerm": { - "bestTermName": "take", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "take" - ] - }, - "oldBranchRef": "main", - "oldTerm": { - "bestTermName": "take", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "take" - ] - }, - "project": "diffs" -} + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": "\n" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "Var" + }, + "diffTag": "segmentChange", + "fromSegment": "a", + "toSegment": "n" + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": " " + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": " " + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "diffTag": "segmentChange", + "fromSegment": "handle", + "toSegment": "if" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "Var" + }, + "diffTag": "segmentChange", + "fromSegment": "s", + "toSegment": "n" + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + } + ] + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newTerm": { + "bestTermName": "take", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "take" + ] + }, + "oldBranchRef": "main", + "oldTerm": { + "bestTermName": "take", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "take" + ] + }, + "project": "diffs" + } ``` Diff types ``` api GET /api/projects/diffs/diff/types?oldBranchRef=main&newBranchRef=new&oldType=Type&newType=Type -{ - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - } - ] - }, - { - "diffTag": "annotationChange", - "fromAnnotation": { - "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", - "tag": "TermReference" - }, - "segment": "Type", - "toAnnotation": { - "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", - "tag": "TermReference" - } - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ] - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newType": { - "bestTypeName": "Type", - "defnTypeTag": "Data", - "typeDefinition": { - "contents": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - }, - { - "annotation": { - "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", - "tag": "TermReference" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "typeDocs": [], - "typeNames": [ - "Type" - ] - }, - "oldBranchRef": "main", - "oldType": { - "bestTypeName": "Type", - "defnTypeTag": "Data", - "typeDefinition": { - "contents": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - }, - { - "annotation": { - "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", - "tag": "TermReference" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "typeDocs": [], - "typeNames": [ - "Type" - ] - }, - "project": "diffs" -} + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + } + ] + }, + { + "diffTag": "annotationChange", + "fromAnnotation": { + "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", + "tag": "TermReference" + }, + "segment": "Type", + "toAnnotation": { + "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", + "tag": "TermReference" + } + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ] + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newType": { + "bestTypeName": "Type", + "defnTypeTag": "Data", + "typeDefinition": { + "contents": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + }, + { + "annotation": { + "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", + "tag": "TermReference" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "typeDocs": [], + "typeNames": [ + "Type" + ] + }, + "oldBranchRef": "main", + "oldType": { + "bestTypeName": "Type", + "defnTypeTag": "Data", + "typeDefinition": { + "contents": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + }, + { + "annotation": { + "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", + "tag": "TermReference" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "typeDocs": [], + "typeNames": [ + "Type" + ] + }, + "project": "diffs" + } ``` diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md index e39d8892a8..55bbbc526c 100644 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ b/unison-src/transcripts/delete-namespace-dependents-check.output.md @@ -6,7 +6,6 @@ This is a regression test, previously `delete.namespace` allowed a delete as lon ``` ucm :hide myproject/main> builtins.merge - ``` ``` unison @@ -16,52 +15,48 @@ dependent = dependency + 99 ``` ``` ucm :added-by-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`: dependent : Nat sub.dependency : Nat - ``` ``` ucm :error myproject/main> add ⍟ I've added these definitions: - + dependent : Nat sub.dependency : Nat - myproject/main> branch /new Done. I've created the new branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /new`. - myproject/new> delete.namespace sub ⚠️ - + I didn't delete the namespace because the following definitions are still in use. - + Dependency Referenced In dependency 1. dependent - + If you want to proceed anyways and leave those definitions without names, use delete.namespace.force - myproject/new> view dependent dependent : Nat dependent = use Nat + dependency + 99 - ``` diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index e27ee9f28f..3360102d47 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide @@ -17,7 +16,6 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 ``` ucm :hide scratch/main> add - ``` Deleting a namespace with no external dependencies should succeed. @@ -26,7 +24,6 @@ Deleting a namespace with no external dependencies should succeed. scratch/main> delete.namespace no_dependencies Done. - ``` Deleting a namespace with external dependencies should fail and list all dependents. @@ -35,20 +32,19 @@ Deleting a namespace with external dependencies should fail and list all depende scratch/main> delete.namespace dependencies ⚠️ - + I didn't delete the namespace because the following definitions are still in use. - + Dependency Referenced In term2 1. dependents.usage1 2. dependents.usage2 term1 3. dependents.usage1 4. dependents.usage2 - + If you want to proceed anyways and leave those definitions without names, use delete.namespace.force - ``` Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` @@ -59,17 +55,16 @@ scratch/main> delete.namespace.force dependencies Done. ⚠️ - + Of the things I deleted, the following are still used in the following definitions. They now contain un-named references. - + Dependency Referenced In term2 1. dependents.usage1 2. dependents.usage2 term1 3. dependents.usage1 4. dependents.usage2 - ``` I should be able to view an affected dependency by number @@ -81,7 +76,6 @@ scratch/main> view 2 dependents.usage2 = use Nat * #gjmq673r1v * #dcgdua2lj6 - ``` Deleting the root namespace should require confirmation if not forced. @@ -90,27 +84,24 @@ Deleting the root namespace should require confirmation if not forced. 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, or delete the current branch with `delete.branch` - 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 scratch/main> history . Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` Deleting the root namespace shouldn't require confirmation if forced. @@ -121,15 +112,13 @@ 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 scratch/main> history . Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index 3724341733..9ed4a06a7e 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -5,12 +5,10 @@ your working directory with each command). foo/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`. - foo/topic> delete.branch /topic - ``` A branch need not be preceded by a forward slash. @@ -19,12 +17,10 @@ A branch need not be preceded by a forward slash. foo/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`. - foo/topic> delete.branch topic - ``` You can precede the branch name by a project name. @@ -33,45 +29,37 @@ You can precede the branch name by a project name. foo/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`. - scratch/main> delete.branch foo/topic - ``` You can delete the only branch in a project. ``` ucm foo/main> delete.branch /main - ``` You can delete the last branch in the project, a new one will be created. ``` ucm scratch/main> delete.branch scratch/main - scratch/main> branches Branch Remote branch 1. main 2. main2 - ``` If the the last branch isn't /main, then /main will be created. ``` ucm scratch/main2> delete.branch /main - scratch/main2> delete.branch /main2 - scratch/other> branches Branch Remote branch 1. main 2. other - ``` diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md index 37d8b2e350..3830718958 100644 --- a/unison-src/transcripts/delete-project.output.md +++ b/unison-src/transcripts/delete-project.output.md @@ -8,15 +8,14 @@ scratch/main> project.create-empty foo 🎨 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! + 🎉 🥳 Happy coding! scratch/main> project.create-empty bar 🎉 I've created the project bar. @@ -24,46 +23,36 @@ scratch/main> project.create-empty 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! + 🎉 🥳 Happy coding! -- I can delete the project I'm currently on scratch/main> delete.project scratch - foo/main> projects 1. bar 2. foo - -- I can delete a different project foo/main> delete.project bar - foo/main> projects 1. foo - -- I can delete the last project, a new scratch project will be created foo/main> delete.project foo - project/main> projects 1. project 2. scratch - -- If the last project is scratch, a scratch2 project will be created. scratch/main> delete.project project - scratch/main> delete.project scratch - project/main> projects 1. project 2. scratch2 - ``` diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index 755c217dad..a12f718915 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -2,10 +2,9 @@ scratch/main> delete foo ⚠️ - + The following names were not found in the codebase. Check your spelling. foo - ``` ``` unison :hide @@ -17,20 +16,16 @@ structural type Foo = Foo () scratch/main> add ⍟ I've added these definitions: - + structural type Foo foo : ##Nat - scratch/main> delete foo Done. - scratch/main> delete.type Foo Done. - scratch/main> delete.term Foo.Foo Done. - ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index daaf290aa3..89e8019007 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` The delete command can delete both terms and types. @@ -14,10 +13,9 @@ exist. scratch/main> delete.verbose foo ⚠️ - + The following names were not found in the codebase. Check your spelling. foo - ``` Now for some easy cases. Deleting an unambiguous term, then deleting an @@ -32,37 +30,33 @@ structural type Foo = Foo () scratch/main> add ⍟ I've added these definitions: - + structural type Foo foo : Nat - scratch/main> delete.verbose foo Removed definitions: - + 1. foo : Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> delete.verbose Foo Removed definitions: - + 1. structural type Foo - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> delete.verbose Foo.Foo Removed definitions: - + 1. Foo.Foo : '#089vmor9c5 - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` How about an ambiguous term? @@ -76,14 +70,12 @@ a.bar = 2 scratch/main> add ⍟ I've added these definitions: - + a.bar : Nat a.foo : Nat - scratch/main> debug.alias.term.force a.bar a.foo Done. - ``` A delete should remove both versions of the term. @@ -92,22 +84,20 @@ A delete should remove both versions of the term. scratch/main> delete.verbose a.foo Removed definitions: - + 1. a.foo#gjmq673r1v : Nat - + Name changes: - + Original Changes 2. a.bar ┐ 3. a.foo#dcgdua2lj6 (removed) 4. a.foo#dcgdua2lj6 ┘ - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> ls a 1. bar (Nat) - ``` Let's repeat all that on a type, for completeness. @@ -121,40 +111,36 @@ structural type a.Bar = Bar scratch/main> add ⍟ I've added these definitions: - + structural type a.Bar (also named lib.builtins.Unit) structural type a.Foo - scratch/main> debug.alias.type.force a.Bar a.Foo Done. - scratch/main> delete.verbose a.Foo Removed definitions: - + 1. structural type a.Foo#089vmor9c5 - + Name changes: - + Original Changes 2. a.Bar ┐ 3. a.Foo#00nv2kob8f (removed) 4. lib.builtins.Unit │ 5. a.Foo#00nv2kob8f ┘ - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> delete.verbose a.Foo.Foo Removed definitions: - + 1. a.Foo.Foo : '#089vmor9c5 - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` Finally, let's try to delete a term and a type with the same name. @@ -168,20 +154,18 @@ structural type foo = Foo () scratch/main> add ⍟ I've added these definitions: - + structural type foo foo : Nat - scratch/main> delete.verbose foo Removed definitions: - + 1. structural type foo 2. foo : Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` We want to be able to delete multiple terms at once @@ -196,22 +180,20 @@ c = "c" scratch/main> add ⍟ I've added these definitions: - + a : Text b : Text c : Text - scratch/main> delete.verbose a b c Removed definitions: - + 1. a : Text 2. b : Text 3. c : Text - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` We can delete terms and types in the same invocation of delete @@ -227,35 +209,32 @@ c = "c" scratch/main> add ⍟ I've added these definitions: - + structural type Foo a : Text b : Text c : Text - scratch/main> 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 use a hash from `reflog` to undo this change. - scratch/main> delete.verbose Foo.Foo Name changes: - + Original Changes 1. Foo.Foo ┐ 2. Foo.Foo (removed) 3. foo.Foo ┘ - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` We can delete a type and its constructors @@ -268,24 +247,22 @@ structural type Foo = Foo () scratch/main> add ⍟ I've added these definitions: - - structural type Foo + structural type Foo scratch/main> 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 use a hash from `reflog` to undo this change. - ``` You should not be able to delete terms which are referenced by other terms @@ -301,25 +278,23 @@ d = a + b + c scratch/main> add ⍟ I've added these definitions: - + a : Nat b : Nat (also named a.bar) c : Nat d : Nat - scratch/main> delete.verbose a b c ⚠️ - + 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 @@ -335,24 +310,22 @@ h = e + f + g scratch/main> add ⍟ I've added these definitions: - + e : Nat f : Nat g : Nat h : Nat - scratch/main> 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 use a hash from `reflog` to undo this change. - ``` You should be able to delete a type and all the functions that reference it in a single command @@ -369,21 +342,19 @@ incrementFoo = cases scratch/main> add ⍟ I've added these definitions: - + structural type Foo incrementFoo : Foo -> Nat - scratch/main> delete.verbose Foo Foo.Foo incrementFoo Removed definitions: - + 1. structural type Foo 2. Foo.Foo : Nat -> Foo 3. incrementFoo : Foo -> Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` If you mess up on one of the names of your command, delete short circuits @@ -399,19 +370,17 @@ h = e + f + g scratch/main> add ⍟ I've added these definitions: - + e : Nat f : Nat g : Nat h : Nat - scratch/main> 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 @@ -425,24 +394,21 @@ pong _ = 4 Nat.+ !ping scratch/main> add ⍟ I've added these definitions: - + ping : 'Nat pong : 'Nat - scratch/main> delete.verbose ping Removed definitions: - + 1. ping : 'Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> view pong pong : 'Nat pong _ = use Nat + 4 + #l9uq1dpl5v.1() - ``` diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 0a688cecbd..b41edea0f1 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ### `debug.file` @@ -32,7 +31,6 @@ scratch/main> debug.file inside.r#nkgohbke6n outside.c#f3lgjvjqoo outside.d#ukd7tu6kds - ``` This will help me make progress in some situations when UCM is being deficient or broken. @@ -45,7 +43,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini scratch/main> add ⍟ I've added these definitions: - + structural type inside.M structural type outside.A structural type outside.B @@ -54,70 +52,64 @@ scratch/main> add inside.r : Boolean outside.c : Nat outside.d : Boolean - scratch/main> dependents q q has no dependents. - scratch/main> dependencies q Dependencies of: q - + Types: - + 1. Nat - + Terms: - + 2. Nat.* 3. Nat.+ 4. p - + Tip: Try `view 4` to see the source of any numbered item in the above list. - scratch/main> dependencies B Dependencies of: type B, B - + Types: - + 1. B 2. Int - + Tip: Try `view 2` to see the source of any numbered item in the above list. - scratch/main> dependencies d Dependencies of: d - + Types: - + 1. Boolean 2. Nat - + Terms: - + 3. < 4. c 5. Nat.+ 6. p - + Tip: Try `view 6` to see the source of any numbered item in the above list. - scratch/main> dependents d Dependents of: d - + Terms: - + 1. r - + Tip: Try `view 1` to see the source of any numbered item in the above list. - ``` 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/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index f1e203dd37..fcaa949d26 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Here's a couple examples: @@ -20,27 +19,26 @@ ex1 tup = ``` ``` ucm :added-by-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`: ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat - scratch/main> view ex0 ex1 ex0 : Nat -> Nat @@ -48,10 +46,9 @@ scratch/main> view ex0 ex1 use Nat + (a, _, (c, d)) = ("uno", "dos", (n, 7)) c + d - + ex1 : (a, b, (Nat, Nat)) -> Nat ex1 = cases (a, b, (c, d)) -> c Nat.+ d - ``` 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`. @@ -65,17 +62,17 @@ ex2 tup = match tup with ``` ``` ucm :added-by-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`: ex2 : (a, b, (Nat, Nat)) -> Nat (also named ex1) - ``` ## Corner cases @@ -89,23 +86,23 @@ ex4 = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what a refers to here: - + 2 | (a,b) = (a Nat.+ b, 19) - + I think its type should be: - + Nat - + Some common causes of this error include: * Your current namespace is too deep to contain the definition in its subtree * The definition is part of a library which hasn't been added to this project * You have a typo in the name - ``` Even though the parser accepts any pattern on the LHS of a bind, it looks pretty weird to see things like `12 = x`, so we avoid showing a destructuring bind when the LHS is a "literal" pattern (like `42` or "hi"). Again these examples wouldn't compile with coverage checking. @@ -123,39 +120,37 @@ ex5a _ = match (99 + 1, "hi") with ``` ``` ucm :added-by-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`: ex5 : 'Text ex5a : 'Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + ex5 : 'Text ex5a : 'Text - scratch/main> view ex5 ex5a ex5 : 'Text ex5 _ = match 99 Nat.+ 1 with 12 -> "Hi" _ -> "Bye" - + ex5a : 'Text ex5a _ = match (99 Nat.+ 1, "hi") with (x, "hi") -> "Not printed as a destructuring bind." _ -> "impossible" - ``` Notice how it prints both an ordinary match. @@ -173,12 +168,10 @@ For clarity, the pretty-printer leaves this alone, even though in theory it coul scratch/main> add ⍟ I've added these definitions: - - ex6 : (Nat, Nat) -> Nat + ex6 : (Nat, Nat) -> Nat scratch/main> view ex6 ex6 : (Nat, Nat) -> Nat ex6 = cases (x, y) -> x Nat.+ y - ``` diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index d7154af257..08f325a6d6 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -1,14 +1,9 @@ ``` ucm :hide scratch/b1> builtins.merge lib.builtins - scratch/b2> builtins.merge lib.builtins - scratch/nsx> builtins.merge lib.builtins - scratch/main> builtins.merge lib.builtins - scratch/ns1> builtins.merge lib.builtins - ``` ``` unison :hide @@ -20,10 +15,9 @@ fslkdjflskdjflksjdf = 663 scratch/b1> add ⍟ I've added these definitions: - + fslkdjflskdjflksjdf : Nat x : Nat - ``` ``` unison :hide @@ -36,34 +30,31 @@ abc = 23 scratch/b2> add ⍟ I've added these definitions: - + abc : Nat fslkdjflskdjflksjdf : Nat x : Nat - scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf Done. - ``` ``` ucm scratch/main> 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) - ``` Things we want to test: @@ -92,7 +83,7 @@ structural ability X a1 a2 where x : () scratch/ns1> add ⍟ I've added these definitions: - + structural type A a structural ability X a1 a2 b : Nat @@ -100,22 +91,18 @@ scratch/ns1> add c : Nat fromJust : Nat helloWorld : Text - scratch/ns1> alias.term fromJust fromJust' Done. - scratch/ns1> alias.term helloWorld helloWorld2 Done. - scratch/ns1> branch /ns2 Done. I've created the ns2 branch based off of ns1. - + Tip: To merge your work back into the ns1 branch, first `switch /ns1` then `merge /ns2`. - ``` Here's what we've done so far: @@ -124,16 +111,14 @@ Here's what we've done so far: scratch/main> diff.namespace .nothing /ns1: ⚠️ - - The namespace scratch/main:.nothing is empty. Was there a typo? + The namespace scratch/main:.nothing is empty. Was there a typo? ``` ``` ucm :error scratch/main> diff.namespace /ns1: /ns2: The namespaces are identical. - ``` ``` unison :hide @@ -144,17 +129,14 @@ junk = "asldkfjasldkfj" scratch/ns1> add ⍟ I've added these definitions: - - junk : Text + junk : Text scratch/ns1> debug.alias.term.force junk fromJust Done. - scratch/ns1> delete.term junk Done. - ``` ``` unison :hide @@ -177,18 +159,17 @@ scratch/ns2> update Everything typechecks, so I'm saving the results... Done. - scratch/main> 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 : Nat @@ -196,52 +177,46 @@ scratch/main> diff.namespace /ns1: /ns2: 6. bdependent : Nat ↓ 7. bdependent : 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 - + Name changes: - + Original Changes 13. fromJust' ┐ 14. fromJust#gjmq673r1v (removed) 15. fromJust#gjmq673r1v ┘ - scratch/ns2> alias.term d d' Done. - scratch/ns2> alias.type A A' Done. - scratch/ns2> alias.term A.A A'.A Done. - scratch/ns2> alias.type X X' Done. - scratch/ns2> alias.term X.x X'.x Done. - scratch/main> 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 : Nat @@ -249,18 +224,18 @@ scratch/main> diff.namespace /ns1: /ns2: 6. bdependent : Nat ↓ 7. bdependent : 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 - + Name changes: - + Original Changes 14. A 15. A' (added) @@ -272,53 +247,44 @@ scratch/main> diff.namespace /ns1: /ns2: 22. fromJust#gjmq673r1v ┘ 23. X.x 24. X'.x (added) - scratch/ns1> alias.type X X2 Done. - scratch/ns1> alias.term X.x X2.x Done. - scratch/ns2> alias.type A' A'' Done. - scratch/ns2> alias.term A'.A A''.A Done. - scratch/ns2> branch /ns3 Done. I've created the ns3 branch based off of ns2. - + Tip: To merge your work back into the ns2 branch, first `switch /ns2` then `merge /ns3`. - scratch/ns2> alias.term fromJust' yoohoo Done. - scratch/ns2> delete.term.verbose fromJust' Name changes: - + Original Changes 1. fromJust' ┐ 2. fromJust' (removed) 3. yoohoo ┘ - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - scratch/main> diff.namespace /ns3: /ns2: Name changes: - + Original Changes 1. fromJust' 2. yoohoo (added) 3. fromJust' (removed) - ``` ``` unison :hide @@ -332,21 +298,19 @@ scratch/ns3> update updated... Done. - scratch/main> diff.namespace /ns2: /ns3: Updates: - + 1. bdependent : Nat ↓ 2. bdependent : Text - + Name changes: - + Original Changes 3. yoohoo 4. fromJust' (added) 5. yoohoo (removed) - ``` ## Two different auto-propagated changes creating a name conflict @@ -365,25 +329,22 @@ forconflicts = 777 scratch/nsx> add ⍟ I've added these definitions: - + a : Nat b : Nat forconflicts : Nat - scratch/nsx> branch /nsy Done. I've created the nsy branch based off of nsx. - + Tip: To merge your work back into the nsx branch, first `switch /nsx` then `merge /nsy`. - scratch/nsx> branch /nsz Done. I've created the nsz branch based off of nsx. - + Tip: To merge your work back into the nsx branch, first `switch /nsx` then `merge /nsz`. - ``` ``` unison :hide @@ -401,7 +362,6 @@ scratch/nsy> update Everything typechecks, so I'm saving the results... Done. - ``` ``` unison :hide @@ -419,29 +379,25 @@ scratch/nsz> update Everything typechecks, so I'm saving the results... Done. - scratch/nsy> branch /nsw Done. I've created the nsw branch based off of nsy. - + Tip: To merge your work back into the nsy branch, first `switch /nsy` then `merge /nsw`. - scratch/nsw> debug.alias.term.force .forconflicts .a Done. - scratch/nsw> debug.alias.term.force .forconflicts .b Done. - ``` ``` ucm scratch/main> diff.namespace /nsx: /nsw: New name conflicts: - + 1. a#uiiiv8a86s : Nat ↓ 2. ┌ a#mdl4vqtu00 : Nat @@ -451,31 +407,28 @@ scratch/main> diff.namespace /nsx: /nsw: ↓ 5. ┌ b#r3msrbpp1v : Nat 6. └ b#unkqhuu66p : Nat - + Name changes: - + Original Changes 7. forconflicts 8. a#r3msrbpp1v (added) 9. b#r3msrbpp1v (added) - scratch/nsw> view a a#mdl4vqtu00 : Nat a#mdl4vqtu00 = 444 - + a#r3msrbpp1v : Nat a#r3msrbpp1v = 777 - scratch/nsw> view b b#r3msrbpp1v : Nat b#r3msrbpp1v = 777 - + b#unkqhuu66p : Nat b#unkqhuu66p = use Nat + a#mdl4vqtu00 + 1 - ``` ## Should be able to diff a namespace hash from history. @@ -485,25 +438,24 @@ x = 1 ``` ``` ucm :added-by-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 scratch/hashdiff> add ⍟ I've added these definitions: - - x : ##Nat + x : ##Nat ``` ``` unison @@ -511,44 +463,41 @@ y = 2 ``` ``` ucm :added-by-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 scratch/hashdiff> add ⍟ I've added these definitions: - - y : ##Nat + y : ##Nat scratch/hashdiff> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #ru1hnjofdj - + + Adds / updates: y - - □ 2. #i52j9fd57b (start of history) + □ 2. #i52j9fd57b (start of history) scratch/hashdiff> diff.namespace 2 1 Added definitions: - - 1. y : ##Nat + 1. y : ##Nat ``` ## diff --git a/unison-src/transcripts/doc-formatting.output.md b/unison-src/transcripts/doc-formatting.output.md index b9bd004682..f6404dee11 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -4,7 +4,6 @@ Docs can be used as inline code comments. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -15,21 +14,20 @@ foo n = ``` ``` ucm :added-by-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 : Nat -> Nat - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -40,7 +38,6 @@ scratch/main> view foo use Nat + _ = [: do the thing :] n + 1 - ``` Note that `@` and `:]` must be escaped within docs. @@ -50,21 +47,20 @@ escaping = [: Docs look [: like \@this \:] :] ``` ``` ucm :added-by-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`: escaping : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -72,7 +68,6 @@ scratch/main> view escaping escaping : Doc escaping = [: Docs look [: like \@this \:] :] - ``` (Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) @@ -88,21 +83,20 @@ commented = [: ``` ``` ucm :added-by-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`: commented : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -114,7 +108,6 @@ scratch/main> view commented -- a comment f x = x + 1 :] - ``` ### Indenting, and paragraph reflow @@ -129,21 +122,20 @@ doc1 = [: hi :] ``` ``` ucm :added-by-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 - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -151,7 +143,6 @@ scratch/main> view doc1 doc1 : Doc doc1 = [: hi :] - ``` ``` unison @@ -167,21 +158,20 @@ doc2 = [: hello ``` ``` ucm :added-by-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`: doc2 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -193,7 +183,6 @@ scratch/main> view doc2 - foo - bar and the rest. :] - ``` ``` unison @@ -212,21 +201,20 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ``` ucm :added-by-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`: doc3 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -253,7 +241,6 @@ scratch/main> view doc3 mentioned above, where its leading space is removed, it is always treated as a paragraph. :] - ``` ``` unison @@ -265,21 +252,20 @@ doc4 = [: Here's another example of some paragraphs. ``` ``` ucm :added-by-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`: doc4 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -292,7 +278,6 @@ scratch/main> view doc4 All these lines have zero indent. - Apart from this one. :] - ``` ``` unison @@ -306,21 +291,20 @@ doc5 = [: - foo ``` ``` ucm :added-by-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`: doc5 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -331,7 +315,6 @@ scratch/main> view doc5 [: - foo - bar and the rest. :] - ``` ``` unison @@ -344,21 +327,20 @@ doc6 = [: ``` ``` ucm :added-by-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`: doc6 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -370,7 +352,6 @@ scratch/main> view doc6 - bar and the rest. :] - ``` ### More testing @@ -383,22 +364,21 @@ expr = foo 1 ``` ``` ucm :added-by-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`: empty : Doc expr : Nat - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -406,7 +386,6 @@ scratch/main> view empty empty : Doc empty = [: :] - ``` ``` unison @@ -450,21 +429,20 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ``` ucm :added-by-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`: test1 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -528,7 +506,6 @@ scratch/main> view test1 @[signature] List.take :] - ``` ``` unison @@ -538,21 +515,20 @@ reg1363 = [: `@List.take foo` bar ``` ``` ucm :added-by-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`: reg1363 : Doc - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -560,7 +536,6 @@ scratch/main> view reg1363 reg1363 : Doc reg1363 = [: `@List.take foo` bar baz :] - ``` ``` unison @@ -574,21 +549,20 @@ test2 = [: ``` ``` ucm :added-by-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`: test2 : Doc - ``` ``` ucm :hide scratch/main> add - ``` View is fine. @@ -601,7 +575,6 @@ scratch/main> view test2 [: Take a look at this: @[source] foo ▶ bar :] - ``` But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: @@ -615,6 +588,4 @@ scratch/main> display test2 use Nat + _ = [: do the thing :] n + 1 ▶ bar - - ``` diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index 4b9affb78b..8e9fdb7c99 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -8,7 +8,6 @@ See https://github.com/unisonweb/unison/issues/2642 for an example. ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -30,7 +29,6 @@ docs.example4 = {{A doc that links to the {type Labels} type}} ``` ucm :hide scratch/main> add - ``` Now we check that each doc links to the object of the correct name: @@ -39,17 +37,13 @@ Now we check that each doc links to the object of the correct name: scratch/main> display docs.example1 A doc that links to the abilityPatterns term - scratch/main> display docs.example2 A doc that links to the Patterns ability - scratch/main> display docs.example3 A doc that links to the typeLabels term - scratch/main> display docs.example4 A doc that links to the Labels type - ``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index eccc38a17f..1c95c14626 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` Unison documentation is written in Unison. Documentation is a value of the following type: @@ -17,7 +16,6 @@ scratch/main> view lib.builtins.Doc | 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: @@ -33,16 +31,16 @@ Can link to definitions like @List.drop or @List ``` ``` ucm :added-by-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: @@ -65,27 +63,26 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ``` ucm :added-by-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: - + List.take.ex1 : [Nat] List.take.ex2 : [Nat] - ``` And now let's write our docs and reference these examples: @@ -108,16 +105,16 @@ List.take.doc = [: ``` ``` ucm :added-by-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. @@ -126,9 +123,8 @@ Let's add it to the codebase. scratch/main> add ⍟ I've added these definitions: - - List.take.doc : Doc + List.take.doc : Doc ``` We can view it with `docs`, which shows the `Doc` value that is associated with a definition. @@ -140,21 +136,19 @@ scratch/main> docs List.take 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. @@ -164,5 +158,4 @@ scratch/main> view List.take builtin lib.builtins.List.take : lib.builtins.Nat -> [a] -> [a] - ``` diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index d8b9308728..1e164c14ce 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -116,7 +115,6 @@ Format it to check that everything pretty-prints in a valid way. ``` ucm scratch/main> debug.format - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index 7708a8928b..9f8a946c0f 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -88,83 +87,80 @@ Table ``` ucm :hide scratch/main> add - ``` ```` ucm scratch/main> debug.doc-to-markdown fulldoc Heres some text with a soft line break - + hard line break - + Here's a cool **BOLD** _italic_ ~~strikethrough~~ thing with an inline code block `1 + 2` - + # Heading - + ## Heading 2 - + Term Link: `otherTerm` - + Type Link: `Optional` - + Term source: - + ```unison term : '{g} a -> Doc2.Term term a = Term.Term (Any a) ``` - - - + + + Term signature: - + ```unison term : '{g} a -> Doc2.Term ``` - - - + + + - List item - + Inline code: - + `1 Nat.+ 2` - + ` "doesn't typecheck" + 1 ` - + [Link](https://unison-lang.org) - + ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - + Horizontal rule - + --- - + Video - + ![](test.mp4) - + Transclusion/evaluation: - + yo - - - + + + --- - + The following markdown features aren't supported by the Doc format yet, but maybe will someday - + > Block quote - + Table - + | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | - + Indented Code block - - - + ```` @@ -186,12 +182,13 @@ structural type MyStructuralType = MyStructuralType ``` ``` ucm :added-by-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 MyStructuralType @@ -203,5 +200,4 @@ structural type MyStructuralType = MyStructuralType MyUniqueType.doc : Doc2 myTerm : Nat myTerm.doc : Doc2 - ``` diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md index 3efefe25d9..6672495a0b 100644 --- a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md +++ b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md @@ -3,7 +3,6 @@ If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrad ``` ucm :hide foo/main> builtins.merge lib.builtin - ``` ``` unison @@ -14,40 +13,37 @@ mything = lib.old.foo + lib.old.foo ``` ``` ucm :added-by-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`: lib.new.foo : Nat lib.new.other : Nat lib.old.foo : Nat mything : Nat - ``` ``` ucm foo/main> add ⍟ I've added these definitions: - + lib.new.foo : Nat lib.new.other : Nat lib.old.foo : Nat mything : Nat - foo/main> upgrade old new I upgraded old to new, and removed old. - foo/main> view mything mything : Nat mything = use Nat + other + other - ``` diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 352aefb635..c1834160e3 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Term and ability constructor collisions should cause a parse error. @@ -16,17 +15,16 @@ Stream.send _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name Stream.send: 2 | send : a -> () 3 | 4 | Stream.send : a -> () 5 | Stream.send _ = () - - ``` Term and type constructor collisions should cause a parse error. @@ -39,17 +37,16 @@ X.x _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name X.x: 1 | structural type X = x 2 | 3 | X.x : a -> () 4 | X.x _ = () - - ``` Ability and type constructor collisions should cause a parse error. @@ -61,15 +58,14 @@ structural ability X where ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found two types called X: - + 1 | structural type X = x 2 | structural ability X where 3 | x : () - - ``` Field accessors and terms with the same name should cause a parse error. @@ -82,28 +78,27 @@ X.x = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name X.x: 1 | structural type X = {x : ()} 2 | X.x.modify = () 3 | X.x.set = () 4 | X.x = () - - + + I found multiple bindings with the name X.x.modify: 1 | structural type X = {x : ()} 2 | X.x.modify = () - - + + I found multiple bindings with the name X.x.set: 1 | structural type X = {x : ()} 2 | X.x.modify = () 3 | X.x.set = () - - ``` Types and terms with the same name are allowed. @@ -115,34 +110,32 @@ X = () ``` ``` ucm :added-by-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 X (also named builtin.Unit) X : () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type X (also named builtin.Unit) X : () - scratch/main> view X structural type X = Z - + X : () X = () - ``` diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md index e1db509b28..0e3eeebe0f 100644 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ b/unison-src/transcripts/duplicate-term-detection.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Trivial duplicate terms should be detected: @@ -13,15 +12,14 @@ x = 2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name x: 1 | x = 1 2 | x = 2 - - ``` Equivalent duplicate terms should be detected: @@ -32,15 +30,14 @@ x = 1 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name x: 1 | x = 1 2 | x = 1 - - ``` Duplicates from record accessors/setters should be detected @@ -53,28 +50,27 @@ Record.x.modify = 2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name Record.x: 1 | structural type Record = {x: Nat, y: Nat} 2 | Record.x = 1 - - + + I found multiple bindings with the name Record.x.modify: 1 | structural type Record = {x: Nat, y: Nat} 2 | Record.x = 1 3 | Record.x.set = 2 4 | Record.x.modify = 2 - - + + I found multiple bindings with the name Record.x.set: 1 | structural type Record = {x: Nat, y: Nat} 2 | Record.x = 1 3 | Record.x.set = 2 - - ``` Duplicate terms and constructors should be detected: @@ -91,20 +87,19 @@ AnAbility.thing = 2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ❗️ - + I found multiple bindings with the name AnAbility.thing: 6 | thing : Nat -> () 7 | 8 | AnAbility.thing = 2 - - + + I found multiple bindings with the name SumType.X: 1 | structural type SumType = X 2 | 3 | SumType.X = 1 - - ``` diff --git a/unison-src/transcripts/ed25519.output.md b/unison-src/transcripts/ed25519.output.md index 17ce7c2215..11bfafdd77 100644 --- a/unison-src/transcripts/ed25519.output.md +++ b/unison-src/transcripts/ed25519.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -26,12 +25,13 @@ sigOkay = match signature with ``` ``` ucm :added-by-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`: down : Bytes @@ -41,7 +41,7 @@ sigOkay = match signature with sigOkay : Either Failure Boolean signature : Either Failure Bytes up : Bytes - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -49,9 +49,8 @@ sigOkay = match signature with ⧩ Right 0xs0b76988ce7e5147d36597d2a526ec7b8e178b3ae29083598c33c9fbcdf0f84b4ff2f8c5409123dd9a0c54447861c07e21296500a98540f5d5f15d927eaa6d30a - + 19 | > sigOkay ⧩ Right true - ``` diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index c9088e5c6c..70bcc562c9 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison /private/tmp/scratch.u @@ -14,47 +13,44 @@ mytest = [Ok "ok"] ``` ``` ucm :added-by-ucm + Loading changes detected in /private/tmp/scratch.u. I found and typechecked these definitions in /private/tmp/scratch.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: bar : Nat foo : Nat mytest : [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat mytest : [Result] - scratch/main> edit foo bar ☝️ - + I added 2 definitions to the top of /private/tmp/scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/main> edit mytest ☝️ - + I added 1 definitions to the top of /private/tmp/scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ``` unison :added-by-ucm /private/tmp/scratch.u @@ -73,8 +69,7 @@ test> mytest = [Ok "ok"] scratch/main> edit missing ⚠️ - + The following names were not found in the codebase. Check your spelling. missing - ``` diff --git a/unison-src/transcripts/edit-namespace.output.md b/unison-src/transcripts/edit-namespace.output.md index 64f84fe80a..78e8f6aa2f 100644 --- a/unison-src/transcripts/edit-namespace.output.md +++ b/unison-src/transcripts/edit-namespace.output.md @@ -1,6 +1,5 @@ ``` ucm :hide project/main> builtins.mergeio lib.builtin - ``` ``` unison @@ -23,12 +22,13 @@ unique type Foo = { bar : Nat, baz : Nat } ``` ``` ucm :added-by-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 @@ -46,14 +46,13 @@ unique type Foo = { bar : Nat, baz : Nat } simple.x : Nat simple.y : Nat toplevel : Text - ``` ``` ucm project/main> add ⍟ I've added these definitions: - + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo @@ -69,7 +68,6 @@ project/main> add simple.x : Nat simple.y : Nat toplevel : Text - ``` `edit.namespace` edits the whole namespace (minus the top-level `lib`). @@ -78,12 +76,11 @@ project/main> add project/main> edit.namespace ☝️ - + I added 8 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ``` unison :added-by-ucm scratch.u @@ -121,12 +118,11 @@ toplevel = "hi" project/main> edit.namespace nested simple ☝️ - + I added 6 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 39511aec5b..51807308a4 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -6,9 +6,7 @@ mynamespace.x = 1 ``` ucm :hide scratch/main> add - scratch/main> delete.namespace mynamespace - ``` The deleted namespace shouldn't appear in `ls` output. @@ -17,43 +15,40 @@ The deleted namespace shouldn't appear in `ls` output. scratch/main> ls nothing to show - ``` ``` ucm :error scratch/main> find.verbose ☝️ - + 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. - + `debug.find.global` can be used to search outside the current namespace. - ``` ``` ucm :error scratch/main> find mynamespace ☝️ - + 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. - + `debug.find.global` can be used to search outside the current namespace. - ``` ## history @@ -65,11 +60,10 @@ scratch/main> history mynamespace Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` Add and then delete a term to add some history to a deleted namespace. @@ -81,9 +75,7 @@ stuff.thing = 2 ``` ucm :hide scratch/main> add - scratch/main> delete.namespace deleted - ``` ## fork @@ -94,7 +86,6 @@ I should be allowed to fork over a deleted namespace scratch/main> fork stuff deleted Done. - ``` The history from the `deleted` namespace should have been overwritten by the history from `stuff`. @@ -104,20 +95,18 @@ scratch/main> history stuff Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #q2dq4tsno1 (start of history) + + + □ 1. #q2dq4tsno1 (start of history) scratch/main> history deleted Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #q2dq4tsno1 (start of history) + + + □ 1. #q2dq4tsno1 (start of history) ``` ## move.namespace @@ -129,7 +118,6 @@ moveme.y = 2 ``` ucm :hide scratch/main> add - ``` I should be able to move a namespace over-top of a deleted namespace. @@ -139,27 +127,23 @@ The history should be that of the moved namespace. scratch/main> delete.namespace moveoverme Done. - scratch/main> history moveme Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #c5uisu4kll (start of history) + + + □ 1. #c5uisu4kll (start of history) scratch/main> move.namespace moveme moveoverme Done. - scratch/main> history moveoverme Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #c5uisu4kll (start of history) + + + □ 1. #c5uisu4kll (start of history) ``` diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index 0aecd1406d..6492740f26 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -10,7 +10,6 @@ BEHOLD\!\!\! scratch/main> ls nothing to show - ``` Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: @@ -19,11 +18,9 @@ Technically, the definitions all exist, but they have no names. `builtins.merge` scratch/main> builtins.merge lib.builtins Done. - scratch/main> ls lib 1. builtins/ (469 terms, 74 types) - ``` And for a limited time, you can get even more builtin goodies: @@ -32,12 +29,10 @@ And for a limited time, you can get even more builtin goodies: scratch/main> builtins.mergeio lib.builtinsio Done. - scratch/main> ls lib 1. builtins/ (469 terms, 74 types) 2. builtinsio/ (643 terms, 92 types) - ``` More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md index 1721c8c699..1496829a52 100644 --- a/unison-src/transcripts/error-messages.output.md +++ b/unison-src/transcripts/error-messages.output.md @@ -1,6 +1,5 @@ ``` ucm :hide 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. @@ -16,15 +15,15 @@ x = 1. -- missing some digits after the decimal ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 1. -- missing some digits after the decimal - + I was expecting some digits after the `.` , for example: `1.0` or `1.1e37`. - ``` ``` unison :error @@ -32,15 +31,15 @@ x = 1e -- missing an exponent ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 1e -- missing an exponent - + I was expecting some digits for the exponent, for example: `1e37`. - ``` ``` unison :error @@ -48,15 +47,15 @@ x = 1e- -- missing an exponent ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 1e- -- missing an exponent - + I was expecting some digits for the exponent, for example: `1e-37`. - ``` ``` unison :error @@ -64,15 +63,15 @@ x = 1E+ -- missing an exponent ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 1E+ -- missing an exponent - + I was expecting some digits for the exponent, for example: `1e+37`. - ``` ### Hex, octal, binary, and bytes literals @@ -82,15 +81,15 @@ x = 0xoogabooga -- invalid hex chars ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 0xoogabooga -- invalid hex chars - + I was expecting only hexidecimal characters (one of 0123456789abcdefABCDEF) after the 0x. - ``` ``` unison :error @@ -98,15 +97,15 @@ x = 0o987654321 -- 9 and 8 are not valid octal char ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 0o987654321 -- 9 and 8 are not valid octal char - + I was expecting only octal characters (one of 01234567) after the 0o. - ``` ``` unison :error @@ -114,15 +113,15 @@ x = 0b3201 -- 3 and 2 are not valid binary chars ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This number isn't valid syntax: - + 1 | x = 0b3201 -- 3 and 2 are not valid binary chars - + I was expecting only binary characters (one of 01) after the 0b. - ``` ``` unison :error @@ -130,15 +129,15 @@ x = 0xsf -- odd number of hex chars in a bytes literal ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsf - + 1 | x = 0xsf -- odd number of hex chars in a bytes literal - + I was expecting an even number of hexidecimal characters (one of 0123456789abcdefABCDEF) after the 0xs. - ``` ``` unison :error @@ -146,15 +145,15 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsnotvalidhexchars - + 1 | x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal - + I was expecting an even number of hexidecimal characters (one of 0123456789abcdefABCDEF) after the 0xs. - ``` ### Layout errors @@ -164,13 +163,12 @@ foo = else -- not matching if ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a closing 'else' here without a matching 'then'. - - 1 | foo = else -- not matching if - + 1 | foo = else -- not matching if ``` ``` unison :error @@ -178,13 +176,12 @@ foo = then -- unclosed ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a closing 'then' here without a matching 'if'. - - 1 | foo = then -- unclosed - + 1 | foo = then -- unclosed ``` ``` unison :error @@ -192,13 +189,12 @@ foo = with -- unclosed ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a closing 'with' here without a matching 'handle' or 'match'. - - 1 | foo = with -- unclosed - + 1 | foo = with -- unclosed ``` ### Matching @@ -209,15 +205,15 @@ foo = match 1 with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | foo = match 1 with - + Patterns not matched: * _ - ``` ``` unison :error @@ -226,19 +222,19 @@ foo = match 1 with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 3 | - + I was surprised to find an end of section here. I was expecting one of these instead: - + * "," * case match * pattern guard - ``` ``` unison :error @@ -249,6 +245,7 @@ foo = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. 😶 @@ -259,7 +256,6 @@ foo = cases 1 arguments: 4 | 3 -> () - ``` ``` unison :error @@ -272,22 +268,22 @@ x = match Some a with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 7 | - + I was surprised to find an end of section here. I was expecting one of these instead: - + * "," * blank * case match * false * pattern guard * true - ``` ``` unison :error @@ -299,19 +295,19 @@ x = match Some a with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 4 | -> 2 - - + + I was surprised to find a -> here. I was expecting one of these instead: - + * end of input * newline or semicolon - ``` ``` unison :error @@ -322,19 +318,19 @@ x = match Some a with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 4 | | true -> 2 - - + + I was surprised to find a '|' here. I was expecting one of these instead: - + * end of input * newline or semicolon - ``` ### Watches @@ -345,13 +341,12 @@ x = match Some a with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I expected a non-empty watch expression and not just ">" - - 2 | > - + 2 | > ``` ### Keywords @@ -361,15 +356,15 @@ use.keyword.in.namespace = 1 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The identifier `namespace` used here is a reserved keyword: - + 1 | use.keyword.in.namespace = 1 - + You can avoid this problem either by renaming the identifier or wrapping it in backticks (like `namespace` ). - ``` ``` unison :error @@ -378,20 +373,19 @@ a ! b = 1 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This looks like the start of an expression here - + 2 | a ! b = 1 - + but at the file top-level, I expect one of the following: - + - A binding, like a = 42 OR a : Nat a = 42 - A watch expression, like > a + 1 - An `ability` declaration, like unique ability Foo where ... - A `type` declaration, like structural type Optional a = None | Some a - - ``` diff --git a/unison-src/transcripts/errors/code-block-parse-error.output.md b/unison-src/transcripts/errors/code-block-parse-error.output.md index 5a8ed201c6..ab6626d668 100644 --- a/unison-src/transcripts/errors/code-block-parse-error.output.md +++ b/unison-src/transcripts/errors/code-block-parse-error.output.md @@ -1,5 +1,6 @@ -:2:9: +:2:8: | 2 | foo/bar% this uses the wrong delimiter before the UCM command - | ^ -expecting end of input or spaces + | ^ +unexpected '%' +expecting '>' diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md index 8725a6e9a1..f2ed9f0446 100644 --- a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md +++ b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md @@ -2,9 +2,7 @@ Since this code block is expecting an error, we still hide it. It seems unusual ``` ucm :hide:error scratch/main> help pull - scratch/main> not.a.command - ``` For comparison, here’s what we get without `:hide`. @@ -15,7 +13,7 @@ scratch/main> help pull pull The `pull` command merges a remote namespace into a local branch - + `pull @unison/base/main` merges the branch `main` of the Unison Share hosted project @@ -28,13 +26,12 @@ scratch/main> help pull the branch `topic` of the local `my-base` project - + where `remote` is a project or project branch, such as: Project (defaults to the /main branch) `@unison/base` Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` Project Release `@unison/base/releases/1.0.0` - scratch/main> not.a.command ⚠️ diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md index d21d307c54..8069556a7a 100644 --- a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md +++ b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md @@ -11,22 +11,22 @@ x + x + ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 1 | x + x + - - + + I was surprised to find a x here. I was expecting one of these instead: - + * ability * namespace * newline or semicolon * type * use - ``` Even though this code block has `:hide` on it, we should still see the error output, because it wasn’t expecting an error. @@ -40,17 +40,17 @@ x + x + The transcript failed due to an error in the stanza above. The error is: ``` - I got confused here: - - 1 | x + x + - - - I was surprised to find a x here. - I was expecting one of these instead: - - * ability - * namespace - * newline or semicolon - * type - * use +I got confused here: + + 1 | x + x + + + +I was surprised to find a x here. +I was expecting one of these instead: + +* ability +* namespace +* newline or semicolon +* type +* use ``` diff --git a/unison-src/transcripts/errors/info-string-parse-error.output.md b/unison-src/transcripts/errors/info-string-parse-error.output.md index 8d5e2f9ea6..7c6ea84d4b 100644 --- a/unison-src/transcripts/errors/info-string-parse-error.output.md +++ b/unison-src/transcripts/errors/info-string-parse-error.output.md @@ -1,5 +1,6 @@ -:1:11: +:1:9: | 1 | ``` ucm :hode - | ^ -expecting comment (delimited with “--”), end of input, or spaces + | ^ +unexpected ':' +expecting ":added-by-ucm", ":error", ":hide", ":hide:all", or newline diff --git a/unison-src/transcripts/errors/invalid-api-requests.output.md b/unison-src/transcripts/errors/invalid-api-requests.output.md index 402122788b..1326224e62 100644 --- a/unison-src/transcripts/errors/invalid-api-requests.output.md +++ b/unison-src/transcripts/errors/invalid-api-requests.output.md @@ -1,5 +1,6 @@ -:2:4: +:2:1: | 2 | DELETE /something/important - | ^ -expecting end of input or spaces + | ^^^ +unexpected "DEL" +expecting " ", " ", "--", "GET", end of input, or newline diff --git a/unison-src/transcripts/errors/missing-result-typed.output.md b/unison-src/transcripts/errors/missing-result-typed.output.md index 2caf3b1b6c..87c2308bec 100644 --- a/unison-src/transcripts/errors/missing-result-typed.output.md +++ b/unison-src/transcripts/errors/missing-result-typed.output.md @@ -6,7 +6,6 @@ and surface a helpful message. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide:all @@ -20,11 +19,11 @@ a = The transcript failed due to an error in the stanza above. The error is: ``` - The last element of a block must be an expression, but this is - a definition: - - 3 | b = 24 - - Try adding an expression at the end of the block. - It should be of type Nat. +The last element of a block must be an expression, but this is a +definition: + + 3 | b = 24 + +Try adding an expression at the end of the block. +It should be of type Nat. ``` diff --git a/unison-src/transcripts/errors/missing-result.output.md b/unison-src/transcripts/errors/missing-result.output.md index 99dcdedfa0..fb0ab98c9f 100644 --- a/unison-src/transcripts/errors/missing-result.output.md +++ b/unison-src/transcripts/errors/missing-result.output.md @@ -14,10 +14,10 @@ x = The transcript failed due to an error in the stanza above. The error is: ``` - The last element of a block must be an expression, but this is - a definition: - - 2 | y = 24 - - Try adding an expression at the end of the block. +The last element of a block must be an expression, but this is a +definition: + + 2 | y = 24 + +Try adding an expression at the end of the block. ``` diff --git a/unison-src/transcripts/errors/no-abspath-in-ucm.output.md b/unison-src/transcripts/errors/no-abspath-in-ucm.output.md index 73cc009b1b..4b38721ad7 100644 --- a/unison-src/transcripts/errors/no-abspath-in-ucm.output.md +++ b/unison-src/transcripts/errors/no-abspath-in-ucm.output.md @@ -1,5 +1,6 @@ -:4:3: +:4:1: | 4 | .> ls - | ^ -expecting comment (delimited with “--”), end of input, or spaces + | ^^ +unexpected ".>" +expecting " ", " ", '@', comment (delimited with “--”), end of input, or newline diff --git a/unison-src/transcripts/errors/ucm-hide-all.output.md b/unison-src/transcripts/errors/ucm-hide-all.output.md index 523ef40b2f..2753dd7f11 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all.output.md @@ -15,7 +15,7 @@ scratch/main> move.namespace foo bar The transcript failed due to an error in the stanza above. The error is: ``` - ⚠️ - - The namespace foo doesn't exist. +⚠️ + +The namespace foo doesn't exist. ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index da84189a66..e2045b6ee5 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -6,11 +6,6 @@ When an expected error is not encountered in a `ucm :hide` block then the transcript parser should print the stanza and surface a helpful message. -``` ucm :hide:error -scratch/main> history - -``` - ``` ucm :hide:error scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide.output.md b/unison-src/transcripts/errors/ucm-hide.output.md index 6f9083e070..c42cd9294f 100644 --- a/unison-src/transcripts/errors/ucm-hide.output.md +++ b/unison-src/transcripts/errors/ucm-hide.output.md @@ -15,7 +15,7 @@ scratch/main> move.namespace foo bar The transcript failed due to an error in the stanza above. The error is: ``` - ⚠️ - - The namespace foo doesn't exist. +⚠️ + +The namespace foo doesn't exist. ``` diff --git a/unison-src/transcripts/errors/unison-hide-all.output.md b/unison-src/transcripts/errors/unison-hide-all.output.md index 30659b4c35..c27b7dd28f 100644 --- a/unison-src/transcripts/errors/unison-hide-all.output.md +++ b/unison-src/transcripts/errors/unison-hide-all.output.md @@ -13,17 +13,16 @@ g 3 The transcript failed due to an error in the stanza above. The error is: ``` - This looks like the start of an expression here - - 1 | g 3 - - but at the file top-level, I expect one of the following: - - - A binding, like g = 42 OR - g : Nat - g = 42 - - A watch expression, like > g + 1 - - An `ability` declaration, like unique ability Foo where ... - - A `type` declaration, like structural type Optional a = None | Some a - +This looks like the start of an expression here + + 1 | g 3 + +but at the file top-level, I expect one of the following: + + - A binding, like g = 42 OR + g : Nat + g = 42 + - A watch expression, like > g + 1 + - An `ability` declaration, like unique ability Foo where ... + - A `type` declaration, like structural type Optional a = None | Some a ``` diff --git a/unison-src/transcripts/errors/unison-hide.output.md b/unison-src/transcripts/errors/unison-hide.output.md index 571c94c396..f9a48fb687 100644 --- a/unison-src/transcripts/errors/unison-hide.output.md +++ b/unison-src/transcripts/errors/unison-hide.output.md @@ -13,17 +13,16 @@ g 3 The transcript failed due to an error in the stanza above. The error is: ``` - This looks like the start of an expression here - - 1 | g 3 - - but at the file top-level, I expect one of the following: - - - A binding, like g = 42 OR - g : Nat - g = 42 - - A watch expression, like > g + 1 - - An `ability` declaration, like unique ability Foo where ... - - A `type` declaration, like structural type Optional a = None | Some a - +This looks like the start of an expression here + + 1 | g 3 + +but at the file top-level, I expect one of the following: + + - A binding, like g = 42 OR + g : Nat + g = 42 + - A watch expression, like > g + 1 + - An `ability` declaration, like unique ability Foo where ... + - A `type` declaration, like structural type Optional a = None | Some a ``` diff --git a/unison-src/transcripts/escape-sequences.output.md b/unison-src/transcripts/escape-sequences.output.md index 4a946f64d8..fdc05a5045 100644 --- a/unison-src/transcripts/escape-sequences.output.md +++ b/unison-src/transcripts/escape-sequences.output.md @@ -5,25 +5,25 @@ ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > "Rúnar" ⧩ "Rúnar" - + 2 | > "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" ⧩ "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" - + 3 | > "古池や蛙飛びこむ水の音" ⧩ "古池や蛙飛びこむ水の音" - ``` diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index b476e113d0..d4a8f1a26f 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> alias.type ##Text builtin.Text - ``` ``` unison :hide @@ -21,41 +20,32 @@ baz = cases scratch/main> add ⍟ I've added these definitions: - + type A bar : Text -> A baz : A -> Text foo : A - scratch/main> find : Text -> A 1. bar : Text -> A 2. A.A : Text -> A - - scratch/main> find : A -> Text 1. baz : A -> Text - - scratch/main> find : A 1. foo : A - - ``` ``` ucm :error scratch/main> find : Text ☝️ - + I couldn't find exact type matches, resorting to fuzzy matching... 1. bar : Text -> A 2. baz : A -> Text 3. A.A : Text -> A - - ``` diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index c3eaca47e9..ad1cb6727f 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison :hide @@ -15,7 +14,6 @@ somewhere.bar = 7 ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -23,50 +21,38 @@ scratch/main> find foo 1. cat.foo : Nat 2. foo : Nat - - scratch/main> view 1 cat.foo : Nat cat.foo = 4 - scratch/main> find.all foo 1. cat.foo : Nat 2. cat.lib.foo : Nat 3. lib.foo : Nat 4. foo : Nat - - scratch/main> view 1 cat.foo : Nat cat.foo = 4 - ``` ``` ucm scratch/main> find-in cat foo 1. foo : Nat - - scratch/main> view 1 cat.foo : Nat cat.foo = 4 - scratch/main> find-in.all cat foo 1. lib.foo : Nat 2. foo : Nat - - scratch/main> view 1 cat.lib.foo : Nat cat.lib.foo = 5 - ``` Finding within a namespace @@ -75,38 +61,31 @@ Finding within a namespace scratch/main> find bar 1. somewhere.bar : Nat - - scratch/other> debug.find.global bar Found results in scratch/main - + 1. .cat.lib.bar : Nat 2. .lib.bar : Nat 3. .somewhere.bar : Nat - - scratch/main> find-in somewhere bar 1. bar : Nat - - ``` ``` ucm :error scratch/main> find baz ☝️ - + 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. - + `debug.find.global` can be used to search outside the current namespace. - ``` diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index d039c6255f..b724b01f05 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -11,10 +11,9 @@ X.foo = "a namespace" scratch/main> add ⍟ I've added these definitions: - + X.foo : ##Text a : ##Text - ``` Here is an update which should not affect `X`: @@ -30,7 +29,6 @@ scratch/main> update updated... Done. - ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; @@ -40,11 +38,10 @@ scratch/main> history X Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #das1se4g2i (start of history) + + + □ 1. #das1se4g2i (start of history) ``` however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: @@ -53,7 +50,6 @@ however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is scratch/main> history #7nl6ppokhg 😶 - - I don't know of a namespace with that hash. + I don't know of a namespace with that hash. ``` diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md index aad592c765..32224c32e3 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.output.md @@ -2,7 +2,6 @@ Tests that `if` statements can appear as list and tuple elements. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide diff --git a/unison-src/transcripts/fix-5267.output.md b/unison-src/transcripts/fix-5267.output.md index 4000b2b315..475180d672 100644 --- a/unison-src/transcripts/fix-5267.output.md +++ b/unison-src/transcripts/fix-5267.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -12,18 +11,18 @@ bar = direct.foo + direct.foo ``` ``` ucm :added-by-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`: bar : Nat lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat - ``` Here, `bar` renders as `foo + foo`, even though there are two names with suffix `foo` in scope, because one is an @@ -33,18 +32,16 @@ indirect dependency. It used to render as `direct.foo + direct.foo`. scratch/main> add ⍟ I've added these definitions: - + bar : Nat lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat - scratch/main> view bar bar : Nat bar = use Nat + foo + foo - ``` Same test, but for types. @@ -57,31 +54,29 @@ type Bar = MkBar direct.Foo ``` ``` ucm :added-by-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 Bar type lib.direct.Foo type lib.direct.lib.indirect.Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Bar type lib.direct.Foo type lib.direct.lib.indirect.Foo - scratch/main> view Bar type Bar = MkBar Foo - ``` diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md index 3d9010392d..be2a126470 100644 --- a/unison-src/transcripts/fix-5301.output.md +++ b/unison-src/transcripts/fix-5301.output.md @@ -5,7 +5,6 @@ letter) that is either not found or ambiguouus fails. Previously, it would be tr scratch/main> builtins.merge Done. - ``` ``` unison :error @@ -17,9 +16,10 @@ foo = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. - + ❓ I couldn't resolve any of these symbols: @@ -30,8 +30,6 @@ foo = cases Symbol Suggestions X No matches - - ``` ``` unison :error @@ -45,9 +43,10 @@ foo = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. - + ❓ I couldn't resolve any of these symbols: @@ -59,6 +58,4 @@ foo = cases X A.X B.X - - ``` diff --git a/unison-src/transcripts/fix-5312.output.md b/unison-src/transcripts/fix-5312.output.md index 57f35a45d5..710cf258c2 100644 --- a/unison-src/transcripts/fix-5312.output.md +++ b/unison-src/transcripts/fix-5312.output.md @@ -5,7 +5,6 @@ render as `c = y + 1` (ambiguous). scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison @@ -18,31 +17,30 @@ c = b.y + 1 ``` ``` ucm :added-by-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.y : Nat b.y : Nat c : Nat x : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + a.y : Nat b.y : Nat c : Nat x : Nat - ``` ``` unison @@ -50,17 +48,17 @@ x = 100 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm @@ -74,5 +72,4 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - ``` diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md index 1d56f2e1c0..a4142f5c3a 100644 --- a/unison-src/transcripts/fix-5320.output.md +++ b/unison-src/transcripts/fix-5320.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison :error @@ -11,9 +10,10 @@ foo = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. - + ❓ I couldn't resolve any of these symbols: @@ -24,6 +24,4 @@ foo = cases Symbol Suggestions bar.Baz No matches - - ``` diff --git a/unison-src/transcripts/fix-5323.output.md b/unison-src/transcripts/fix-5323.output.md index 38e8e4d729..873797fadc 100644 --- a/unison-src/transcripts/fix-5323.output.md +++ b/unison-src/transcripts/fix-5323.output.md @@ -5,7 +5,6 @@ render as `c = y + 1` (ambiguous). scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison @@ -19,12 +18,13 @@ c = b.y + 1 ``` ``` ucm :added-by-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.y : Nat @@ -32,25 +32,22 @@ c = b.y + 1 c : Nat lib.new.x : Nat lib.old.x : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + a.y : Nat b.y : Nat c : Nat lib.new.x : Nat lib.old.x : Nat - ``` ``` ucm scratch/main> upgrade old new I upgraded old to new, and removed old. - ``` diff --git a/unison-src/transcripts/fix-5326.output.md b/unison-src/transcripts/fix-5326.output.md index f92d88fb72..71e7894ed9 100644 --- a/unison-src/transcripts/fix-5326.output.md +++ b/unison-src/transcripts/fix-5326.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison @@ -10,16 +9,16 @@ x = 1 ``` ``` ucm :added-by-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 @@ -29,14 +28,12 @@ scratch/main> update updated... Done. - scratch/main> branch foo Done. I've created the foo branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /foo`. - ``` ``` @@ -50,17 +47,17 @@ x = 2 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm @@ -70,14 +67,12 @@ scratch/main> update updated... Done. - scratch/main> branch bar Done. I've created the bar branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bar`. - ``` ``` @@ -93,17 +88,17 @@ x = 3 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm @@ -113,7 +108,6 @@ scratch/main> update updated... Done. - ``` ``` @@ -129,17 +123,17 @@ x = 4 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm @@ -149,7 +143,6 @@ scratch/main> update updated... Done. - ``` ``` @@ -165,16 +158,16 @@ y = 5 ``` ``` ucm :added-by-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 @@ -184,7 +177,6 @@ scratch/foo> update updated... Done. - ``` ``` @@ -203,7 +195,6 @@ D - C - B - A scratch/main> merge /foo I merged scratch/foo into scratch/main. - ``` ``` @@ -222,9 +213,8 @@ F - D - C - B - A scratch/main> merge /bar 😶 - - scratch/main was already up-to-date with scratch/bar. + scratch/main was already up-to-date with scratch/bar. ``` This should be a fast-forward, but we used to get this shape instead (which fails due to conflicts), because we diff --git a/unison-src/transcripts/fix-5340.output.md b/unison-src/transcripts/fix-5340.output.md index 2cecf8efc7..f4825dcdbc 100644 --- a/unison-src/transcripts/fix-5340.output.md +++ b/unison-src/transcripts/fix-5340.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -12,31 +11,30 @@ lib.dep.lib.dep.foo = 18 ``` ``` ucm :added-by-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 lib.dep.lib.dep.Foo type my.Foo lib.dep.lib.dep.foo : Nat my.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type lib.dep.lib.dep.Foo type my.Foo lib.dep.lib.dep.foo : Nat my.foo : Nat - ``` These references to type `Foo` and term `foo` are unambiguous (resolving to the `my.Foo` and `my.foo` in the @@ -48,18 +46,18 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: my.Foo ⍟ These new definitions are ok to `add`: type Bar - ``` ``` unison @@ -68,16 +66,16 @@ bar = foo Nat.+ foo ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: my.foo ⍟ These new definitions are ok to `add`: bar : Nat - ``` diff --git a/unison-src/transcripts/fix-5357.output.md b/unison-src/transcripts/fix-5357.output.md index 46277d2450..ad9c45ca93 100644 --- a/unison-src/transcripts/fix-5357.output.md +++ b/unison-src/transcripts/fix-5357.output.md @@ -9,27 +9,26 @@ foo = ``` ``` ucm :added-by-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 : () util.ignore : a -> () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + foo : () util.ignore : a -> () - ``` ``` unison @@ -38,43 +37,40 @@ lib.base.ignore _ = () ``` ``` ucm :added-by-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`: lib.base.ignore : a -> () (also named util.ignore) - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.base.ignore : a -> () (also named util.ignore) - scratch/main> edit.namespace ☝️ - + I added 2 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/main> load Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix-5369.output.md b/unison-src/transcripts/fix-5369.output.md index 7b9a4b51f7..6559b94f26 100644 --- a/unison-src/transcripts/fix-5369.output.md +++ b/unison-src/transcripts/fix-5369.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,27 +13,26 @@ two.foo = "blah" ``` ``` ucm :added-by-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.foo : Nat two.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + one.foo : Nat two.foo : Text - ``` ``` unison @@ -46,12 +44,13 @@ bar = foo + foo ``` ``` ucm :added-by-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`: bar : Nat @@ -60,5 +59,4 @@ bar = foo + foo new definition: one.foo : Nat - ``` diff --git a/unison-src/transcripts/fix-5374.output.md b/unison-src/transcripts/fix-5374.output.md index 0a19054d90..a22dc8f370 100644 --- a/unison-src/transcripts/fix-5374.output.md +++ b/unison-src/transcripts/fix-5374.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison @@ -13,29 +12,28 @@ thing = indirect.foo + indirect.foo ``` ``` ucm :added-by-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`: lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat thing : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat thing : Nat - scratch/main> view thing thing : Nat @@ -43,16 +41,14 @@ scratch/main> view thing use Nat + use indirect foo foo + foo - scratch/main> edit thing ☝️ - + I added 1 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix-5380.output.md b/unison-src/transcripts/fix-5380.output.md index 842e4ce3a2..f24dcaa513 100644 --- a/unison-src/transcripts/fix-5380.output.md +++ b/unison-src/transcripts/fix-5380.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge lib.builtin Done. - ``` ``` unison @@ -17,31 +16,29 @@ bar = ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - scratch/main> move.term foo qux Done. - scratch/main> view bar bar : Nat @@ -50,5 +47,4 @@ scratch/main> view bar qux : Nat qux = 18 .qux + qux - ``` diff --git a/unison-src/transcripts/fix-5402.output.md b/unison-src/transcripts/fix-5402.output.md index 5fcd16e5a4..b220a92a86 100644 --- a/unison-src/transcripts/fix-5402.output.md +++ b/unison-src/transcripts/fix-5402.output.md @@ -7,16 +7,16 @@ x = 10 ``` ``` ucm :added-by-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.x : ##Nat - ``` ``` unison @@ -26,14 +26,14 @@ x = 10 ``` ``` ucm :added-by-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.x : ##Nat - ``` diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md index b490a782ff..1ab91c73a7 100644 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ b/unison-src/transcripts/fix-big-list-crash.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Big lists have been observed to crash, while in the garbage collection step. @@ -14,15 +13,15 @@ x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U ``` ``` ucm :added-by-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 Direction x : [(Direction, Nat)] - ``` diff --git a/unison-src/transcripts/fix-ls.output.md b/unison-src/transcripts/fix-ls.output.md index 3ac9a35ff7..a6b134972c 100644 --- a/unison-src/transcripts/fix-ls.output.md +++ b/unison-src/transcripts/fix-ls.output.md @@ -2,7 +2,6 @@ test-ls/main> builtins.merge Done. - ``` ``` unison @@ -12,34 +11,31 @@ foo.bar.subtract x y = x Int.- y ``` ``` ucm :added-by-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.bar.add : Int -> Int -> Int foo.bar.subtract : Int -> Int -> Int - ``` ``` ucm test-ls/main> add ⍟ I've added these definitions: - + foo.bar.add : Int -> Int -> Int foo.bar.subtract : Int -> Int -> Int - test-ls/main> ls foo 1. bar/ (2 terms) - test-ls/main> ls 1 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) - ``` diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index dba0fa5e04..03399ce4a0 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -2,7 +2,6 @@ Tests that functions named `.` are rendered correctly. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,32 +13,30 @@ noop = not `.` not ``` ``` ucm :added-by-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`: `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean - scratch/main> view noop noop : Boolean -> Boolean noop = use Boolean not not `.` not - ``` diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md index 525943fa2e..f93ab84b4c 100644 --- a/unison-src/transcripts/fix1327.output.md +++ b/unison-src/transcripts/fix1327.output.md @@ -5,17 +5,17 @@ bar = 5 ``` ``` ucm :added-by-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`: bar : ##Nat foo : ##Nat - ``` `alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones. @@ -26,25 +26,22 @@ Now `ls` returns a pair of the absolute search directory and the result relative scratch/main> add ⍟ I've added these definitions: - + bar : ##Nat foo : ##Nat - scratch/main> ls 1. bar (##Nat) 2. foo (##Nat) - scratch/main> alias.many 1-2 .ns1_nohistory Here's what changed in .ns1_nohistory : - + Added definitions: - + 1. bar : ##Nat 2. foo : ##Nat - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. - ``` diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md index dfadcbe0ad..f0475b4de6 100644 --- a/unison-src/transcripts/fix1334.output.md +++ b/unison-src/transcripts/fix1334.output.md @@ -8,9 +8,7 @@ Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: scratch/main> alias.type ##Nat Cat Done. - scratch/main> alias.term ##Nat.+ please_fix_763.+ Done. - ``` diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index bd8baf34bf..40ae203bca 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -15,25 +14,24 @@ List.map f = ``` ``` ucm :added-by-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.map : (i ->{g} o) -> [i] ->{g} [o] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - List.map : (i ->{g} o) -> [i] ->{g} [o] + List.map : (i ->{g} o) -> [i] ->{g} [o] scratch/main> view List.map List.map : (i ->{g} o) -> [i] ->{g} [o] @@ -42,7 +40,6 @@ scratch/main> view List.map [] -> acc h +: t -> go (acc :+ f h) t go [] - ``` ``` unison @@ -56,14 +53,14 @@ List.map2 f = ``` ``` ucm :added-by-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.map2 : (g ->{h} g2) -> [g] ->{h} [g2] - ``` diff --git a/unison-src/transcripts/fix1421.output.md b/unison-src/transcripts/fix1421.output.md index c9db9ffe64..d372af4910 100644 --- a/unison-src/transcripts/fix1421.output.md +++ b/unison-src/transcripts/fix1421.output.md @@ -2,11 +2,9 @@ scratch/main> alias.type ##Nat Nat Done. - scratch/main> alias.term ##Nat.+ Nat.+ Done. - ``` ``` unison @@ -15,15 +13,15 @@ unique type B = B Nat Nat ``` ``` ucm :added-by-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 A type B - ``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index be4484f2b9..6d44d627e5 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` First, lets create two namespaces. `foo` and `bar`, and add some definitions. @@ -14,29 +13,28 @@ bar.z = x + y ``` ``` ucm :added-by-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`: bar.z : Nat foo.x : Nat foo.y : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar.z : Nat foo.x : Nat foo.y : Nat - ``` Let's see what we have created... @@ -47,7 +45,6 @@ scratch/main> ls 1. bar/ (1 term) 2. builtin/ (469 terms, 74 types) 3. foo/ (2 terms) - ``` Now, if we try deleting the namespace `foo`, we get an error, as expected. @@ -56,18 +53,17 @@ Now, if we try deleting the namespace `foo`, we get an error, as expected. scratch/main> delete.namespace foo ⚠️ - + I didn't delete the namespace because the following definitions are still in use. - + Dependency Referenced In x 1. bar.z y 2. bar.z - + If you want to proceed anyways and leave those definitions without names, use delete.namespace.force - ``` Any numbered arguments should refer to `bar.z`. @@ -77,7 +73,6 @@ scratch/main> debug.numberedArgs 1. bar.z 2. bar.z - ``` We can then delete the dependent term, and then delete `foo`. @@ -86,9 +81,7 @@ We can then delete the dependent term, and then delete `foo`. scratch/main> delete.term 1 Done. - scratch/main> delete.namespace foo Done. - ``` diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index c6650efdd7..4461c47c64 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :error @@ -22,11 +21,10 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. - - 13 | dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") - + 13 | dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") ``` diff --git a/unison-src/transcripts/fix1709.output.md b/unison-src/transcripts/fix1709.output.md index f8f53f2e16..5b73cc3a96 100644 --- a/unison-src/transcripts/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -7,27 +7,26 @@ id2 x = ``` ``` ucm :added-by-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`: id : x -> x id2 : x -> x - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + id : x -> x id2 : x -> x - ``` ``` unison @@ -35,17 +34,17 @@ scratch/main> add ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > id2 "hi" ⧩ "hi" - ``` diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md index a9058a24a9..45341bc675 100644 --- a/unison-src/transcripts/fix1731.output.md +++ b/unison-src/transcripts/fix1731.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide @@ -11,7 +10,6 @@ structural ability CLI where ``` ucm :hide scratch/main> add - ``` The `input` here should parse as a wildcard, not as `CLI.input`. @@ -23,14 +21,14 @@ repro = cases ``` ``` ucm :added-by-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`: repro : Text -> () - ``` diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 4478fa778c..ee969c0eed 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide @@ -29,36 +28,29 @@ Testing a few variations here: scratch/main> run main1 () - scratch/main> run main2 () - scratch/main> run main3 () - scratch/main> add ⍟ I've added these definitions: - + main1 : '{IO} () main2 : ∀ _. _ ->{IO} () main3 : '{IO} () printLine : Text ->{IO} () - scratch/main> rename.term main1 code.main1 Done. - scratch/main> rename.term main2 code.main2 Done. - scratch/main> rename.term main3 code.main3 Done. - ``` The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: @@ -67,15 +59,12 @@ The renaming just ensures that when running `code.main1`, it has to get that mai scratch/main> run code.main1 () - scratch/main> run code.main2 () - scratch/main> run code.main3 () - ``` Now testing a few variations that should NOT typecheck. @@ -94,28 +83,26 @@ This shouldn't work since `main4` and `main5` don't have the right type. scratch/main> run main4 😶 - + I found this function: - + main4 : Nat ->{IO} Nat - + but in order for me to `run` it needs to be a subtype of: - - main4 : '{IO, Exception} result + main4 : '{IO, Exception} result ``` ``` ucm :error scratch/main> run main5 😶 - + I found this function: - + main5 : Nat ->{IO} () - + but in order for me to `run` it needs to be a subtype of: - - main5 : '{IO, Exception} result + main5 : '{IO, Exception} result ``` diff --git a/unison-src/transcripts/fix1844.output.md b/unison-src/transcripts/fix1844.output.md index 6924f886d7..60a97a6e2f 100644 --- a/unison-src/transcripts/fix1844.output.md +++ b/unison-src/transcripts/fix1844.output.md @@ -10,24 +10,24 @@ snoc k aN = match k with ``` ``` ucm :added-by-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 One a type Woot a b c type Z snoc : One a -> aN -> Woot (One a) (One aN) ##Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 8 | > snoc (One 1) 2 ⧩ Woot (One 1) (One 2) 99 - ``` diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index 4d8cd94f8b..0363045c97 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -12,23 +11,23 @@ sq = 2934892384 ``` ``` ucm :added-by-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`: sq : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > 'sq ⧩ do sq - ``` ``` unison @@ -38,21 +37,21 @@ sq = 2934892384 ``` ``` ucm :added-by-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`: sq : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > 'sq ⧩ do sq - ``` diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index f4a7b67693..eb9ec090e5 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison @@ -41,12 +40,13 @@ Exception.unsafeRun! e _ = ``` ``` ucm :added-by-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 ability Exception @@ -65,12 +65,10 @@ Exception.unsafeRun! e _ = putText : Handle -> Text ->{IO, Exception} () stdOut : Handle toException : Either Failure a ->{Exception} a - ``` ``` ucm scratch/main> run ex () - ``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index 5bc4be0887..fe4095adbf 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -50,12 +49,13 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ``` ucm :added-by-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 Either a b @@ -79,21 +79,19 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") -> Bytes ->{IO, Exception} () toException : Either Failure a ->{Exception} a - ``` ``` ucm :error scratch/main> run myServer 💔💥 - + I've encountered a call to builtin.bug with the following value: - + Failure (typeLink IOFailure) "problem" (Any ()) - + Stack trace: bug #8ppr1tt4q2 - ``` diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index 7f7daecc2d..21686574b7 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -54,12 +53,13 @@ Fold.Stream.fold = ``` ``` ucm :added-by-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 Fold g a b @@ -80,14 +80,13 @@ Fold.Stream.fold = Stream.range : Nat -> Nat -> '{Stream Nat} () folds.all : (a ->{g} Boolean) -> Fold g a Boolean id : x -> x - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 44 | pred = n -> (Nat.gt n 2) ⧩ true - ``` Tests some capabilities for catching runtime exceptions. @@ -112,37 +111,35 @@ tests _ = ``` ``` ucm :added-by-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`: catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] - scratch/main> io.test tests New test results: - + 1. tests ◉ caught ◉ caught ◉ got the right answer - + ✅ 3 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md index f6aff5c844..2d5f1ce62e 100644 --- a/unison-src/transcripts/fix2053.output.md +++ b/unison-src/transcripts/fix2053.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` ucm @@ -13,5 +12,4 @@ scratch/main> display List.map None -> acc Some a -> go (i + 1) as (acc :+ f a) go 0 a [] - ``` diff --git a/unison-src/transcripts/fix2156.output.md b/unison-src/transcripts/fix2156.output.md index 8c0067e7c9..e0823b9652 100644 --- a/unison-src/transcripts/fix2156.output.md +++ b/unison-src/transcripts/fix2156.output.md @@ -3,7 +3,6 @@ output/caching. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,21 +13,21 @@ sqr n = n * n ``` ``` ucm :added-by-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`: sqr : Nat -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | > sqr ⧩ n -> n Nat.* n - ``` diff --git a/unison-src/transcripts/fix2167.output.md b/unison-src/transcripts/fix2167.output.md index b4a5b52893..58613b9685 100644 --- a/unison-src/transcripts/fix2167.output.md +++ b/unison-src/transcripts/fix2167.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This is just a simple transcript to regression check an ability @@ -21,18 +20,18 @@ R.near1 region loc = match R.near 42 with ``` ``` ucm :added-by-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 ability R t R.near : Nat ->{R t} [Nat] R.near1 : region -> loc ->{R t} Nat - ``` The issue was that abilities with parameters like this were sometimes diff --git a/unison-src/transcripts/fix2187.output.md b/unison-src/transcripts/fix2187.output.md index 819ea88d96..9357219032 100644 --- a/unison-src/transcripts/fix2187.output.md +++ b/unison-src/transcripts/fix2187.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -20,14 +19,14 @@ lexicalScopeEx = ``` ``` ucm :added-by-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`: lexicalScopeEx : [Text] - ``` diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index 81fff1cc23..c6230bfa08 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -8,7 +8,6 @@ strategies. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -26,29 +25,28 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ``` ucm :added-by-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`: << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c f : Float -> Float foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b txt : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c f : Float -> Float foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b txt : Text - ``` diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 88cc9b13ca..454c80f56f 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` This should not typecheck - the inline `@eval` expression uses abilities. @@ -12,13 +11,12 @@ ex = {{ @eval{abort} }} ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. - - 3 | ex = {{ @eval{abort} }} - + 3 | ex = {{ @eval{abort} }} ``` This file should also not typecheck - it has a triple backticks block that uses abilities. @@ -29,8 +27,6 @@ scratch/main> load unison-src/transcripts/fix2238.u Loading changes detected in unison-src/transcripts/fix2238.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. - - 7 | abort + 1 - + 7 | abort + 1 ``` diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md index d1932a85d6..d8d899bb9c 100644 --- a/unison-src/transcripts/fix2244.output.md +++ b/unison-src/transcripts/fix2244.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` Ensure closing token is emitted by closing brace in doc eval block. @@ -14,14 +13,12 @@ scratch/main> load ./unison-src/transcripts/fix2244.u I found and typechecked these definitions in ./unison-src/transcripts/fix2244.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: x : Doc2 - ``` ``` ucm :hide scratch/main> add - ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 073a1514ac..dcb8e9668d 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -1,6 +1,5 @@ ``` ucm :hide 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: @@ -41,21 +40,19 @@ We'll make our edits in a new branch. 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 f2 : A Nat Nat Nat Nat -> Nat f3 : NeedsA Nat Nat -> Nat g : A Nat Nat Nat Nat -> Nat - 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. @@ -82,7 +79,6 @@ scratch/a2> update Everything typechecks, so I'm saving the results... Done. - scratch/a2> view A NeedsA f f2 f3 g type A a b c d @@ -91,36 +87,34 @@ scratch/a2> view A NeedsA f f2 f3 g | 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 You have no pending todo items. Good work! ✅ - ``` ## Record updates @@ -129,7 +123,6 @@ Here's a test of updating a record: ``` ucm :hide scratch/r1> builtins.merge lib.builtins - ``` ``` unison @@ -139,12 +132,13 @@ combine r = uno r + dos r ``` ``` ucm :added-by-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 @@ -155,14 +149,13 @@ combine r = uno r + dos r 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 @@ -171,14 +164,12 @@ scratch/r1> add 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 @@ -186,12 +177,13 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } ``` ``` ucm :added-by-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 @@ -208,7 +200,6 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } 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`: @@ -224,9 +215,7 @@ scratch/r2> update Everything typechecks, so I'm saving the results... Done. - scratch/r2> todo You have no pending todo items. Good work! ✅ - ``` diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md index 6d274b5d7b..b75a1ac3c4 100644 --- a/unison-src/transcripts/fix2268.output.md +++ b/unison-src/transcripts/fix2268.output.md @@ -4,7 +4,6 @@ a value weren't getting disambiguated. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -21,16 +20,16 @@ test _ = ``` ``` ucm :added-by-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`: ability A ability B test : '{B} Nat - ``` diff --git a/unison-src/transcripts/fix2334.output.md b/unison-src/transcripts/fix2334.output.md index c31d4d6a37..7235d10d6b 100644 --- a/unison-src/transcripts/fix2334.output.md +++ b/unison-src/transcripts/fix2334.output.md @@ -3,7 +3,6 @@ types was discarding default cases in some branches. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -20,33 +19,33 @@ f = cases ``` ``` ucm :added-by-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`: f : Nat -> Nat -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 7 | > f 0 0 ⧩ 0 - + 8 | > f 1 0 ⧩ 3 - + 9 | > f 0 1 ⧩ 2 - + 10 | > f 1 1 ⧩ 2 - ``` diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md index 686b0239ba..ebf6ec6399 100644 --- a/unison-src/transcripts/fix2344.output.md +++ b/unison-src/transcripts/fix2344.output.md @@ -5,7 +5,6 @@ recursive. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -22,15 +21,15 @@ sneezy dee _ = ``` ``` ucm :added-by-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`: ability Nate sneezy : (Nat ->{d} a) -> '{d, Nate} a - ``` diff --git a/unison-src/transcripts/fix2350.output.md b/unison-src/transcripts/fix2350.output.md index a00fbc4bfb..4eda0fee4f 100644 --- a/unison-src/transcripts/fix2350.output.md +++ b/unison-src/transcripts/fix2350.output.md @@ -29,15 +29,15 @@ save a = !(save.impl a) ``` ``` ucm :added-by-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`: ability Storage d g save : a ->{g, Storage d g} d a - ``` diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md index 55d89cf543..5d404425c2 100644 --- a/unison-src/transcripts/fix2353.output.md +++ b/unison-src/transcripts/fix2353.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -17,16 +16,16 @@ pure.run a0 a = ``` ``` ucm :added-by-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`: ability Async t g ability Exception pure.run : a -> (∀ t. '{Async t g} a) ->{g, Exception} a - ``` diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md index 7491255127..7a0eeea719 100644 --- a/unison-src/transcripts/fix2354.output.md +++ b/unison-src/transcripts/fix2354.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests that delaying an un-annotated higher-rank type gives a normal @@ -14,19 +13,18 @@ x = 'f ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat where I expected to find: (a -> 𝕣1) -> 𝕣 - + 1 | f : (forall a . a -> a) -> Nat 2 | f id = id 0 3 | 4 | x = 'f - + from right here: - - 1 | f : (forall a . a -> a) -> Nat - + 1 | f : (forall a . a -> a) -> Nat ``` diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md index 98da1e1164..e04b76fa87 100644 --- a/unison-src/transcripts/fix2355.output.md +++ b/unison-src/transcripts/fix2355.output.md @@ -2,7 +2,6 @@ Tests for a loop that was previously occurring in the type checker. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :error @@ -25,21 +24,20 @@ example = 'let ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I tried to infer a cyclic ability. - + The expression in red was inferred to require the ability: - + {A t25 {𝕖36, 𝕖18}} - + where `𝕖18` is its overall abilities. - + I need a type signature to help figure this out. - + 10 | go u = 11 | t = A.fork '(go (u + 1)) 12 | A.await t - - ``` diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md index 0e28a8d7f9..e8003d95c4 100644 --- a/unison-src/transcripts/fix2378.output.md +++ b/unison-src/transcripts/fix2378.output.md @@ -4,7 +4,6 @@ rows until a fixed point is reached. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -44,12 +43,13 @@ x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ``` ``` ucm :added-by-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`: ability A t g @@ -60,5 +60,4 @@ x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) Ex.catch : '{g, Ex} a ->{g} Either () a ex : '{C c, A t {C c}} Nat x : 'Either () Nat - ``` diff --git a/unison-src/transcripts/fix2423.output.md b/unison-src/transcripts/fix2423.output.md index ca3eb4cf20..4d80a93472 100644 --- a/unison-src/transcripts/fix2423.output.md +++ b/unison-src/transcripts/fix2423.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -32,12 +31,13 @@ Split.zipSame sa sb _ = ``` ``` ucm :added-by-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 ability Split @@ -48,5 +48,4 @@ Split.zipSame sa sb _ = -> '{g, Split} b -> '{g, Split} (a, b) force : '{g} o ->{g} o - ``` diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index e63e29e2ad..6ddb859310 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -22,7 +22,6 @@ should be typed in the following way: scratch/main> builtins.merge Done. - ``` ``` unison @@ -39,16 +38,16 @@ Stream.uncons s = ``` ``` ucm :added-by-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 ability Stream a Stream.uncons : '{g, Stream a} r ->{g} Either r (a, '{g, Stream a} r) - ``` diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 647b525f40..02a9894f11 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> alias.type ##Nat lib.base.Nat - ``` ``` unison :hide @@ -13,7 +12,7 @@ unique type foo.bar.baz.MyRecord = { 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) @@ -22,10 +21,7 @@ scratch/main> add foo.bar.baz.MyRecord.value.set : Nat -> MyRecord -> MyRecord - scratch/main> find : Nat -> MyRecord 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord - - ``` diff --git a/unison-src/transcripts/fix2663.output.md b/unison-src/transcripts/fix2663.output.md index 5a0b876efe..59667660af 100644 --- a/unison-src/transcripts/fix2663.output.md +++ b/unison-src/transcripts/fix2663.output.md @@ -10,7 +10,6 @@ and z would end up referring to the first p3 rather than the second. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -26,22 +25,22 @@ bad x = match Some (Some x) with ``` ``` ucm :added-by-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 Trip bad : Nat -> (Nat, Nat) - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 9 | > bad 2 ⧩ (2, 5) - ``` diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index 28e32ffe06..31ca467e57 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -14,27 +13,26 @@ range = loop [] ``` ``` ucm :added-by-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`: loop : [Nat] -> Nat -> [Nat] range : Nat -> [Nat] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + loop : [Nat] -> Nat -> [Nat] range : Nat -> [Nat] - ``` ``` unison @@ -42,12 +40,13 @@ scratch/main> add ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -2054,7 +2053,6 @@ scratch/main> add , 1999 , 2000 ] - ``` Should be cached: @@ -2064,12 +2062,13 @@ Should be cached: ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -4076,5 +4075,4 @@ Should be cached: , 1999 , 2000 ] - ``` diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index a92d386f07..2787499d1a 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -11,27 +10,26 @@ mapWithKey f m = Tip ``` ``` ucm :added-by-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 Map k v mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Map k v mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b - ``` ``` unison @@ -48,14 +46,14 @@ naiomi = ``` ``` ucm :added-by-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`: naiomi : Map Nat () - ``` diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md index 39da527ba0..9c62136a85 100644 --- a/unison-src/transcripts/fix2795.output.md +++ b/unison-src/transcripts/fix2795.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.mergeio Done. - scratch/main> load unison-src/transcripts/fix2795/docs.u Loading changes detected in @@ -11,12 +10,11 @@ scratch/main> load unison-src/transcripts/fix2795/docs.u I found and typechecked these definitions in unison-src/transcripts/fix2795/docs.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: t1 : Text test : Doc2 - scratch/main> display test t : Text @@ -24,8 +22,7 @@ scratch/main> display test t ⧨ "hi" - + t1 : Text t1 = "hi" - ``` diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md index 84da8067a8..8dadc1c54c 100644 --- a/unison-src/transcripts/fix2822.output.md +++ b/unison-src/transcripts/fix2822.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` There should be no issue having terms with an underscore-led component @@ -14,17 +13,17 @@ b = _a.blah + 1 ``` ``` ucm :added-by-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.blah : Nat b : Nat - ``` Or even that *are* a single “blank” component @@ -36,17 +35,17 @@ x = _b + 1 ``` ``` ucm :added-by-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`: _b : Nat x : Nat - ``` Types can also have underscore-led components. @@ -59,17 +58,17 @@ c = A ``` ``` ucm :added-by-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 _a.Blah c : Blah - ``` And we should also be able to access underscore-led fields. @@ -81,12 +80,13 @@ doStuff = _value.modify ``` ``` ucm :added-by-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 Hello @@ -94,7 +94,6 @@ doStuff = _value.modify Hello._value.modify : (Nat ->{g} Nat) -> Hello ->{g} Hello Hello._value.set : Nat -> Hello -> Hello doStuff : (Nat ->{g} Nat) -> Hello ->{g} Hello - ``` But pattern matching shouldn’t bind to underscore-led names. @@ -106,21 +105,21 @@ dontMap f = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what _used refers to here: - + 3 | Some _used -> f _used - + I also don't know what type it should be. - + Some common causes of this error include: * Your current namespace is too deep to contain the definition in its subtree * The definition is part of a library which hasn't been added to this project * You have a typo in the name - ``` But we can use them as unbound patterns. @@ -132,14 +131,14 @@ dontMap f = cases ``` ``` ucm :added-by-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`: dontMap : (Nat ->{g} Boolean) -> Optional a ->{g} Boolean - ``` diff --git a/unison-src/transcripts/fix2826.output.md b/unison-src/transcripts/fix2826.output.md index 2f78e31dc6..46ea907bad 100644 --- a/unison-src/transcripts/fix2826.output.md +++ b/unison-src/transcripts/fix2826.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.mergeio Done. - ``` Supports fences that are longer than three backticks. @@ -18,16 +17,16 @@ doc = {{ ```` ``` ucm :added-by-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`: doc : Doc2 - ``` And round-trips properly. @@ -36,25 +35,22 @@ And round-trips properly. scratch/main> add ⍟ I've added these definitions: - - doc : Doc2 + doc : Doc2 scratch/main> edit doc ☝️ - + I added 1 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/main> load scratch.u Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ```` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index 39796b695d..e8e54f3085 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -2,7 +2,6 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to ``` ucm :hide scratch/main> builtins.merge - ``` First, a few \[hidden\] definitions necessary for typechecking a simple Doc2. @@ -11,7 +10,7 @@ First, a few \[hidden\] definitions necessary for typechecking a simple Doc2. scratch/main> add ⍟ I've added these definitions: - + type Doc2 type Doc2.SpecialForm type Doc2.Term @@ -20,7 +19,6 @@ scratch/main> add syntax.docParagraph : [Doc2] -> Doc2 syntax.docUntitledSection : [Doc2] -> Doc2 syntax.docWord : Text -> Doc2 - ``` Next, define and display a simple Doc: @@ -35,7 +33,6 @@ Hi scratch/main> display README Hi - ``` Previously, the error was: diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index a38b21c4ec..bcbbf93c4f 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -4,7 +4,6 @@ Also fixes \#1519 (it's the same issue). scratch/main> builtins.merge Done. - ``` ``` unison @@ -13,14 +12,14 @@ foo.+.doc = 10 ``` ``` ucm :added-by-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.+.doc : Nat - ``` diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md index 36fa022c82..b3bd705af6 100644 --- a/unison-src/transcripts/fix3037.output.md +++ b/unison-src/transcripts/fix3037.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests for an unsound case of ability checking that was erroneously being @@ -19,22 +18,21 @@ runner = pureRunner ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found an ability mismatch when checking the expression in red - + 3 | pureRunner : Runner {} 4 | pureRunner = Runner base.force 5 | 6 | -- this compiles, but shouldn't the effect type parameter on Runner be invariant? 7 | runner : Runner {IO} 8 | runner = pureRunner - - + + When trying to match Runner {} with Runner {IO} the right hand side contained extra abilities: {IO} - - ``` @@ -53,16 +51,15 @@ h _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found an ability mismatch when checking the application - + 9 | > h anA - - + + When trying to match A {} with A {IO} the right hand side contained extra abilities: {IO} - - ``` diff --git a/unison-src/transcripts/fix3171.output.md b/unison-src/transcripts/fix3171.output.md index c199b539bb..e15ba83254 100644 --- a/unison-src/transcripts/fix3171.output.md +++ b/unison-src/transcripts/fix3171.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests an case where decompiling could cause function arguments to occur in the @@ -15,25 +14,25 @@ f x y z _ = x + y * z ``` ``` ucm :added-by-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`: f : Nat -> Nat -> Nat -> 'Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | > f 1 2 ⧩ z _ -> 1 Nat.+ 2 Nat.* z - + 5 | > f 1 2 3 ⧩ _ -> 1 Nat.+ 2 Nat.* 3 - ``` diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md index b8ec85f206..02f78449f7 100644 --- a/unison-src/transcripts/fix3196.output.md +++ b/unison-src/transcripts/fix3196.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests ability checking in scenarios where one side is concrete and the other is @@ -35,12 +34,13 @@ w2 = cases W -> W ``` ``` ucm :added-by-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 C @@ -50,12 +50,11 @@ w2 = cases W -> W w1 : W {Zoot} w2 : W {g} -> W {g} woot : W {g} -> '{g, Zoot} a ->{Zoot} a - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 22 | > w2 w1 ⧩ W - ``` diff --git a/unison-src/transcripts/fix3215.output.md b/unison-src/transcripts/fix3215.output.md index ac5bf82d1a..43f652eb67 100644 --- a/unison-src/transcripts/fix3215.output.md +++ b/unison-src/transcripts/fix3215.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests a case where concrete abilities were appearing multiple times in an @@ -22,15 +21,15 @@ f = cases ``` ``` ucm :added-by-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 ability T f : Request {g, T} x -> Nat - ``` diff --git a/unison-src/transcripts/fix3244.output.md b/unison-src/transcripts/fix3244.output.md index c62b6b6b10..8159eb8b28 100644 --- a/unison-src/transcripts/fix3244.output.md +++ b/unison-src/transcripts/fix3244.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This tests an previously erroneous case in the pattern compiler. It was assuming @@ -22,21 +21,21 @@ foo t = ``` ``` ucm :added-by-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 : (Nat, Nat) -> Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 11 | > foo (10,20) ⧩ 30 - ``` diff --git a/unison-src/transcripts/fix3265.output.md b/unison-src/transcripts/fix3265.output.md index 8feb1f6a64..11547b8bf3 100644 --- a/unison-src/transcripts/fix3265.output.md +++ b/unison-src/transcripts/fix3265.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Tests cases that produced bad decompilation output previously. There @@ -27,12 +26,13 @@ are three cases that need to be 'fixed up.' ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -52,7 +52,6 @@ are three cases that need to be 'fixed up.' f3 x y = 1 + y + f2 x g h = h 1 + x g (z -> x + f0 z)) - ``` Also check for some possible corner cases. @@ -72,12 +71,13 @@ discard its arguments, where `f` also occurs. ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -90,5 +90,4 @@ discard its arguments, where `f` also occurs. 0 -> 0 _ -> f x (f y (Nat.drop y 1)) f x 20) - ``` diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md index 937714613f..95a1b880ea 100644 --- a/unison-src/transcripts/fix3424.output.md +++ b/unison-src/transcripts/fix3424.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge lib.builtins Done. - ``` ``` unison :hide @@ -15,15 +14,13 @@ c = "World" scratch/main> add ⍟ I've added these definitions: - + a : 'Text b : Text c : Text - scratch/main> run a "Hello, World!" - ``` ``` unison :hide @@ -42,11 +39,9 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> run a "Hello, Unison!" - ``` The result should be "Hello, Unison\!". diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index 8c38248615..fcd46aade7 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison @@ -16,33 +15,31 @@ d = {{ ``` ``` ucm :added-by-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 M a (also named builtin.Optional) d : Doc2 - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type M a (also named builtin.Optional) d : Doc2 - scratch/main> display d `x -> J x` - - J + J ``` diff --git a/unison-src/transcripts/fix3678.output.md b/unison-src/transcripts/fix3678.output.md index 926b65121b..f8c1dff0fb 100644 --- a/unison-src/transcripts/fix3678.output.md +++ b/unison-src/transcripts/fix3678.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Array comparison was indexing out of bounds. @@ -14,21 +13,21 @@ arr = Scope.run do ``` ``` ucm :added-by-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`: arr : ImmutableArray Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 5 | > compare arr arr ⧩ +0 - ``` diff --git a/unison-src/transcripts/fix3752.output.md b/unison-src/transcripts/fix3752.output.md index 7dce7688e1..25d17717ba 100644 --- a/unison-src/transcripts/fix3752.output.md +++ b/unison-src/transcripts/fix3752.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` These were failing to type check before, because id was not @@ -22,15 +21,15 @@ bar = do ``` ``` ucm :added-by-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`: bar : 'Text foo : 'Text - ``` diff --git a/unison-src/transcripts/fix3773.output.md b/unison-src/transcripts/fix3773.output.md index 2916b94262..b781453bb3 100644 --- a/unison-src/transcripts/fix3773.output.md +++ b/unison-src/transcripts/fix3773.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -13,21 +12,21 @@ foo = ``` ``` ucm :added-by-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 : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 6 | > foo + 20 ⧩ 62 - ``` diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index bd8bc7e150..cac95349b6 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”. @@ -15,26 +14,23 @@ foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with scratch/main> add ⍟ I've added these definitions: - + failure : Text -> context -> Failure foo : Either Failure b - scratch/main> edit foo ☝️ - + I added 1 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/main> load scratch.u Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index d23edf6adf..e87835951c 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -17,48 +16,46 @@ allowDebug = debug [1,2,3] ``` ``` ucm :added-by-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`: allowDebug : Text bool : Boolean debug : a -> Text t1 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 6 | test> t1 = if bool then [Ok "Yay"] ✅ Passed Yay - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + allowDebug : Text bool : Boolean debug : a -> Text t1 : [Result] - scratch/main> test Cached test results (`help testcache` to learn more) - + 1. t1 ◉ Yay - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` unison @@ -66,40 +63,36 @@ bool = false ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: bool : Boolean - ``` ``` ucm :error scratch/main> update.old ⍟ I've updated these names to your new definition: - - bool : Boolean + bool : Boolean scratch/main> test ✅ - - New test results: - + 1. t1 ✗ [1, 2, 3] - + 🚫 1 test(s) failing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/fix4280.output.md b/unison-src/transcripts/fix4280.output.md index 385bfd727f..8d7ff2c2d0 100644 --- a/unison-src/transcripts/fix4280.output.md +++ b/unison-src/transcripts/fix4280.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -13,15 +12,15 @@ bonk = ``` ``` ucm :added-by-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 foo.bar._baz : Nat - ``` diff --git a/unison-src/transcripts/fix4397.output.md b/unison-src/transcripts/fix4397.output.md index e09bfbc80a..fa95e4a577 100644 --- a/unison-src/transcripts/fix4397.output.md +++ b/unison-src/transcripts/fix4397.output.md @@ -8,6 +8,7 @@ unique type Bar ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -15,5 +16,4 @@ unique type Bar Foo expects an argument of kind: Type -> Type; however, it is applied to Bar which has kind: Type. - ``` diff --git a/unison-src/transcripts/fix4415.output.md b/unison-src/transcripts/fix4415.output.md index ff8234939c..541d736413 100644 --- a/unison-src/transcripts/fix4415.output.md +++ b/unison-src/transcripts/fix4415.output.md @@ -4,15 +4,15 @@ unique type sub.Foo = ``` ``` ucm :added-by-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 type sub.Foo - ``` diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index 014762f8d4..8915119bd9 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Some basics: @@ -17,11 +16,10 @@ countCat = cases scratch/main> add ⍟ I've added these definitions: - + type Cat.Dog type Rat.Dog countCat : Cat.Dog -> Rat.Dog - ``` Now I want to add a constructor. @@ -41,5 +39,4 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - ``` diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index 82a5314ea9..8cabe342e1 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -1,6 +1,5 @@ ``` ucm :hide myproj/main> builtins.merge - ``` ``` unison @@ -12,12 +11,13 @@ mybar = bar + bar ``` ``` ucm :added-by-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`: lib.foo0.baz : Nat @@ -25,38 +25,35 @@ mybar = bar + bar lib.foo1.lib.bonk2.qux : Nat lib.foo1.zonk : Nat mybar : Nat - ``` ``` ucm :error myproj/main> add ⍟ I've added these definitions: - + lib.foo0.baz : Nat lib.foo0.lib.bonk1.bar : Nat lib.foo1.lib.bonk2.qux : Nat lib.foo1.zonk : Nat mybar : Nat - myproj/main> upgrade foo0 foo1 I couldn't automatically upgrade foo0 to foo1. However, I've added the definitions that need attention to the top of scratch.u. - + When you're done, you can run - + upgrade.commit - + to merge your changes back into main and delete the temporary branch. Or, if you decide to cancel the upgrade instead, you can run - + delete.branch /upgrade-foo0-to-foo1 - - to delete the temporary branch and switch back to main. + to delete the temporary branch and switch back to main. ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index e0fd544d15..00614c6a9e 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -11,36 +10,34 @@ myterm = foo + 2 ``` ``` ucm :added-by-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`: lib.dep0.bonk.foo : Nat lib.dep0.lib.dep1.foo : Nat lib.dep0.zonk.foo : Text myterm : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.dep0.bonk.foo : Nat lib.dep0.lib.dep1.foo : Nat lib.dep0.zonk.foo : Text myterm : Nat - scratch/main> view myterm myterm : Nat myterm = use Nat + bonk.foo + 2 - ``` diff --git a/unison-src/transcripts/fix4515.output.md b/unison-src/transcripts/fix4515.output.md index 9005c68261..87e3c19cea 100644 --- a/unison-src/transcripts/fix4515.output.md +++ b/unison-src/transcripts/fix4515.output.md @@ -1,6 +1,5 @@ ``` ucm :hide myproject/main> builtins.merge - ``` ``` unison @@ -14,31 +13,30 @@ useBar = cases ``` ``` ucm :added-by-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 Bar type Baz type Foo useBar : Bar -> Nat - ``` ``` ucm myproject/main> add ⍟ I've added these definitions: - + type Bar type Baz type Foo useBar : Bar -> Nat - ``` ``` unison @@ -46,17 +44,17 @@ unique type Foo = Foo1 | Foo2 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -70,5 +68,4 @@ myproject/main> update Everything typechecks, so I'm saving the results... Done. - ``` diff --git a/unison-src/transcripts/fix4528.output.md b/unison-src/transcripts/fix4528.output.md index 3834e4ee19..6c7f76915f 100644 --- a/unison-src/transcripts/fix4528.output.md +++ b/unison-src/transcripts/fix4528.output.md @@ -1,6 +1,5 @@ ``` ucm :hide foo/main> builtins.merge - ``` ``` unison @@ -11,29 +10,27 @@ main _ = MkFoo 5 ``` ``` ucm :added-by-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 Foo main : 'Foo - ``` ``` ucm foo/main> add ⍟ I've added these definitions: - + structural type Foo main : 'Foo - foo/main> run main MkFoo 5 - ``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index 3afaf86ddf..30048e4bb3 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -11,31 +10,30 @@ hey = foo.hello ``` ``` ucm :added-by-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`: bar.hello : Nat foo.hello : Nat hey : Nat thing : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar.hello : Nat foo.hello : Nat hey : Nat thing : Nat - ``` ``` unison @@ -43,17 +41,17 @@ thing = 2 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: thing : Nat - ``` ``` ucm @@ -67,5 +65,4 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - ``` diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md index 3746008bf4..4379da14a5 100644 --- a/unison-src/transcripts/fix4592.output.md +++ b/unison-src/transcripts/fix4592.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison @@ -9,14 +8,14 @@ doc = {{ {{ bug "bug" ``` ``` ucm :added-by-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`: doc : Doc2 - ``` diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index a197cd84e2..b8e775dc2a 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -9,27 +8,26 @@ unique type Bugs.Zonk = Bugs ``` ``` ucm :added-by-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 Bugs.Zonk foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Bugs.Zonk foo : Nat - ``` ``` unison @@ -38,12 +36,13 @@ unique type Bugs = ``` ``` ucm :added-by-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 Bugs @@ -52,7 +51,6 @@ unique type Bugs = new definition: foo : Nat - ``` ``` ucm @@ -62,5 +60,4 @@ scratch/main> update updated... Done. - ``` diff --git a/unison-src/transcripts/fix4711.output.md b/unison-src/transcripts/fix4711.output.md index f74619e5f8..20c94397cf 100644 --- a/unison-src/transcripts/fix4711.output.md +++ b/unison-src/transcripts/fix4711.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -12,17 +11,17 @@ thisDoesNotWork = ['(+1)] ``` ``` ucm :added-by-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`: thisDoesNotWork : ['{g} Int] thisWorks : 'Int - ``` Since this is fixed, `thisDoesNotWork` now does work. @@ -31,26 +30,23 @@ Since this is fixed, `thisDoesNotWork` now does work. scratch/main> add ⍟ I've added these definitions: - + thisDoesNotWork : ['{g} Int] thisWorks : 'Int - scratch/main> edit thisWorks thisDoesNotWork ☝️ - + I added 2 definitions to the top of scratch.u - + You can edit them there, then run `update` to replace the definitions currently in this namespace. - scratch/main> load Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/fix4722.output.md b/unison-src/transcripts/fix4722.output.md index b1905abc8c..b7568064f7 100644 --- a/unison-src/transcripts/fix4722.output.md +++ b/unison-src/transcripts/fix4722.output.md @@ -9,7 +9,6 @@ like annotations on each case. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -40,12 +39,13 @@ foo = cases ``` ``` ucm :added-by-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 Bar a @@ -59,5 +59,4 @@ foo = cases -> '{g, X a} () -> '{g, X a} () foo : Bar (Optional b) -> '{Y, X (Foo z ('{Y} r))} () - ``` diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md index 2101cc9cfe..23b743a42e 100644 --- a/unison-src/transcripts/fix4731.output.md +++ b/unison-src/transcripts/fix4731.output.md @@ -3,25 +3,24 @@ structural type Void = ``` ``` ucm :added-by-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 Void - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - structural type Void + structural type Void ``` We should be able to `match` on empty types like `Void`. @@ -32,16 +31,16 @@ Void.absurdly v = match !v with ``` ``` ucm :added-by-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`: Void.absurdly : '{e} Void ->{e} a - ``` ``` unison @@ -50,16 +49,16 @@ Void.absurdly v = match v with ``` ``` ucm :added-by-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`: Void.absurdly : Void -> a - ``` And empty `cases` should also work. @@ -70,16 +69,16 @@ Void.absurdly = cases ``` ``` ucm :added-by-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`: Void.absurdly : Void -> a - ``` But empty function bodies are not allowed. @@ -90,10 +89,9 @@ Void.absurd x = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: 2 | Void.absurd x = - - ``` diff --git a/unison-src/transcripts/fix4780.output.md b/unison-src/transcripts/fix4780.output.md index e1aa5ae26b..266ac610d6 100644 --- a/unison-src/transcripts/fix4780.output.md +++ b/unison-src/transcripts/fix4780.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Just a simple test case to see whether partially applied @@ -11,17 +10,17 @@ builtins decompile properly. ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > (+) 2 ⧩ (Nat.+) 2 - ``` diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index c2ff2614ba..f8c1948545 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,40 +13,37 @@ redouble x = double x + double x ``` ``` ucm :added-by-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`: double : Int -> Int redouble : Int -> Int - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + double : Int -> Int redouble : Int -> Int - scratch/main> dependents double Dependents of: double - + Terms: - + 1. redouble - + Tip: Try `view 1` to see the source of any numbered item in the above list. - scratch/main> delete.term 1 Done. - ``` diff --git a/unison-src/transcripts/fix5055.output.md b/unison-src/transcripts/fix5055.output.md index 31d75903ef..a19493dce8 100644 --- a/unison-src/transcripts/fix5055.output.md +++ b/unison-src/transcripts/fix5055.output.md @@ -2,7 +2,6 @@ test-5055/main> builtins.merge Done. - ``` ``` unison @@ -12,37 +11,34 @@ foo.subtract x y = x Int.- y ``` ``` ucm :added-by-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.add : Int -> Int -> Int foo.subtract : Int -> Int -> Int - ``` ``` ucm test-5055/main> add ⍟ I've added these definitions: - + foo.add : Int -> Int -> Int foo.subtract : Int -> Int -> Int - test-5055/main> ls foo 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) - test-5055/main> view 1 foo.add : Int -> Int -> Int foo.add x y = use Int + x + y - ``` diff --git a/unison-src/transcripts/fix5076.output.md b/unison-src/transcripts/fix5076.output.md index d6d992ee63..4fadef5b75 100644 --- a/unison-src/transcripts/fix5076.output.md +++ b/unison-src/transcripts/fix5076.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` Nested call to code lexer wasn’t terminating inline examples containing blocks properly. @@ -13,14 +12,14 @@ x = {{ ``` ``` ucm :added-by-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 : Doc2 - ``` diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md index 4bd68dcd66..97accafa83 100644 --- a/unison-src/transcripts/fix5080.output.md +++ b/unison-src/transcripts/fix5080.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` ``` unison @@ -9,65 +8,61 @@ test> fix5080.tests.failure = [Fail "fail"] ``` ``` ucm :added-by-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`: fix5080.tests.failure : [Result] fix5080.tests.success : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | test> fix5080.tests.success = [Ok "success"] ✅ Passed success - + 2 | test> fix5080.tests.failure = [Fail "fail"] 🚫 FAILED fail - ``` ``` ucm :error scratch/main> add ⍟ I've added these definitions: - + fix5080.tests.failure : [Result] fix5080.tests.success : [Result] - scratch/main> test Cached test results (`help testcache` to learn more) - + 1. fix5080.tests.success ◉ success - + 2. fix5080.tests.failure ✗ fail - + 🚫 1 test(s) failing, ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` ucm scratch/main> delete.term 2 Done. - scratch/main> test Cached test results (`help testcache` to learn more) - + 1. fix5080.tests.success ◉ success - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/fix5168.output.md b/unison-src/transcripts/fix5168.output.md index a62179ca2a..b5ece8dc7a 100644 --- a/unison-src/transcripts/fix5168.output.md +++ b/unison-src/transcripts/fix5168.output.md @@ -5,14 +5,14 @@ b = 2 ``` ``` ucm :added-by-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`: b : ##Nat - ``` diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md index 8b8f135fa4..6d9b0d4b99 100644 --- a/unison-src/transcripts/fix5349.output.md +++ b/unison-src/transcripts/fix5349.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` Empty code blocks are invalid in Unison, but shouldn’t crash the parser. @@ -13,12 +12,11 @@ README = {{ ```` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: 0 | README = {{ - - ``` ``` unison :error @@ -26,15 +24,16 @@ README = {{ {{ }} }} ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - - - + + + I was surprised to find an end of input here. I was expecting one of these instead: - + * bang * do * false @@ -48,7 +47,6 @@ README = {{ {{ }} }} * true * tuple * typeLink - ``` ``` unison :error @@ -56,15 +54,16 @@ README = {{ `` `` }} ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - - - + + + I was surprised to find an end of input here. I was expecting one of these instead: - + * bang * do * false @@ -78,5 +77,4 @@ README = {{ `` `` }} * true * tuple * typeLink - ``` diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md index cda55d61bc..ebd58ef50c 100644 --- a/unison-src/transcripts/fix614.output.md +++ b/unison-src/transcripts/fix614.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. @@ -17,22 +16,21 @@ ex1 = do ``` ``` ucm :added-by-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 ability Stream a ex1 : '{Stream Nat} Nat - ``` ``` ucm :hide scratch/main> add - ``` This does not typecheck, we've accidentally underapplied `Stream.emit`: @@ -44,17 +42,17 @@ ex2 = do ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a value of type: a ->{Stream a} Unit where I expected to find: Unit - + 2 | Stream.emit 3 | 42 - + Hint: Actions within a block must have type Unit. Use _ = to ignore a result. - ``` We can explicitly ignore an unused result like so: @@ -66,16 +64,16 @@ ex3 = do ``` ``` ucm :added-by-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`: ex3 : '() - ``` Using a helper function like `void` also works fine: @@ -89,17 +87,17 @@ ex4 = ``` ``` ucm :added-by-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`: ex4 : () void : x -> () - ``` One more example: @@ -111,19 +109,19 @@ ex4 = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a value of type: [Nat] where I expected to find: Unit - + 2 | [1,2,3] -- no good 3 | () - + from right here: - + 2 | [1,2,3] -- no good - + Hint: Actions within a block must have type Unit. Use _ = to ignore a result. - ``` diff --git a/unison-src/transcripts/fix689.output.md b/unison-src/transcripts/fix689.output.md index e2fb83039f..c3ff7cdc80 100644 --- a/unison-src/transcripts/fix689.output.md +++ b/unison-src/transcripts/fix689.output.md @@ -2,7 +2,6 @@ Tests the fix for https://github.com/unisonweb/unison/issues/689 ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -13,15 +12,15 @@ tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) ``` ``` ucm :added-by-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 ability SystemTime tomorrow : '{SystemTime} Nat - ``` diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 375c6031e5..1680e443ca 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -12,27 +11,26 @@ structural ability Abort where ``` ``` ucm :added-by-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 ability Abort structural ability X t - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural ability Abort structural ability X t - ``` This code should not type check. The match on X.x ought to introduce a @@ -48,22 +46,21 @@ h0 req = match req with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Each case of a match / with expression need to have the same type. - + Here, one is: Optional b and another is: Optional a - - + + 3 | { X.x _ c -> _ } -> handle c with h0 - + from these spots, respectively: - - 1 | h0 : Request {X t} b -> Optional b - + 1 | h0 : Request {X t} b -> Optional b ``` This code should not check because `t` does not match `b`. @@ -76,22 +73,21 @@ h1 req = match req with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Each case of a match / with expression need to have the same type. - + Here, one is: Optional b and another is: Optional t - - + + 3 | { X.x t _ -> _ } -> handle t with h1 - + from these spots, respectively: - - 1 | h1 : Request {X t} b -> Optional b - + 1 | h1 : Request {X t} b -> Optional b ``` This code should not check for reasons similar to the first example, @@ -105,16 +101,15 @@ h2 req = match req with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. The 1st argument to `k` - + has type: Nat but I expected: a - - 3 | { Abort.abort -> k } -> handle k 5 with h2 - + 3 | { Abort.abort -> k } -> handle k 5 with h2 ``` This should work fine. @@ -128,14 +123,14 @@ h3 = cases ``` ``` ucm :added-by-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`: h3 : Request {X b, Abort} b -> Optional b - ``` diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md index 17915b7555..d837030803 100644 --- a/unison-src/transcripts/fix845.output.md +++ b/unison-src/transcripts/fix845.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Add `List.zonk` to the codebase: @@ -14,22 +13,21 @@ Text.zonk txt = txt ++ "!! " ``` ``` ucm :added-by-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.zonk : [a] -> [a] Text.zonk : Text -> Text - ``` ``` ucm :hide scratch/main> add - ``` Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: @@ -40,23 +38,23 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what Blah.zonk refers to here: - + 2 | > Blah.zonk [1,2,3] - + I think its type should be: - + [Nat] -> o - + Some common causes of this error include: * Your current namespace is too deep to contain the definition in its subtree * The definition is part of a library which hasn't been added to this project * You have a typo in the name - ``` Here's another example, just checking that TDNR works for definitions in the same file: @@ -72,25 +70,25 @@ ex = baz ++ ", world!" ``` ``` ucm :added-by-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`: ex : Text foo.bar.baz : Nat qux.baz : Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 7 | > ex ⧩ "hello, world!" - ``` Here's another example, checking that TDNR works when multiple codebase definitions have matching names: @@ -102,23 +100,23 @@ ex = zonk "hi" ``` ``` ucm :added-by-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`: ex : Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 3 | > ex ⧩ "hi!! " - ``` Last example, showing that TDNR works when there are multiple matching names in both the file and the codebase: @@ -134,23 +132,23 @@ ex = zonk "hi" -- should resolve to Text.zonk, from the codebase ``` ``` ucm :added-by-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`: ex : Text woot.zonk : Text woot2.zonk : Nat - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 7 | > ex ⧩ "hi!! woot" - ``` diff --git a/unison-src/transcripts/fix849.output.md b/unison-src/transcripts/fix849.output.md index 7d725d160a..12321025e4 100644 --- a/unison-src/transcripts/fix849.output.md +++ b/unison-src/transcripts/fix849.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` See [this ticket](https://github.com/unisonweb/unison/issues/849). @@ -12,21 +11,21 @@ x = 42 ``` ``` ucm :added-by-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 - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 3 | > x ⧩ 42 - ``` diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index 50731c9293..fc2522afef 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` First we add some code: @@ -12,29 +11,28 @@ z = y + 2 ``` ``` ucm :added-by-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 y : Nat z : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + x : Nat y : Nat z : Nat - ``` Now we edit `x` to be `7`, which should make `z` equal `10`: @@ -44,17 +42,17 @@ x = 7 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm @@ -68,22 +66,20 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view x y z x : Nat x = 7 - + y : Nat y = use Nat + x + 1 - + z : Nat z = use Nat + y + 2 - ``` Uh oh\! `z` is still referencing the old version. Just to confirm: @@ -93,40 +89,38 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ``` ucm :added-by-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`: t1 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ✅ Passed great - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - t1 : [Result] + t1 : [Result] scratch/main> test Cached test results (`help testcache` to learn more) - + 1. t1 ◉ great - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index 4fb18e42c0..524ade93ae 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` First we'll add a definition: @@ -16,17 +15,17 @@ spaceAttack1 x = ``` ``` ucm :added-by-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 ability DeathStar spaceAttack1 : x ->{DeathStar} Text - ``` Add it to the codebase: @@ -35,10 +34,9 @@ Add it to the codebase: scratch/main> add ⍟ I've added these definitions: - + structural ability DeathStar spaceAttack1 : x ->{DeathStar} Text - ``` Now we'll try to add a different definition that runs the actions in a different order. This should work fine: @@ -51,25 +49,24 @@ spaceAttack2 x = ``` ``` ucm :added-by-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`: spaceAttack2 : x ->{DeathStar} Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - spaceAttack2 : x ->{DeathStar} Text + spaceAttack2 : x ->{DeathStar} Text ``` 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/formatter.output.md b/unison-src/transcripts/formatter.output.md index aac9cba15e..186695e07e 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -90,7 +89,6 @@ with a strike-through block~ ``` ucm scratch/main> debug.format - ``` ``` unison :added-by-ucm scratch.u @@ -178,34 +176,33 @@ brokenDoc = {{ hello }} + 1 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what + refers to here: - + 1 | brokenDoc = {{ hello }} + 1 - + The name + is ambiguous. I tried to resolve it by type but no term with that name would pass typechecking. I think its type should be: - + Doc2 -> Nat -> o - + If that's not what you expected, you may have a type error somewhere else in your code. Help me out by using a more specific name here or adding a type annotation. - + I found some terms in scope with matching names but different types. If one of these is what you meant, try using its full name: - + (Float.+) : Float -> Float -> Float (Int.+) : Int -> Int -> Int (Nat.+) : Nat -> Nat -> Nat - ``` ``` ucm scratch/main> debug.format - ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index 1642a95bf3..bdc558c114 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. scratch/empty> view ⚠️ - + Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 ``` @@ -32,16 +32,14 @@ Definition args scratch/main> add ⍟ I've added these definitions: - + nested.optionTwo : ##Nat optionOne : ##Nat - scratch/main> debug.fuzzy-options view _ Select a definition to view: * optionOne * nested.optionTwo - ``` Namespace args @@ -51,12 +49,10 @@ scratch/main> add ⊡ Ignored previously added definitions: nested.optionTwo optionOne - scratch/main> debug.fuzzy-options find-in _ Select a namespace: * nested - ``` Project Branch args @@ -65,10 +61,9 @@ 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`. - scratch/main> debug.fuzzy-options switch _ Select a project or branch to switch to: @@ -78,5 +73,4 @@ scratch/main> debug.fuzzy-options switch _ * scratch/main * myproject * scratch - ``` diff --git a/unison-src/transcripts/generic-parse-errors.output.md b/unison-src/transcripts/generic-parse-errors.output.md index fac94257ea..38da7ff587 100644 --- a/unison-src/transcripts/generic-parse-errors.output.md +++ b/unison-src/transcripts/generic-parse-errors.output.md @@ -6,20 +6,20 @@ x = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 2 | foo.123 - - + + I was surprised to find a 1 here. I was expecting one of these instead: - + * end of input * hash (ex: #af3sj3) * identifier (ex: abba1, snake_case, .foo.bar#xyz, .foo.++#xyz, or 🌻) - ``` ``` unison :error @@ -27,16 +27,17 @@ namespace.blah = 1 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 1 | namespace.blah = 1 - - + + I was surprised to find a = here. I was expecting one of these instead: - + * ability * bang * binding @@ -55,7 +56,6 @@ namespace.blah = 1 * type * typeLink * use - ``` ``` unison :error @@ -63,13 +63,12 @@ x = 1 ] ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a closing ']' here without a matching '['. - - 1 | x = 1 ] - + 1 | x = 1 ] ``` ``` unison :error @@ -77,16 +76,17 @@ x = a.#abc ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 1 | x = a.#abc - - + + I was surprised to find a '.' here. I was expecting one of these instead: - + * and * bang * do @@ -103,7 +103,6 @@ x = a.#abc * true * tuple * typeLink - ``` ``` unison :error @@ -111,19 +110,19 @@ x = "hi ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 2 | - + I was surprised to find an end of input here. I was expecting one of these instead: - + * " * \s * literal character - ``` ``` unison :error @@ -131,16 +130,16 @@ y : a ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I got confused here: - + 2 | - + I was surprised to find an end of section here. I was expecting one of these instead: - + * -> * newline or semicolon - ``` diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index ab3c7d4fe9..a8e3cf478b 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -2,7 +2,6 @@ ``` ucm :hide 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. @@ -31,16 +30,16 @@ x = 42 ``` ``` ucm :added-by-ucm + Loading changes detected in myfile.u. I found and typechecked these definitions in myfile.u. If you do an `add` or `update`, here's how your codebase would change: - + ⍟ These new definitions are ok to `add`: x : Nat - ``` Let's go ahead and add that to the codebase, then make sure it's there: @@ -49,14 +48,12 @@ Let's go ahead and add that to the codebase, then make sure it's there: scratch/main> add ⍟ I've added these definitions: - - x : Nat + x : Nat scratch/main> view x x : Nat x = 42 - ``` If `view` returned no results, the transcript would fail at this point. @@ -73,7 +70,6 @@ This works for `ucm` blocks as well. ``` ucm :hide 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. @@ -88,17 +84,16 @@ hmm = "Not, in fact, a number" ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found a value of type: Text where I expected to find: Nat - + 1 | hmm : .builtin.Nat 2 | hmm = "Not, in fact, a number" - + from right here: - - 2 | hmm = "Not, in fact, a number" - + 2 | hmm = "Not, in fact, a number" ``` diff --git a/unison-src/transcripts/help.output.md b/unison-src/transcripts/help.output.md index 914d727c47..8180b08e21 100644 --- a/unison-src/transcripts/help.output.md +++ b/unison-src/transcripts/help.output.md @@ -5,55 +5,55 @@ scratch/main> help add `add` adds to the codebase all the definitions from the most recently typechecked file. - + add.preview `add.preview` previews additions to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. - + add.run `add.run name` adds to the codebase the result of the most recent `run` command as `name`. - + alias.many (or copy) `alias.many [relative2...] ` creates aliases `relative1`, `relative2`, ... in the namespace `namespace`. `alias.many foo.foo bar.bar .quux` creates aliases `.quux.foo.foo` and `.quux.bar.bar`. - + alias.term `alias.term foo bar` introduces `bar` with the same definition as `foo`. - + alias.type `alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`. - + api `api` provides details about the API. - + auth.login Obtain an authentication session with Unison Share. `auth.login`authenticates ucm with Unison Share. - + back (or popd) `back` undoes the last `switch` command. - + branch (or branch.create, create.branch) `branch foo` forks the current project branch to a new branch `foo` `branch /bar foo` forks the branch `bar` of the current project to a new branch `foo` - + branch.empty (or branch.create-empty, create.empty-branch) Create a new empty branch. - + branch.rename (or rename.branch) `branch.rename foo` renames the current branch to `foo` - + branches (or list.branch, ls.branch, branch.list) `branches` lists all branches in the current project `branches foo` lists all branches in the project `foo` - + clear `clear` Clears the screen. - + clone `clone @unison/json/topic json/my-topic` creates `json/my-topic` from @@ -84,35 +84,35 @@ scratch/main> help project's associated remote (see `help-topics remotes`) - + compile (or compile.output) `compile main file` Outputs a stand alone file that can be directly loaded and executed by unison. Said execution will have the effect of running `!main`. - + create.author `create.author alicecoder "Alice McGee"` creates `alicecoder` values in `metadata.authors` and `metadata.copyrightHolders.` - + debug.clear-cache Clear the watch expression cache - + debug.doc-to-markdown `debug.doc-to-markdown term.doc` Render a doc to markdown. - + debug.doctor Analyze your codebase for errors and inconsistencies. - + debug.dump-namespace Dump the namespace to a text file - + debug.dump-namespace-simple Dump the namespace to a text file - + debug.file View details about the most recent successfully typechecked file. - + debug.find.global `find` lists all definitions in the current namespace. @@ -150,64 +150,64 @@ scratch/main> help name similar to 'foo'. Note that this is a very slow operation. - + debug.names.global `debug.names.global foo` Iteratively search across all projects and branches for names matching `foo`. Note that this is expected to be quite slow and is primarily for debugging issues with your codebase. - + debug.numberedArgs Dump the contents of the numbered args state. - + delete `delete foo` removes the term or type name `foo` from the namespace. `delete foo bar` removes the term or type name `foo` and `bar` from the namespace. - + delete.branch (or branch.delete) `delete.branch foo/bar` deletes the branch `bar` in the project `foo` `delete.branch /bar` deletes the branch `bar` in the current project - + delete.namespace `delete.namespace ` deletes the namespace `foo` - + delete.namespace.force `delete.namespace.force ` deletes the namespace `foo`,deletion will proceed even if other code depends on definitions in foo. - + delete.project (or project.delete) `delete.project foo` deletes the local project `foo` - + delete.term `delete.term foo` removes the term name `foo` from the namespace. `delete.term foo bar` removes the term name `foo` and `bar` from the namespace. - + delete.term.verbose `delete.term.verbose foo` removes the term name `foo` from the namespace. `delete.term.verbose foo bar` removes the term name `foo` and `bar` from the namespace. - + delete.type `delete.type foo` removes the type name `foo` from the namespace. `delete.type foo bar` removes the type name `foo` and `bar` from the namespace. - + delete.type.verbose `delete.type.verbose foo` removes the type name `foo` from the namespace. `delete.type.verbose foo bar` removes the type name `foo` and `bar` from the namespace. - + delete.verbose `delete.verbose foo` removes the term or type name `foo` from the namespace. `delete.verbose foo bar` removes the term or type name `foo` and `bar` from the namespace. - + dependencies List the dependencies of the specified definition. - + dependents List the named dependents of the specified definition. - + deprecated.cd (or deprecated.namespace) Moves your perspective to a different namespace. Deprecated for now because too many important things depend on your perspective selection. - + `deprecated.cd foo.bar` descends into foo.bar from the current namespace. `deprecated.cd .cat.dog` sets the current namespace to the @@ -219,10 +219,10 @@ scratch/main> help namespace to move to, which requires that `fzf` can be found within your PATH. - + deprecated.root-reflog `deprecated.root-reflog` lists the changes that have affected the root namespace. This has been deprecated in favor of `reflog` which shows the reflog for the current project. - + diff.namespace `diff.namespace before after` shows how the namespace `after` differs from the namespace @@ -230,19 +230,19 @@ scratch/main> help `diff.namespace before` shows how the current namespace differs from the namespace `before` - + display `display foo` prints a rendered version of the term `foo`. `display` without arguments invokes a search to select a definition to display, which requires that `fzf` can be found within your PATH. - + display.to `display.to foo` prints a rendered version of the term `foo` to the given file. - + docs `docs foo` shows documentation for the definition `foo`. `docs` without arguments invokes a search to select which definition to view documentation for, which requires that `fzf` can be found within your PATH. - + docs.to-html `docs.to-html .path.to.ns doc-dir` Render all docs @@ -273,15 +273,15 @@ scratch/main> help to html in `/tmp/doc-dir`. - + edit `edit foo` prepends the definition of `foo` to the top of the most recently saved file. `edit` without arguments invokes a search to select a definition for editing, which requires that `fzf` can be found within your PATH. - + edit.namespace `edit.namespace` will load all terms and types contained within the current namespace into your scratch file. This includes definitions in namespaces, but excludes libraries. `edit.namespace ns1 ns2 ...` loads the terms and types contained within the provided namespaces. - + find `find` lists all definitions in the current namespace. @@ -319,7 +319,7 @@ scratch/main> help name similar to 'foo'. Note that this is a very slow operation. - + find-in `find` lists all definitions in the current namespace. @@ -357,7 +357,7 @@ scratch/main> help name similar to 'foo'. Note that this is a very slow operation. - + find-in.all `find` lists all definitions in the current namespace. @@ -395,7 +395,7 @@ scratch/main> help name similar to 'foo'. Note that this is a very slow operation. - + find.all `find` lists all definitions in the current namespace. @@ -433,13 +433,13 @@ scratch/main> help name similar to 'foo'. Note that this is a very slow operation. - + find.all.verbose `find.all.verbose` searches for definitions like `find.all`, but includes hashes and aliases in the results. - + find.verbose `find.verbose` searches for definitions like `find`, but includes hashes and aliases in the results. - + fork (or copy.namespace) `fork src dest` creates the @@ -469,13 +469,13 @@ scratch/main> help `srcbranch` of `srcproject`. - + help (or ?) `help` shows general help and `help ` shows help for one command. - + help-topics (or help-topic) `help-topics` lists all topics and `help-topics ` shows an explanation of that topic. - + history `history` Shows the history of the current path. @@ -483,20 +483,20 @@ scratch/main> help `history #9dndk3kbsk13nbpeu` Shows the history of the namespace with the given hash. The full hash must be provided. - + io.test (or test.io) `io.test mytest` Runs `!mytest`, where `mytest` is a delayed test that can use the `IO` and `Exception` abilities. - + io.test.all (or test.io.all) `io.test.all` runs unit tests for the current branch that use IO - + lib.install (or install.lib) The `lib.install` command installs a dependency into the `lib` namespace. - + `lib.install @unison/base/releases/latest` installs the latest release of `@unison/base` @@ -506,71 +506,71 @@ scratch/main> help `lib.install @unison/base/topic` installs the `topic` branch of `@unison/base` - + list (or ls, dir) `list` lists definitions and namespaces at the current level of the current namespace. `list foo` lists the 'foo' namespace. `list .foo` lists the '.foo' namespace. - + load `load` parses, typechecks, and evaluates the most recent scratch file. `load ` parses, typechecks, and evaluates the given scratch file. - + merge `merge /branch` merges `branch` into the current branch - + merge.commit (or commit.merge) `merge.commit` merges a temporary branch created by the `merge` command back into its parent branch, and removes the temporary branch. - + For example, if you've done `merge topic` from main, then `merge.commit` is equivalent to doing - + * switch /main * merge /merge-topic-into-main * delete.branch /merge-topic-into-main - + move (or rename) `move foo bar` renames the term, type, and namespace foo to bar. - + move.namespace (or rename.namespace) `move.namespace foo bar` renames the path `foo` to `bar`. - + move.term (or rename.term) `move.term foo bar` renames `foo` to `bar`. - + move.type (or rename.type) `move.type foo bar` renames `foo` to `bar`. - + names `names foo` List all known names for `foo` in the current branch. - + namespace.dependencies List the external dependencies of the specified namespace. - + project.create (or create.project) `project.create` creates a project with a random name `project.create foo` creates a project named `foo` - + project.reflog (or reflog.project) `project.reflog` lists all the changes that have affected any branches in the current project. `project.reflog myproject` lists all the changes that have affected any branches in myproject. - + project.rename (or rename.project) `project.rename foo` renames the current project to `foo` - + projects (or list.project, ls.project, project.list) List projects. - + pull The `pull` command merges a remote namespace into a local branch - + `pull @unison/base/main` merges the branch `main` of the Unison Share hosted project @@ -583,18 +583,18 @@ scratch/main> help the branch `topic` of the local `my-base` project - + where `remote` is a project or project branch, such as: Project (defaults to the /main branch) `@unison/base` Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` Project Release `@unison/base/releases/1.0.0` - + pull.without-history The `pull.without-history` command merges a remote namespace into a local branch without including the remote's history. This usually results in smaller codebase sizes. - + `pull.without-history @unison/base/main` merges the branch @@ -627,17 +627,17 @@ scratch/main> help local `my-base` project - + where `remote` is a project or project branch, such as: Project (defaults to the /main branch) `@unison/base` Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` Project Release `@unison/base/releases/1.0.0` - + push The `push` command merges a local project or namespace into a remote project or namespace. - + `push ` publishes the contents of a local namespace or branch into a remote namespace or branch. @@ -655,16 +655,16 @@ scratch/main> help you cloned from or pushed to initially. Otherwise, it is pushed to @/ - + where `remote` is a project or project branch, such as: Project (defaults to the /main branch) `@unison/base` Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` - + push.create The `push.create` command pushes a local namespace to an empty remote namespace. - + `push.create remote local` pushes the contents of the local namespace `local` into the empty remote namespace `remote`. @@ -680,25 +680,25 @@ scratch/main> help namespace, then publishes the current namespace to that location. - + where `remote` is a project or project branch, such as: Project (defaults to the /main branch) `@unison/base` Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` - + quit (or exit, :q) Exits the Unison command line interface. - + reflog (or reflog.branch, branch.reflog) `reflog` lists all the changes that have affected the current branch. `reflog /mybranch` lists all the changes that have affected /mybranch. - + reflog.global `reflog.global` lists all recent changes across all projects and branches. - + release.draft (or draft.release) Draft a release. - + reset `reset #pvfd222s8n` reset the current namespace to the hash `#pvfd222s8n` @@ -707,46 +707,46 @@ scratch/main> help `reset #pvfd222s8n /topic` reset the branch `topic` of the current project to the causal `#pvfd222s8n`. - + If you make a mistake using reset, consult the `reflog` command and use another `reset` command to return to a previous state. - + rewrite (or sfind.replace) `rewrite rule1` rewrites definitions in the latest scratch file. - + The argument `rule1` must refer to a `@rewrite` block or a function that immediately returns a `@rewrite` block. It can be in the codebase or scratch file. An example: - + rule1 x = @rewrite term x + 1 ==> Nat.increment x - + Here, `x` will stand in for any expression wherever this rewrite is applied, so this rule will match `(42+10+11) + 1` and replace it with `Nat.increment (42+10+11)`. - + See https://unison-lang.org/learn/structured-find to learn more. - + Also see the related command `rewrite.find` - + rewrite.find (or sfind) `rewrite.find rule1` finds definitions that match any of the left side(s) of `rule` in the current namespace. - + The argument `rule1` must refer to a `@rewrite` block or a function that immediately returns a `@rewrite` block. It can be in the codebase or scratch file. An example: - + -- right of ==> is ignored by this command rule1 x = @rewrite term x + 1 ==> () - + Here, `x` will stand in for any expression, so this rule will match `(42+10+11) + 1`. - + See https://unison-lang.org/learn/structured-find to learn more. - + Also see the related command `rewrite` - + run `run mymain args...` Runs `!mymain`, where `mymain` is searched for in the most recent @@ -755,11 +755,11 @@ scratch/main> help program arguments as though they were provided at the command line when running mymain as an executable. - + run.native `run.native main args` Executes !main using native compilation via scheme. - + switch `switch` opens an interactive selector to pick a project and branch @@ -769,44 +769,44 @@ scratch/main> help the project `foo` `switch /bar` switches to the branch `bar` in the current project - + test `test` runs unit tests for the current branch `test foo` runs unit tests for the current branch defined in namespace `foo` - + test.all `test.all` runs unit tests for the current branch (including the `lib` namespace). - + text.find (or grep) `text.find token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. - + Numeric literals must be quoted (ex: "42") but single words need not be quoted. - + Use `text.find.all` to include search of `lib`. - + text.find.all (or grep.all) `text.find.all token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. - + Numeric literals must be quoted (ex: "42") but single words need not be quoted. - + Use `text.find` to exclude `lib` from search. - + todo `todo` lists the current namespace's outstanding issues, including conflicted names, dependencies with missing names, and merge precondition violations. - + ui `ui` opens the Local UI in the default browser. - + undo `undo` reverts the most recent change to the codebase. - + update Adds everything in the most recently typechecked file to the namespace, replacing existing definitions having the same @@ -814,7 +814,7 @@ scratch/main> help accordingly. If the process can't be completed automatically, the dependents will be added back to the scratch file for your review. - + update.old `update.old` works like `add`, except that if a definition in the file has the same name as an existing definition, the name @@ -832,7 +832,7 @@ scratch/main> help dependents from the .u file, noting any replacements into the specified patch. - + update.old.nopatch `update.old.nopatch` works like `update.old`, except it doesn't add a patch entry for any updates. Use this when you @@ -842,29 +842,29 @@ scratch/main> help all definitions in the .u file. `update.old.nopatch foo bar` updates `foo`, `bar`, and their dependents from the .u file. - + update.old.preview `update.old.preview` previews updates to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. - + upgrade `upgrade old new` upgrades library dependency `lib.old` to `lib.new`, and, if successful, deletes `lib.old`. - + upgrade.commit (or commit.upgrade) `upgrade.commit` merges a temporary branch created by the `upgrade` command back into its parent branch, and removes the temporary branch. - + For example, if you've done `upgrade foo bar` from main, then `upgrade.commit` is equivalent to doing - + * switch /main * merge /upgrade-foo-to-bar * delete.branch /upgrade-foo-to-bar - + version Print the version of unison you're running - + view `view foo` shows definitions named `foo` within your current namespace. @@ -875,33 +875,31 @@ scratch/main> help Supports glob syntax, where ? acts a wildcard, so `view List.?` will show `List.map`, `List.filter`, etc, but not `List.map.doc` (since ? only matches 1 name segment). - + view.global `view.global foo` prints definitions of `foo` within your codebase. `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. - scratch/main> help-topics 🌻 - + Here's a list of topics I can tell you more about: - + filestatus messages.disallowedAbsolute namespaces projects remotes testcache - - Example: use `help-topics filestatus` to learn more about that topic. + Example: use `help-topics filestatus` to learn more about that topic. scratch/main> help-topic filestatus 📓 - + Here's a list of possible status messages you might see for definitions in a .u file. - + needs update A definition with the same name as an existing definition. Doing `update` instead of `add` will turn this failure @@ -925,51 +923,48 @@ scratch/main> help-topic filestatus extra dependency This definition was added because it was a dependency of a definition explicitly selected. - scratch/main> help-topic messages.disallowedAbsolute 🤖 - + Although I can understand absolute (ex: .foo.bar) or relative (ex: util.math.sqrt) references to existing definitions (help namespaces to learn more), I can't yet handle giving new definitions with absolute names in a .u file. - + As a workaround, you can give definitions with a relative name temporarily (like `exports.blah.foo`) and then use `move.*`. - scratch/main> help-topic namespaces 🧐 - + There are two kinds of namespaces, absolute, such as (.foo.bar or .base.math.+) and relative, such as (math.sqrt or util.List.++). - + Relative names are converted to absolute names by prepending the current namespace. For example, if your Unison prompt reads: - + .foo.bar> - + and your .u file looks like: - + x = 41 - + then doing an add will create the definition with the absolute name .foo.bar.x = 41 - + and you can refer to x by its absolute name .foo.bar.x elsewhere in your code. For instance: - - answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 + answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 scratch/main> help-topic projects A project is a versioned collection of code that can be edited, published, and depended on other projects. Unison projects are analogous to Git repositories. - + project.create create a new project projects list all your projects branch create a new workstream @@ -979,38 +974,35 @@ scratch/main> help-topic projects push upload your changes to Unison Share pull download code(/changes/updates) from Unison Share clone download a Unison Share project or branch for contribution - + Tip: Use `help project.create` to learn more. - + For full documentation, see https://unison-lang.org/learn/projects - scratch/main> help-topic remotes 🤖 - + Local projects may be associated with at most one remote project on Unison Share. When this relationship is established, it becomes the default argument for a number of share commands. For example, running `push` or `pull` in a project with no arguments will push to or pull from the associated remote, if it exists. - + This association is created automatically on when a project is created by `clone`. If the project was created locally then the relationship will be established on the first `push`. - scratch/main> help-topic testcache 🎈 - + Unison caches the results of test> watch expressions. Since these expressions are pure and always yield the same result when evaluated, there's no need to run them more than once! - + A test is rerun only if it has changed, or if one of the definitions it depends on has changed. - ``` We should add a command to show help for hidden commands also. diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index 0a7b54486d..cedbd148dc 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -2,11 +2,8 @@ This transcript does some testing of higher-rank types. Regression tests related ``` ucm :hide 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: @@ -19,23 +16,23 @@ f id = (id 1, id "hi") ``` ``` ucm :added-by-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`: f : (∀ a. a ->{g} a) ->{g} (Nat, Text) - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 4 | > f (x -> x) ⧩ (1, "hi") - ``` Another example, involving abilities. Here the ability-polymorphic function is instantiated with two different ability lists, `{}` and `{IO}`: @@ -48,16 +45,16 @@ f id _ = ``` ``` ucm :added-by-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`: f : (∀ a g. '{g} a ->{h} '{g} a) -> '{h} () - ``` Here's an example, showing that polymorphic functions can be fields of a constructor, and the functions remain polymorphic even when the field is bound to a name during pattern matching: @@ -76,19 +73,19 @@ Functor.blah = cases Functor f -> ``` ``` ucm :added-by-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 Functor f Functor.blah : Functor f -> () Functor.map : Functor f -> (∀ a b. (a -> b) -> f a -> f b) - ``` This example is similar, but involves abilities: @@ -120,12 +117,13 @@ Loc.transform2 nt = cases Loc f -> ``` ``` ucm :added-by-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 Loc @@ -137,7 +135,6 @@ Loc.transform2 nt = cases Loc f -> Loc.transform2 : (∀ t a. '{Remote t} a -> '{Remote t} a) -> Loc -> Loc - ``` ## Types with polymorphic fields @@ -152,11 +149,9 @@ We should be able to add and view records with higher-rank fields. scratch/main> add ⍟ I've added these definitions: - - structural type HigherRanked + structural type HigherRanked scratch/main> view HigherRanked structural type HigherRanked = HigherRanked (∀ a. a -> a) - ``` diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md index 4be7bfc8b4..73f99779a3 100644 --- a/unison-src/transcripts/input-parse-errors.output.md +++ b/unison-src/transcripts/input-parse-errors.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison :hide @@ -11,7 +10,6 @@ x = 55 ``` ucm :hide scratch/main> add - ``` `handleNameArg` parse error in `add` @@ -20,9 +18,9 @@ scratch/main> add scratch/main> add . ⚠️ - + Sorry, I wasn’t sure how to process your request: - + 1:2: | 1 | . @@ -30,26 +28,21 @@ scratch/main> add . unexpected end of input expecting '`' or operator (valid characters: !$%&*+-/:<=>\^|~) - + You can run `help add` for more information on using `add`. scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/main> add 1 - - scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/main> add 2 ⊡ Ignored previously added definitions: x - ``` todo: @@ -75,11 +68,11 @@ aliasMany: skipped -- similar to `add` scratch/main> update arg ⚠️ - + Sorry, I wasn’t sure how to process your request: - + I expected no arguments, but received one. - + You can run `help update` for more information on using `update`. ``` diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index f079c525e4..a2012915ba 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` The `io.test` command should run all of the tests within the current namespace, excluding libs. @@ -22,7 +21,6 @@ lib.ioAndExceptionTestInLib = do ``` ucm :hide scratch/main> add - ``` Run a IO tests one by one @@ -31,23 +29,21 @@ Run a IO tests one by one scratch/main> io.test ioAndExceptionTest New test results: - + 1. ioAndExceptionTest ◉ Success - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test ioTest New test results: - + 1. ioTest ◉ Success - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` `io.test` doesn't cache results @@ -56,13 +52,12 @@ scratch/main> io.test ioTest scratch/main> io.test ioAndExceptionTest New test results: - + 1. ioAndExceptionTest ◉ Success - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` `io.test.all` will run all matching tests except those in the `lib` namespace. @@ -70,21 +65,16 @@ scratch/main> io.test ioAndExceptionTest ``` ucm scratch/main> io.test.all - - - - New test results: - + 1. ioAndExceptionTest ◉ Success 2. ioTest ◉ Success - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index ef5a8e5c85..4d0be24599 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -2,13 +2,9 @@ ``` ucm :hide 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. @@ -22,7 +18,6 @@ create a scratch directory which will automatically get cleaned up. ``` ucm :hide scratch/main> add - ``` ## Basic File Functions @@ -64,29 +59,28 @@ testCreateRename _ = ``` ``` ucm :added-by-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`: testCreateRename : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - testCreateRename : '{IO} [Result] + testCreateRename : '{IO} [Result] scratch/main> io.test testCreateRename New test results: - + 1. testCreateRename ◉ create a foo directory ◉ directory should exist ◉ foo should no longer exist @@ -94,11 +88,10 @@ scratch/main> io.test testCreateRename ◉ bar should now exist ◉ removeDirectory works recursively ◉ removeDirectory works recursively - + ✅ 7 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Opening / Closing files @@ -149,40 +142,38 @@ testOpenClose _ = ``` ``` ucm :added-by-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`: testOpenClose : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - testOpenClose : '{IO} [Result] + testOpenClose : '{IO} [Result] scratch/main> io.test testOpenClose New test results: - + 1. testOpenClose ◉ file should be open ◉ file handle buffering should match what we just set. ◉ file should be closed ◉ bytes have been written ◉ bytes have been written ◉ file should be closed - + ✅ 6 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Reading files with getSomeBytes @@ -242,29 +233,28 @@ testGetSomeBytes _ = ``` ``` ucm :added-by-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`: testGetSomeBytes : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - testGetSomeBytes : '{IO} [Result] + testGetSomeBytes : '{IO} [Result] scratch/main> io.test testGetSomeBytes New test results: - + 1. testGetSomeBytes ◉ chunk size splits data into 2 uneven sides ◉ file should be closed ◉ first chunk matches first part of testData @@ -273,11 +263,10 @@ scratch/main> io.test testGetSomeBytes ◉ reading at end of file results in Bytes.empty ◉ requesting many bytes results in what's available ◉ file should be closed - + ✅ 8 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Seeking in open files @@ -352,31 +341,30 @@ testAppend _ = ``` ``` ucm :added-by-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`: testAppend : '{IO} [Result] testSeek : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + testAppend : '{IO} [Result] testSeek : '{IO} [Result] - scratch/main> io.test testSeek New test results: - + 1. testSeek ◉ seeked ◉ readable file should be seekable ◉ shouldn't be the EOF @@ -384,21 +372,19 @@ scratch/main> io.test testSeek ◉ we should be at position 1 ◉ should be able to read our temporary file after seeking ◉ getLine should get a line - + ✅ 7 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> io.test testAppend New test results: - + 1. testAppend ◉ should be able to read our temporary file - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### SystemTime @@ -414,35 +400,33 @@ testSystemTime _ = ``` ``` ucm :added-by-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`: testSystemTime : '{IO} [Result] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - testSystemTime : '{IO} [Result] + testSystemTime : '{IO} [Result] scratch/main> io.test testSystemTime New test results: - + 1. testSystemTime ◉ systemTime should be sane - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Get temp directory @@ -461,20 +445,18 @@ testGetTempDirectory _ = scratch/main> add ⍟ I've added these definitions: - - testGetTempDirectory : '{IO} [Result] + testGetTempDirectory : '{IO} [Result] scratch/main> io.test testGetTempDirectory New test results: - + 1. testGetTempDirectory ◉ Temp directory is directory ◉ Temp directory should exist - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Get current directory @@ -493,20 +475,18 @@ testGetCurrentDirectory _ = scratch/main> add ⍟ I've added these definitions: - - testGetCurrentDirectory : '{IO} [Result] + testGetCurrentDirectory : '{IO} [Result] scratch/main> io.test testGetCurrentDirectory New test results: - + 1. testGetCurrentDirectory ◉ Current directory is directory ◉ Current directory should exist - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Get directory contents @@ -527,20 +507,18 @@ testDirContents _ = scratch/main> add ⍟ I've added these definitions: - - testDirContents : '{IO} [Result] + testDirContents : '{IO} [Result] scratch/main> io.test testDirContents New test results: - + 1. testDirContents ◉ directory size should be ◉ directory contents should have current directory and parent - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Read environment variables @@ -561,20 +539,18 @@ testGetEnv _ = scratch/main> add ⍟ I've added these definitions: - - testGetEnv : '{IO} [Result] + testGetEnv : '{IO} [Result] scratch/main> io.test testGetEnv New test results: - + 1. testGetEnv ◉ PATH environent variable should be set ◉ DOESNTEXIST didn't exist - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Read command line args @@ -617,24 +593,20 @@ Test that they can be run with the right number of args. scratch/main> add ⍟ I've added these definitions: - + testGetArgs.fail : Text -> Failure testGetArgs.runMeWithNoArgs : '{IO, Exception} () testGetArgs.runMeWithOneArg : '{IO, Exception} () testGetArgs.runMeWithTwoArgs : '{IO, Exception} () - 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. @@ -643,57 +615,53 @@ Calling our examples with the wrong number of args will error. scratch/main> run runMeWithNoArgs foo 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink IOFailure) "called with args" (Any ()) - + Stack trace: ##raise - ``` ``` ucm :error scratch/main> run runMeWithOneArg 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink IOFailure) "called with no args" (Any ()) - + Stack trace: ##raise - ``` ``` ucm :error scratch/main> run runMeWithOneArg foo bar 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink IOFailure) "called with too many args" (Any ()) - + Stack trace: ##raise - ``` ``` ucm :error scratch/main> run runMeWithTwoArgs 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink IOFailure) "called with no args" (Any ()) - + Stack trace: ##raise - ``` ### Get the time zone @@ -709,13 +677,11 @@ testTimeZone = do scratch/main> add ⍟ I've added these definitions: - - testTimeZone : '{IO} () + testTimeZone : '{IO} () scratch/main> run testTimeZone () - ``` ### Get some random bytes @@ -733,18 +699,16 @@ testRandom = do scratch/main> add ⍟ I've added these definitions: - - testRandom : '{IO} [Result] + testRandom : '{IO} [Result] scratch/main> io.test testGetEnv New test results: - + 1. testGetEnv ◉ PATH environent variable should be set ◉ DOESNTEXIST didn't exist - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index df826609c7..eb80e6a616 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ## A type param cannot have conflicting kind constraints within a single decl @@ -12,13 +11,13 @@ unique type T a = T a (a Nat) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from 1 | unique type T a = T a (a Nat) a doesn't expect an argument; however, it is applied to Nat. - ``` conflicting constraints on the kind of `a` in a sum @@ -30,13 +29,13 @@ unique type T a ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from 3 | | StarStar (a Nat) a doesn't expect an argument; however, it is applied to Nat. - ``` ## Kinds are inferred by decl component @@ -50,17 +49,17 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm :added-by-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 Ping a type Pong - ``` Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts @@ -72,6 +71,7 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -79,7 +79,6 @@ unique type Pong = Pong (Ping Optional) The arrow type (->) expects arguments of kind Type; however, it is applied to a which has kind: Type -> Type. - ``` Successful example between mutually recursive type and ability @@ -91,17 +90,17 @@ unique ability Pong a where ``` ``` ucm :added-by-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 Ping a ability Pong a - ``` Catch conflict between mutually recursive type and ability @@ -113,6 +112,7 @@ unique ability Pong a where ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -120,7 +120,6 @@ unique ability Pong a where Ping expects an argument of kind: Type; however, it is applied to Optional which has kind: Type -> Type. - ``` Consistent instantiation of `T`'s `a` parameter in `S` @@ -132,17 +131,17 @@ unique type S = S (T Nat) ``` ``` ucm :added-by-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 S type T a - ``` Delay kind defaulting until all components are processed. Here `S` @@ -156,17 +155,17 @@ unique type S = S (T Optional) ``` ``` ucm :added-by-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 S type T a - ``` Catch invalid instantiation of `T`'s `a` parameter in `S` @@ -178,6 +177,7 @@ unique type S = S (T Optional) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -185,7 +185,6 @@ unique type S = S (T Optional) T expects an argument of kind: Type; however, it is applied to Optional which has kind: Type -> Type. - ``` ## Checking annotations @@ -198,6 +197,7 @@ test = 0 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -205,7 +205,6 @@ test = 0 Nat doesn't expect an argument; however, it is applied to Nat. - ``` Catch kind error in annotation example 2 @@ -216,6 +215,7 @@ test _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -223,7 +223,6 @@ test _ = () The arrow type (->) expects arguments of kind Type; however, it is applied to Optional which has kind: Type -> Type. - ``` Catch kind error in annotation example 3 @@ -236,6 +235,7 @@ test _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -243,7 +243,6 @@ test _ = () T expects an argument of kind: Type -> Type; however, it is applied to Nat which has kind: Type. - ``` Catch kind error in scoped type variable annotation @@ -260,6 +259,7 @@ test _ = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -267,7 +267,6 @@ test _ = Star expects an argument of kind: Type; however, it is applied to a which has kind: Type -> Type. - ``` ## Effect/type mismatch @@ -283,6 +282,7 @@ test _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -290,7 +290,6 @@ test _ = () The arrow type (->) expects arguments of kind Type; however, it is applied to Foo which has kind: Ability. - ``` Types appearing where effects are expected @@ -301,6 +300,7 @@ test _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Kind mismatch arising from @@ -309,7 +309,6 @@ test _ = () An ability list must consist solely of abilities; however, this list contains Nat which has kind Type. Abilities are of kind Ability. - ``` ## Cyclic kinds @@ -319,6 +318,7 @@ unique type T a = T (a a) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Cannot construct infinite kind @@ -327,7 +327,6 @@ unique type T a = T (a a) The above application constrains the kind of a to be infinite, generated by the constraint k = k -> Type where k is the kind of a. - ``` ``` unison :error @@ -335,6 +334,7 @@ unique type T a b = T (a b) (b a) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Cannot construct infinite kind @@ -343,7 +343,6 @@ unique type T a b = T (a b) (b a) The above application constrains the kind of b to be infinite, generated by the constraint k = (k -> Type) -> Type where k is the kind of b. - ``` ``` unison :error @@ -352,6 +351,7 @@ unique type Pong a = Pong (a Ping) ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Cannot construct infinite kind @@ -361,5 +361,4 @@ unique type Pong a = Pong (a Ping) infinite, generated by the constraint k = (((k -> Type) -> Type) -> Type) -> Type where k is the kind of a. - ``` diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index 36446ea285..28f46ed248 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -2,7 +2,6 @@ ``` ucm :hide 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: @@ -14,21 +13,20 @@ isEmpty x = match x with ``` ``` ucm :added-by-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`: isEmpty : [t] -> Boolean - ``` ``` ucm :hide scratch/main> add - ``` Here's the same function written using `cases` syntax: @@ -40,17 +38,17 @@ isEmpty2 = cases ``` ``` ucm :added-by-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`: isEmpty2 : [t] -> Boolean (also named isEmpty) - ``` Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` @@ -62,7 +60,6 @@ scratch/main> view isEmpty isEmpty = cases [] -> true _ -> false - ``` it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -85,9 +82,8 @@ merge xs ys = match (xs, ys) with scratch/main> add ⍟ I've added these definitions: - - merge : [a] -> [a] -> [a] + merge : [a] -> [a] -> [a] ``` And here's a version using `cases`. The patterns are separated by commas: @@ -103,17 +99,17 @@ merge2 = cases ``` ``` ucm :added-by-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`: merge2 : [a] -> [a] -> [a] (also named merge) - ``` Notice that Unison detects this as an alias of `merge`, and if we view `merge` @@ -128,7 +124,6 @@ scratch/main> view merge h +: t, h2 +: t2 -> if h <= h2 then h +: merge t (h2 +: t2) else h2 +: merge (h +: t) t2 - ``` it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -153,33 +148,33 @@ blorf = cases ``` ``` ucm :added-by-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 B blah : B -> B -> Text blorf : B -> B -> B - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 12 | > blah T F ⧩ "hi" - + 13 | > blah F F ⧩ "bye" - + 14 | > blorf T F ⧩ F - ``` ## Patterns with multiple guards @@ -194,25 +189,24 @@ merge3 = cases ``` ``` ucm :added-by-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`: merge3 : [a] -> [a] -> [a] - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - merge3 : [a] -> [a] -> [a] + merge3 : [a] -> [a] -> [a] scratch/main> view merge3 merge3 : [a] -> [a] -> [a] @@ -222,7 +216,6 @@ scratch/main> view merge3 h +: t, h2 +: t2 | h <= h2 -> h +: merge3 t (h2 +: t2) | otherwise -> h2 +: merge3 (h +: t) t2 - ``` This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. @@ -237,15 +230,15 @@ merge4 a b = match (a,b) with ``` ``` ucm :added-by-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`: merge4 : [a] -> [a] -> [a] (also named merge3) - ``` diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index e0b06117df..50f3242b57 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.mergeio - ``` ``` unison :hide @@ -32,15 +31,15 @@ test> z = let ``` ucm scratch/main> debug.lsp.fold-ranges - + 《{{ Type doc }}》 《structural type Optional a = None | Some a》 - + 《{{ Multi line - + Term doc }}》 《List.map : @@ -50,10 +49,9 @@ scratch/main> debug.lsp.fold-ranges List.map f = cases (x +: xs) -> f x +: List.map f xs [] -> []》 - + 《test> z = let x = "hello" y = "world" [Ok (x ++ y)]》 - ``` diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md index 2d2d58eb2f..c3af7b2e61 100644 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ b/unison-src/transcripts/lsp-name-completion.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` ``` unison :hide @@ -18,7 +17,6 @@ other = "other" ``` ucm :hide scratch/main> add - ``` Completion should find all the `foldMap` definitions in the codebase, @@ -36,7 +34,6 @@ scratch/main> debug.lsp-name-completion foldMap foldMap nested.deeply.foldMap #snrjegr5dk foldMap lib.base.foldMap #jf4buul17k foldMap lib.dep.lib.transitive.foldMap #0o01gvr3fi - ``` Should still find the term which has a matching hash to a better name if the better name doesn't match. @@ -46,5 +43,4 @@ scratch/main> debug.lsp-name-completion transitive_same_hash.foldMap Matching Path Name Hash transitive_same_hash.foldMap lib.dep.lib.transitive_same_hash.foldMap #o38ps8p4q6 - ``` diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 037bef8309..948f0ec17a 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -8,21 +8,19 @@ scratch/main> help merge merge `merge /branch` merges `branch` into the current branch - scratch/main> help merge.commit merge.commit (or commit.merge) `merge.commit` merges a temporary branch created by the `merge` command back into its parent branch, and removes the temporary branch. - + For example, if you've done `merge topic` from main, then `merge.commit` is equivalent to doing - + * switch /main * merge /merge-topic-into-main * delete.branch /merge-topic-into-main - ``` Let's see a simple unconflicted merge in action: Alice (us) and Bob (them) add different terms. The merged result @@ -32,12 +30,10 @@ contains both additions. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's adds: @@ -49,9 +45,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's adds: @@ -63,7 +57,6 @@ bar = "bobs bar" ``` ucm :hide scratch/bob> add - ``` Merge result: @@ -72,20 +65,17 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar bar : Text bar = "bobs bar" - + foo : Text foo = "alices foo" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Basic merge: two identical adds @@ -94,9 +84,7 @@ If Alice and Bob also happen to add the same definition, that's not a conflict. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - scratch/main> branch alice - ``` Alice's adds: @@ -108,9 +96,7 @@ foo = "alice and bobs foo" ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's adds: @@ -125,7 +111,6 @@ bar = "bobs bar" ``` ucm :hide scratch/bob> add - ``` Merge result: @@ -134,20 +119,17 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar bar : Text bar = "bobs bar" - + foo : Text foo = "alice and bobs foo" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Simple update propagation @@ -156,7 +138,6 @@ Updates that occur in one branch are propagated to the other. In this example, A ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -168,9 +149,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's updates: @@ -182,9 +161,7 @@ foo = "new foo" ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's adds: @@ -198,12 +175,10 @@ bar = foo ++ " - " ++ foo scratch/bob> display bar "old foo - old foo" - ``` ``` ucm :hide scratch/bob> add - ``` Merge result: @@ -212,26 +187,22 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar bar : Text bar = use Text ++ foo ++ " - " ++ foo - + foo : Text foo = "new foo" - scratch/alice> display bar "old foo - old foo" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Update propagation with common dependent @@ -242,7 +213,6 @@ Let's see an example. We have `foo`, which depends on `bar` and `baz`. Alice upd ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -260,9 +230,7 @@ baz = "old baz" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's updates: @@ -274,19 +242,16 @@ bar = "alices bar" ``` ucm :hide scratch/alice> update - ``` ``` ucm scratch/alice> display foo "foo - alices bar - old baz" - ``` ``` ucm :hide scratch/main> branch bob - ``` Bob's updates: @@ -298,14 +263,12 @@ baz = "bobs baz" ``` ucm :hide scratch/bob> update - ``` ``` ucm scratch/bob> display foo "foo - old bar - bobs baz" - ``` Merge result: @@ -314,29 +277,25 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar baz bar : Text bar = "alices bar" - + baz : Text baz = "bobs baz" - + foo : Text foo = use Text ++ "foo" ++ " - " ++ bar ++ " - " ++ baz - scratch/alice> display foo "foo - alices bar - bobs baz" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Propagating an update to an update @@ -345,7 +304,6 @@ Of course, it's also possible for Alice's update to propagate to one of Bob's up ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -363,19 +321,16 @@ baz = "old baz" ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> display foo "old foo - old bar - old baz" - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's updates: @@ -387,19 +342,16 @@ baz = "alices baz" ``` ucm :hide scratch/alice> update - ``` ``` ucm scratch/alice> display foo "old foo - old bar - alices baz" - ``` ``` ucm :hide scratch/main> branch bob - ``` Bob's updates: @@ -411,14 +363,12 @@ bar = "bobs bar" ++ " - " ++ baz ``` ucm :hide scratch/bob> update - ``` ``` ucm scratch/bob> display foo "old foo - bobs bar - old baz" - ``` Merge result: @@ -427,31 +377,27 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar baz bar : Text bar = use Text ++ "bobs bar" ++ " - " ++ baz - + baz : Text baz = "alices baz" - + foo : Text foo = use Text ++ "old foo" ++ " - " ++ bar - scratch/alice> display foo "old foo - bobs bar - alices baz" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Update + delete isn't (currently) a conflict @@ -460,7 +406,6 @@ We don't currently consider "update + delete" a conflict like Git does. In this ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -472,9 +417,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's updates: @@ -486,9 +429,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's changes: @@ -497,7 +438,6 @@ Bob's changes: scratch/bob> delete.term foo Done. - ``` Merge result: @@ -506,17 +446,14 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo foo : Text foo = "alices foo" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` In a future version, we'd like to give the user a warning at least. @@ -527,14 +464,12 @@ Library dependencies don't cause merge conflicts, the library dependencies are j ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Alice's adds: ``` ucm :hide scratch/main> branch alice - ``` ``` unison :hide @@ -550,9 +485,7 @@ lib.bothDifferent.baz = 19 ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's adds: @@ -570,7 +503,6 @@ lib.bothDifferent.baz = 21 ``` ucm :hide scratch/bob> add - ``` Merge result: @@ -579,29 +511,26 @@ Merge result: scratch/alice> merge bob I merged scratch/bob into scratch/alice. - scratch/alice> view foo bar baz lib.alice.foo : Nat lib.alice.foo = 17 - + lib.bob.foo : Nat lib.bob.foo = 20 - + lib.bothDifferent__0.baz : Nat lib.bothDifferent__0.baz = 19 - + lib.bothDifferent__1.baz : Nat lib.bothDifferent__1.baz = 21 - + lib.bothSame.bar : Nat lib.bothSame.bar = 18 - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## No-op merge (Bob = Alice) @@ -610,35 +539,30 @@ If Bob is equals Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - scratch/alice> merge /bob 😶 - - scratch/alice was already up-to-date with scratch/bob. + scratch/alice was already up-to-date with scratch/bob. ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## No-op merge (Bob \< Alice) @@ -647,24 +571,21 @@ If Bob is behind Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - ``` Alice's addition: @@ -678,20 +599,17 @@ foo = "foo" scratch/alice> add ⍟ I've added these definitions: - - foo : Text + foo : Text scratch/alice> merge /bob 😶 - - scratch/alice was already up-to-date with scratch/bob. + scratch/alice was already up-to-date with scratch/bob. ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Fast-forward merge (Bob \> Alice) @@ -700,24 +618,21 @@ If Bob is ahead of Alice, then merging Bob into Alice looks like this. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - ``` Bob's addition: @@ -731,18 +646,15 @@ foo = "foo" scratch/bob> add ⍟ I've added these definitions: - - foo : Text + foo : Text scratch/alice> merge /bob I fast-forward merged scratch/bob into scratch/alice. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## No-op merge: merge empty namespace into empty namespace @@ -751,21 +663,18 @@ scratch/main> project.delete scratch scratch/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`. - scratch/main> merge /topic 😶 - - scratch/main was already up-to-date with scratch/topic. + scratch/main was already up-to-date with scratch/topic. ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: someone deleted something @@ -778,7 +687,6 @@ In this example, Alice deletes `foo`, while Bob adds a new dependent of `foo`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -790,9 +698,7 @@ foo = "foo" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's delete: @@ -801,12 +707,10 @@ Alice's delete: scratch/alice> delete.term foo Done. - ``` ``` ucm :hide scratch/main> branch bob - ``` Bob's new code that depends on `foo`: @@ -820,27 +724,25 @@ bar = foo ++ " - " ++ foo scratch/bob> add ⍟ I've added these definitions: - - bar : Text + bar : Text scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -853,7 +755,6 @@ bar = ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: type error @@ -864,7 +765,6 @@ In this example, Alice updates a `Text` to a `Nat`, while Bob adds a new depende ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -876,9 +776,7 @@ foo = "foo" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's update: @@ -890,9 +788,7 @@ foo = 100 ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's new definition: @@ -904,7 +800,6 @@ bar = foo ++ " - " ++ foo ``` ucm :hide scratch/bob> update - ``` ``` ucm :error @@ -913,19 +808,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -938,7 +832,6 @@ bar = ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: simple term conflict @@ -948,7 +841,6 @@ are presented to the user to resolve. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -963,9 +855,7 @@ bar = "old bar" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's changes: @@ -983,9 +873,7 @@ qux = "alices qux depends on alices foo" ++ foo ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's changes: @@ -1000,7 +888,6 @@ baz = "bobs baz" ``` ucm :hide scratch/bob> update - ``` ``` ucm :error @@ -1009,19 +896,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1048,15 +934,13 @@ scratch/merge-bob-into-alice> view bar baz bar : Text bar = "alices bar" - + baz : Text baz = "bobs baz" - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: simple type conflict @@ -1065,7 +949,6 @@ Ditto for types; if the hashes don't match, it's a conflict. In this example, Al ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1076,9 +959,7 @@ unique type Foo = MkFoo Nat ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's changes: @@ -1089,9 +970,7 @@ unique type Foo = MkFoo Nat Nat ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's changes: @@ -1102,7 +981,6 @@ unique type Foo = MkFoo Nat Text ``` ucm :hide scratch/bob> update - ``` ``` ucm :error @@ -1111,19 +989,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1137,7 +1014,6 @@ type Foo = MkFoo Nat Text ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: type-update + constructor-rename conflict @@ -1146,7 +1022,6 @@ We model the renaming of a type's constructor as an update, so if Alice updates ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1157,9 +1032,7 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's changes `Baz Nat` to `Baz Nat Nat` @@ -1170,9 +1043,7 @@ unique type Foo = Baz Nat Nat | Qux Text ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's renames `Qux` to `BobQux`: @@ -1181,7 +1052,6 @@ Bob's renames `Qux` to `BobQux`: scratch/bob> move.term Foo.Qux Foo.BobQux Done. - ``` ``` ucm :error @@ -1190,19 +1060,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1216,7 +1085,6 @@ type Foo = BobQux Text | Baz Nat ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: constructor-rename conflict @@ -1225,7 +1093,6 @@ Here is another example demonstrating that constructor renames are modeled as up ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1236,9 +1103,7 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's rename: @@ -1247,12 +1112,10 @@ Alice's rename: scratch/alice> move.term Foo.Baz Foo.Alice Done. - ``` ``` ucm :hide scratch/main> branch bob - ``` Bob's rename: @@ -1261,7 +1124,6 @@ Bob's rename: scratch/bob> move.term Foo.Qux Foo.Bob Done. - ``` ``` ucm :error @@ -1270,19 +1132,18 @@ scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1296,7 +1157,6 @@ type Foo = Bob Text | Baz Nat ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: non-constructor/constructor conflict @@ -1305,12 +1165,10 @@ A constructor on one side can conflict with a regular term definition on the oth ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's additions: @@ -1322,9 +1180,7 @@ my.cool.thing = 17 ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's additions: @@ -1336,7 +1192,6 @@ unique ability my.cool where ``` ucm :hide scratch/bob> add - ``` ``` ucm :error @@ -1345,19 +1200,18 @@ scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1372,7 +1226,6 @@ ability my.cool where thing : Nat ->{cool} Nat ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge failure: type/type conflict with term/constructor conflict @@ -1381,7 +1234,6 @@ Here's a subtle situation where a new type is added on each side of the merge, a ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1393,9 +1245,7 @@ Foo.Bar = 17 ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice adds this type `Foo` with constructor `Foo.Alice`: @@ -1406,9 +1256,7 @@ unique type Foo = Alice Nat ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob adds the type `Foo` with constructor `Foo.Bar`, replacing the original `Foo.Bar` term: @@ -1417,7 +1265,6 @@ Bob adds the type `Foo` with constructor `Foo.Bar`, replacing the original `Foo. scratch/bob> delete.term Foo.Bar Done. - ``` ``` unison :hide @@ -1426,7 +1273,6 @@ unique type Foo = Bar Nat Nat ``` ucm :hide scratch/bob> add - ``` These won't cleanly merge. @@ -1437,19 +1283,18 @@ scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1467,14 +1312,12 @@ type Foo = Bar Nat Nat ``` ucm :hide scratch/main> project.delete scratch - ``` Here's a more involved example that demonstrates the same idea. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` In the LCA, we have a type with two constructors, and some term. @@ -1490,25 +1333,19 @@ Foo.Bar.Hello = 17 ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice deletes this type entirely, and repurposes its constructor names for other terms. She also updates the term. ``` ucm :hide scratch/alice> delete.type Foo - scratch/alice> delete.term Foo.Bar.Baz - scratch/alice> delete.term Foo.Bar.Qux - ``` ``` ucm :hide scratch/alice> update - ``` ``` ucm @@ -1516,33 +1353,27 @@ scratch/alice> view Foo.Bar.Baz Foo.Bar.Qux Foo.Bar.Hello Foo.Bar.Baz : Nat Foo.Bar.Baz = 100 - + Foo.Bar.Hello : Nat Foo.Bar.Hello = 18 - + Foo.Bar.Qux : Nat Foo.Bar.Qux = 200 - ``` Bob, meanwhile, first deletes the term, then sort of deletes the type and re-adds it under another name, but one constructor's fully qualified names doesn't actually change. The other constructor reuses the name of the deleted term. ``` ucm :hide scratch/main> branch bob - scratch/bob> delete.term Foo.Bar.Hello - scratch/bob> move.type Foo Foo.Bar - scratch/bob> move.term Foo.Bar.Qux Foo.Bar.Hello - ``` ``` ucm scratch/bob> view Foo.Bar type Foo.Bar = Baz Nat | Hello Nat Nat - ``` At this point, Bob and alice have both updated the name `Foo.Bar.Hello` in different ways, so that's a conflict. Therefore, Bob's entire type (`Foo.Bar` with constructors `Foo.Bar.Baz` and `Foo.Bar.Hello`) gets rendered into the scratch file. @@ -1555,19 +1386,18 @@ scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1586,7 +1416,6 @@ type Foo.Bar = Baz Nat | Hello Nat Nat ``` ucm :hide scratch/main> project.delete scratch - ``` ## Merge algorithm quirk: add/add unique types @@ -1599,12 +1428,10 @@ We will resolve this situation automatically in a future version. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's additions: @@ -1618,9 +1445,7 @@ alice _ = 18 ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's additions: @@ -1634,7 +1459,6 @@ bob _ = 19 ``` ucm :hide scratch/bob> add - ``` ``` ucm :error @@ -1643,19 +1467,18 @@ scratch/alice> merge bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1680,7 +1503,6 @@ bob _ = 19 ``` ucm :hide scratch/main> project.delete scratch - ``` ## `merge.commit` example (success) @@ -1690,7 +1512,6 @@ After merge conflicts are resolved, you can use `merge.commit` rather than `swit ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1702,9 +1523,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's changes: @@ -1716,9 +1535,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's changes: @@ -1732,7 +1549,6 @@ Attempt to merge: ``` ucm :hide scratch/bob> update - ``` ``` ucm :error @@ -1741,19 +1557,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -1775,17 +1590,17 @@ foo = "alice and bobs foo" ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Text - ``` ``` ucm @@ -1795,29 +1610,24 @@ scratch/merge-bob-into-alice> update updated... Done. - scratch/merge-bob-into-alice> merge.commit I fast-forward merged scratch/merge-bob-into-alice into scratch/alice. - scratch/alice> view foo foo : Text foo = "alice and bobs foo" - scratch/alice> branches Branch Remote branch 1. alice 2. bob 3. main - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## `merge.commit` example (failure) @@ -1826,29 +1636,25 @@ scratch/main> project.delete scratch ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm scratch/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 :error scratch/topic> merge.commit It doesn't look like there's a merge in progress. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Precondition violations @@ -1861,7 +1667,6 @@ If `foo` and `bar` are aliases in the nearest common ancestor, but not in Alice' ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Original branch: @@ -1876,9 +1681,7 @@ bar = 100 ``` ucm :hide scratch/main> add - scratch/main> branch alice - ``` Alice's updates: @@ -1893,9 +1696,7 @@ bar = 300 ``` ucm :hide scratch/alice> update - scratch/main> branch bob - ``` Bob's addition: @@ -1907,34 +1708,31 @@ baz = "baz" ``` ucm :hide scratch/bob> add - ``` ``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: - + On the merge ancestor, bar and foo were aliases for the same term, but on scratch/alice the names have different definitions currently. I'd need just a single new definition to use in their dependents when I merge. - + Please fix up scratch/alice to resolve this. For example, - + * `update` the definitions to be the same again, so that there's nothing for me to decide. * `move` or `delete` all but one of the definitions; I'll use the remaining name when propagating updates. (You can `move` it back after the merge.) - - and then try merging again. + and then try merging again. ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Conflict involving builtin @@ -1946,12 +1744,10 @@ One way to fix this in the future would be to introduce a syntax for defining al ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's branch: @@ -1960,14 +1756,12 @@ Alice's branch: scratch/alice> alias.type lib.builtins.Nat MyNat Done. - ``` Bob's branch: ``` ucm :hide scratch/main> branch bob - ``` ``` unison :hide @@ -1976,27 +1770,24 @@ unique type MyNat = MyNat Nat ``` ucm :hide scratch/bob> add - ``` ``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: - + There's a merge conflict on type MyNat, but it's a builtin on one or both branches. I can't yet handle merge conflicts involving builtins. - + Please eliminate this conflict by updating one branch or the other, making MyNat the same on both branches, or making neither of them a builtin, and then try the merge again. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Constructor alias @@ -2005,12 +1796,10 @@ Each naming of a decl may not have more than one name for each constructor, with ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` ucm :hide scratch/main> branch alice - ``` Alice's branch: @@ -2021,21 +1810,18 @@ unique type Foo = Bar ``` ucm :hide scratch/alice> add - ``` ``` ucm scratch/alice> alias.term Foo.Bar Foo.some.other.Alias Done. - ``` Bob's branch: ``` ucm :hide scratch/main> branch bob - ``` ``` unison :hide @@ -2045,28 +1831,25 @@ bob = 100 ``` ucm :hide scratch/bob> add - ``` ``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: - + On scratch/alice, the type Foo has a constructor with multiple names, and I can't perform a merge in this situation: - + * Foo.Bar * Foo.some.other.Alias - + Please delete all but one name for each constructor, and then try merging again. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Missing constructor name @@ -2075,14 +1858,12 @@ Each naming of a decl must have a name for each constructor, within the decl's n ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Alice's branch: ``` ucm :hide scratch/main> branch alice - ``` ``` unison :hide @@ -2091,21 +1872,18 @@ unique type Foo = Bar ``` ucm :hide scratch/alice> add - ``` ``` ucm scratch/alice> delete.term Foo.Bar Done. - ``` Bob's branch: ``` ucm :hide scratch/main> branch /bob - ``` ``` unison :hide @@ -2115,26 +1893,23 @@ bob = 100 ``` ucm :hide scratch/bob> add - ``` ``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: - + On scratch/alice, the type Foo has some constructors with missing names, and I can't perform a merge in this situation. - + You can use `view Foo` and `alias.term Foo.` to give names to each unnamed constructor, and then try the merge again. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Nested decl alias @@ -2143,14 +1918,12 @@ A decl cannot be aliased within the namespace of another of its aliased. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Alice's branch: ``` ucm :hide scratch/main> branch alice - ``` ``` unison :hide @@ -2160,7 +1933,6 @@ structural type A.inner.X = Y Nat | Z Nat Nat ``` ucm :hide scratch/alice> add - ``` ``` ucm @@ -2169,14 +1941,12 @@ scratch/alice> names A Type Hash: #65mdg7015r Names: A A.inner.X - ``` Bob's branch: ``` ucm :hide scratch/main> branch bob - ``` ``` unison :hide @@ -2186,7 +1956,6 @@ bob = 100 ``` ucm :hide scratch/bob> add - ``` ``` ucm :error @@ -2196,12 +1965,10 @@ scratch/alice> merge /bob able to perform a merge when a type exists nested under an alias of itself. Please separate them or delete one copy, and then try merging again. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Stray constructor alias @@ -2210,43 +1977,37 @@ Constructors may only exist within the corresponding decl's namespace. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Alice's branch: ``` ucm :hide scratch/main> branch alice - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/alice> alias.term Foo.Bar AliasOutsideFooNamespace Done. - ``` Bob's branch: ``` ucm :hide scratch/main> branch bob - ``` ``` ucm scratch/bob> add ⍟ I've added these definitions: - - bob : Nat + bob : Nat ``` ``` ucm :error @@ -2255,17 +2016,15 @@ scratch/alice> merge bob Sorry, I wasn't able to perform the merge, because I need all constructor names to be nested somewhere beneath the corresponding type name. - + On scratch/alice, the constructor AliasOutsideFooNamespace is not nested beneath the corresponding type name. Please either use `move` to move it, or if it's an extra copy, you can simply `delete` it. Then try the merge again. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Term or type in `lib` @@ -2274,14 +2033,12 @@ By convention, `lib` can only namespaces; each of these represents a library dep ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` Alice's branch: ``` ucm :hide scratch/main> branch alice - ``` ``` unison :hide @@ -2291,9 +2048,7 @@ lib.foo = 1 ``` ucm :hide scratch/alice> add - scratch/main> branch bob - ``` Bob's branch: @@ -2305,25 +2060,22 @@ bob = 100 ``` ucm :hide scratch/bob> add - ``` ``` ucm :error scratch/alice> merge /bob Sorry, I wasn't able to perform the merge: - + On scratch/alice, there's a type or term at the top level of the `lib` namespace, where I only expect to find subnamespaces representing library dependencies. - - Please move or remove it and then try merging again. + Please move or remove it and then try merging again. ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## LCA precondition violations @@ -2335,7 +2087,6 @@ together. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` LCA: @@ -2345,29 +2096,27 @@ structural type Foo = Bar Nat | Baz Nat Nat ``` ``` ucm :added-by-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 Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - structural type Foo + structural type Foo scratch/main> delete.term Foo.Baz Done. - ``` Alice's branch: @@ -2376,18 +2125,15 @@ Alice's branch: scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/alice> delete.type Foo Done. - scratch/alice> delete.term Foo.Bar Done. - ``` ``` unison @@ -2396,25 +2142,24 @@ alice = 100 ``` ``` ucm :added-by-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`: alice : Nat - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - - alice : Nat + alice : Nat ``` Bob's branch: @@ -2423,18 +2168,15 @@ Bob's branch: scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - scratch/bob> delete.type Foo Done. - scratch/bob> delete.term Foo.Bar Done. - ``` ``` unison @@ -2443,25 +2185,24 @@ bob = 101 ``` ``` ucm :added-by-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`: bob : Nat - ``` ``` ucm scratch/bob> add ⍟ I've added these definitions: - - bob : Nat + bob : Nat ``` Now we merge: @@ -2470,12 +2211,10 @@ Now we merge: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ## Regression tests @@ -2484,7 +2223,6 @@ scratch/main> project.delete scratch ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -2493,38 +2231,35 @@ bar = 17 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/alice> delete.term bar Done. - ``` ``` unison @@ -2532,17 +2267,17 @@ foo = 18 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat - ``` ``` ucm @@ -2552,14 +2287,12 @@ scratch/alice> update updated... Done. - scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - ``` ``` unison @@ -2567,44 +2300,40 @@ bob = 101 ``` ``` ucm :added-by-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`: bob : Nat - ``` ``` ucm scratch/bob> add ⍟ I've added these definitions: - - bob : Nat + bob : Nat ``` ``` ucm scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Delete a constructor ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -2612,32 +2341,30 @@ type Foo = Bar | Baz ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/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`. - ``` ``` unison @@ -2645,25 +2372,24 @@ boop = "boop" ``` ``` ucm :added-by-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`: boop : Text - ``` ``` ucm scratch/topic> add ⍟ I've added these definitions: - - boop : Text + boop : Text ``` ``` unison @@ -2671,17 +2397,17 @@ type Foo = Bar ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -2691,23 +2417,19 @@ scratch/main> update updated... Done. - ``` ``` ucm scratch/main> merge topic I merged scratch/topic into scratch/main. - scratch/main> view Foo type Foo = Bar - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Dependent that doesn't need to be in the file @@ -2716,7 +2438,6 @@ This test demonstrates a bug. ``` ucm :hide scratch/alice> builtins.mergeio lib.builtins - ``` In the LCA, we have `foo` with dependent `bar`, and `baz`. @@ -2733,36 +2454,34 @@ baz = "lca" ``` ``` ucm :added-by-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`: bar : Nat baz : Text foo : Nat - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - + bar : Nat baz : Text foo : Nat - scratch/alice> branch bob Done. I've created the bob branch based off of alice. - + Tip: To merge your work back into the alice branch, first `switch /alice` then `merge /bob`. - ``` On Bob, we update `baz` to "bob". @@ -2773,17 +2492,17 @@ baz = "bob" ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: baz : Text - ``` ``` ucm @@ -2793,7 +2512,6 @@ scratch/bob> update updated... Done. - ``` On Alice, we update `baz` to "alice" (conflict), but also update `foo` (unconflicted), which propagates to `bar`. @@ -2807,18 +2525,18 @@ baz = "alice" ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: baz : Text foo : Nat - ``` ``` ucm @@ -2832,7 +2550,6 @@ scratch/alice> update Everything typechecks, so I'm saving the results... Done. - ``` When we try to merge Bob into Alice, we should see both versions of `baz`, with Alice's unconflicted `foo` and `bar` in @@ -2844,19 +2561,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -2882,7 +2598,6 @@ But `bar` was put into the scratch file instead. ``` ucm :hide scratch/main> project.delete scratch - ``` ### Merge loop test @@ -2897,25 +2612,24 @@ a = 1 ``` ``` ucm :added-by-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 - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - - a : ##Nat + a : ##Nat ``` ``` unison @@ -2923,25 +2637,24 @@ b = 2 ``` ``` ucm :added-by-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`: b : ##Nat - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - - b : ##Nat + b : ##Nat ``` ``` unison @@ -2949,20 +2662,19 @@ b = 2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` ucm scratch/bob> add ⍟ I've added these definitions: - - b : ##Nat + b : ##Nat ``` ``` unison @@ -2970,25 +2682,24 @@ a = 1 ``` ``` ucm :added-by-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 - ``` ``` ucm scratch/bob> add ⍟ I've added these definitions: - - a : ##Nat + a : ##Nat ``` ``` unison @@ -2997,50 +2708,45 @@ b = 2 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` ucm scratch/carol> add ⍟ I've added these definitions: - + a : ##Nat b : ##Nat - scratch/bob> merge /alice I merged scratch/alice into scratch/bob. - scratch/carol> merge /bob I merged scratch/bob into scratch/carol. - scratch/carol> history 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 - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Variables named `_` @@ -3050,7 +2756,6 @@ results. ``` ucm :hide scratch/alice> builtins.mergeio lib.builtins - ``` ``` unison @@ -3067,36 +2772,34 @@ bar = ``` ``` ucm :added-by-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`: bar : Nat foo : Nat ignore : a -> () - ``` ``` ucm scratch/alice> add ⍟ I've added these definitions: - + bar : Nat foo : Nat ignore : a -> () - scratch/alice> branch bob Done. I've created the bob branch based off of alice. - + Tip: To merge your work back into the alice branch, first `switch /alice` then `merge /bob`. - ``` ``` unison @@ -3107,17 +2810,17 @@ bar = ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: bar : Nat - ``` ``` ucm @@ -3127,7 +2830,6 @@ scratch/bob> update updated... Done. - ``` Previously, this update to `foo` would also cause a "real update" on `bar`, its dependent. Now it doesn't, so the merge @@ -3139,17 +2841,17 @@ foo = 19 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat - ``` ``` ucm @@ -3163,19 +2865,16 @@ scratch/alice> update Everything typechecks, so I'm saving the results... Done. - ``` ``` ucm scratch/alice> merge /bob I merged scratch/bob into scratch/alice. - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` ### Unique type GUID reuse @@ -3185,7 +2884,6 @@ types' GUIDs being regenerated. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -3194,49 +2892,44 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-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 Bar type Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Bar type Foo - scratch/main> branch alice Done. I've created the alice branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. - scratch/alice> move.term Foo.Lca Foo.Alice Done. - scratch/main> branch bob Done. I've created the bob branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. - scratch/bob> move.term Foo.Lca Foo.Bob Done. - ``` ``` ucm :error @@ -3245,19 +2938,18 @@ scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/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. + to delete the temporary branch and switch back to alice. ``` ``` unison :added-by-ucm scratch.u @@ -3286,11 +2978,11 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` ``` ucm @@ -3300,22 +2992,18 @@ scratch/merge-bob-into-alice> update updated... Done. - scratch/merge-bob-into-alice> names Bar Type Hash: #h3af39sae7 Names: Bar - scratch/alice> names Bar Type Hash: #h3af39sae7 Names: Bar - ``` ``` ucm :hide scratch/main> project.delete scratch - ``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index 6a9cf9de0f..927fadf5e0 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ## Happy Path - namespace, term, and type @@ -17,31 +16,30 @@ unique type Foo.T = T ``` ``` ucm :added-by-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 type Foo.T Foo : Nat Foo.termInA : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo type Foo.T Foo : Nat Foo.termInA : Nat - ``` ``` unison @@ -50,19 +48,19 @@ unique type Foo.T = T1 | T2 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo.T Foo.termInA : Nat (also named Foo) - ``` ``` ucm @@ -72,7 +70,6 @@ scratch/main> update updated... Done. - ``` Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. @@ -81,28 +78,25 @@ Should be able to move the term, type, and namespace, including its types, terms scratch/main> move Foo Bar Done. - scratch/main> ls 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) - scratch/main> ls Bar 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) - scratch/main> history Bar Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #o7vuviel4c - + + Adds / updates: T T.T1 T.T2 termInA @@ -110,9 +104,8 @@ scratch/main> history Bar - Deletes: T.T - - □ 2. #c5cggiaumo (start of history) + □ 2. #c5cggiaumo (start of history) ``` ## Happy Path - Just term @@ -122,38 +115,34 @@ bonk = 5 ``` ``` ucm :added-by-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 z/main> builtins.merge Done. - z/main> add ⍟ I've added these definitions: - - bonk : Nat + bonk : Nat z/main> move bonk zonk Done. - z/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk (Nat) - ``` ## Happy Path - Just namespace @@ -163,44 +152,39 @@ bonk.zonk = 5 ``` ``` ucm :added-by-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.zonk : Nat (also named zonk) - ``` ``` ucm a/main> builtins.merge Done. - a/main> add ⍟ I've added these definitions: - - bonk.zonk : Nat + bonk.zonk : Nat a/main> move bonk zonk Done. - a/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) - a/main> view zonk.zonk zonk.zonk : Nat zonk.zonk = 5 - ``` ## Sad Path - No term, type, or namespace named src @@ -209,7 +193,6 @@ a/main> view zonk.zonk scratch/main> move doesntexist foo ⚠️ - - There is no term, type, or namespace at doesntexist. + There is no term, type, or namespace at doesntexist. ``` diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index db14534288..4a2fcd117e 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -12,50 +12,43 @@ foo = 1 scratch/main> add ⍟ I've added these definitions: - - foo : ##Nat + foo : ##Nat -- 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 1. root/ (1 term) - scratch/main> history Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #g97lh1m2v7 (start of history) + + + □ 1. #g97lh1m2v7 (start of history) ``` ``` ucm scratch/main> ls .root.at.path 1. foo (##Nat) - scratch/main> history .root.at.path Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #08a6hgi6s4 (start of history) + + + □ 1. #08a6hgi6s4 (start of history) ``` I should be able to move a sub namespace *over* the root. @@ -65,27 +58,23 @@ I should be able to move a sub namespace *over* the root. 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 1. foo (##Nat) - scratch/main> history Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #08a6hgi6s4 (start of history) + + + □ 1. #08a6hgi6s4 (start of history) ``` ``` ucm :error @@ -93,21 +82,18 @@ scratch/main> history scratch/main> ls .root.at.path nothing to show - scratch/main> history .root.at.path Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` ``` ucm :hide scratch/happy> builtins.merge lib.builtins - ``` ## Happy path @@ -120,27 +106,26 @@ unique type a.T = T ``` ``` ucm :added-by-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 a.T a.termInA : Nat - ``` ``` ucm scratch/happy> add ⍟ I've added these definitions: - + type a.T a.termInA : Nat - ``` ``` unison @@ -149,18 +134,18 @@ unique type a.T = T1 | T2 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type a.T a.termInA : Nat - ``` ``` ucm @@ -170,7 +155,6 @@ scratch/happy> update updated... Done. - ``` Should be able to move the namespace, including its types, terms, and sub-namespaces. @@ -179,20 +163,18 @@ Should be able to move the namespace, including its types, terms, and sub-namesp scratch/happy> move.namespace a b Done. - scratch/happy> ls b 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) - scratch/happy> history b Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #rkvfe5p8fu - + + Adds / updates: T T.T1 T.T2 termInA @@ -200,16 +182,14 @@ scratch/happy> history b - Deletes: T.T - - □ 2. #avlnmh0erc (start of history) + □ 2. #avlnmh0erc (start of history) ``` ## Namespace history ``` ucm :hide scratch/history> builtins.merge lib.builtins - ``` Create some namespaces and add some history to them @@ -220,27 +200,26 @@ b.termInB = 10 ``` ``` ucm :added-by-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.termInA : Nat b.termInB : Nat - ``` ``` ucm scratch/history> add ⍟ I've added these definitions: - + a.termInA : Nat b.termInB : Nat - ``` ``` unison @@ -249,18 +228,18 @@ b.termInB = 11 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: a.termInA : Nat b.termInB : Nat - ``` ``` ucm @@ -270,7 +249,6 @@ scratch/history> update updated... Done. - ``` Deleting a namespace should not leave behind any history, @@ -281,42 +259,37 @@ of the moved namespace. scratch/history> delete.namespace b Done. - scratch/history> move.namespace a b Done. - -- Should be the history from 'a' scratch/history> history b Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #j0cjjqepb3 - + + Adds / updates: termInA - - □ 2. #m8smmmgjso (start of history) + □ 2. #m8smmmgjso (start of history) -- Should be empty scratch/history> history a Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` ## Moving over an existing branch ``` ucm :hide scratch/existing> builtins.merge lib.builtins - ``` Create some namespace and add some history to them @@ -327,27 +300,26 @@ b.termInB = 10 ``` ``` ucm :added-by-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.termInA : Nat b.termInB : Nat - ``` ``` ucm scratch/existing> add ⍟ I've added these definitions: - + a.termInA : Nat b.termInB : Nat - ``` ``` unison @@ -356,18 +328,18 @@ b.termInB = 11 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: a.termInA : Nat b.termInB : Nat - ``` ``` ucm @@ -377,16 +349,14 @@ scratch/existing> update updated... Done. - scratch/existing> move.namespace a b ⚠️ - + A branch existed at the destination: b so I over-wrote it. - + Tip: You can use `undo` or use a hash from `reflog` to undo this change. Done. - ``` diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md index b7e4adc618..59a40fdcc3 100644 --- a/unison-src/transcripts/name-resolution.output.md +++ b/unison-src/transcripts/name-resolution.output.md @@ -7,7 +7,6 @@ ambiguous. A reference to `Namespace.Foo` or `File.Foo` work fine. scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -15,25 +14,24 @@ type Namespace.Foo = Bar ``` ``` ucm :added-by-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 Namespace.Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - type Namespace.Foo + type Namespace.Foo ``` ``` unison :error @@ -42,9 +40,10 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. - + ❓ I couldn't resolve any of these symbols: @@ -56,8 +55,6 @@ type UsesFoo = UsesFoo Foo Foo File.Foo Namespace.Foo - - ``` ``` unison @@ -66,22 +63,21 @@ type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` ``` ucm :added-by-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 File.Foo type UsesFoo - ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 2 @@ -93,7 +89,6 @@ it refers to the namespace type (because it is an exact match). scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -101,25 +96,24 @@ type Foo = Bar ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo ``` ``` unison @@ -128,36 +122,33 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-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 File.Foo type UsesFoo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type File.Foo type UsesFoo - scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo - ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 3 @@ -169,7 +160,6 @@ it refers to the file type (because it is an exact match). scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -177,25 +167,24 @@ type Namespace.Foo = Bar ``` ``` ucm :added-by-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 Namespace.Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - type Namespace.Foo + type Namespace.Foo ``` ``` unison @@ -204,36 +193,33 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-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 type UsesFoo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo type UsesFoo - scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo - ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -245,7 +231,6 @@ but resolves to `ns.foo` via TDNR. scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -254,25 +239,24 @@ ns.foo = 42 ``` ``` ucm :added-by-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`: ns.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - ns.foo : Nat + ns.foo : Nat ``` ``` unison @@ -284,22 +268,21 @@ bar = foo ++ "bar" ``` ``` ucm :added-by-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`: bar : Text file.foo : Text - ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -311,7 +294,6 @@ but resolves to `file.foo` via TDNR. scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -320,25 +302,24 @@ ns.foo = 42 ``` ``` ucm :added-by-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`: ns.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - ns.foo : Nat + ns.foo : Nat ``` ``` unison @@ -350,22 +331,21 @@ bar = foo + 42 ``` ``` ucm :added-by-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`: bar : Nat file.foo : Text - ``` ``` ucm scratch/main> project.delete scratch - ``` # Example 4 @@ -377,7 +357,6 @@ A reference to `ns.foo` or `file.foo` work fine. scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -386,25 +365,24 @@ ns.foo = 42 ``` ``` ucm :added-by-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`: ns.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - ns.foo : Nat + ns.foo : Nat ``` ``` unison :error @@ -416,20 +394,20 @@ bar = foo + 10 ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what foo refers to here: - + 5 | bar = foo + 10 - + The name foo is ambiguous. Its type should be: Nat - + I found some terms in scope that have matching names and types. Maybe you meant one of these: - + file.foo : Nat ns.foo : Nat - ``` ``` unison @@ -441,37 +419,34 @@ bar = file.foo + ns.foo ``` ``` ucm :added-by-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`: bar : Nat file.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat file.foo : Nat - scratch/main> view bar bar : Nat bar = use Nat + file.foo + ns.foo - ``` ``` ucm scratch/main> project.delete scratch - ``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 157efa93a6..da62438c48 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -4,17 +4,15 @@ You can use a keyword or reserved operator as a name segment if you surround it scratch/main> view `match` ⚠️ - + The following names were not found in the codebase. Check your spelling. `match` - scratch/main> view `=` ⚠️ - + The following names were not found in the codebase. Check your spelling. `=` - ``` You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` @@ -25,15 +23,13 @@ This allows you to spell `.` or `()` as name segments (which historically have a scratch/main> view `.` ⚠️ - + The following names were not found in the codebase. Check your spelling. `.` - scratch/main> view `()` ⚠️ - + The following names were not found in the codebase. Check your spelling. `()` - ``` diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index b6da125932..34690c9855 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -6,9 +6,7 @@ This transcript shows how the pretty-printer picks names for a hash when multipl ``` ucm :hide scratch/main> builtins.merge lib.builtins - scratch/biasing> builtins.merge lib.builtins - ``` ``` unison :hide @@ -23,18 +21,16 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment scratch/main> add ⍟ I've added these definitions: - + a.a : Nat a.aaa.but.more.segments : Nat a.b : Nat - scratch/main> view a.a a.a : Nat a.a = use Nat + b + 1 - ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: @@ -59,7 +55,7 @@ a3.long.name.but.shortest.suffixification = 1 scratch/main> add ⍟ I've added these definitions: - + a2.a : Nat (also named a.a) a2.aaa.but.more.segments : Nat @@ -78,15 +74,12 @@ scratch/main> add a3.c : Nat a3.d : Nat a3.long.name.but.shortest.suffixification : Nat - scratch/main> debug.alias.term.force a2.c a3.c Done. - scratch/main> debug.alias.term.force a2.d a3.d Done. - ``` At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. @@ -100,28 +93,27 @@ scratch/main> view a b c d 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 @@ -136,29 +128,28 @@ a = 10 ``` ``` ucm :added-by-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 scratch/biasing> add ⍟ 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. @@ -168,7 +159,6 @@ scratch/biasing> view deeply.nested.term deeply.nested.term = use Nat + num + 1 - ``` Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` @@ -178,25 +168,24 @@ other.num = 20 ``` ``` ucm :added-by-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 - ``` ``` ucm scratch/biasing> add ⍟ I've added these definitions: - - other.num : Nat + 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. scratch/biasing> view deeply.nested.term @@ -205,5 +194,4 @@ scratch/biasing> view deeply.nested.term deeply.nested.term = use Nat + nested.num + 1 - ``` diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md index dae9da040d..254a1cd2c8 100644 --- a/unison-src/transcripts/names.output.md +++ b/unison-src/transcripts/names.output.md @@ -4,7 +4,6 @@ scratch/main> builtins.merge lib.builtins Done. - ``` Example uses of the `names` command and output @@ -20,12 +19,13 @@ somewhere.y = 2 ``` ``` ucm :added-by-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`: some.otherplace.x : Nat @@ -33,20 +33,18 @@ somewhere.y = 2 some.place.x : Nat somewhere.y : Nat somewhere.z : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + some.otherplace.x : Nat some.otherplace.y : Nat some.place.x : Nat somewhere.y : Nat somewhere.z : Nat - ``` `names` searches relative to the current path. @@ -58,24 +56,21 @@ scratch/main> names 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 scratch/main> names #gjmq673r1v Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z - -- Works with absolute names too scratch/main> names .some.place.x Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z - ``` `debug.names.global` searches from the root, and absolutely qualifies results @@ -85,30 +80,27 @@ scratch/main> names .some.place.x scratch/other> debug.names.global x Found results in scratch/main - + 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 scratch/other> debug.names.global #gjmq673r1v Found results in scratch/main - + Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z - -- We can search using an absolute name scratch/other> debug.names.global .some.place.x Found results in scratch/main - + Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z - ``` diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index 1730897d3e..fa3adfbe0b 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -11,21 +11,16 @@ unexpectedly 😬. scratch/main> alias.term ##Nat.+ Nat.+ Done. - scratch/main> ls Nat 1. + (##Nat -> ##Nat -> ##Nat) - scratch/main> move.namespace Nat Nat.operators Done. - scratch/main> ls Nat 1. operators/ (1 term) - scratch/main> ls Nat.operators 1. + (##Nat -> ##Nat -> ##Nat) - ``` diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md index d7e75a87cf..c803a2009a 100644 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -4,7 +4,6 @@ scratch/main> builtins.merge lib.builtins Done. - ``` ``` unison :hide @@ -17,11 +16,10 @@ mynamespace.dependsOnText = const external.mynat 10 scratch/main> add ⍟ I've added these definitions: - + const : a -> b -> a external.mynat : Nat mynamespace.dependsOnText : Nat - scratch/main> namespace.dependencies mynamespace External dependency Dependents in scratch/main:.mynamespace @@ -30,5 +28,4 @@ scratch/main> namespace.dependencies mynamespace const 1. dependsOnText external.mynat 1. dependsOnText - ``` diff --git a/unison-src/transcripts/namespace-directive.output.md b/unison-src/transcripts/namespace-directive.output.md index 26a664181f..fa3c5f67b7 100644 --- a/unison-src/transcripts/namespace-directive.output.md +++ b/unison-src/transcripts/namespace-directive.output.md @@ -9,7 +9,6 @@ It affects the contents of the file as follows: scratch/main> builtins.mergeio lib.builtins Done. - ``` ``` unison @@ -20,16 +19,16 @@ baz = 17 ``` ``` ucm :added-by-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.baz : Nat - ``` 2. Free variables whose names exactly match bindings in the file are rewritten to refer to the prefixed binder instead. @@ -48,37 +47,35 @@ longer.evil.factorial n = n ``` ``` ucm :added-by-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.factorial : Int -> Int foo.longer.evil.factorial : Int -> Int - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + foo.factorial : Int -> Int foo.longer.evil.factorial : Int -> Int - scratch/main> view factorial foo.factorial : Int -> Int foo.factorial = cases +0 -> +1 n -> n Int.* foo.factorial (n Int.- +1) - + foo.longer.evil.factorial : Int -> Int foo.longer.evil.factorial n = n - ``` Note that in the above example, we do not want the existence of a `namespace foo` directive to determine whether the @@ -95,12 +92,13 @@ type longer.foo.Baz = { qux : Nat } ``` ``` ucm :added-by-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 longer.foo.Baz @@ -110,20 +108,18 @@ type longer.foo.Baz = { qux : Nat } -> Baz ->{g} Baz longer.foo.Baz.qux.set : Nat -> Baz -> Baz - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type longer.foo.Baz type longer.foo.Foo longer.foo.Baz.qux : Baz -> Nat longer.foo.Baz.qux.modify : (Nat ->{g} Nat) -> Baz ->{g} Baz longer.foo.Baz.qux.set : Nat -> Baz -> Baz - ``` ``` unison @@ -145,12 +141,13 @@ hasTypeLink = ``` ``` ucm :added-by-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.Baz @@ -164,14 +161,13 @@ hasTypeLink = foo.hasTypeLink : Doc2 foo.refersToBar : foo.Foo -> Nat foo.refersToQux : foo.Baz -> Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type foo.Baz type foo.Foo type foo.RefersToFoo @@ -183,25 +179,22 @@ scratch/main> add foo.hasTypeLink : Doc2 foo.refersToBar : foo.Foo -> Nat foo.refersToQux : foo.Baz -> Nat - scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink type foo.RefersToFoo = RefersToFoo foo.Foo - + foo.hasTypeLink : Doc2 foo.hasTypeLink = {{ {type foo.Foo} }} - + foo.refersToBar : foo.Foo -> Nat foo.refersToBar = cases foo.Foo.Bar -> 17 - + foo.refersToQux : foo.Baz -> Nat foo.refersToQux baz = use Nat + use foo.Baz qux qux baz + qux baz - scratch/main> todo You have no pending todo items. Good work! ✅ - ``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index 44251bb5e1..27f26ebfa2 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> alias.type ##Text Text - ``` First lets add some contents to our codebase. @@ -17,12 +16,13 @@ corge = "corge" ``` ``` ucm :added-by-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`: bar : Text @@ -31,21 +31,19 @@ corge = "corge" foo : Text quux : Text qux : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Text baz : Text corge : Text foo : Text quux : Text qux : Text - ``` We can get the list of things in the namespace, and UCM will give us a numbered @@ -61,8 +59,6 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text - - ``` We can ask to `view` the second element of this list: @@ -77,13 +73,10 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text - - scratch/main> view 2 baz : Text baz = "baz" - ``` And we can `view` multiple elements by separating with spaces: @@ -98,19 +91,16 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text - - scratch/main> view 2 3 5 baz : Text baz = "baz" - + corge : Text corge = "corge" - + quux : Text quux = "quux" - ``` We can also ask for a range: @@ -125,19 +115,16 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text - - scratch/main> view 2-4 baz : Text baz = "baz" - + corge : Text corge = "corge" - + foo : Text foo = "foo" - ``` And we can ask for multiple ranges and use mix of ranges and numbers: @@ -152,26 +139,23 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text - - scratch/main> view 1-3 4 5-6 bar : Text bar = "bar" - + baz : Text baz = "baz" - + corge : Text corge = "corge" - + foo : Text foo = "foo" - + quux : Text quux = "quux" - + qux : Text qux = "qux" - ``` diff --git a/unison-src/transcripts/old-fold-right.output.md b/unison-src/transcripts/old-fold-right.output.md index cfa3fe9d74..a73bcebd0e 100644 --- a/unison-src/transcripts/old-fold-right.output.md +++ b/unison-src/transcripts/old-fold-right.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -17,15 +16,15 @@ pecan = 'let ``` ``` ucm :added-by-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`: oldRight : (b ->{e} a ->{e} b) -> [a] ->{e} [b] pecan : '[Text] - ``` diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 7fc0ae7272..75c628b11e 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` # Basics @@ -16,18 +15,18 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 4 | test = cases 5 | A -> () - + Patterns not matched: - + * B * C - ``` ``` unison :error @@ -42,6 +41,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -51,10 +51,9 @@ test = cases 7 | (B, Some A) -> () 8 | (B, None) -> () - + Patterns not matched: * (B, Some B) - ``` ## redundant patterns @@ -71,12 +70,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 8 | _ -> () - ``` ``` unison :error @@ -92,12 +91,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 9 | (A, Some A) -> () - ``` # Uninhabited patterns @@ -114,17 +113,17 @@ test = cases ``` ``` ucm :added-by-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 V test : Optional (Optional V) -> () - ``` uninhabited patterns are reported as redundant @@ -138,12 +137,12 @@ test0 = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 5 | _ -> () - ``` ``` unison :error @@ -157,12 +156,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 7 | Some _ -> () - ``` # Guards @@ -176,16 +175,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | () | false -> () - + Patterns not matched: * () - ``` ``` unison :error @@ -197,6 +196,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -205,10 +205,9 @@ test = cases 4 | Some x 5 | | isEven x -> x - + Patterns not matched: * Some _ - ``` ## Complete patterns with guards should be accepted @@ -223,16 +222,16 @@ test = cases ``` ``` ucm :added-by-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`: test : Optional Nat -> Nat - ``` # Pattern instantiation depth @@ -250,6 +249,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -257,10 +257,9 @@ test = cases 5 | None -> () 6 | Some None -> () - + Patterns not matched: * Some (Some _) - ``` ``` unison :error @@ -274,6 +273,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -282,12 +282,11 @@ test = cases 6 | Some None -> () 7 | Some (Some A) -> () - + Patterns not matched: - + * Some (Some B) * Some (Some C) - ``` # Literals @@ -303,16 +302,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | 0 -> () - + Patterns not matched: * _ - ``` Boolean @@ -324,16 +323,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | true -> () - + Patterns not matched: * false - ``` ## Exhaustive @@ -348,16 +347,16 @@ test = cases ``` ``` ucm :added-by-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`: test : Nat -> () - ``` Boolean @@ -370,16 +369,16 @@ test = cases ``` ``` ucm :added-by-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`: test : Boolean -> () - ``` # Redundant @@ -395,12 +394,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 4 | 0 -> () - ``` Boolean @@ -414,12 +413,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 5 | _ -> () - ``` # Sequences @@ -434,16 +433,16 @@ test = cases ``` ``` ucm :added-by-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`: test : [()] -> () - ``` ## Non-exhaustive @@ -455,16 +454,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | [] -> () - + Patterns not matched: * (() +: _) - ``` ``` unison :error @@ -474,16 +473,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | x +: xs -> () - + Patterns not matched: * [] - ``` ``` unison :error @@ -493,16 +492,16 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 2 | test = cases 3 | xs :+ x -> () - + Patterns not matched: * [] - ``` ``` unison :error @@ -513,6 +512,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -520,10 +520,9 @@ test = cases 3 | x0 +: (x1 +: xs) -> () 4 | [] -> () - + Patterns not matched: * (() +: []) - ``` ``` unison :error @@ -534,6 +533,7 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -541,10 +541,9 @@ test = cases 3 | [] -> () 4 | x0 +: [] -> () - + Patterns not matched: * (() +: (() +: _)) - ``` ## Uninhabited @@ -560,17 +559,17 @@ test = cases ``` ``` ucm :added-by-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 V test : [V] -> () - ``` ## Length restrictions can equate cons and nil patterns @@ -592,16 +591,16 @@ test = cases ``` ``` ucm :added-by-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`: test : [Boolean] -> () - ``` This is the same idea as above but shows that fourth match is redundant. @@ -617,12 +616,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 6 | true +: xs -> () - ``` This is another similar example. The first pattern matches lists of @@ -642,12 +641,12 @@ test = cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 5 | _ ++ [true, false, true, false] -> () - ``` # bugfix: Sufficient data decl map @@ -661,27 +660,26 @@ unit2t = cases ``` ``` ucm :added-by-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 T unit2t : 'T - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type T unit2t : 'T - ``` Pattern coverage checking needs the data decl map to contain all @@ -699,16 +697,16 @@ witht = match unit2t () with ``` ``` ucm :added-by-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`: witht : () - ``` ``` unison @@ -719,27 +717,26 @@ evil = bug "" ``` ``` ucm :added-by-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 V evil : 'V - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type V evil : 'V - ``` ``` unison :error @@ -749,12 +746,12 @@ withV = match evil () with ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 3 | x -> () - ``` ``` unison @@ -762,25 +759,24 @@ unique type SomeType = A ``` ``` ucm :added-by-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 SomeType - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - type SomeType + type SomeType ``` ``` unison @@ -791,17 +787,17 @@ get x = match x with ``` ``` ucm :added-by-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 R get : R -> SomeType - ``` ``` unison @@ -809,19 +805,19 @@ unique type R = { someType : SomeType } ``` ``` ucm :added-by-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 R R.someType : R -> SomeType R.someType.modify : (SomeType ->{g} SomeType) -> R ->{g} R R.someType.set : SomeType -> R -> R - ``` # Ability handlers @@ -840,17 +836,17 @@ result f = handle !f with cases ``` ``` ucm :added-by-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 ability Abort result : '{e, Abort} a ->{e} a - ``` ``` unison @@ -867,12 +863,13 @@ result f = handle !f with cases ``` ``` ucm :added-by-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 ability Abort @@ -882,7 +879,6 @@ result f = handle !f with cases new definition: type T - ``` ``` unison @@ -898,17 +894,17 @@ result f = ``` ``` ucm :added-by-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 ability Abort result : '{e, Abort} V ->{e} V - ``` ``` unison @@ -928,18 +924,18 @@ handleMulti c = ``` ``` ucm :added-by-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 ability Abort structural ability Stream a handleMulti : '{Abort, Stream a} r -> (Optional r, [a]) - ``` ## Non-exhaustive ability handlers are rejected @@ -956,18 +952,18 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 7 | result f = handle !f with cases 8 | { abort -> _ } -> bug "aborted" - + Patterns not matched: - + * { _ } * { abortWithMessage _ -> _ } - ``` ``` unison :error @@ -983,6 +979,7 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -990,10 +987,9 @@ result f = handle !f with cases 8 | { T.A } -> () 9 | { abort -> _ } -> bug "aborted" - + Patterns not matched: * { B } - ``` ``` unison :error @@ -1009,6 +1005,7 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1016,10 +1013,9 @@ result f = handle !f with cases 8 | { x } -> x 9 | { give T.A -> resume } -> result resume - + Patterns not matched: * { give B -> _ } - ``` ``` unison :error @@ -1039,6 +1035,7 @@ handleMulti c = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1046,10 +1043,9 @@ handleMulti c = 11 | { r } -> (Some r, xs) 12 | { emit x -> resume } -> handle !resume with impl (xs :+ x) - + Patterns not matched: * { abort -> _ } - ``` ## Redundant handler cases are rejected @@ -1068,12 +1064,12 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 10 | { give T.A -> resume } -> result resume - ``` ## Exhaustive ability reinterpretations are accepted @@ -1092,17 +1088,17 @@ result f = handle !f with cases ``` ``` ucm :added-by-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 ability Abort result : '{e, Abort} a ->{e, Abort} a - ``` ``` unison @@ -1120,17 +1116,17 @@ result f = ``` ``` ucm :added-by-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 ability Abort a result : '{e, Abort V} a ->{e, Abort V} a - ``` ## Non-exhaustive ability reinterpretations are rejected @@ -1148,6 +1144,7 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1155,10 +1152,9 @@ result f = handle !f with cases 8 | { x } -> x 9 | { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) - + Patterns not matched: * { abort -> _ } - ``` ## Hacky workaround for uninhabited abilities @@ -1188,18 +1184,18 @@ result f = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: 8 | impl = cases 9 | { x } -> x - + Patterns not matched: - + * { give _ -> _ } * { give2 _ -> _ } - ``` ``` unison @@ -1217,17 +1213,17 @@ result f = ``` ``` ucm :added-by-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`: ability Give a result : '{e, Give V} r ->{e} r - ``` ``` unison @@ -1245,17 +1241,17 @@ result f = ``` ``` ucm :added-by-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`: ability Give a result : '{e, Give V} r ->{e} r - ``` ``` unison :error @@ -1274,12 +1270,12 @@ result f = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 11 | { give2 _ -> resume } -> bug "impossible" - ``` ``` unison :error @@ -1304,12 +1300,12 @@ result f = ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): 15 | { giveA2 _ -> _ } -> bug "impossible" - ``` ``` unison @@ -1332,16 +1328,16 @@ result f = ``` ``` ucm :added-by-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`: ability GiveA a ability GiveB a result : '{e, GiveA V, GiveB V} r ->{e} r - ``` diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index 2e36ed984d..c09675c9c1 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -2,7 +2,6 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -65,12 +64,13 @@ doc = cases ``` ``` ucm :added-by-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 ability Ab @@ -88,14 +88,13 @@ doc = cases sneezy : Int -> () throaty : Request {g, Ab} x -> () tremulous : (Nat, Nat) -> () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural ability Ab agitated : Nat -> () angry : [t] -> () @@ -111,99 +110,84 @@ scratch/main> add sneezy : Int -> () throaty : Request {g, Ab} x -> () tremulous : (Nat, Nat) -> () - scratch/main> view dopey dopey : Char -> () dopey = cases ?0 -> () _ -> () - scratch/main> view grumpy grumpy : ff284oqf651 -> () grumpy = cases d -> () - scratch/main> view happy happy : Boolean -> () happy = cases true -> () false -> () - scratch/main> view sneezy sneezy : Int -> () sneezy = cases +1 -> () _ -> () - scratch/main> view bashful bashful : Optional a -> () bashful = cases Some a -> () _ -> () - scratch/main> view mouthy mouthy : [t] -> () mouthy = cases [] -> () _ -> () - scratch/main> view pokey pokey : [t] -> () pokey = cases h +: t -> () _ -> () - scratch/main> view sleepy sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () - scratch/main> view demure demure : [Nat] -> () demure = cases [0] -> () _ -> () - scratch/main> view angry angry : [t] -> () angry = cases a ++ [] -> () - scratch/main> view tremulous tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () - scratch/main> view throaty throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () - scratch/main> view agitated agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () - scratch/main> view doc doc : Nat -> () doc = cases y@4 -> () _ -> () - ``` diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index 2b0fc39b79..88b34574b2 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` We had bugs in the calling conventions for both send and terminate which would @@ -26,29 +25,27 @@ assertRight = cases ``` ``` ucm :added-by-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`: assertRight : Either a b -> b frank : '{IO} () - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + assertRight : Either a b -> b frank : '{IO} () - scratch/main> run frank () - ``` diff --git a/unison-src/transcripts/patterns.output.md b/unison-src/transcripts/patterns.output.md index 187ba50eaf..56b0474376 100644 --- a/unison-src/transcripts/patterns.output.md +++ b/unison-src/transcripts/patterns.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Some tests of pattern behavior. @@ -13,25 +12,25 @@ p1 = join [literal "blue", literal "frog"] ``` ``` ucm :added-by-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`: p1 : Pattern Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 3 | > Pattern.run (many p1) "bluefrogbluegoat" ⧩ Some ([], "goat") - + 4 | > Pattern.run (many.corrected p1) "bluefrogbluegoat" ⧩ Some ([], "bluegoat") - ``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index 6fbc51332f..dd5838bedf 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` We introduce a type `Foo` with a function dependent `fooToInt`. @@ -15,17 +14,17 @@ fooToInt _ = +42 ``` ``` ucm :added-by-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 fooToInt : Foo -> Int - ``` And then we add it. @@ -34,10 +33,9 @@ And then we add it. scratch/main> add ⍟ I've added these definitions: - + type Foo fooToInt : Foo -> Int - scratch/main> find.verbose 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo @@ -49,13 +47,10 @@ scratch/main> find.verbose 3. -- #j6hbm1gc2ak4f46b6705q90ld4bmhoi8etq2q45j081i9jgn95fvk3p6tjg67e7sm0021035i8qikmk4p6k845l5d00u26cos5731to fooToInt : Foo -> Int - - scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 - ``` Then if we change the type `Foo`... @@ -65,17 +60,17 @@ unique type Foo = Foo | Bar ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` and update the codebase to use the new type `Foo`... @@ -84,9 +79,8 @@ and update the codebase to use the new type `Foo`... scratch/main> update.old ⍟ I've updated these names to your new definition: - - type Foo + type Foo ``` ... it should automatically propagate the type to `fooToInt`. @@ -96,7 +90,6 @@ scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 - ``` ### Preserving user type variables @@ -113,17 +106,17 @@ preserve.otherTerm y = someTerm y ``` ``` ucm :added-by-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`: preserve.otherTerm : Optional baz -> Optional baz preserve.someTerm : Optional foo -> Optional foo - ``` Add that to the codebase: @@ -132,10 +125,9 @@ Add that to the codebase: scratch/main> add ⍟ I've added these definitions: - + preserve.otherTerm : Optional baz -> Optional baz preserve.someTerm : Optional foo -> Optional foo - ``` Let's now edit the dependency: @@ -146,17 +138,17 @@ preserve.someTerm _ = None ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: preserve.someTerm : Optional x -> Optional x - ``` Update... @@ -165,9 +157,8 @@ Update... scratch/main> update.old ⍟ I've updated these names to your new definition: - - preserve.someTerm : Optional x -> Optional x + preserve.someTerm : Optional x -> Optional x ``` Now the type of `someTerm` should be `Optional x -> Optional x` and the @@ -178,10 +169,8 @@ scratch/main> view preserve.someTerm preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None - scratch/main> view preserve.otherTerm preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y - ``` diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md index c440fc536c..9a1b0e4cdf 100644 --- a/unison-src/transcripts/pull-errors.output.md +++ b/unison-src/transcripts/pull-errors.output.md @@ -9,33 +9,31 @@ test/main> pull @aryairani/test-almost-empty/main lib.base_latest I installed @aryairani/test-almost-empty/main as aryairani_test_almost_empty_main. - test/main> pull @aryairani/test-almost-empty/main a.b ⚠️ - + Sorry, I wasn’t sure how to process your request: - + I think you want to merge @aryairani/test-almost-empty/main into the a.b namespace, but the `pull` command only supports merging into the top level of a local project branch. - + You can run `help pull` for more information on using `pull`. test/main> pull @aryairani/test-almost-empty/main a I think you want to merge @aryairani/test-almost-empty/main into the a branch, but it doesn't exist. If you want, you can create it with `branch.empty a`, and then `pull` again. - test/main> pull @aryairani/test-almost-empty/main .a ⚠️ - + Sorry, I wasn’t sure how to process your request: - + I think you want to merge @aryairani/test-almost-empty/main into the .a namespace, but the `pull` command only supports merging into the top level of a local project branch. - + You can run `help pull` for more information on using `pull`. ``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index b961461b63..26548ab236 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -2,9 +2,7 @@ Ensure that Records keep their syntax after being added to the codebase ``` ucm :hide scratch/main> builtins.merge - scratch/main> load unison-src/transcripts-using-base/base.u - ``` ## Record with 1 field @@ -15,14 +13,12 @@ unique type Record1 = { a : Text } ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> view Record1 type Record1 = { a : Text } - ``` ## Record with 2 fields @@ -33,14 +29,12 @@ unique type Record2 = { a : Text, b : Int } ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> view Record2 type Record2 = { a : Text, b : Int } - ``` ## Record with 3 fields @@ -51,14 +45,12 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> view Record3 type Record3 = { a : Text, b : Int, c : Nat } - ``` ## Record with many fields @@ -77,7 +69,6 @@ unique type Record4 = ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -91,7 +82,6 @@ scratch/main> view Record4 e : Text, f : Nat, g : [Nat] } - ``` ## Record with many many fields @@ -124,7 +114,6 @@ unique type Record5 = { ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -152,7 +141,6 @@ scratch/main> view Record5 eighteen : [[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]], nineteen : [[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]], twenty : [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] } - ``` ## Record with user-defined type fields @@ -167,7 +155,6 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` ucm :hide 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) @@ -177,7 +164,6 @@ scratch/main> view RecordWithUserType type RecordWithUserType = { a : Text, b : Record4, c : UserType } - ``` ## Syntax @@ -192,12 +178,13 @@ unique type Record5 = ``` ``` ucm :added-by-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`: Record5.a : Record5 -> Text @@ -215,5 +202,4 @@ unique type Record5 = new definition: type Record5 - ``` diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md index aeca75dfed..75a5c5d7b5 100644 --- a/unison-src/transcripts/reflog.output.md +++ b/unison-src/transcripts/reflog.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` First we make some changes to the codebase so there's data in the reflog. @@ -10,25 +9,24 @@ x = 1 ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - x : Nat + x : Nat ``` ``` unison @@ -36,44 +34,39 @@ y = 2 ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - y : Nat + y : Nat scratch/main> branch /other Done. I've created the other branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /other`. - scratch/other> alias.term y z Done. - newproject/main> builtins.merge lib.builtins Done. - newproject/main> alias.type lib.builtins.Nat MyNat Done. - ``` Should see reflog entries from the current branch @@ -84,16 +77,15 @@ scratch/main> reflog Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. - + Tip: Use `diff.namespace 1 7` to compare between points in history. - + Branch Hash Description 1. scratch/main #6mdl5gruh5 add 2. scratch/main #3rqf1hbev7 add 3. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins 4. scratch/main #sg60bvjo91 Project Created - ``` Should see reflog entries from the current project @@ -104,10 +96,10 @@ scratch/main> project.reflog Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. - + Tip: Use `diff.namespace 1 7` to compare between points in history. - + Branch Hash Description 1. scratch/other #148flqs4b1 alias.term scratch/other:.y scratch/other:z 2. scratch/other #6mdl5gruh5 Branch created from scratch/main @@ -115,7 +107,6 @@ scratch/main> project.reflog 4. scratch/main #3rqf1hbev7 add 5. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins 6. scratch/main #sg60bvjo91 Project Created - ``` Should see reflog entries from all projects @@ -126,10 +117,10 @@ scratch/main> reflog.global Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. - + Tip: Use `diff.namespace 1 7` to compare between points in history. - + Branch Hash Description 1. newproject/main #2rjhs2vq43 alias.term newproject/main:lib.builtins.Nat newproject/main:... 2. newproject/main #ms9lggs2rg builtins.merge newproject/main:lib.builtins @@ -140,5 +131,4 @@ scratch/main> reflog.global 7. scratch/main #3rqf1hbev7 add 8. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins 9. scratch/main #sg60bvjo91 Project Created - ``` diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md index 1e2e3be6fd..a1136ec464 100644 --- a/unison-src/transcripts/release-draft-command.output.md +++ b/unison-src/transcripts/release-draft-command.output.md @@ -2,7 +2,6 @@ The `release.draft` command drafts a release from the current branch. ``` ucm :hide foo/main> builtins.merge - ``` Some setup: @@ -12,25 +11,24 @@ someterm = 18 ``` ``` ucm :added-by-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`: someterm : Nat - ``` ``` ucm foo/main> add ⍟ I've added these definitions: - - someterm : Nat + someterm : Nat ``` Now, the `release.draft` demo: @@ -42,18 +40,17 @@ foo/main> release.draft 1.2.3 😎 Great! I've created a draft release for you at /releases/drafts/1.2.3. - + You can create a `ReleaseNotes : Doc` in this branch to give an overview of the release. It'll automatically show up on Unison Share when you publish. - + When ready to release 1.2.3 to the world, `push` the release to Unison Share, navigate to the release, and click "Publish". - + Tip: if you get pulled away from drafting your release, you can always get back to it with `switch /releases/drafts/1.2.3`. - ``` It's an error to try to create a `releases/drafts/x.y.z` branch that already exists. @@ -63,5 +60,4 @@ foo/main> release.draft 1.2.3 foo/releases/drafts/1.2.3 already exists. You can switch to it with `switch foo/releases/drafts/1.2.3`. - ``` diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index 370f4851f3..54e23fb64c 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -8,21 +7,20 @@ def = "first value" ``` ``` ucm :added-by-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`: def : Text - ``` ``` ucm :hide scratch/main> update - ``` ``` unison :hide @@ -38,48 +36,43 @@ scratch/main> update updated... Done. - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #5vq851j3hg - + + Adds / updates: def - + ⊙ 2. #ujvq6e87kp - + + Adds / updates: def - - □ 3. #4bigcpnl7t (start of history) + □ 3. #4bigcpnl7t (start of history) scratch/main> reset 2 Done. - scratch/main> view def def : Text def = "first value" - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #ujvq6e87kp - + + Adds / updates: def - - □ 2. #4bigcpnl7t (start of history) + □ 2. #4bigcpnl7t (start of history) ``` Can reset to a value from reflog by number. @@ -90,46 +83,42 @@ scratch/main> reflog Below is a record of recent changes, you can use `reset #abcdef` to reset the current branch to a previous state. - + Tip: Use `diff.namespace 1 7` to compare between points in history. - + Branch Hash Description 1. scratch/main #ujvq6e87kp reset ujvq6e87kp4288eq3al9v5luctic0ocd7ug1fu0go5bicrr2vfnrb0... 2. scratch/main #5vq851j3hg update 3. scratch/main #ujvq6e87kp update 4. scratch/main #4bigcpnl7t builtins.merge 5. scratch/main #sg60bvjo91 Project Created - -- Reset the current branch to the first history element scratch/main> reset 2 Done. - scratch/main> view def def : Text def = "second value" - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #5vq851j3hg - + + Adds / updates: def - + ⊙ 2. #ujvq6e87kp - + + Adds / updates: def - - □ 3. #4bigcpnl7t (start of history) + □ 3. #4bigcpnl7t (start of history) ``` # reset branch @@ -139,11 +128,10 @@ foo/main> history Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #sg60bvjo91 (start of history) + + + □ 1. #sg60bvjo91 (start of history) ``` ``` unison :hide @@ -157,25 +145,21 @@ foo/main> update updated... Done. - foo/empty> reset /main: Done. - foo/empty> view a a : ##Nat a = 5 - foo/empty> history Note: The most recent namespace hash is immediately below this message. - - - - □ 1. #5l94rduvel (start of history) + + + □ 1. #5l94rduvel (start of history) ``` ## second argument is always interpreted as a branch @@ -191,22 +175,19 @@ foo/main> update updated... Done. - foo/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #0i64kpfccl - + + Adds / updates: main.a - - □ 2. #5l94rduvel (start of history) + □ 2. #5l94rduvel (start of history) foo/main> reset 2 main Done. - ``` diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index 589607a44b..863ce848b2 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -8,7 +8,6 @@ This transcript tests the errors printed to the user when a name cannot be resol scratch/main> builtins.merge lib.builtins Done. - ``` First we define differing types with the same name in different namespaces: @@ -22,31 +21,30 @@ two.ambiguousTerm = "term two" ``` ``` ucm :added-by-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 one.AmbiguousType type two.AmbiguousType one.ambiguousTerm : Text two.ambiguousTerm : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type one.AmbiguousType type two.AmbiguousType one.ambiguousTerm : Text two.ambiguousTerm : Text - ``` ## Tests @@ -74,9 +72,10 @@ separateAmbiguousTypeUsage _ = () ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. - + ❓ I couldn't resolve any of these symbols: @@ -97,8 +96,6 @@ separateAmbiguousTypeUsage _ = () two.AmbiguousType UnknownType No matches - - ``` Currently, ambiguous terms are caught and handled by type directed name resolution, @@ -109,19 +106,19 @@ useAmbiguousTerm = ambiguousTerm ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what ambiguousTerm refers to here: - + 1 | useAmbiguousTerm = ambiguousTerm - + The name ambiguousTerm is ambiguous. I couldn't narrow it down by type, as any type would work here. - + I found some terms in scope that have matching names and types. Maybe you meant one of these: - + one.ambiguousTerm : Text two.ambiguousTerm : Text - ``` diff --git a/unison-src/transcripts/rsa.output.md b/unison-src/transcripts/rsa.output.md index a97966bce9..cd07c425a3 100644 --- a/unison-src/transcripts/rsa.output.md +++ b/unison-src/transcripts/rsa.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -37,12 +36,13 @@ sigKo = match signature with ``` ``` ucm :added-by-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`: down : Bytes @@ -54,7 +54,7 @@ sigKo = match signature with sigOkay : Either Failure Boolean signature : Either Failure Bytes up : Bytes - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -62,13 +62,12 @@ sigKo = match signature with ⧩ Right 0xs84b02b6bb0e1196b65378cb12b727f7b4b38e5979f0632e8a51cfab088827f6d3da4221788029f75a0a5f4d740372cfa590462888a1189bbd9de9b084f26116640e611af5a1a17229beec7fb2570887181bbdced8f0ebfec6cad6bdd318a616ba4f01c90e1436efe44b18417d18ce712a0763be834f8c76e0c39b2119b061373 - + 29 | > sigOkay ⧩ Right true - + 30 | > sigKo ⧩ Right false - ``` diff --git a/unison-src/transcripts/scope-ref.output.md b/unison-src/transcripts/scope-ref.output.md index 4355968731..ac1972098d 100644 --- a/unison-src/transcripts/scope-ref.output.md +++ b/unison-src/transcripts/scope-ref.output.md @@ -2,7 +2,6 @@ A short script to test mutable references with local scope. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -19,21 +18,21 @@ test = Scope.run 'let ``` ``` ucm :added-by-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`: test : (Nat, Nat, Nat) - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 10 | > test ⧩ (1, 2, 5) - ``` diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 55d99ee748..ad8d1d3e69 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Any unique name suffix can be used to refer to a definition. For instance: @@ -24,10 +23,9 @@ This also affects commands like find. Notice lack of qualified names in output: scratch/main> add ⍟ I've added these definitions: - + foo.bar.a : Int optional.isNone : Optional a -> Boolean - scratch/main> find take 1. builtin.Bytes.take : Nat -> Bytes -> Bytes @@ -35,8 +33,6 @@ scratch/main> find take 3. builtin.Text.take : Nat -> Text -> Text 4. builtin.io2.MVar.take.impl : MVar a ->{IO} Either Failure a 5. builtin.io2.MVar.tryTake : MVar a ->{IO} Optional a - - ``` The `view` and `display` commands also benefit from this: @@ -45,11 +41,9 @@ The `view` and `display` commands also benefit from this: scratch/main> view List.drop builtin builtin.List.drop : builtin.Nat -> [a] -> [a] - scratch/main> display bar.a +99 - ``` In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. @@ -61,8 +55,6 @@ scratch/main> find : Nat -> [a] -> [a] 1. builtin.List.drop : Nat -> [a] -> [a] 2. builtin.List.take : Nat -> [a] -> [a] - - ``` ## Preferring names not in `lib.*.lib.*` @@ -77,31 +69,30 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ``` ucm :added-by-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`: cool.abra.cadabra : Text lib.distributed.abra.cadabra : Text lib.distributed.baz.qux : Text lib.distributed.lib.baz.qux : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + cool.abra.cadabra : Text lib.distributed.abra.cadabra : Text lib.distributed.baz.qux : Text lib.distributed.lib.baz.qux : Text - ``` ``` unison :error @@ -109,21 +100,21 @@ scratch/main> add ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I couldn't figure out what abra.cadabra refers to here: - + 1 | > abra.cadabra - + The name abra.cadabra is ambiguous. I couldn't narrow it down by type, as any type would work here. - + I found some terms in scope that have matching names and types. Maybe you meant one of these: - + cool.abra.cadabra : Text distributed.abra.cadabra : Text - ``` ``` unison @@ -131,19 +122,19 @@ scratch/main> add ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > baz.qux ⧩ "direct dependency 2" - ``` ``` ucm @@ -151,15 +142,13 @@ scratch/main> view abra.cadabra cool.abra.cadabra : Text cool.abra.cadabra = "my project" - + lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" - scratch/main> view baz.qux lib.distributed.baz.qux : Text lib.distributed.baz.qux = "direct dependency 2" - ``` Note that we can always still view indirect dependencies by using more name segments: @@ -169,11 +158,9 @@ scratch/main> view distributed.abra.cadabra lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" - scratch/main> names distributed.lib.baz.qux Term Hash: #nhup096n2s Names: lib.distributed.lib.baz.qux - ``` diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index 954a0c807f..ec032c8949 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -4,7 +4,6 @@ https://github.com/unisonweb/unison/issues/2786 ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` First we add a sum-type to the codebase. @@ -14,27 +13,26 @@ structural type X = x ``` ``` ucm :added-by-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 X (also named lib.builtins.Unit) - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type X (also named lib.builtins.Unit) - ``` Now we update the type, changing the name of the constructors, *but*, we simultaneously @@ -50,12 +48,13 @@ dependsOnX = Text.size X.x ``` ``` ucm :added-by-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.x : Text @@ -66,7 +65,6 @@ dependsOnX = Text.size X.x structural type X (The old definition is also named lib.builtins.Unit.) - ``` This update should succeed since the conflicted constructor @@ -76,13 +74,12 @@ is removed in the same update that the new term is being added. scratch/main> update.old ⍟ I've added these definitions: - + X.x : Text dependsOnX : Nat - + ⍟ I've updated these names to your new definition: - + structural type X (The old definition was also named lib.builtins.Unit.) - ``` diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index e9a036b6ca..4c8b6e1377 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -2,9 +2,7 @@ The `switch` command switches to an existing project or branch. ``` ucm :hide foo/main> builtins.merge - bar/main> builtins.merge - ``` Setup stuff. @@ -14,39 +12,36 @@ someterm = 18 ``` ``` ucm :added-by-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`: someterm : Nat - ``` ``` ucm foo/main> add ⍟ I've added these definitions: - - someterm : Nat + someterm : Nat foo/main> branch bar Done. I've created the bar branch based off of main. - + Tip: To merge your work back into the main branch, first `switch /main` then `merge /bar`. - foo/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`. - ``` Now, the demo. When unambiguous, `switch` switches to either a project or a branch in the current project. A branch in @@ -55,15 +50,10 @@ forward slash (which makes it unambiguous). ``` ucm scratch/main> switch foo - scratch/main> switch foo/topic - foo/main> switch topic - foo/main> switch /topic - foo/main> switch bar/ - ``` It's an error to try to switch to something ambiguous. @@ -73,12 +63,11 @@ foo/main> switch bar I'm not sure if you wanted to switch to the branch foo/bar or the project bar. Could you be more specific? - + 1. /bar (the branch bar in the current project) 2. bar/ (the project bar, with the branch left unspecified) - - Tip: use `switch 1` or `switch 2` to pick one of these. + Tip: use `switch 1` or `switch 2` to pick one of these. ``` It's an error to try to switch to something that doesn't exist, of course. @@ -87,7 +76,6 @@ It's an error to try to switch to something that doesn't exist, of course. scratch/main> switch foo/no-such-branch foo/no-such-branch does not exist. - ``` ``` ucm :error @@ -95,7 +83,6 @@ scratch/main> switch no-such-project Neither project no-such-project nor branch /no-such-project exists. - ``` ``` ucm :error @@ -103,5 +90,4 @@ foo/main> switch no-such-project-or-branch Neither project no-such-project-or-branch nor branch /no-such-project-or-branch exists. - ``` diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 3bf54aef2f..0a6336d99a 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -9,7 +9,6 @@ scratch/main> debug.tab-complete vi view view.global - scratch/main> debug.tab-complete delete. delete.branch @@ -21,7 +20,6 @@ scratch/main> debug.tab-complete delete. delete.type delete.type.verbose delete.verbose - ``` ## Tab complete terms & types @@ -36,12 +34,13 @@ unique type subnamespace.AType = A | B ``` ``` ucm :added-by-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 subnamespace.AType @@ -49,12 +48,10 @@ unique type subnamespace.AType = A | B subnamespace.someName : ##Nat subnamespace.someOtherName : ##Nat subnamespace2.thing : ##Nat - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -63,13 +60,11 @@ 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 scratch/main> debug.tab-complete view subnamespace subnamespace. subnamespace2. - -- Should complete things from child namespaces of the current query if it's dot-suffixed scratch/main> debug.tab-complete view subnamespace. @@ -77,23 +72,19 @@ scratch/main> debug.tab-complete view subnamespace. subnamespace.AType. * subnamespace.someName * subnamespace.someOtherName - -- Should complete things from child namespaces of the current query if there are no more completions at this level. scratch/main> debug.tab-complete view subnamespace2 subnamespace2. * subnamespace2.thing - -- Should prefix-filter by query suffix scratch/main> debug.tab-complete view subnamespace.some * subnamespace.someName * subnamespace.someOtherName - scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName - ``` ``` unison :hide @@ -104,14 +95,12 @@ absolute.term = "absolute" scratch/main> add ⍟ I've added these definitions: - - absolute.term : ##Text + absolute.term : ##Text -- Should tab complete absolute names scratch/main> debug.tab-complete view .absolute.te * .absolute.term - ``` ## Tab complete namespaces @@ -122,32 +111,26 @@ scratch/main> debug.tab-complete find-in sub subnamespace subnamespace2 - scratch/main> debug.tab-complete find-in subnamespace subnamespace subnamespace2 - scratch/main> debug.tab-complete find-in subnamespace. subnamespace.AType - scratch/main> debug.tab-complete io.test sub subnamespace. subnamespace2. - scratch/main> debug.tab-complete io.test subnamespace subnamespace. subnamespace2. - scratch/main> debug.tab-complete io.test subnamespace. subnamespace.AType. * subnamespace.someName * subnamespace.someOtherName - ``` Tab Complete Delete Subcommands @@ -159,36 +142,33 @@ add b = b ``` ``` ucm :added-by-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 add : a -> a - ``` ``` ucm scratch/main> update.old ⍟ I've added these definitions: - + type Foo add : a -> a - scratch/main> debug.tab-complete delete.type Foo * Foo Foo. - scratch/main> debug.tab-complete delete.term add * add - ``` ## Tab complete projects and branches @@ -197,18 +177,15 @@ scratch/main> debug.tab-complete delete.term add 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`. - myproject/main> debug.tab-complete branch.delete /mybr /mybranch - myproject/main> debug.tab-complete project.rename my myproject - ``` Commands which complete namespaces OR branches should list both @@ -218,27 +195,25 @@ mybranchsubnamespace.term = 1 ``` ``` ucm :added-by-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`: mybranchsubnamespace.term : ##Nat - ``` ``` ucm myproject/main> add ⍟ I've added these definitions: - - mybranchsubnamespace.term : ##Nat + mybranchsubnamespace.term : ##Nat myproject/main> debug.tab-complete merge mybr /mybranch - ``` diff --git a/unison-src/transcripts/tdnr.output.md b/unison-src/transcripts/tdnr.output.md index 84389f48b0..cbb138389b 100644 --- a/unison-src/transcripts/tdnr.output.md +++ b/unison-src/transcripts/tdnr.output.md @@ -2,7 +2,6 @@ TDNR selects local term (in file) that typechecks over local term (in file) that ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -12,30 +11,28 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: bad.foo : Text good.foo : Nat thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in file) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -43,25 +40,24 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - bad.foo : Text + bad.foo : Text ``` ``` unison @@ -70,29 +66,27 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: good.foo : Nat thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in file) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -100,25 +94,24 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - bad.foo : Text + bad.foo : Text ``` ``` unison @@ -128,12 +121,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: good.foo : Nat @@ -143,19 +137,16 @@ thing = foo Nat.+ foo new definition: bad.foo : Text - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in namespace) that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -163,25 +154,24 @@ good.foo = 17 ``` ``` ucm :added-by-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`: good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - good.foo : Nat + good.foo : Nat ``` ``` unison @@ -190,29 +180,27 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: bad.foo : Text thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in namespace) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -221,27 +209,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text good.foo : Nat - ``` ``` unison @@ -249,28 +236,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -279,27 +264,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text good.foo : Nat - ``` ``` unison @@ -308,12 +292,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -322,19 +307,16 @@ thing = foo Nat.+ foo new definition: bad.foo : Text - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (shadowing namespace) that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -342,25 +324,24 @@ good.foo = 17 ``` ``` ucm :added-by-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`: good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - good.foo : Nat + good.foo : Nat ``` ``` unison @@ -370,12 +351,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: bad.foo : Text @@ -385,19 +367,16 @@ thing = foo Nat.+ foo new definition: good.foo : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (shadowing namespace) that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -406,27 +385,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text good.foo : Nat - ``` ``` unison @@ -435,12 +413,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -449,19 +428,16 @@ thing = foo Nat.+ foo new definition: good.foo : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (shadowing namespace) that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -470,27 +446,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text good.foo : Nat - ``` ``` unison @@ -500,12 +475,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -515,12 +491,10 @@ thing = foo Nat.+ foo bad.foo : Text good.foo : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` \=== start local over direct dep @@ -529,7 +503,6 @@ TDNR selects local term (in file) that typechecks over direct dependency that do ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -537,25 +510,24 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-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`: lib.bad.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - lib.bad.foo : Text + lib.bad.foo : Text ``` ``` unison @@ -564,29 +536,27 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: good.foo : Nat thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (in namespace) that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -595,27 +565,26 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-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`: good.foo : Nat lib.bad.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + good.foo : Nat lib.bad.foo : Text - ``` ``` unison @@ -623,28 +592,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects local term (shadowing namespace) that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -653,27 +620,26 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-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`: good.foo : Nat lib.bad.foo : Text - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + good.foo : Nat lib.bad.foo : Text - ``` ``` unison @@ -682,12 +648,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -696,19 +663,16 @@ thing = foo Nat.+ foo new definition: good.foo : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR not used to select local term (in file) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -716,25 +680,24 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-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`: lib.dep.lib.dep.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - lib.dep.lib.dep.foo : Nat + lib.dep.lib.dep.foo : Nat ``` ``` unison @@ -743,29 +706,27 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: good.foo : Nat thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR not used to select local term (in namespace) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -774,27 +735,26 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-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`: good.foo : Nat lib.dep.lib.dep.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + good.foo : Nat lib.dep.lib.dep.foo : Nat - ``` ``` unison @@ -802,28 +762,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR not used to select local term (shadowing namespace) that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -832,27 +790,26 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-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`: good.foo : Nat lib.dep.lib.dep.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + good.foo : Nat lib.dep.lib.dep.foo : Nat - ``` ``` unison @@ -861,12 +818,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -875,19 +833,16 @@ thing = foo Nat.+ foo new definition: good.foo : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects direct dependency that typechecks over local term (in file) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -895,25 +850,24 @@ lib.good.foo = 17 ``` ``` ucm :added-by-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`: lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - lib.good.foo : Nat + lib.good.foo : Nat ``` ``` unison @@ -922,29 +876,27 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: bad.foo : Text thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects direct dependency that typechecks over local term (in namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -953,27 +905,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text lib.good.foo : Nat - ``` ``` unison @@ -981,28 +932,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects direct dependency that typechecks over local term (shadowing namespace) that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -1011,27 +960,26 @@ bad.foo = "bar" ``` ``` ucm :added-by-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`: bad.foo : Text lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bad.foo : Text lib.good.foo : Nat - ``` ``` unison @@ -1040,12 +988,13 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat @@ -1054,19 +1003,16 @@ thing = foo Nat.+ foo new definition: bad.foo : Text - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects direct dependency that typechecks over direct dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -1075,27 +1021,26 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-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`: lib.bad.foo : Text lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.bad.foo : Text lib.good.foo : Nat - ``` ``` unison @@ -1103,28 +1048,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR not used to select direct dependency that typechecks over indirect dependency that also typechecks. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -1133,27 +1076,26 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-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`: lib.dep.lib.dep.foo : Nat lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.dep.lib.dep.foo : Nat lib.good.foo : Nat - ``` ``` unison @@ -1161,28 +1103,26 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` TDNR selects indirect dependency that typechecks over indirect dependency that doesn't. ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -1191,27 +1131,26 @@ lib.dep.lib.bad.foo = "bar" ``` ``` ucm :added-by-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`: lib.dep.lib.bad.foo : Text lib.dep.lib.good.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lib.dep.lib.bad.foo : Text lib.dep.lib.good.foo : Nat - ``` ``` unison @@ -1219,19 +1158,18 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-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`: thing : Nat - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index 3ed4335ce0..202c8b4525 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -2,7 +2,6 @@ Merge builtins so we get enough names for the testing stuff. ``` ucm :hide scratch/main> builtins.merge - ``` The `test` command should run all of the tests in the current directory. @@ -16,22 +15,21 @@ foo.test2 = [Ok "test2"] ``` ``` ucm :added-by-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.test2 : [Result] test1 : [Result] - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -39,23 +37,18 @@ scratch/main> test ✅ - - - - New test results: - + 1. foo.test2 ◉ test2 2. test1 ◉ test1 - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` Tests should be cached if unchanged. @@ -64,14 +57,13 @@ Tests should be cached if unchanged. scratch/main> test Cached test results (`help testcache` to learn more) - + 1. foo.test2 ◉ test2 2. test1 ◉ test1 - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` `test` won't descend into the `lib` namespace, but `test.all` will. @@ -82,35 +74,33 @@ lib.dep.testInLib = [Ok "testInLib"] ``` ``` ucm :added-by-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`: lib.dep.testInLib : [Result] - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> test Cached test results (`help testcache` to learn more) - + 1. foo.test2 ◉ test2 2. test1 ◉ test1 - + ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. scratch/main> test.all @@ -123,18 +113,15 @@ scratch/main> test.all ✅ - - New test results: - + 1. lib.dep.testInLib ◉ testInLib - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` `test` WILL run tests within `lib` if specified explicitly. @@ -143,13 +130,12 @@ scratch/main> test.all scratch/main> test lib.dep Cached test results (`help testcache` to learn more) - + 1. lib.dep.testInLib ◉ testInLib - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 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. @@ -158,11 +144,10 @@ scratch/main> test lib.dep scratch/main> test foo Cached test results (`help testcache` to learn more) - + 1. foo.test2 ◉ test2 - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index db998f1095..1ecc7b517a 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` This transcript shows some syntax for raw text literals. @@ -37,17 +36,18 @@ lit2 = """" ``` ``` ucm :added-by-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`: lit1 : Text lit2 : Text - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. @@ -66,12 +66,12 @@ lit2 = """" Use an extra blank line if you'd like a trailing newline. Like so: """ - + 16 | > Some lit1 ⧩ Some "This is a raw text literal.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThe initial newline, if it exists, is ignored.\nThe last line, if it's just whitespace up to the closing quotes,\nis ignored.\n\nUse an extra blank line if you'd like a trailing newline. Like so:\n" - + 27 | > lit2 ⧩ """" @@ -82,22 +82,20 @@ lit2 = """" This doesn't terminate the literal - """ """" - + 28 | > Some lit2 ⧩ Some "This is a raw text literal, indented.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThis doesn't terminate the literal - \"\"\"" - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + lit1 : Text lit2 : Text - scratch/main> view lit1 lit2 lit1 : Text @@ -115,7 +113,7 @@ scratch/main> view lit1 lit2 Use an extra blank line if you'd like a trailing newline. Like so: """ - + lit2 : Text lit2 = """" @@ -126,5 +124,4 @@ scratch/main> view lit1 lit2 This doesn't terminate the literal - """ """" - ``` diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md index e3e17133d7..41c0d8ac54 100644 --- a/unison-src/transcripts/textfind.output.md +++ b/unison-src/transcripts/textfind.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` The `text.find` (or `grep`) command can be used to search for text or numeric literals appearing anywhere in your project. Just supply one or more tokens to search for. Unlike regular grep over the text of your code, this ignores local variables and function names that happen to match your search tokens (use `dependents` or `find` for that purpose). It's only searching for text or numeric literals that match. @@ -13,12 +12,11 @@ scratch/main> help grep text.find (or grep) `text.find token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. - + Numeric literals must be quoted (ex: "42") but single words need not be quoted. - - Use `text.find.all` to include search of `lib`. + Use `text.find.all` to include search of `lib`. ``` ``` ucm @@ -27,12 +25,11 @@ scratch/main> help text.find.all text.find.all (or grep.all) `text.find.all token1 "99" token2` finds terms with literals (text or numeric) containing `token1`, `99`, and `token2`. - + Numeric literals must be quoted (ex: "42") but single words need not be quoted. - - Use `text.find` to exclude `lib` from search. + Use `text.find` to exclude `lib` from search. ``` Here's an example: @@ -55,12 +52,13 @@ lib.bar = 3 ``` ``` ucm :added-by-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`: bar : Nat @@ -69,25 +67,22 @@ lib.bar = 3 lib.bar : Nat lib.foo : [Any] qux : Nat - ``` ``` ucm :hide scratch/main> add - ``` ``` ucm scratch/main> grep hi 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 bar : Nat @@ -95,29 +90,26 @@ scratch/main> view 1 "ooga" -> 99 "booga" -> 23 _ -> 0 - scratch/main> grep "hi" 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> text.find.all hi 🔎 - + These definitions from the current namespace have matches: - + 1. bar 2. lib.foo - + Tip: Try `edit 1` or `edit 1-2` to bring these into your scratch file. - scratch/main> view 1-5 bar : Nat @@ -125,20 +117,18 @@ scratch/main> view 1-5 "ooga" -> 99 "booga" -> 23 _ -> 0 - + lib.foo : [Any] lib.foo = [Any 46, Any "hi", Any "zoink"] - scratch/main> grep oog 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 bar : Nat @@ -146,52 +136,46 @@ scratch/main> view 1 "ooga" -> 99 "booga" -> 23 _ -> 0 - ``` ``` ucm scratch/main> grep quaffle 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. baz - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 baz : [Text] baz = ["an", "quaffle", "tres"] - scratch/main> text.find "interesting const" 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. foo - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 foo : Nat foo = _ = "an interesting constant" 1 - scratch/main> text.find "99" "23" 🔎 - + These definitions from the current namespace (excluding `lib`) have matches: - + 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 bar : Nat @@ -199,7 +183,6 @@ scratch/main> view 1 "ooga" -> 99 "booga" -> 23 _ -> 0 - ``` Now some failed searches: @@ -208,9 +191,8 @@ Now some failed searches: scratch/main> grep lsdkfjlskdjfsd 😶 I couldn't find any matches. - - Tip: `text.find.all` will search `lib` as well. + Tip: `text.find.all` will search `lib` as well. ``` Notice it gives the tip about `text.find.all`. But not here: @@ -219,5 +201,4 @@ Notice it gives the tip about `text.find.all`. But not here: scratch/main> grep.all lsdkfjlskdjfsd 😶 I couldn't find any matches. - ``` diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md index 82b22f84d1..b1db33c768 100644 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ b/unison-src/transcripts/todo-bug-builtins.output.md @@ -2,7 +2,6 @@ ``` ucm :hide 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. @@ -12,26 +11,26 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 💔💥 - + I've encountered a call to builtin.todo with the following value: - + "implement me later" - + Stack trace: todo #qe5e1lcfn8 - ``` ``` unison :error @@ -39,26 +38,26 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 💔💥 - + I've encountered a call to builtin.bug with the following value: - + "there's a bug in my code" - + Stack trace: bug #m67hcdcoda - ``` ## Todo @@ -70,16 +69,16 @@ complicatedMathStuff x = todo "Come back and to something with x here" ``` ``` ucm :added-by-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`: complicatedMathStuff : x -> r - ``` ## Bug @@ -93,14 +92,14 @@ test = match true with ``` ``` ucm :added-by-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`: test : Text - ``` diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index fdb0142df1..a985d1177b 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -6,7 +6,6 @@ When there's nothing to do, `todo` says this: scratch/main> todo You have no pending todo items. Good work! ✅ - ``` # Dependents of `todo` @@ -15,7 +14,6 @@ The `todo` command shows local (outside `lib`) terms that directly call `todo`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -27,38 +25,35 @@ bar = foo + foo ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - scratch/main> todo These terms call `todo`: - - 1. foo + 1. foo ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Direct dependencies without names @@ -68,7 +63,6 @@ the current namespace. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -77,50 +71,46 @@ baz = foo.bar + foo.bar ``` ``` ucm :added-by-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`: baz : Nat foo.bar : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + baz : Nat foo.bar : Nat - scratch/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 - scratch/main> todo These terms do not have any names in the current namespace: - - 1. #1jujb8oelv + 1. #1jujb8oelv ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Conflicted names @@ -129,7 +119,6 @@ The `todo` command shows conflicted names. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -138,48 +127,44 @@ bar = 17 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - scratch/main> debug.alias.term.force foo bar Done. - scratch/main> todo ❓ - + The term bar has conflicting definitions: - + 1. bar#14ibahkll6 2. bar#cq22mm4sca - + Tip: Use `move.term` or `delete.term` to resolve the conflicts. - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Definitions in lib @@ -188,7 +173,6 @@ The `todo` command complains about terms and types directly in `lib`. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -196,36 +180,33 @@ lib.foo = 16 ``` ``` ucm :added-by-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`: lib.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - lib.foo : Nat + lib.foo : Nat scratch/main> todo There's a type or term at the top level of the `lib` namespace, where I only expect to find subnamespaces representing library dependencies. Please move or remove it. - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Constructor aliases @@ -234,7 +215,6 @@ The `todo` command complains about constructor aliases. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -242,43 +222,39 @@ type Foo = One ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> alias.term Foo.One Foo.Two Done. - scratch/main> todo The type Foo has a constructor with multiple names. - + 1. Foo.One 2. Foo.Two - - Please delete all but one name for each constructor. + Please delete all but one name for each constructor. ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Missing constructor names @@ -287,7 +263,6 @@ The `todo` command complains about missing constructor names. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -295,44 +270,40 @@ type Foo = Bar ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> delete.term Foo.Bar Done. - scratch/main> todo These types have some constructors with missing names. - + 1. Foo - + You can use `view 1` and `alias.term .` to give names to each unnamed constructor. - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Nested decl aliases @@ -341,7 +312,6 @@ The `todo` command complains about nested decl aliases. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -350,40 +320,37 @@ structural type Foo.inner.Bar a = Uno a | Dos a a ``` ``` ucm :added-by-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 Foo a structural type Foo.inner.Bar a - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type Foo a structural type Foo.inner.Bar a - scratch/main> todo These types are aliases, but one is nested under the other. Please separate them or delete one copy. - + 1. Foo 2. Foo.inner.Bar - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` # Stray constructors @@ -392,7 +359,6 @@ The `todo` command complains about stray constructors. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins - ``` ``` unison @@ -400,42 +366,38 @@ type Foo = Bar ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> alias.term Foo.Bar Baz Done. - scratch/main> todo These constructors are not nested beneath their corresponding type names: - + 1. Baz - + For each one, please either use `move` to move if, or if it's an extra copy, you can simply `delete` it. - ``` ``` ucm :hide scratch/main> delete.project scratch - ``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 73ecbfbeac..9e7b49520d 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -2,7 +2,6 @@ A simple transcript to test the use of exceptions that bubble to the top level. ``` ucm :hide scratch/main> builtins.merge - ``` FYI, here are the `Exception` and `Failure` types: @@ -12,10 +11,9 @@ scratch/main> view Exception Failure structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x - + type builtin.io2.Failure = Failure Type Text Any - ``` Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: @@ -31,41 +29,38 @@ mytest _ = [Ok "Great"] ``` ``` ucm :added-by-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`: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] - ``` ``` ucm scratch/main> run main () - scratch/main> add ⍟ I've added these definitions: - + main : '{IO, Exception} () mytest : '{IO, Exception} [Result] - scratch/main> io.test mytest New test results: - + 1. mytest ◉ Great - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` Now a test to show the handling of uncaught exceptions: @@ -81,30 +76,29 @@ unique type RuntimeError = ``` ``` ucm :added-by-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 RuntimeError error : Text -> a ->{Exception} x main2 : '{Exception} r - ``` ``` ucm :error scratch/main> run main2 💔💥 - + The program halted with an unhandled exception: - + Failure (typeLink RuntimeError) "oh noes!" (Any ()) - + Stack trace: ##raise - ``` diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md index 0127d05cab..147db1caf7 100644 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ b/unison-src/transcripts/transcript-parser-commands.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` The transcript parser is meant to parse `ucm` and `unison` blocks. @@ -12,25 +11,24 @@ x = 1 ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - x : Nat + x : Nat ``` ``` unison :hide:error :scratch.u @@ -41,20 +39,18 @@ z scratch/main> delete foo ⚠️ - + The following names were not found in the codebase. Check your spelling. foo - ``` ``` ucm :error scratch/main> delete lineToken.call ⚠️ - + The following names were not found in the codebase. Check your spelling. lineToken.call - ``` However handling of blocks of other languages should be supported. diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index 8f45a5b84b..f30039d736 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -4,7 +4,6 @@ https://github.com/unisonweb/unison/pull/2821 ``` ucm :hide scratch/main> builtins.merge - ``` Define a type. @@ -15,7 +14,6 @@ structural type Y = Y ``` ucm :hide scratch/main> add - ``` Now, we update `Y`, and add a new type `Z` which depends on it. @@ -26,12 +24,13 @@ structural type Y = Y Nat ``` ``` ucm :added-by-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 Z @@ -41,7 +40,6 @@ structural type Y = Y Nat structural type Y (The old definition is also named builtin.Unit.) - ``` Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. @@ -50,19 +48,17 @@ Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked scratch/main> add x These definitions failed: - + Reason needs update structural type Y blocked structural type Z - - Tip: Use `help filestatus` to learn more. + Tip: Use `help filestatus` to learn more. -- This shouldn't exist, because it should've been blocked. scratch/main> view Z ⚠️ - + The following names were not found in the codebase. Check your spelling. Z - ``` diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md index 7adbbd15a0..4d2459a147 100644 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. @@ -18,12 +17,13 @@ structural ability MyAbilityS where const : a ``` ``` ucm :added-by-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 Abc @@ -33,5 +33,4 @@ structural ability MyAbilityS where const : a ability MyAbility structural ability MyAbilityS ability MyAbilityU - ``` diff --git a/unison-src/transcripts/undo.output.md b/unison-src/transcripts/undo.output.md index 542daa3b95..42d5854e74 100644 --- a/unison-src/transcripts/undo.output.md +++ b/unison-src/transcripts/undo.output.md @@ -10,35 +10,30 @@ x = 1 scratch/main> builtins.merge lib.builtins Done. - scratch/main> add ⍟ I've added these definitions: - - x : Nat + x : Nat scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/main> alias.term x y Done. - scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #nmem6r6no1 - + + Adds / updates: y @@ -47,42 +42,38 @@ scratch/main> history Original name New name(s) x y - + ⊙ 2. #3rqf1hbev7 - + + Adds / updates: x - - □ 3. #ms9lggs2rg (start of history) + □ 3. #ms9lggs2rg (start of history) scratch/main> undo Here are the changes I undid - + Name changes: - + Original Changes 1. x 2. y (added) - scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/main> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #3rqf1hbev7 - + + Adds / updates: x - - □ 2. #ms9lggs2rg (start of history) + □ 2. #ms9lggs2rg (start of history) ``` ----- @@ -97,35 +88,30 @@ x = 1 scratch/branch1> builtins.merge lib.builtins Done. - scratch/branch1> add ⍟ I've added these definitions: - - x : Nat + x : Nat scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/branch1> alias.term x y Done. - scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) - scratch/branch1> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #nmem6r6no1 - + + Adds / updates: y @@ -134,51 +120,45 @@ scratch/branch1> history Original name New name(s) x y - + ⊙ 2. #3rqf1hbev7 - + + Adds / updates: x - - □ 3. #ms9lggs2rg (start of history) + □ 3. #ms9lggs2rg (start of history) -- Make some changes on an unrelated branch scratch/branch2> builtins.merge lib.builtins Done. - scratch/branch2> delete.namespace lib Done. - scratch/branch1> undo Here are the changes I undid - + Name changes: - + Original Changes 1. x 2. y (added) - scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) - scratch/branch1> history Note: The most recent namespace hash is immediately below this message. - + ⊙ 1. #3rqf1hbev7 - + + Adds / updates: x - - □ 2. #ms9lggs2rg (start of history) + □ 2. #ms9lggs2rg (start of history) ``` ----- @@ -189,13 +169,11 @@ Undo should be a no-op on a newly created branch scratch/main> branch.create-empty new Done. I've created an empty branch scratch/new. - - Tip: Use `merge /somebranch` to initialize this branch. + Tip: Use `merge /somebranch` to initialize this branch. scratch/new> undo ⚠️ - - Nothing more to undo. + Nothing more to undo. ``` diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index abd2d44a8d..c1014c5546 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -9,29 +9,28 @@ unique type C = C B ``` ``` ucm :added-by-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 A type B type C - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type A type B type C - ``` ``` unison @@ -42,11 +41,11 @@ unique type C = C B ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - ``` If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. @@ -57,11 +56,10 @@ scratch/main> names A Type Hash: #uj8oalgadr Names: A - + Term Hash: #uj8oalgadr#0 Names: A.A - ``` ``` unison @@ -69,17 +67,17 @@ unique type A = A () ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type A - ``` ``` ucm @@ -89,17 +87,15 @@ scratch/main> update updated... Done. - scratch/main> names A Type Hash: #ufo5tuc7ho Names: A - + Term Hash: #ufo5tuc7ho#0 Names: A.A - ``` ``` unison @@ -107,17 +103,17 @@ unique type A = A ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type A - ``` Note that `A` is back to its original hash. @@ -129,15 +125,13 @@ scratch/main> update updated... Done. - scratch/main> names A Type Hash: #uj8oalgadr Names: A - + Term Hash: #uj8oalgadr#0 Names: A.A - ``` diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 234ca32f89..287736fb2a 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -3,37 +3,31 @@ ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - `()`.foo : ##Text + `()`.foo : ##Text scratch/main> find 1. `()`.foo : ##Text - - scratch/main> find-in `()` 1. foo : ##Text - - scratch/main> delete.namespace `()` Done. - ``` diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index a6fcf7d0d4..23c1c618bc 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -3,7 +3,6 @@ cases exist for built-in types. Just making sure they don't crash. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -16,31 +15,29 @@ threadEyeDeez _ = ``` ``` ucm :added-by-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 A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) - scratch/main> run threadEyeDeez (false, true) - ``` ``` unison @@ -51,29 +48,29 @@ scratch/main> run threadEyeDeez ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > typeLink A == typeLink A ⧩ true - + 2 | > typeLink Text == typeLink Text ⧩ true - + 3 | > typeLink Text == typeLink A ⧩ false - + 4 | > termLink threadEyeDeez == termLink threadEyeDeez ⧩ true - ``` diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index 248a9a3b87..db2aaa7460 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -17,42 +16,38 @@ main _ = ``` ``` ucm :added-by-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`: f : 'Nat fc : '{IO, Exception} Nat main : '{IO, Exception} [Result] - ``` ``` ucm scratch/main> find unsafe.coerceAbilities 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b - - scratch/main> add ⍟ I've added these definitions: - + f : 'Nat fc : '{IO, Exception} Nat main : '{IO, Exception} [Result] - scratch/main> io.test main New test results: - + 1. main ◉ - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index 068751c86f..31032b48c7 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -4,7 +4,6 @@ one's own code if the "lib" namespace is simply ignored. ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison @@ -13,27 +12,26 @@ lib.foo = 100 ``` ``` ucm :added-by-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 : Nat lib.foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + foo : Nat lib.foo : Nat - ``` ``` unison @@ -41,18 +39,18 @@ foo = 200 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat (The old definition is also named lib.foo.) - ``` ``` ucm @@ -62,11 +60,9 @@ scratch/main> update updated... Done. - scratch/main> names foo Term Hash: #9ntnotdp87 Names: foo - ``` diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 075f0d7d51..078f2cfdda 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -4,7 +4,6 @@ Conflicted definitions prevent `update` from succeeding. ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` ``` unison @@ -13,35 +12,32 @@ temp = 2 ``` ``` ucm :added-by-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`: temp : Nat x : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + temp : Nat x : Nat - scratch/main> debug.alias.term.force temp x Done. - scratch/main> delete.term temp Done. - ``` ``` unison @@ -49,17 +45,17 @@ x = 3 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: x : Nat - ``` ``` ucm :error @@ -68,5 +64,4 @@ scratch/main> update This branch has more than one term with the name `x`. Please delete or rename all but one of them, then try the update again. - ``` diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md index cca076ded2..8edef4df26 100644 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ b/unison-src/transcripts/update-suffixifies-properly.output.md @@ -1,6 +1,5 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin - ``` ``` unison @@ -13,12 +12,13 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm :added-by-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.x.x.x.x : Nat @@ -27,21 +27,19 @@ bar = a.x.x.x.x + c.y.y.y.y c.y.y.y.y : Nat d.y.y.y.y : Nat foo : Nat - ``` ``` ucm myproject/main> add ⍟ I've added these definitions: - + a.x.x.x.x : Nat b.x.x.x.x : Nat bar : Nat c.y.y.y.y : Nat d.y.y.y.y : Nat foo : Nat - ``` ``` unison @@ -49,17 +47,17 @@ foo = +30 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Int - ``` ``` ucm :error @@ -73,7 +71,6 @@ myproject/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u 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 33363f22da..e8b3d4ef9f 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 @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,27 +13,26 @@ bar = 5 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - ``` ``` unison @@ -46,12 +44,13 @@ bar = 7 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: @@ -59,7 +58,6 @@ bar = 7 (The old definition is also named foo.) foo : Nat (The old definition is also named bar.) - ``` ``` ucm @@ -69,13 +67,11 @@ scratch/main> update updated... Done. - scratch/main> view foo bar bar : Nat bar = 7 - + foo : Nat foo = 6 - ``` 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 88b4665ced..ee2d0d88af 100644 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ b/unison-src/transcripts/update-term-to-different-type.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -11,25 +10,24 @@ foo = 5 ``` ``` ucm :added-by-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 : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - foo : Nat + foo : Nat ``` ``` unison @@ -38,17 +36,17 @@ foo = +5 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Int - ``` ``` ucm @@ -58,10 +56,8 @@ scratch/main> update updated... Done. - scratch/main> view foo foo : Int foo = +5 - ``` diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index 57e28e0dd9..a13bfd8150 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,27 +13,26 @@ bar = 5 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - ``` ``` unison @@ -43,18 +41,18 @@ foo = 6 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat (The old definition is also named bar.) - ``` ``` ucm @@ -64,13 +62,11 @@ scratch/main> update updated... Done. - scratch/main> view foo bar bar : Nat bar = 5 - + foo : Nat foo = 6 - ``` 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 76a2a6dd64..e590bc1b04 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 @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,27 +13,26 @@ bar = foo + 10 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - ``` ``` unison @@ -43,17 +41,17 @@ foo = +5 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Int - ``` ``` ucm :error @@ -67,7 +65,6 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/update-term-with-dependent.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index 3a704ecafb..aba7ad6b70 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -14,27 +13,26 @@ bar = foo + 10 ``` ``` ucm :added-by-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`: bar : Nat foo : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + bar : Nat foo : Nat - ``` ``` unison @@ -43,17 +41,17 @@ foo = 6 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat - ``` ``` ucm @@ -67,12 +65,10 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view bar bar : Nat bar = use Nat + foo + 10 - ``` diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index f74e6fe586..753eab2cf0 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -11,25 +10,24 @@ foo = 5 ``` ``` ucm :added-by-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 : Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - foo : Nat + foo : Nat ``` ``` unison @@ -38,17 +36,17 @@ foo = 6 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat - ``` ``` ucm @@ -58,10 +56,8 @@ scratch/main> update updated... Done. - scratch/main> view foo foo : Nat foo = 6 - ``` 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 9625b5af3c..21965f8a19 100644 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ b/unison-src/transcripts/update-test-to-non-test.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.merge Done. - ``` ``` unison @@ -10,22 +9,22 @@ test> foo = [] ``` ``` ucm :added-by-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 : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | test> foo = [] - ``` After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) @@ -34,14 +33,12 @@ After adding the test `foo`, we expect `view` to render it like a test. (Bug: It scratch/main> add ⍟ I've added these definitions: - - foo : [Result] + foo : [Result] scratch/main> view foo foo : [Result] foo = [] - ``` ``` unison @@ -49,17 +46,17 @@ foo = 1 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : Nat - ``` After updating `foo` to not be a test, we expect `view` to not render it like a test. @@ -71,10 +68,8 @@ scratch/main> update updated... Done. - scratch/main> view foo foo : Nat foo = 1 - ``` diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index 617fb0efbe..0c3cac7aaa 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge - ``` Given a test that depends on another definition, @@ -17,10 +16,9 @@ test> mynamespace.foo.test = scratch/main> add ⍟ I've added these definitions: - + foo : Nat -> Nat mynamespace.foo.test : [Result] - ``` if we change the type of the dependency, the test should show in the scratch file as a test watch. @@ -30,17 +28,17 @@ foo n = "hello, world!" ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: foo : n -> Text - ``` ``` ucm :error @@ -54,7 +52,6 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index baa0adf2f7..6ca215cd51 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -9,25 +8,24 @@ unique type Foo ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo ``` ``` unison @@ -37,17 +35,17 @@ unique type Foo ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -57,11 +55,9 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = Bar Nat | Baz Nat Nat - scratch/main> find.verbose 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog @@ -73,6 +69,4 @@ scratch/main> find.verbose 3. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#1 Foo.Baz : Nat -> Nat -> Foo - - ``` diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 116143e4fe..6cfe366468 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,25 +7,24 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo ``` ``` unison @@ -34,17 +32,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -54,11 +52,9 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = Bar Nat Nat - scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g @@ -67,6 +63,4 @@ scratch/main> find.verbose 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> 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 9a80bab106..4527bc19bb 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtins - ``` ``` unison @@ -8,19 +7,19 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-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 Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` ``` ucm @@ -30,9 +29,7 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = { bar : Nat } - ``` 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 23fa6982a6..bef52e1367 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,31 +7,30 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-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 Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` ``` unison @@ -40,12 +38,13 @@ unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm :added-by-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.baz : Foo -> Int @@ -59,7 +58,6 @@ unique type Foo = { bar : Nat, baz : Int } Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` ``` ucm @@ -69,11 +67,9 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = { bar : Nat, baz : Int } - scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 @@ -100,6 +96,4 @@ scratch/main> find.verbose 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 Foo.Foo : Nat -> Int -> Foo - - ``` diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 7970e3b926..564977360d 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,29 +7,27 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> alias.term Foo.Bar Foo.BarAlias Done. - ``` ``` unison @@ -38,31 +35,30 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error scratch/main> update Sorry, I wasn't able to perform the update: - + The type Foo has a constructor with multiple names, and I can't perform an update in this situation: - + * Foo.Bar * Foo.BarAlias - + Please delete all but one name for each constructor, and then try updating again. - ``` 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 4d6fe306be..d267239d61 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 @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -15,27 +14,26 @@ foo = cases ``` ``` ucm :added-by-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 foo : Foo -> Nat - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo foo : Foo -> Nat - ``` ``` unison @@ -44,17 +42,17 @@ unique type Foo ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error @@ -68,7 +66,6 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index e259f2a6c6..1d3f8ab182 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -10,25 +9,24 @@ unique type Foo ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo ``` ``` unison @@ -37,17 +35,17 @@ unique type Foo ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -57,11 +55,9 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = Bar Nat - scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 @@ -70,6 +66,4 @@ scratch/main> find.verbose 2. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 Foo.Bar : Nat -> Foo - - ``` 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 5ee6051f1a..418d886e24 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,12 +7,13 @@ unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm :added-by-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 @@ -23,14 +23,13 @@ unique type Foo = { bar : Nat, baz : Int } Foo.baz : Foo -> Int Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo Foo.baz.set : Int -> Foo -> Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo @@ -38,7 +37,6 @@ scratch/main> add Foo.baz : Foo -> Int Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo Foo.baz.set : Int -> Foo -> Foo - ``` ``` unison @@ -46,12 +44,13 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: @@ -59,7 +58,6 @@ unique type Foo = { bar : Nat } Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` We want the field accessors to go away; but for now they are here, causing the update to fail. @@ -75,11 +73,9 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - scratch/main> view Foo type Foo = { bar : Nat, baz : Int } - scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 @@ -106,8 +102,6 @@ scratch/main> find.verbose 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 Foo.Foo : Nat -> Int -> Foo - - ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index 56fcb8b8ce..20f9b77371 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,29 +7,27 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> delete.term Foo.Bar Done. - ``` Now we've set up a situation where the original constructor missing. @@ -40,33 +37,31 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error scratch/main> view Foo type Foo = #b509v3eg4k#0 Nat - scratch/main> update Sorry, I wasn't able to perform the update: - + The type Foo has some constructors with missing names, and I can't perform an update in this situation. - + You can use `view Foo` and `alias.term Foo.` to give names to each unnamed constructor, and then try the update again. - ``` 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 743a3bb8c0..b6cdaacd02 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -11,29 +10,28 @@ structural type A = B.TheOtherAlias Foo ``` ``` ucm :added-by-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 A structural type A.B type Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + structural type A structural type A.B type Foo - ``` ``` unison @@ -41,17 +39,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error @@ -61,5 +59,4 @@ scratch/main> update update when a type exists nested under an alias of itself. Please separate them or delete one copy, and then try updating again. - ``` 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 4ab1a1af3e..c810b32965 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,31 +7,30 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-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 Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo - ``` Bug: this no-op update should (of course) succeed. @@ -44,5 +42,4 @@ scratch/main> update updated... Done. - ``` 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 bb941f3ef9..dc9e4bf2f8 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,29 +7,27 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> alias.term Foo.Bar Stray.BarAlias Done. - ``` ``` unison @@ -38,17 +35,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error @@ -57,10 +54,9 @@ scratch/main> update Sorry, I wasn't able to perform the update, because I need all constructor names to be nested somewhere beneath the corresponding type name. - + The constructor Stray.BarAlias is not nested beneath the corresponding type name. Please either use `move` to move it, or if it's an extra copy, you can simply `delete` it. Then try the update again. - ``` diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index 338b769122..9af0c8065d 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,29 +7,27 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo scratch/main> move.term Foo.Bar Stray.Bar Done. - ``` Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. @@ -40,17 +37,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` 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. @@ -59,16 +56,14 @@ Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) scratch/main> view Foo type Foo = Stray.Bar Nat - scratch/main> update Sorry, I wasn't able to perform the update: - + The type Foo has some constructors with missing names, and I can't perform an update in this situation. - + You can use `view Foo` and `alias.term Foo.` to give names to each unnamed constructor, and then try the update again. - ``` 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 0e47648e1f..0808ba0660 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 @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -11,27 +10,26 @@ makeFoo n = Bar (n+10) ``` ``` ucm :added-by-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 makeFoo : Nat -> Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo makeFoo : Nat -> Foo - ``` ``` unison @@ -42,18 +40,18 @@ Foo.Bar n = internal.Bar n ``` ``` ucm :added-by-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: - + ⊡ Previously added definitions will be ignored: Foo ⍟ These new definitions are ok to `add`: Foo.Bar : Nat -> Foo - ``` ``` ucm @@ -67,11 +65,9 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view Foo type Foo = internal.Bar Nat - scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 @@ -86,6 +82,4 @@ scratch/main> find.verbose 4. -- #204frdcl0iid1ujkkfbkc6b3v7cgqp56h1q3duc46i5md6qb4m6am1fqbceb335u87l05gkdnaa7fjn4alj1diukgme63e41lh072l8 makeFoo : Nat -> Foo - - ``` 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 2ec99d8b5d..7c4574a088 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 @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -8,25 +7,24 @@ unique type Foo = Nat ``` ``` ucm :added-by-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 scratch/main> add ⍟ I've added these definitions: - - type Foo + type Foo ``` ``` unison @@ -34,12 +32,13 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-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.bar : Foo -> Nat @@ -50,7 +49,6 @@ unique type Foo = { bar : Nat } new definition: type Foo - ``` ``` ucm @@ -60,11 +58,9 @@ scratch/main> update updated... Done. - scratch/main> view Foo type Foo = { bar : Nat } - scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 @@ -82,6 +78,4 @@ scratch/main> find.verbose 5. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 Foo.Foo : Nat -> Foo - - ``` 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 115c871b2e..c56e884d6c 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -11,27 +10,26 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ``` ucm :added-by-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 incrFoo : Foo -> Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Foo incrFoo : Foo -> Foo - ``` ``` unison @@ -39,17 +37,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm :error @@ -63,7 +61,6 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u 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 5ff560bae8..c8d569aa01 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 @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -9,27 +8,26 @@ unique type Baz = Qux Foo ``` ``` ucm :added-by-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 Baz type Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Baz type Foo - ``` ``` unison @@ -37,17 +35,17 @@ unique type Foo a = Bar Nat a ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo a - ``` ``` ucm :error @@ -61,7 +59,6 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. - ``` ``` unison :added-by-ucm scratch.u 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 fed7c02ade..9fe59c9183 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -1,6 +1,5 @@ ``` ucm :hide scratch/main> builtins.merge lib.builtin - ``` ``` unison @@ -9,27 +8,26 @@ unique type Baz = Qux Foo ``` ``` ucm :added-by-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 Baz type Foo - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - + type Baz type Foo - ``` ``` unison @@ -37,17 +35,17 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: type Foo - ``` ``` ucm @@ -61,15 +59,12 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. - scratch/main> view Foo type Foo = Bar Nat Nat - scratch/main> view Baz type Baz = Qux Foo - scratch/main> find.verbose 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 @@ -84,6 +79,4 @@ scratch/main> find.verbose 4. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo - - ``` diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index 3de295bdcb..9024cc741a 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -3,19 +3,19 @@ ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > 1 ⧩ 1 - ``` ``` ucm @@ -25,5 +25,4 @@ scratch/main> update updated... Done. - ``` diff --git a/unison-src/transcripts/upgrade-happy-path.output.md b/unison-src/transcripts/upgrade-happy-path.output.md index 65c8727c83..7d92085582 100644 --- a/unison-src/transcripts/upgrade-happy-path.output.md +++ b/unison-src/transcripts/upgrade-happy-path.output.md @@ -1,6 +1,5 @@ ``` ucm :hide proj/main> builtins.merge lib.builtin - ``` ``` unison @@ -10,29 +9,28 @@ thingy = lib.old.foo + 10 ``` ``` ucm :added-by-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`: lib.new.foo : Nat lib.old.foo : Nat thingy : Nat - ``` ``` ucm proj/main> add ⍟ I've added these definitions: - + lib.new.foo : Nat lib.old.foo : Nat thingy : Nat - ``` Test tab completion and fzf options of upgrade command. @@ -41,38 +39,32 @@ Test tab completion and fzf options of upgrade command. proj/main> debug.tab-complete upgrade ol old - proj/main> debug.fuzzy-options upgrade _ Select a dependency to upgrade: * builtin * new * old - proj/main> debug.fuzzy-options upgrade old _ Select a dependency to upgrade to: * builtin * new * old - ``` ``` ucm proj/main> upgrade old new I upgraded old to new, and removed old. - proj/main> ls lib 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) - proj/main> view thingy thingy : Nat thingy = use Nat + foo + 10 - ``` diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md index 1d3fc282cc..128079cdb4 100644 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ b/unison-src/transcripts/upgrade-sad-path.output.md @@ -1,6 +1,5 @@ ``` ucm :hide proj/main> builtins.merge lib.builtin - ``` ``` unison @@ -10,29 +9,28 @@ thingy = lib.old.foo + 10 ``` ``` ucm :added-by-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`: lib.new.foo : Int lib.old.foo : Nat thingy : Nat - ``` ``` ucm proj/main> add ⍟ I've added these definitions: - + lib.new.foo : Int lib.old.foo : Nat thingy : Nat - ``` ``` ucm :error @@ -41,19 +39,18 @@ proj/main> upgrade old new I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. - + When you're done, you can run - + upgrade.commit - + to merge your changes back into main and delete the temporary branch. Or, if you decide to cancel the upgrade instead, you can run - + delete.branch /upgrade-old-to-new - - to delete the temporary branch and switch back to main. + to delete the temporary branch and switch back to main. ``` ``` unison :added-by-ucm scratch.u @@ -70,17 +67,17 @@ thingy = foo + +10 ``` ``` ucm :added-by-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 names already exist. You can `update` them to your new definition: thingy : Int - ``` ``` ucm @@ -90,26 +87,21 @@ proj/upgrade-old-to-new> update updated... Done. - proj/upgrade-old-to-new> upgrade.commit I fast-forward merged proj/upgrade-old-to-new into proj/main. - proj/main> view thingy thingy : Int thingy = use Int + foo + +10 - proj/main> ls lib 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) - proj/main> branches Branch Remote branch 1. main - ``` diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md index 38ed75aaf2..17272a8510 100644 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ b/unison-src/transcripts/upgrade-suffixifies-properly.output.md @@ -1,6 +1,5 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin - ``` ``` unison @@ -14,12 +13,13 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm :added-by-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.x.x.x.x : Nat @@ -29,14 +29,13 @@ bar = a.x.x.x.x + c.y.y.y.y d.y.y.y.y : Nat lib.new.foo : Int lib.old.foo : Nat - ``` ``` ucm myproject/main> add ⍟ I've added these definitions: - + a.x.x.x.x : Nat b.x.x.x.x : Nat bar : Nat @@ -44,7 +43,6 @@ myproject/main> add d.y.y.y.y : Nat lib.new.foo : Int lib.old.foo : Nat - ``` ``` ucm :error @@ -53,19 +51,18 @@ myproject/main> upgrade old new I couldn't automatically upgrade old to new. However, I've added the definitions that need attention to the top of scratch.u. - + When you're done, you can run - + upgrade.commit - + to merge your changes back into main and delete the temporary branch. Or, if you decide to cancel the upgrade instead, you can run - + delete.branch /upgrade-old-to-new - - to delete the temporary branch and switch back to main. + to delete the temporary branch and switch back to main. ``` ``` unison :added-by-ucm scratch.u diff --git a/unison-src/transcripts/upgrade-with-old-alias.output.md b/unison-src/transcripts/upgrade-with-old-alias.output.md index d512eea624..d635a912f0 100644 --- a/unison-src/transcripts/upgrade-with-old-alias.output.md +++ b/unison-src/transcripts/upgrade-with-old-alias.output.md @@ -1,6 +1,5 @@ ``` ucm :hide myproject/main> builtins.merge lib.builtin - ``` ``` unison @@ -11,19 +10,19 @@ mything = lib.old.foo + 100 ``` ``` ucm :added-by-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`: bar : Nat lib.new.foo : Nat lib.old.foo : Nat mything : Nat - ``` ``` ucm @@ -33,21 +32,17 @@ myproject/main> update updated... Done. - myproject/main> upgrade old new I upgraded old to new, and removed old. - myproject/main> view mything mything : Nat mything = use Nat + foo + 100 - myproject/main> view bar bar : Nat bar = 141 - ``` diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md index a285626959..b84c8c9427 100644 --- a/unison-src/transcripts/view.output.md +++ b/unison-src/transcripts/view.output.md @@ -2,7 +2,6 @@ ``` ucm :hide scratch/main> builtins.merge - ``` ``` unison :hide @@ -12,7 +11,6 @@ b.thing = "b" ``` ucm :hide scratch/main> add - ``` ``` ucm @@ -21,16 +19,14 @@ scratch/main> view thing a.thing : Text a.thing = "a" - + b.thing : Text b.thing = "b" - -- Should support absolute paths scratch/main> view .b.thing .b.thing : Text .b.thing = "b" - ``` TODO: swap this back to a 'ucm' block when view.global is re-implemented diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 9d39d34d2b..b1f9869ccf 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -2,7 +2,6 @@ scratch/main> builtins.mergeio Done. - ``` ``` unison @@ -10,32 +9,31 @@ test> pass = [Ok "Passed"] ``` ``` ucm :added-by-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`: pass : [Result] - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | test> pass = [Ok "Passed"] ✅ Passed Passed - ``` ``` ucm scratch/main> add ⍟ I've added these definitions: - - pass : [Result] + pass : [Result] ``` ``` unison @@ -43,35 +41,33 @@ test> pass = [Ok "Passed"] ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This file has been previously added to the codebase. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | test> pass = [Ok "Passed"] ✅ Passed Passed (cached) - ``` ``` ucm scratch/main> add ⊡ Ignored previously added definitions: pass - scratch/main> test Cached test results (`help testcache` to learn more) - + 1. pass ◉ Passed - + ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ``` unison @@ -80,21 +76,21 @@ scratch/main> test ``` ``` ucm :added-by-ucm + Loading changes detected in scratch.u. ✅ - + scratch.u changed. - + Now evaluating any watch expressions (lines starting with `>`)... Ctrl+C cancels. 1 | > ImmutableArray.fromList [?a, ?b, ?c] ⧩ ImmutableArray.fromList [?a, ?b, ?c] - + 2 | > ImmutableByteArray.fromBytes 0xs123456 ⧩ fromBytes 0xs123456 - ``` From cf0f3e25658153d6cafae7a6f513db5849cffe69 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 11:58:31 -0600 Subject: [PATCH 07/15] Add idempotent transcript tests --- unison-cli/transcripts/Transcripts.hs | 12 +- unison-src/transcripts/abilities.output.md | 45 - ...ability-order-doesnt-affect-hash.output.md | 47 - ...ability-term-conflicts-on-update.output.md | 233 - unison-src/transcripts/add-run.output.md | 307 -- .../add-test-watch-roundtrip.output.md | 23 - .../transcripts/addupdatemessages.output.md | 156 - unison-src/transcripts/alias-term.output.md | 45 - unison-src/transcripts/alias-type.output.md | 45 - unison-src/transcripts/anf-tests.output.md | 58 - unison-src/transcripts/any-extract.output.md | 47 - .../transcripts/api-doc-rendering.output.md | 951 ---- unison-src/transcripts/api-find.output.md | 255 - .../transcripts/api-getDefinition.output.md | 526 -- .../api-list-projects-branches.output.md | 65 - .../api-namespace-details.output.md | 85 - .../transcripts/api-namespace-list.output.md | 138 - .../transcripts/api-summaries.output.md | 838 --- .../block-on-required-update.output.md | 71 - unison-src/transcripts/blocks.output.md | 365 -- .../boolean-op-pretty-print-2819.output.md | 39 - .../transcripts/branch-command.output.md | 164 - .../branch-relative-path.output.md | 86 - unison-src/transcripts/bug-fix-4354.output.md | 26 - .../transcripts/bug-strange-closure.output.md | 4522 ----------------- .../transcripts/builtins-merge.output.md | 89 - unison-src/transcripts/builtins.output.md | 616 --- .../transcripts/bytesFromList.output.md | 25 - unison-src/transcripts/check763.output.md | 37 - unison-src/transcripts/check873.output.md | 47 - .../constructor-applied-to-unit.output.md | 60 - .../transcripts/contrabilities.output.md | 21 - .../transcripts/create-author.output.md | 22 - .../transcripts/cycle-update-1.output.md | 79 - .../transcripts/cycle-update-2.output.md | 77 - .../transcripts/cycle-update-3.output.md | 72 - .../transcripts/cycle-update-4.output.md | 91 - .../transcripts/debug-definitions.output.md | 150 - .../transcripts/debug-name-diffs.output.md | 104 - unison-src/transcripts/deep-names.output.md | 100 - .../transcripts/definition-diff-api.output.md | 3598 ------------- ...elete-namespace-dependents-check.output.md | 62 - .../transcripts/delete-namespace.output.md | 124 - .../delete-project-branch.output.md | 65 - .../transcripts/delete-project.output.md | 58 - .../transcripts/delete-silent.output.md | 31 - unison-src/transcripts/delete.output.md | 414 -- ...ependents-dependencies-debugfile.output.md | 115 - .../transcripts/destructuring-binds.output.md | 177 - .../transcripts/diff-namespace.output.md | 548 -- .../transcripts/doc-formatting.output.md | 591 --- .../doc-type-link-keywords.output.md | 49 - unison-src/transcripts/doc1.output.md | 161 - unison-src/transcripts/doc2.output.md | 220 - unison-src/transcripts/doc2markdown.output.md | 203 - ...t-upgrade-refs-that-exist-in-old.output.md | 49 - .../transcripts/duplicate-names.output.md | 141 - .../duplicate-term-detection.output.md | 105 - unison-src/transcripts/ed25519.output.md | 56 - unison-src/transcripts/edit-command.output.md | 75 - .../transcripts/edit-namespace.output.md | 150 - .../transcripts/empty-namespaces.output.md | 149 - .../transcripts/emptyCodebase.output.md | 38 - .../transcripts/error-messages.output.md | 391 -- .../transcripts/escape-sequences.output.md | 29 - unison-src/transcripts/find-by-type.output.md | 51 - unison-src/transcripts/find-command.output.md | 91 - .../fix-1381-excess-propagate.output.md | 55 - .../fix-2258-if-as-list-element.output.md | 65 - unison-src/transcripts/fix-5267.output.md | 82 - unison-src/transcripts/fix-5301.output.md | 61 - unison-src/transcripts/fix-5312.output.md | 75 - unison-src/transcripts/fix-5320.output.md | 27 - unison-src/transcripts/fix-5323.output.md | 53 - unison-src/transcripts/fix-5326.output.md | 233 - unison-src/transcripts/fix-5340.output.md | 81 - unison-src/transcripts/fix-5357.output.md | 85 - unison-src/transcripts/fix-5369.output.md | 62 - unison-src/transcripts/fix-5374.output.md | 60 - unison-src/transcripts/fix-5380.output.md | 50 - .../transcripts/fix-big-list-crash.output.md | 27 - unison-src/transcripts/fix-ls.output.md | 41 - unison-src/transcripts/fix1063.output.md | 42 - unison-src/transcripts/fix1327.output.md | 47 - unison-src/transcripts/fix1334.output.md | 14 - unison-src/transcripts/fix1390.output.md | 66 - unison-src/transcripts/fix1421.output.md | 27 - unison-src/transcripts/fix1532.output.md | 87 - unison-src/transcripts/fix1696.output.md | 30 - unison-src/transcripts/fix1709.output.md | 50 - unison-src/transcripts/fix1731.output.md | 34 - unison-src/transcripts/fix1800.output.md | 108 - unison-src/transcripts/fix1844.output.md | 33 - unison-src/transcripts/fix1926.output.md | 57 - unison-src/transcripts/fix2026.output.md | 74 - unison-src/transcripts/fix2027.output.md | 97 - unison-src/transcripts/fix2049.output.md | 145 - unison-src/transcripts/fix2053.output.md | 15 - unison-src/transcripts/fix2156.output.md | 33 - unison-src/transcripts/fix2167.output.md | 43 - unison-src/transcripts/fix2187.output.md | 32 - unison-src/transcripts/fix2231.output.md | 52 - unison-src/transcripts/fix2238.output.md | 32 - unison-src/transcripts/fix2244.output.md | 24 - unison-src/transcripts/fix2254.output.md | 221 - unison-src/transcripts/fix2268.output.md | 35 - unison-src/transcripts/fix2334.output.md | 51 - unison-src/transcripts/fix2344.output.md | 35 - unison-src/transcripts/fix2350.output.md | 43 - unison-src/transcripts/fix2353.output.md | 31 - unison-src/transcripts/fix2354.output.md | 30 - unison-src/transcripts/fix2355.output.md | 43 - unison-src/transcripts/fix2378.output.md | 63 - unison-src/transcripts/fix2423.output.md | 51 - unison-src/transcripts/fix2474.output.md | 53 - unison-src/transcripts/fix2628.output.md | 27 - unison-src/transcripts/fix2663.output.md | 46 - unison-src/transcripts/fix2693.output.md | 4078 --------------- unison-src/transcripts/fix2712.output.md | 59 - unison-src/transcripts/fix2795.output.md | 28 - unison-src/transcripts/fix2822.output.md | 144 - unison-src/transcripts/fix2826.output.md | 64 - unison-src/transcripts/fix2970.output.md | 25 - unison-src/transcripts/fix3037.output.md | 65 - unison-src/transcripts/fix3171.output.md | 38 - unison-src/transcripts/fix3196.output.md | 60 - unison-src/transcripts/fix3215.output.md | 35 - unison-src/transcripts/fix3244.output.md | 41 - unison-src/transcripts/fix3265.output.md | 93 - unison-src/transcripts/fix3424.output.md | 47 - unison-src/transcripts/fix3634.output.md | 45 - unison-src/transcripts/fix3678.output.md | 33 - unison-src/transcripts/fix3752.output.md | 35 - unison-src/transcripts/fix3773.output.md | 32 - unison-src/transcripts/fix3977.output.md | 45 - unison-src/transcripts/fix4172.output.md | 98 - unison-src/transcripts/fix4280.output.md | 26 - unison-src/transcripts/fix4397.output.md | 19 - unison-src/transcripts/fix4415.output.md | 18 - unison-src/transcripts/fix4424.output.md | 42 - unison-src/transcripts/fix4482.output.md | 65 - unison-src/transcripts/fix4498.output.md | 43 - unison-src/transcripts/fix4515.output.md | 71 - unison-src/transcripts/fix4528.output.md | 36 - unison-src/transcripts/fix4556.output.md | 68 - unison-src/transcripts/fix4592.output.md | 21 - unison-src/transcripts/fix4618.output.md | 63 - unison-src/transcripts/fix4711.output.md | 58 - unison-src/transcripts/fix4722.output.md | 62 - unison-src/transcripts/fix4731.output.md | 97 - unison-src/transcripts/fix4780.output.md | 26 - unison-src/transcripts/fix4898.output.md | 49 - unison-src/transcripts/fix5055.output.md | 44 - unison-src/transcripts/fix5076.output.md | 25 - unison-src/transcripts/fix5080.output.md | 68 - unison-src/transcripts/fix5141.output.md | 5 - unison-src/transcripts/fix5168.output.md | 18 - unison-src/transcripts/fix5349.output.md | 80 - unison-src/transcripts/fix614.output.md | 127 - unison-src/transcripts/fix689.output.md | 26 - unison-src/transcripts/fix693.output.md | 136 - unison-src/transcripts/fix845.output.md | 154 - unison-src/transcripts/fix849.output.md | 31 - unison-src/transcripts/fix942.output.md | 126 - unison-src/transcripts/fix987.output.md | 72 - unison-src/transcripts/formatter.output.md | 208 - .../transcripts/fuzzy-options.output.md | 76 - .../generic-parse-errors.output.md | 145 - unison-src/transcripts/help.output.md | 1008 ---- unison-src/transcripts/higher-rank.output.md | 157 - .../transcripts/{ => idempotent}/abilities.md | 0 .../ability-order-doesnt-affect-hash.md | 0 .../ability-term-conflicts-on-update.md | 0 .../transcripts/{ => idempotent}/add-run.md | 0 .../add-test-watch-roundtrip.md | 0 .../{ => idempotent}/addupdatemessages.md | 0 .../{ => idempotent}/alias-term.md | 0 .../{ => idempotent}/alias-type.md | 0 .../transcripts/{ => idempotent}/anf-tests.md | 0 .../{ => idempotent}/any-extract.md | 0 .../{ => idempotent}/api-doc-rendering.md | 0 .../transcripts/{ => idempotent}/api-find.md | 0 .../{ => idempotent}/api-getDefinition.md | 0 .../api-list-projects-branches.md | 0 .../{ => idempotent}/api-namespace-details.md | 0 .../{ => idempotent}/api-namespace-list.md | 0 .../{ => idempotent}/api-summaries.md | 0 .../block-on-required-update.md | 0 .../transcripts/{ => idempotent}/blocks.md | 0 .../boolean-op-pretty-print-2819.md | 0 .../{ => idempotent}/branch-command.md | 0 .../{ => idempotent}/branch-relative-path.md | 0 .../{ => idempotent}/bug-fix-4354.md | 0 .../{ => idempotent}/bug-strange-closure.md | 0 .../{ => idempotent}/builtins-merge.md | 0 .../transcripts/{ => idempotent}/builtins.md | 0 .../{ => idempotent}/bytesFromList.md | 0 .../transcripts/{ => idempotent}/check763.md | 0 .../transcripts/{ => idempotent}/check873.md | 0 .../constructor-applied-to-unit.md | 0 .../{ => idempotent}/contrabilities.md | 0 .../{ => idempotent}/create-author.md | 0 .../{ => idempotent}/cycle-update-1.md | 0 .../{ => idempotent}/cycle-update-2.md | 0 .../{ => idempotent}/cycle-update-3.md | 0 .../{ => idempotent}/cycle-update-4.md | 0 .../{ => idempotent}/debug-definitions.md | 0 .../{ => idempotent}/debug-name-diffs.md | 0 .../{ => idempotent}/deep-names.md | 0 .../{ => idempotent}/definition-diff-api.md | 0 .../delete-namespace-dependents-check.md | 0 .../{ => idempotent}/delete-namespace.md | 0 .../{ => idempotent}/delete-project-branch.md | 0 .../{ => idempotent}/delete-project.md | 0 .../{ => idempotent}/delete-silent.md | 0 .../transcripts/{ => idempotent}/delete.md | 0 .../dependents-dependencies-debugfile.md | 0 .../{ => idempotent}/destructuring-binds.md | 0 .../{ => idempotent}/diff-namespace.md | 0 .../{ => idempotent}/doc-formatting.md | 0 .../doc-type-link-keywords.md | 0 .../transcripts/{ => idempotent}/doc1.md | 0 .../transcripts/{ => idempotent}/doc2.md | 0 .../{ => idempotent}/doc2markdown.md | 0 .../dont-upgrade-refs-that-exist-in-old.md | 0 .../{ => idempotent}/duplicate-names.md | 0 .../duplicate-term-detection.md | 0 .../transcripts/{ => idempotent}/ed25519.md | 0 .../{ => idempotent}/edit-command.md | 0 .../{ => idempotent}/edit-namespace.md | 0 .../{ => idempotent}/empty-namespaces.md | 0 .../{ => idempotent}/emptyCodebase.md | 0 .../{ => idempotent}/error-messages.md | 0 .../{ => idempotent}/escape-sequences.md | 0 .../{ => idempotent}/find-by-type.md | 0 .../{ => idempotent}/find-command.md | 0 .../fix-1381-excess-propagate.md | 0 .../fix-2258-if-as-list-element.md | 0 .../transcripts/{ => idempotent}/fix-5267.md | 0 .../transcripts/{ => idempotent}/fix-5301.md | 0 .../transcripts/{ => idempotent}/fix-5312.md | 0 .../transcripts/{ => idempotent}/fix-5320.md | 0 .../transcripts/{ => idempotent}/fix-5323.md | 0 .../transcripts/{ => idempotent}/fix-5326.md | 0 .../transcripts/{ => idempotent}/fix-5340.md | 0 .../transcripts/{ => idempotent}/fix-5357.md | 0 .../transcripts/{ => idempotent}/fix-5369.md | 0 .../transcripts/{ => idempotent}/fix-5374.md | 0 .../transcripts/{ => idempotent}/fix-5380.md | 0 .../{ => idempotent}/fix-big-list-crash.md | 0 .../transcripts/{ => idempotent}/fix-ls.md | 0 .../transcripts/{ => idempotent}/fix1063.md | 0 .../transcripts/{ => idempotent}/fix1327.md | 0 .../transcripts/{ => idempotent}/fix1334.md | 0 .../transcripts/{ => idempotent}/fix1390.md | 0 .../transcripts/{ => idempotent}/fix1421.md | 0 .../transcripts/{ => idempotent}/fix1532.md | 0 .../transcripts/{ => idempotent}/fix1696.md | 0 .../transcripts/{ => idempotent}/fix1709.md | 0 .../transcripts/{ => idempotent}/fix1731.md | 0 .../transcripts/{ => idempotent}/fix1800.md | 0 .../transcripts/{ => idempotent}/fix1844.md | 0 .../transcripts/{ => idempotent}/fix1926.md | 0 .../transcripts/{ => idempotent}/fix2026.md | 0 .../transcripts/{ => idempotent}/fix2027.md | 0 .../transcripts/{ => idempotent}/fix2049.md | 0 .../transcripts/{ => idempotent}/fix2053.md | 0 .../transcripts/{ => idempotent}/fix2156.md | 0 .../transcripts/{ => idempotent}/fix2167.md | 0 .../transcripts/{ => idempotent}/fix2187.md | 0 .../transcripts/{ => idempotent}/fix2231.md | 0 .../transcripts/{ => idempotent}/fix2238.md | 0 .../transcripts/{ => idempotent}/fix2238.u | 0 .../transcripts/{ => idempotent}/fix2244.md | 0 .../transcripts/{ => idempotent}/fix2244.u | 0 .../transcripts/{ => idempotent}/fix2254.md | 0 .../transcripts/{ => idempotent}/fix2268.md | 0 .../transcripts/{ => idempotent}/fix2334.md | 0 .../transcripts/{ => idempotent}/fix2344.md | 0 .../transcripts/{ => idempotent}/fix2350.md | 0 .../transcripts/{ => idempotent}/fix2353.md | 0 .../transcripts/{ => idempotent}/fix2354.md | 0 .../transcripts/{ => idempotent}/fix2355.md | 0 .../transcripts/{ => idempotent}/fix2378.md | 0 .../transcripts/{ => idempotent}/fix2423.md | 0 .../transcripts/{ => idempotent}/fix2474.md | 0 .../transcripts/{ => idempotent}/fix2628.md | 0 .../transcripts/{ => idempotent}/fix2663.md | 0 .../transcripts/{ => idempotent}/fix2693.md | 0 .../transcripts/{ => idempotent}/fix2712.md | 0 .../transcripts/{ => idempotent}/fix2795.md | 0 .../{ => idempotent}/fix2795/docs.u | 0 .../transcripts/{ => idempotent}/fix2822.md | 0 .../transcripts/{ => idempotent}/fix2826.md | 0 .../transcripts/{ => idempotent}/fix2970.md | 0 .../transcripts/{ => idempotent}/fix3037.md | 0 .../transcripts/{ => idempotent}/fix3171.md | 0 .../transcripts/{ => idempotent}/fix3196.md | 0 .../transcripts/{ => idempotent}/fix3215.md | 0 .../transcripts/{ => idempotent}/fix3244.md | 0 .../transcripts/{ => idempotent}/fix3265.md | 0 .../transcripts/{ => idempotent}/fix3424.md | 0 .../transcripts/{ => idempotent}/fix3634.md | 0 .../transcripts/{ => idempotent}/fix3678.md | 0 .../transcripts/{ => idempotent}/fix3752.md | 0 .../transcripts/{ => idempotent}/fix3773.md | 0 .../transcripts/{ => idempotent}/fix3977.md | 0 .../transcripts/{ => idempotent}/fix4172.md | 0 .../transcripts/{ => idempotent}/fix4280.md | 0 .../transcripts/{ => idempotent}/fix4397.md | 0 .../transcripts/{ => idempotent}/fix4415.md | 0 .../transcripts/{ => idempotent}/fix4424.md | 0 .../transcripts/{ => idempotent}/fix4482.md | 0 .../transcripts/{ => idempotent}/fix4498.md | 0 .../transcripts/{ => idempotent}/fix4515.md | 0 .../transcripts/{ => idempotent}/fix4528.md | 0 .../transcripts/{ => idempotent}/fix4556.md | 0 .../transcripts/{ => idempotent}/fix4592.md | 0 .../transcripts/{ => idempotent}/fix4618.md | 0 .../transcripts/{ => idempotent}/fix4711.md | 0 .../transcripts/{ => idempotent}/fix4722.md | 0 .../transcripts/{ => idempotent}/fix4731.md | 0 .../transcripts/{ => idempotent}/fix4780.md | 0 .../transcripts/{ => idempotent}/fix4898.md | 0 .../transcripts/{ => idempotent}/fix5055.md | 0 .../transcripts/{ => idempotent}/fix5076.md | 0 .../transcripts/{ => idempotent}/fix5080.md | 0 .../transcripts/{ => idempotent}/fix5141.md | 0 .../transcripts/{ => idempotent}/fix5168.md | 0 .../transcripts/{ => idempotent}/fix5349.md | 0 .../transcripts/{ => idempotent}/fix614.md | 0 .../transcripts/{ => idempotent}/fix689.md | 0 .../transcripts/{ => idempotent}/fix693.md | 0 .../transcripts/{ => idempotent}/fix845.md | 0 .../transcripts/{ => idempotent}/fix849.md | 0 .../transcripts/{ => idempotent}/fix942.md | 0 .../transcripts/{ => idempotent}/fix987.md | 0 .../transcripts/{ => idempotent}/formatter.md | 0 .../{ => idempotent}/fuzzy-options.md | 0 .../{ => idempotent}/generic-parse-errors.md | 0 .../transcripts/{ => idempotent}/help.md | 0 .../{ => idempotent}/higher-rank.md | 0 .../{ => idempotent}/input-parse-errors.md | 0 .../{ => idempotent}/io-test-command.md | 0 unison-src/transcripts/{ => idempotent}/io.md | 0 .../{ => idempotent}/keyword-identifiers.md | 0 .../{ => idempotent}/kind-inference.md | 0 .../{ => idempotent}/lambdacase.md | 0 .../{ => idempotent}/lsp-fold-ranges.md | 0 .../{ => idempotent}/lsp-name-completion.md | 0 .../transcripts/{ => idempotent}/move-all.md | 0 .../{ => idempotent}/move-namespace.md | 0 .../{ => idempotent}/name-resolution.md | 0 .../{ => idempotent}/name-segment-escape.md | 0 .../{ => idempotent}/name-selection.md | 0 .../transcripts/{ => idempotent}/names.md | 0 .../namespace-deletion-regression.md | 0 .../namespace-dependencies.md | 0 .../{ => idempotent}/namespace-directive.md | 0 .../{ => idempotent}/numbered-args.md | 0 .../{ => idempotent}/old-fold-right.md | 0 .../pattern-match-coverage.md | 0 .../pattern-pretty-print-2345.md | 0 .../{ => idempotent}/patternMatchTls.md | 0 .../transcripts/{ => idempotent}/patterns.md | 0 .../transcripts/{ => idempotent}/propagate.md | 0 .../{ => idempotent}/pull-errors.md | 0 .../transcripts/{ => idempotent}/records.md | 0 .../transcripts/{ => idempotent}/reflog.md | 0 .../{ => idempotent}/release-draft-command.md | 0 .../transcripts/{ => idempotent}/reset.md | 0 .../{ => idempotent}/resolution-failures.md | 0 .../transcripts/{ => idempotent}/rsa.md | 0 .../transcripts/{ => idempotent}/scope-ref.md | 0 .../transcripts/{ => idempotent}/suffixes.md | 0 .../sum-type-update-conflicts.md | 0 .../{ => idempotent}/switch-command.md | 0 .../{ => idempotent}/tab-completion.md | 0 .../transcripts/{ => idempotent}/tdnr.md | 0 .../{ => idempotent}/test-command.md | 0 .../{ => idempotent}/text-literals.md | 0 .../transcripts/{ => idempotent}/textfind.md | 0 .../{ => idempotent}/todo-bug-builtins.md | 0 .../transcripts/{ => idempotent}/todo.md | 0 .../{ => idempotent}/top-level-exceptions.md | 0 .../transcript-parser-commands.md | 0 .../transcripts/{ => idempotent}/type-deps.md | 0 .../type-modifier-are-optional.md | 0 .../transcripts/{ => idempotent}/undo.md | 0 .../{ => idempotent}/unique-type-churn.md | 0 .../{ => idempotent}/unitnamespace.md | 0 .../{ => idempotent}/universal-cmp.md | 0 .../{ => idempotent}/unsafe-coerce.md | 0 .../update-ignores-lib-namespace.md | 0 .../{ => idempotent}/update-on-conflict.md | 0 .../update-suffixifies-properly.md | 0 .../update-term-aliases-in-different-ways.md | 0 .../update-term-to-different-type.md | 0 .../update-term-with-alias.md | 0 ...e-term-with-dependent-to-different-type.md | 0 .../update-term-with-dependent.md | 0 .../{ => idempotent}/update-term.md | 0 .../update-test-to-non-test.md | 0 .../update-test-watch-roundtrip.md | 0 .../update-type-add-constructor.md | 0 .../{ => idempotent}/update-type-add-field.md | 0 .../update-type-add-new-record.md | 0 .../update-type-add-record-field.md | 0 .../update-type-constructor-alias.md | 0 ...-type-delete-constructor-with-dependent.md | 0 .../update-type-delete-constructor.md | 0 .../update-type-delete-record-field.md | 0 .../update-type-missing-constructor.md | 0 .../update-type-nested-decl-aliases.md | 0 .../update-type-no-op-record.md | 0 .../update-type-stray-constructor-alias.md | 0 .../update-type-stray-constructor.md | 0 ...turn-constructor-into-smart-constructor.md | 0 ...update-type-turn-non-record-into-record.md | 0 .../update-type-with-dependent-term.md | 0 ...e-with-dependent-type-to-different-kind.md | 0 .../update-type-with-dependent-type.md | 0 .../{ => idempotent}/update-watch.md | 0 .../{ => idempotent}/upgrade-happy-path.md | 0 .../{ => idempotent}/upgrade-sad-path.md | 0 .../upgrade-suffixifies-properly.md | 0 .../upgrade-with-old-alias.md | 0 .../transcripts/{ => idempotent}/view.md | 0 .../{ => idempotent}/watch-expressions.md | 0 .../transcripts/input-parse-errors.output.md | 209 - .../transcripts/io-test-command.output.md | 80 - unison-src/transcripts/io.output.md | 714 --- .../transcripts/keyword-identifiers.output.md | 271 - .../transcripts/kind-inference.output.md | 364 -- unison-src/transcripts/lambdacase.output.md | 244 - .../transcripts/lsp-fold-ranges.output.md | 57 - .../transcripts/lsp-name-completion.output.md | 46 - unison-src/transcripts/move-all.output.md | 198 - .../transcripts/move-namespace.output.md | 362 -- .../transcripts/name-resolution.output.md | 452 -- .../transcripts/name-segment-escape.output.md | 35 - .../transcripts/name-selection.output.md | 197 - unison-src/transcripts/names.output.md | 106 - .../namespace-deletion-regression.output.md | 26 - .../namespace-dependencies.output.md | 31 - .../transcripts/namespace-directive.output.md | 200 - .../transcripts/numbered-args.output.md | 161 - .../transcripts/old-fold-right.output.md | 30 - .../pattern-match-coverage.output.md | 1343 ----- .../pattern-pretty-print-2345.output.md | 193 - .../transcripts/patternMatchTls.output.md | 51 - unison-src/transcripts/patterns.output.md | 36 - unison-src/transcripts/propagate.output.md | 176 - unison-src/transcripts/pull-errors.output.md | 39 - unison-src/transcripts/records.output.md | 205 - unison-src/transcripts/redundant.output.md | 45 - unison-src/transcripts/reflog.output.md | 134 - .../release-draft-command.output.md | 63 - unison-src/transcripts/reset.output.md | 193 - .../transcripts/resolution-failures.output.md | 124 - unison-src/transcripts/rsa.output.md | 73 - unison-src/transcripts/scope-ref.output.md | 38 - unison-src/transcripts/suffixes.output.md | 166 - .../sum-type-update-conflicts.output.md | 85 - .../transcripts/switch-command.output.md | 93 - .../transcripts/tab-completion.output.md | 219 - unison-src/transcripts/tdnr.output.md | 1175 ----- unison-src/transcripts/test-command.output.md | 153 - .../transcripts/text-literals.output.md | 127 - unison-src/transcripts/textfind.output.md | 204 - .../transcripts/todo-bug-builtins.output.md | 105 - unison-src/transcripts/todo.output.md | 403 -- .../top-level-exceptions.output.md | 104 - .../transcript-parser-commands.output.md | 68 - unison-src/transcripts/type-deps.output.md | 64 - .../type-modifier-are-optional.output.md | 36 - unison-src/transcripts/undo.output.md | 179 - .../transcripts/unique-type-churn.output.md | 137 - .../transcripts/unitnamespace.output.md | 33 - .../transcripts/universal-cmp.output.md | 76 - .../transcripts/unsafe-coerce.output.md | 53 - .../update-ignores-lib-namespace.output.md | 68 - .../transcripts/update-on-conflict.output.md | 67 - .../update-suffixifies-properly.output.md | 97 - ...e-term-aliases-in-different-ways.output.md | 77 - .../update-term-to-different-type.output.md | 63 - .../update-term-with-alias.output.md | 72 - ...with-dependent-to-different-type.output.md | 82 - .../update-term-with-dependent.output.md | 74 - unison-src/transcripts/update-term.output.md | 63 - .../update-test-to-non-test.output.md | 75 - .../update-test-watch-roundtrip.output.md | 67 - .../update-type-add-constructor.output.md | 72 - .../update-type-add-field.output.md | 66 - .../update-type-add-new-record.output.md | 35 - .../update-type-add-record-field.output.md | 99 - .../update-type-constructor-alias.output.md | 64 - ...elete-constructor-with-dependent.output.md | 82 - .../update-type-delete-constructor.output.md | 69 - .../update-type-delete-record-field.output.md | 122 - .../update-type-missing-constructor.output.md | 67 - .../update-type-nested-decl-aliases.output.md | 62 - .../update-type-no-op-record.output.md | 45 - ...ate-type-stray-constructor-alias.output.md | 62 - .../update-type-stray-constructor.output.md | 69 - ...nstructor-into-smart-constructor.output.md | 85 - ...type-turn-non-record-into-record.output.md | 81 - .../update-type-with-dependent-term.output.md | 75 - ...dependent-type-to-different-kind.output.md | 72 - .../update-type-with-dependent-type.output.md | 82 - unison-src/transcripts/update-watch.output.md | 28 - .../transcripts/upgrade-happy-path.output.md | 70 - .../transcripts/upgrade-sad-path.output.md | 107 - .../upgrade-suffixifies-properly.output.md | 83 - .../upgrade-with-old-alias.output.md | 48 - unison-src/transcripts/view.output.md | 39 - .../transcripts/watch-expressions.output.md | 96 - 517 files changed, 7 insertions(+), 42297 deletions(-) delete mode 100644 unison-src/transcripts/abilities.output.md delete mode 100644 unison-src/transcripts/ability-order-doesnt-affect-hash.output.md delete mode 100644 unison-src/transcripts/ability-term-conflicts-on-update.output.md delete mode 100644 unison-src/transcripts/add-run.output.md delete mode 100644 unison-src/transcripts/add-test-watch-roundtrip.output.md delete mode 100644 unison-src/transcripts/addupdatemessages.output.md delete mode 100644 unison-src/transcripts/alias-term.output.md delete mode 100644 unison-src/transcripts/alias-type.output.md delete mode 100644 unison-src/transcripts/anf-tests.output.md delete mode 100644 unison-src/transcripts/any-extract.output.md delete mode 100644 unison-src/transcripts/api-doc-rendering.output.md delete mode 100644 unison-src/transcripts/api-find.output.md delete mode 100644 unison-src/transcripts/api-getDefinition.output.md delete mode 100644 unison-src/transcripts/api-list-projects-branches.output.md delete mode 100644 unison-src/transcripts/api-namespace-details.output.md delete mode 100644 unison-src/transcripts/api-namespace-list.output.md delete mode 100644 unison-src/transcripts/api-summaries.output.md delete mode 100644 unison-src/transcripts/block-on-required-update.output.md delete mode 100644 unison-src/transcripts/blocks.output.md delete mode 100644 unison-src/transcripts/boolean-op-pretty-print-2819.output.md delete mode 100644 unison-src/transcripts/branch-command.output.md delete mode 100644 unison-src/transcripts/branch-relative-path.output.md delete mode 100644 unison-src/transcripts/bug-fix-4354.output.md delete mode 100644 unison-src/transcripts/bug-strange-closure.output.md delete mode 100644 unison-src/transcripts/builtins-merge.output.md delete mode 100644 unison-src/transcripts/builtins.output.md delete mode 100644 unison-src/transcripts/bytesFromList.output.md delete mode 100644 unison-src/transcripts/check763.output.md delete mode 100644 unison-src/transcripts/check873.output.md delete mode 100644 unison-src/transcripts/constructor-applied-to-unit.output.md delete mode 100644 unison-src/transcripts/contrabilities.output.md delete mode 100644 unison-src/transcripts/create-author.output.md delete mode 100644 unison-src/transcripts/cycle-update-1.output.md delete mode 100644 unison-src/transcripts/cycle-update-2.output.md delete mode 100644 unison-src/transcripts/cycle-update-3.output.md delete mode 100644 unison-src/transcripts/cycle-update-4.output.md delete mode 100644 unison-src/transcripts/debug-definitions.output.md delete mode 100644 unison-src/transcripts/debug-name-diffs.output.md delete mode 100644 unison-src/transcripts/deep-names.output.md delete mode 100644 unison-src/transcripts/definition-diff-api.output.md delete mode 100644 unison-src/transcripts/delete-namespace-dependents-check.output.md delete mode 100644 unison-src/transcripts/delete-namespace.output.md delete mode 100644 unison-src/transcripts/delete-project-branch.output.md delete mode 100644 unison-src/transcripts/delete-project.output.md delete mode 100644 unison-src/transcripts/delete-silent.output.md delete mode 100644 unison-src/transcripts/delete.output.md delete mode 100644 unison-src/transcripts/dependents-dependencies-debugfile.output.md delete mode 100644 unison-src/transcripts/destructuring-binds.output.md delete mode 100644 unison-src/transcripts/diff-namespace.output.md delete mode 100644 unison-src/transcripts/doc-formatting.output.md delete mode 100644 unison-src/transcripts/doc-type-link-keywords.output.md delete mode 100644 unison-src/transcripts/doc1.output.md delete mode 100644 unison-src/transcripts/doc2.output.md delete mode 100644 unison-src/transcripts/doc2markdown.output.md delete mode 100644 unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md delete mode 100644 unison-src/transcripts/duplicate-names.output.md delete mode 100644 unison-src/transcripts/duplicate-term-detection.output.md delete mode 100644 unison-src/transcripts/ed25519.output.md delete mode 100644 unison-src/transcripts/edit-command.output.md delete mode 100644 unison-src/transcripts/edit-namespace.output.md delete mode 100644 unison-src/transcripts/empty-namespaces.output.md delete mode 100644 unison-src/transcripts/emptyCodebase.output.md delete mode 100644 unison-src/transcripts/error-messages.output.md delete mode 100644 unison-src/transcripts/escape-sequences.output.md delete mode 100644 unison-src/transcripts/find-by-type.output.md delete mode 100644 unison-src/transcripts/find-command.output.md delete mode 100644 unison-src/transcripts/fix-1381-excess-propagate.output.md delete mode 100644 unison-src/transcripts/fix-2258-if-as-list-element.output.md delete mode 100644 unison-src/transcripts/fix-5267.output.md delete mode 100644 unison-src/transcripts/fix-5301.output.md delete mode 100644 unison-src/transcripts/fix-5312.output.md delete mode 100644 unison-src/transcripts/fix-5320.output.md delete mode 100644 unison-src/transcripts/fix-5323.output.md delete mode 100644 unison-src/transcripts/fix-5326.output.md delete mode 100644 unison-src/transcripts/fix-5340.output.md delete mode 100644 unison-src/transcripts/fix-5357.output.md delete mode 100644 unison-src/transcripts/fix-5369.output.md delete mode 100644 unison-src/transcripts/fix-5374.output.md delete mode 100644 unison-src/transcripts/fix-5380.output.md delete mode 100644 unison-src/transcripts/fix-big-list-crash.output.md delete mode 100644 unison-src/transcripts/fix-ls.output.md delete mode 100644 unison-src/transcripts/fix1063.output.md delete mode 100644 unison-src/transcripts/fix1327.output.md delete mode 100644 unison-src/transcripts/fix1334.output.md delete mode 100644 unison-src/transcripts/fix1390.output.md delete mode 100644 unison-src/transcripts/fix1421.output.md delete mode 100644 unison-src/transcripts/fix1532.output.md delete mode 100644 unison-src/transcripts/fix1696.output.md delete mode 100644 unison-src/transcripts/fix1709.output.md delete mode 100644 unison-src/transcripts/fix1731.output.md delete mode 100644 unison-src/transcripts/fix1800.output.md delete mode 100644 unison-src/transcripts/fix1844.output.md delete mode 100644 unison-src/transcripts/fix1926.output.md delete mode 100644 unison-src/transcripts/fix2026.output.md delete mode 100644 unison-src/transcripts/fix2027.output.md delete mode 100644 unison-src/transcripts/fix2049.output.md delete mode 100644 unison-src/transcripts/fix2053.output.md delete mode 100644 unison-src/transcripts/fix2156.output.md delete mode 100644 unison-src/transcripts/fix2167.output.md delete mode 100644 unison-src/transcripts/fix2187.output.md delete mode 100644 unison-src/transcripts/fix2231.output.md delete mode 100644 unison-src/transcripts/fix2238.output.md delete mode 100644 unison-src/transcripts/fix2244.output.md delete mode 100644 unison-src/transcripts/fix2254.output.md delete mode 100644 unison-src/transcripts/fix2268.output.md delete mode 100644 unison-src/transcripts/fix2334.output.md delete mode 100644 unison-src/transcripts/fix2344.output.md delete mode 100644 unison-src/transcripts/fix2350.output.md delete mode 100644 unison-src/transcripts/fix2353.output.md delete mode 100644 unison-src/transcripts/fix2354.output.md delete mode 100644 unison-src/transcripts/fix2355.output.md delete mode 100644 unison-src/transcripts/fix2378.output.md delete mode 100644 unison-src/transcripts/fix2423.output.md delete mode 100644 unison-src/transcripts/fix2474.output.md delete mode 100644 unison-src/transcripts/fix2628.output.md delete mode 100644 unison-src/transcripts/fix2663.output.md delete mode 100644 unison-src/transcripts/fix2693.output.md delete mode 100644 unison-src/transcripts/fix2712.output.md delete mode 100644 unison-src/transcripts/fix2795.output.md delete mode 100644 unison-src/transcripts/fix2822.output.md delete mode 100644 unison-src/transcripts/fix2826.output.md delete mode 100644 unison-src/transcripts/fix2970.output.md delete mode 100644 unison-src/transcripts/fix3037.output.md delete mode 100644 unison-src/transcripts/fix3171.output.md delete mode 100644 unison-src/transcripts/fix3196.output.md delete mode 100644 unison-src/transcripts/fix3215.output.md delete mode 100644 unison-src/transcripts/fix3244.output.md delete mode 100644 unison-src/transcripts/fix3265.output.md delete mode 100644 unison-src/transcripts/fix3424.output.md delete mode 100644 unison-src/transcripts/fix3634.output.md delete mode 100644 unison-src/transcripts/fix3678.output.md delete mode 100644 unison-src/transcripts/fix3752.output.md delete mode 100644 unison-src/transcripts/fix3773.output.md delete mode 100644 unison-src/transcripts/fix3977.output.md delete mode 100644 unison-src/transcripts/fix4172.output.md delete mode 100644 unison-src/transcripts/fix4280.output.md delete mode 100644 unison-src/transcripts/fix4397.output.md delete mode 100644 unison-src/transcripts/fix4415.output.md delete mode 100644 unison-src/transcripts/fix4424.output.md delete mode 100644 unison-src/transcripts/fix4482.output.md delete mode 100644 unison-src/transcripts/fix4498.output.md delete mode 100644 unison-src/transcripts/fix4515.output.md delete mode 100644 unison-src/transcripts/fix4528.output.md delete mode 100644 unison-src/transcripts/fix4556.output.md delete mode 100644 unison-src/transcripts/fix4592.output.md delete mode 100644 unison-src/transcripts/fix4618.output.md delete mode 100644 unison-src/transcripts/fix4711.output.md delete mode 100644 unison-src/transcripts/fix4722.output.md delete mode 100644 unison-src/transcripts/fix4731.output.md delete mode 100644 unison-src/transcripts/fix4780.output.md delete mode 100644 unison-src/transcripts/fix4898.output.md delete mode 100644 unison-src/transcripts/fix5055.output.md delete mode 100644 unison-src/transcripts/fix5076.output.md delete mode 100644 unison-src/transcripts/fix5080.output.md delete mode 100644 unison-src/transcripts/fix5141.output.md delete mode 100644 unison-src/transcripts/fix5168.output.md delete mode 100644 unison-src/transcripts/fix5349.output.md delete mode 100644 unison-src/transcripts/fix614.output.md delete mode 100644 unison-src/transcripts/fix689.output.md delete mode 100644 unison-src/transcripts/fix693.output.md delete mode 100644 unison-src/transcripts/fix845.output.md delete mode 100644 unison-src/transcripts/fix849.output.md delete mode 100644 unison-src/transcripts/fix942.output.md delete mode 100644 unison-src/transcripts/fix987.output.md delete mode 100644 unison-src/transcripts/formatter.output.md delete mode 100644 unison-src/transcripts/fuzzy-options.output.md delete mode 100644 unison-src/transcripts/generic-parse-errors.output.md delete mode 100644 unison-src/transcripts/help.output.md delete mode 100644 unison-src/transcripts/higher-rank.output.md rename unison-src/transcripts/{ => idempotent}/abilities.md (100%) rename unison-src/transcripts/{ => idempotent}/ability-order-doesnt-affect-hash.md (100%) rename unison-src/transcripts/{ => idempotent}/ability-term-conflicts-on-update.md (100%) rename unison-src/transcripts/{ => idempotent}/add-run.md (100%) rename unison-src/transcripts/{ => idempotent}/add-test-watch-roundtrip.md (100%) rename unison-src/transcripts/{ => idempotent}/addupdatemessages.md (100%) rename unison-src/transcripts/{ => idempotent}/alias-term.md (100%) rename unison-src/transcripts/{ => idempotent}/alias-type.md (100%) rename unison-src/transcripts/{ => idempotent}/anf-tests.md (100%) rename unison-src/transcripts/{ => idempotent}/any-extract.md (100%) rename unison-src/transcripts/{ => idempotent}/api-doc-rendering.md (100%) rename unison-src/transcripts/{ => idempotent}/api-find.md (100%) rename unison-src/transcripts/{ => idempotent}/api-getDefinition.md (100%) rename unison-src/transcripts/{ => idempotent}/api-list-projects-branches.md (100%) rename unison-src/transcripts/{ => idempotent}/api-namespace-details.md (100%) rename unison-src/transcripts/{ => idempotent}/api-namespace-list.md (100%) rename unison-src/transcripts/{ => idempotent}/api-summaries.md (100%) rename unison-src/transcripts/{ => idempotent}/block-on-required-update.md (100%) rename unison-src/transcripts/{ => idempotent}/blocks.md (100%) rename unison-src/transcripts/{ => idempotent}/boolean-op-pretty-print-2819.md (100%) rename unison-src/transcripts/{ => idempotent}/branch-command.md (100%) rename unison-src/transcripts/{ => idempotent}/branch-relative-path.md (100%) rename unison-src/transcripts/{ => idempotent}/bug-fix-4354.md (100%) rename unison-src/transcripts/{ => idempotent}/bug-strange-closure.md (100%) rename unison-src/transcripts/{ => idempotent}/builtins-merge.md (100%) rename unison-src/transcripts/{ => idempotent}/builtins.md (100%) rename unison-src/transcripts/{ => idempotent}/bytesFromList.md (100%) rename unison-src/transcripts/{ => idempotent}/check763.md (100%) rename unison-src/transcripts/{ => idempotent}/check873.md (100%) rename unison-src/transcripts/{ => idempotent}/constructor-applied-to-unit.md (100%) rename unison-src/transcripts/{ => idempotent}/contrabilities.md (100%) rename unison-src/transcripts/{ => idempotent}/create-author.md (100%) rename unison-src/transcripts/{ => idempotent}/cycle-update-1.md (100%) rename unison-src/transcripts/{ => idempotent}/cycle-update-2.md (100%) rename unison-src/transcripts/{ => idempotent}/cycle-update-3.md (100%) rename unison-src/transcripts/{ => idempotent}/cycle-update-4.md (100%) rename unison-src/transcripts/{ => idempotent}/debug-definitions.md (100%) rename unison-src/transcripts/{ => idempotent}/debug-name-diffs.md (100%) rename unison-src/transcripts/{ => idempotent}/deep-names.md (100%) rename unison-src/transcripts/{ => idempotent}/definition-diff-api.md (100%) rename unison-src/transcripts/{ => idempotent}/delete-namespace-dependents-check.md (100%) rename unison-src/transcripts/{ => idempotent}/delete-namespace.md (100%) rename unison-src/transcripts/{ => idempotent}/delete-project-branch.md (100%) rename unison-src/transcripts/{ => idempotent}/delete-project.md (100%) rename unison-src/transcripts/{ => idempotent}/delete-silent.md (100%) rename unison-src/transcripts/{ => idempotent}/delete.md (100%) rename unison-src/transcripts/{ => idempotent}/dependents-dependencies-debugfile.md (100%) rename unison-src/transcripts/{ => idempotent}/destructuring-binds.md (100%) rename unison-src/transcripts/{ => idempotent}/diff-namespace.md (100%) rename unison-src/transcripts/{ => idempotent}/doc-formatting.md (100%) rename unison-src/transcripts/{ => idempotent}/doc-type-link-keywords.md (100%) rename unison-src/transcripts/{ => idempotent}/doc1.md (100%) rename unison-src/transcripts/{ => idempotent}/doc2.md (100%) rename unison-src/transcripts/{ => idempotent}/doc2markdown.md (100%) rename unison-src/transcripts/{ => idempotent}/dont-upgrade-refs-that-exist-in-old.md (100%) rename unison-src/transcripts/{ => idempotent}/duplicate-names.md (100%) rename unison-src/transcripts/{ => idempotent}/duplicate-term-detection.md (100%) rename unison-src/transcripts/{ => idempotent}/ed25519.md (100%) rename unison-src/transcripts/{ => idempotent}/edit-command.md (100%) rename unison-src/transcripts/{ => idempotent}/edit-namespace.md (100%) rename unison-src/transcripts/{ => idempotent}/empty-namespaces.md (100%) rename unison-src/transcripts/{ => idempotent}/emptyCodebase.md (100%) rename unison-src/transcripts/{ => idempotent}/error-messages.md (100%) rename unison-src/transcripts/{ => idempotent}/escape-sequences.md (100%) rename unison-src/transcripts/{ => idempotent}/find-by-type.md (100%) rename unison-src/transcripts/{ => idempotent}/find-command.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-1381-excess-propagate.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-2258-if-as-list-element.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5267.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5301.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5312.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5320.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5323.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5326.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5340.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5357.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5369.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5374.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-5380.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-big-list-crash.md (100%) rename unison-src/transcripts/{ => idempotent}/fix-ls.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1063.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1327.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1334.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1390.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1421.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1532.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1696.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1709.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1731.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1800.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1844.md (100%) rename unison-src/transcripts/{ => idempotent}/fix1926.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2026.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2027.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2049.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2053.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2156.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2167.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2187.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2231.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2238.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2238.u (100%) rename unison-src/transcripts/{ => idempotent}/fix2244.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2244.u (100%) rename unison-src/transcripts/{ => idempotent}/fix2254.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2268.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2334.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2344.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2350.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2353.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2354.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2355.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2378.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2423.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2474.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2628.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2663.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2693.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2712.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2795.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2795/docs.u (100%) rename unison-src/transcripts/{ => idempotent}/fix2822.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2826.md (100%) rename unison-src/transcripts/{ => idempotent}/fix2970.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3037.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3171.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3196.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3215.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3244.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3265.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3424.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3634.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3678.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3752.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3773.md (100%) rename unison-src/transcripts/{ => idempotent}/fix3977.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4172.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4280.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4397.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4415.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4424.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4482.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4498.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4515.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4528.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4556.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4592.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4618.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4711.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4722.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4731.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4780.md (100%) rename unison-src/transcripts/{ => idempotent}/fix4898.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5055.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5076.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5080.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5141.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5168.md (100%) rename unison-src/transcripts/{ => idempotent}/fix5349.md (100%) rename unison-src/transcripts/{ => idempotent}/fix614.md (100%) rename unison-src/transcripts/{ => idempotent}/fix689.md (100%) rename unison-src/transcripts/{ => idempotent}/fix693.md (100%) rename unison-src/transcripts/{ => idempotent}/fix845.md (100%) rename unison-src/transcripts/{ => idempotent}/fix849.md (100%) rename unison-src/transcripts/{ => idempotent}/fix942.md (100%) rename unison-src/transcripts/{ => idempotent}/fix987.md (100%) rename unison-src/transcripts/{ => idempotent}/formatter.md (100%) rename unison-src/transcripts/{ => idempotent}/fuzzy-options.md (100%) rename unison-src/transcripts/{ => idempotent}/generic-parse-errors.md (100%) rename unison-src/transcripts/{ => idempotent}/help.md (100%) rename unison-src/transcripts/{ => idempotent}/higher-rank.md (100%) rename unison-src/transcripts/{ => idempotent}/input-parse-errors.md (100%) rename unison-src/transcripts/{ => idempotent}/io-test-command.md (100%) rename unison-src/transcripts/{ => idempotent}/io.md (100%) rename unison-src/transcripts/{ => idempotent}/keyword-identifiers.md (100%) rename unison-src/transcripts/{ => idempotent}/kind-inference.md (100%) rename unison-src/transcripts/{ => idempotent}/lambdacase.md (100%) rename unison-src/transcripts/{ => idempotent}/lsp-fold-ranges.md (100%) rename unison-src/transcripts/{ => idempotent}/lsp-name-completion.md (100%) rename unison-src/transcripts/{ => idempotent}/move-all.md (100%) rename unison-src/transcripts/{ => idempotent}/move-namespace.md (100%) rename unison-src/transcripts/{ => idempotent}/name-resolution.md (100%) rename unison-src/transcripts/{ => idempotent}/name-segment-escape.md (100%) rename unison-src/transcripts/{ => idempotent}/name-selection.md (100%) rename unison-src/transcripts/{ => idempotent}/names.md (100%) rename unison-src/transcripts/{ => idempotent}/namespace-deletion-regression.md (100%) rename unison-src/transcripts/{ => idempotent}/namespace-dependencies.md (100%) rename unison-src/transcripts/{ => idempotent}/namespace-directive.md (100%) rename unison-src/transcripts/{ => idempotent}/numbered-args.md (100%) rename unison-src/transcripts/{ => idempotent}/old-fold-right.md (100%) rename unison-src/transcripts/{ => idempotent}/pattern-match-coverage.md (100%) rename unison-src/transcripts/{ => idempotent}/pattern-pretty-print-2345.md (100%) rename unison-src/transcripts/{ => idempotent}/patternMatchTls.md (100%) rename unison-src/transcripts/{ => idempotent}/patterns.md (100%) rename unison-src/transcripts/{ => idempotent}/propagate.md (100%) rename unison-src/transcripts/{ => idempotent}/pull-errors.md (100%) rename unison-src/transcripts/{ => idempotent}/records.md (100%) rename unison-src/transcripts/{ => idempotent}/reflog.md (100%) rename unison-src/transcripts/{ => idempotent}/release-draft-command.md (100%) rename unison-src/transcripts/{ => idempotent}/reset.md (100%) rename unison-src/transcripts/{ => idempotent}/resolution-failures.md (100%) rename unison-src/transcripts/{ => idempotent}/rsa.md (100%) rename unison-src/transcripts/{ => idempotent}/scope-ref.md (100%) rename unison-src/transcripts/{ => idempotent}/suffixes.md (100%) rename unison-src/transcripts/{ => idempotent}/sum-type-update-conflicts.md (100%) rename unison-src/transcripts/{ => idempotent}/switch-command.md (100%) rename unison-src/transcripts/{ => idempotent}/tab-completion.md (100%) rename unison-src/transcripts/{ => idempotent}/tdnr.md (100%) rename unison-src/transcripts/{ => idempotent}/test-command.md (100%) rename unison-src/transcripts/{ => idempotent}/text-literals.md (100%) rename unison-src/transcripts/{ => idempotent}/textfind.md (100%) rename unison-src/transcripts/{ => idempotent}/todo-bug-builtins.md (100%) rename unison-src/transcripts/{ => idempotent}/todo.md (100%) rename unison-src/transcripts/{ => idempotent}/top-level-exceptions.md (100%) rename unison-src/transcripts/{ => idempotent}/transcript-parser-commands.md (100%) rename unison-src/transcripts/{ => idempotent}/type-deps.md (100%) rename unison-src/transcripts/{ => idempotent}/type-modifier-are-optional.md (100%) rename unison-src/transcripts/{ => idempotent}/undo.md (100%) rename unison-src/transcripts/{ => idempotent}/unique-type-churn.md (100%) rename unison-src/transcripts/{ => idempotent}/unitnamespace.md (100%) rename unison-src/transcripts/{ => idempotent}/universal-cmp.md (100%) rename unison-src/transcripts/{ => idempotent}/unsafe-coerce.md (100%) rename unison-src/transcripts/{ => idempotent}/update-ignores-lib-namespace.md (100%) rename unison-src/transcripts/{ => idempotent}/update-on-conflict.md (100%) rename unison-src/transcripts/{ => idempotent}/update-suffixifies-properly.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term-aliases-in-different-ways.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term-to-different-type.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term-with-alias.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term-with-dependent-to-different-type.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term-with-dependent.md (100%) rename unison-src/transcripts/{ => idempotent}/update-term.md (100%) rename unison-src/transcripts/{ => idempotent}/update-test-to-non-test.md (100%) rename unison-src/transcripts/{ => idempotent}/update-test-watch-roundtrip.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-add-constructor.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-add-field.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-add-new-record.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-add-record-field.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-constructor-alias.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-delete-constructor-with-dependent.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-delete-constructor.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-delete-record-field.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-missing-constructor.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-nested-decl-aliases.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-no-op-record.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-stray-constructor-alias.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-stray-constructor.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-turn-constructor-into-smart-constructor.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-turn-non-record-into-record.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-with-dependent-term.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-with-dependent-type-to-different-kind.md (100%) rename unison-src/transcripts/{ => idempotent}/update-type-with-dependent-type.md (100%) rename unison-src/transcripts/{ => idempotent}/update-watch.md (100%) rename unison-src/transcripts/{ => idempotent}/upgrade-happy-path.md (100%) rename unison-src/transcripts/{ => idempotent}/upgrade-sad-path.md (100%) rename unison-src/transcripts/{ => idempotent}/upgrade-suffixifies-properly.md (100%) rename unison-src/transcripts/{ => idempotent}/upgrade-with-old-alias.md (100%) rename unison-src/transcripts/{ => idempotent}/view.md (100%) rename unison-src/transcripts/{ => idempotent}/watch-expressions.md (100%) delete mode 100644 unison-src/transcripts/input-parse-errors.output.md delete mode 100644 unison-src/transcripts/io-test-command.output.md delete mode 100644 unison-src/transcripts/io.output.md delete mode 100644 unison-src/transcripts/keyword-identifiers.output.md delete mode 100644 unison-src/transcripts/kind-inference.output.md delete mode 100644 unison-src/transcripts/lambdacase.output.md delete mode 100644 unison-src/transcripts/lsp-fold-ranges.output.md delete mode 100644 unison-src/transcripts/lsp-name-completion.output.md delete mode 100644 unison-src/transcripts/move-all.output.md delete mode 100644 unison-src/transcripts/move-namespace.output.md delete mode 100644 unison-src/transcripts/name-resolution.output.md delete mode 100644 unison-src/transcripts/name-segment-escape.output.md delete mode 100644 unison-src/transcripts/name-selection.output.md delete mode 100644 unison-src/transcripts/names.output.md delete mode 100644 unison-src/transcripts/namespace-deletion-regression.output.md delete mode 100644 unison-src/transcripts/namespace-dependencies.output.md delete mode 100644 unison-src/transcripts/namespace-directive.output.md delete mode 100644 unison-src/transcripts/numbered-args.output.md delete mode 100644 unison-src/transcripts/old-fold-right.output.md delete mode 100644 unison-src/transcripts/pattern-match-coverage.output.md delete mode 100644 unison-src/transcripts/pattern-pretty-print-2345.output.md delete mode 100644 unison-src/transcripts/patternMatchTls.output.md delete mode 100644 unison-src/transcripts/patterns.output.md delete mode 100644 unison-src/transcripts/propagate.output.md delete mode 100644 unison-src/transcripts/pull-errors.output.md delete mode 100644 unison-src/transcripts/records.output.md delete mode 100644 unison-src/transcripts/redundant.output.md delete mode 100644 unison-src/transcripts/reflog.output.md delete mode 100644 unison-src/transcripts/release-draft-command.output.md delete mode 100644 unison-src/transcripts/reset.output.md delete mode 100644 unison-src/transcripts/resolution-failures.output.md delete mode 100644 unison-src/transcripts/rsa.output.md delete mode 100644 unison-src/transcripts/scope-ref.output.md delete mode 100644 unison-src/transcripts/suffixes.output.md delete mode 100644 unison-src/transcripts/sum-type-update-conflicts.output.md delete mode 100644 unison-src/transcripts/switch-command.output.md delete mode 100644 unison-src/transcripts/tab-completion.output.md delete mode 100644 unison-src/transcripts/tdnr.output.md delete mode 100644 unison-src/transcripts/test-command.output.md delete mode 100644 unison-src/transcripts/text-literals.output.md delete mode 100644 unison-src/transcripts/textfind.output.md delete mode 100644 unison-src/transcripts/todo-bug-builtins.output.md delete mode 100644 unison-src/transcripts/todo.output.md delete mode 100644 unison-src/transcripts/top-level-exceptions.output.md delete mode 100644 unison-src/transcripts/transcript-parser-commands.output.md delete mode 100644 unison-src/transcripts/type-deps.output.md delete mode 100644 unison-src/transcripts/type-modifier-are-optional.output.md delete mode 100644 unison-src/transcripts/undo.output.md delete mode 100644 unison-src/transcripts/unique-type-churn.output.md delete mode 100644 unison-src/transcripts/unitnamespace.output.md delete mode 100644 unison-src/transcripts/universal-cmp.output.md delete mode 100644 unison-src/transcripts/unsafe-coerce.output.md delete mode 100644 unison-src/transcripts/update-ignores-lib-namespace.output.md delete mode 100644 unison-src/transcripts/update-on-conflict.output.md delete mode 100644 unison-src/transcripts/update-suffixifies-properly.output.md delete mode 100644 unison-src/transcripts/update-term-aliases-in-different-ways.output.md delete mode 100644 unison-src/transcripts/update-term-to-different-type.output.md delete mode 100644 unison-src/transcripts/update-term-with-alias.output.md delete mode 100644 unison-src/transcripts/update-term-with-dependent-to-different-type.output.md delete mode 100644 unison-src/transcripts/update-term-with-dependent.output.md delete mode 100644 unison-src/transcripts/update-term.output.md delete mode 100644 unison-src/transcripts/update-test-to-non-test.output.md delete mode 100644 unison-src/transcripts/update-test-watch-roundtrip.output.md delete mode 100644 unison-src/transcripts/update-type-add-constructor.output.md delete mode 100644 unison-src/transcripts/update-type-add-field.output.md delete mode 100644 unison-src/transcripts/update-type-add-new-record.output.md delete mode 100644 unison-src/transcripts/update-type-add-record-field.output.md delete mode 100644 unison-src/transcripts/update-type-constructor-alias.output.md delete mode 100644 unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md delete mode 100644 unison-src/transcripts/update-type-delete-constructor.output.md delete mode 100644 unison-src/transcripts/update-type-delete-record-field.output.md delete mode 100644 unison-src/transcripts/update-type-missing-constructor.output.md delete mode 100644 unison-src/transcripts/update-type-nested-decl-aliases.output.md delete mode 100644 unison-src/transcripts/update-type-no-op-record.output.md delete mode 100644 unison-src/transcripts/update-type-stray-constructor-alias.output.md delete mode 100644 unison-src/transcripts/update-type-stray-constructor.output.md delete mode 100644 unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md delete mode 100644 unison-src/transcripts/update-type-turn-non-record-into-record.output.md delete mode 100644 unison-src/transcripts/update-type-with-dependent-term.output.md delete mode 100644 unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md delete mode 100644 unison-src/transcripts/update-type-with-dependent-type.output.md delete mode 100644 unison-src/transcripts/update-watch.output.md delete mode 100644 unison-src/transcripts/upgrade-happy-path.output.md delete mode 100644 unison-src/transcripts/upgrade-sad-path.output.md delete mode 100644 unison-src/transcripts/upgrade-suffixifies-properly.output.md delete mode 100644 unison-src/transcripts/upgrade-with-old-alias.output.md delete mode 100644 unison-src/transcripts/view.output.md delete mode 100644 unison-src/transcripts/watch-expressions.output.md diff --git a/unison-cli/transcripts/Transcripts.hs b/unison-cli/transcripts/Transcripts.hs index c1cc899799..d06875a371 100644 --- a/unison-cli/transcripts/Transcripts.hs +++ b/unison-cli/transcripts/Transcripts.hs @@ -40,6 +40,7 @@ data TestConfig = TestConfig type TestBuilder = FilePath -> FilePath -> [String] -> String -> Test () testBuilder :: + Bool -> Bool -> ((FilePath, Text) -> IO ()) -> FilePath -> @@ -47,7 +48,7 @@ testBuilder :: [String] -> String -> Test () -testBuilder expectFailure recordFailure runtimePath dir prelude transcript = scope transcript $ do +testBuilder expectFailure replaceOriginal recordFailure runtimePath dir prelude transcript = scope transcript $ do outputs <- io . withTemporaryUcmCodebase SC.init Verbosity.Silent "transcript" SC.DoLock $ \(codebasePath, codebase) -> let isTest = True in Transcript.withRunner isTest Verbosity.Silent "TODO: pass version here" runtimePath \runTranscript -> @@ -75,7 +76,7 @@ testBuilder expectFailure recordFailure runtimePath dir prelude transcript = sco io $ recordFailure (filePath, errText) crash $ "Failure in " <> filePath (filePath, Right out) -> do - let outputFile = outputFileForTranscript filePath + let outputFile = if replaceOriginal then filePath else outputFileForTranscript filePath io . writeUtf8 outputFile . Transcript.formatStanzas $ toList out when expectFailure $ do let errMsg = "Expected a failure, but transcript was successful." @@ -137,9 +138,10 @@ test config = do -- what went wrong in CI failuresVar <- io $ STM.newTVarIO [] let recordFailure failure = STM.atomically $ STM.modifyTVar' failuresVar (failure :) - buildTests config (testBuilder False recordFailure) $ "unison-src" "transcripts" - buildTests config (testBuilder False recordFailure) $ "unison-src" "transcripts-using-base" - buildTests config (testBuilder True recordFailure) $ "unison-src" "transcripts" "errors" + buildTests config (testBuilder False False recordFailure) $ "unison-src" "transcripts" + buildTests config (testBuilder False True recordFailure) $ "unison-src" "transcripts" "idempotent" + buildTests config (testBuilder False False recordFailure) $ "unison-src" "transcripts-using-base" + buildTests config (testBuilder True False recordFailure) $ "unison-src" "transcripts" "errors" failures <- io $ STM.readTVarIO failuresVar -- Print all aggregated failures when (not $ null failures) . io $ Text.putStrLn $ "Failures:" diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md deleted file mode 100644 index 32c7116d98..0000000000 --- a/unison-src/transcripts/abilities.output.md +++ /dev/null @@ -1,45 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Some random ability stuff to ensure things work. - -``` unison - -unique ability A where - one : Nat ->{A} Nat - two : Nat -> Nat ->{A} Nat - three : Nat -> Nat -> Nat ->{A} Nat - four : Nat ->{A} (Nat -> Nat -> Nat -> Nat) - -ha : Request {A} r -> r -ha = cases - { x } -> x - { one i -> c } -> handle c (i+1) with ha - { two i j -> c } -> handle c (i+j) with ha - { three i j k -> c } -> handle c (i+j+k) with ha - { four i -> c } -> handle c (j k l -> i+j+k+l) with ha -``` - -``` ucm :added-by-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`: - - ability A - ha : Request {A} r -> r -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ability A - ha : Request {A} r -> r -``` diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md deleted file mode 100644 index 9e34873a6e..0000000000 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ /dev/null @@ -1,47 +0,0 @@ -The order of a set of abilities is normalized before hashing. - -``` unison -unique ability Foo where - foo : () - -unique ability Bar where - bar : () - -term1 : () ->{Foo, Bar} () -term1 _ = () - -term2 : () ->{Bar, Foo} () -term2 _ = () -``` - -``` ucm :added-by-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`: - - ability Bar - ability Foo - term1 : '{Bar, Foo} () - term2 : '{Bar, Foo} () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ability Bar - ability Foo - term1 : '{Bar, Foo} () - term2 : '{Bar, Foo} () -scratch/main> names term1 - - Term - Hash: #8hum58rlih - Names: term1 term2 -``` diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.output.md b/unison-src/transcripts/ability-term-conflicts-on-update.output.md deleted file mode 100644 index 0945af447a..0000000000 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ /dev/null @@ -1,233 +0,0 @@ -# Regression test for updates which conflict with an existing ability constructor - -https://github.com/unisonweb/unison/issues/2786 - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -First we add an ability to the codebase. -Note that this will create the name `Channels.send` as an ability constructor. - -``` unison -unique ability Channels where - send : a -> {Channels} () -``` - -``` ucm :added-by-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`: - - ability Channels -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ability Channels -``` - -Now we update the ability, changing the name of the constructor, *but*, we simultaneously -add a new top-level term with the same name as the constructor which is being -removed from Channels. - -``` unison -unique ability Channels where - sends : [a] -> {Channels} () - -Channels.send : a -> () -Channels.send a = () - -thing : '{Channels} () -thing _ = send 1 -``` - -``` ucm :added-by-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`: - - Channels.send : a -> () - thing : '{Channels} () - - ⍟ These names already exist. You can `update` them to your - new definition: - - ability Channels -``` - -These should fail with a term/ctor conflict since we exclude the ability from the update. - -``` ucm :error -scratch/main> update.old patch Channels.send - - x These definitions failed: - - Reason - term/ctor collision Channels.send : a -> () - - Tip: Use `help filestatus` to learn more. -scratch/main> update.old patch thing - - ⍟ I've added these definitions: - - Channels.send : a -> () - thing : '{Channels} () - - ⍟ I've updated these names to your new definition: - - ability Channels -``` - -If however, `Channels.send` and `thing` *depend* on `Channels`, updating them should succeed since it pulls in the ability as a dependency. - -``` unison -unique ability Channels where - sends : [a] -> {Channels} () - -Channels.send : a -> () -Channels.send a = sends [a] - -thing : '{Channels} () -thing _ = send 1 -``` - -``` ucm :added-by-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: - - ⊡ Previously added definitions will be ignored: Channels - - ⍟ These names already exist. You can `update` them to your - new definition: - - Channels.send : a ->{Channels} () - thing : '{Channels} () -``` - -These updates should succeed since `Channels` is a dependency. - -``` ucm -scratch/main> update.old.preview patch Channels.send - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⊡ Previously added definitions will be ignored: Channels - - ⍟ These names already exist. You can `update` them to your - new definition: - - Channels.send : a ->{Channels} () -scratch/main> update.old.preview patch thing - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⊡ Previously added definitions will be ignored: Channels - - ⍟ These names already exist. You can `update` them to your - new definition: - - Channels.send : a ->{Channels} () - thing : '{Channels} () -``` - -We should also be able to successfully update the whole thing. - -``` ucm -scratch/main> update.old - - ⊡ Ignored previously added definitions: Channels - - ⍟ I've updated these names to your new definition: - - Channels.send : a ->{Channels} () - thing : '{Channels} () -``` - -# Constructor-term conflict - -``` ucm :hide -scratch/main2> builtins.merge lib.builtins -``` - -``` unison -X.x = 1 -``` - -``` ucm :added-by-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.x : Nat -``` - -``` ucm -scratch/main2> add - - ⍟ I've added these definitions: - - X.x : Nat -``` - -``` unison -structural ability X where - x : () -``` - -``` ucm :added-by-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: - - x These definitions would fail on `add` or `update`: - - Reason - blocked structural ability X - ctor/term collision X.x - - Tip: Use `help filestatus` to learn more. -``` - -This should fail with a ctor/term conflict. - -``` ucm :error -scratch/main2> add - - x These definitions failed: - - Reason - blocked structural ability X - ctor/term collision X.x - - Tip: Use `help filestatus` to learn more. -``` diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md deleted file mode 100644 index 77b9559294..0000000000 --- a/unison-src/transcripts/add-run.output.md +++ /dev/null @@ -1,307 +0,0 @@ -# add.run - -## Basic usage - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -even : Nat -> Boolean -even x = if x == 0 then true else odd (drop x 1) - -odd : Nat -> Boolean -odd x = if x == 0 then false else even (drop x 1) - -is2even : 'Boolean -is2even = '(even 2) -``` - -``` ucm :added-by-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`: - - even : Nat -> Boolean - is2even : 'Boolean - odd : Nat -> Boolean -``` - -it errors if there isn't a previous run - -``` ucm :error -scratch/main> add.run foo - - ⚠️ - - There is no previous evaluation to save. Use `run` to evaluate - something before attempting to save it. -``` - -``` ucm -scratch/main> run is2even - - true -``` - -it errors if the desired result name conflicts with a name in the -unison file - -``` ucm :error -scratch/main> add.run is2even - - ⚠️ - - Cannot save the last run result into `is2even` because that - name conflicts with a name in the scratch file. -``` - -otherwise, the result is successfully persisted - -``` ucm -scratch/main> add.run foo.bar.baz - - ⍟ I've added these definitions: - - foo.bar.baz : Boolean -``` - -``` ucm -scratch/main> view foo.bar.baz - - foo.bar.baz : Boolean - foo.bar.baz = true -``` - -## It resolves references within the unison file - -``` unison -z b = b Nat.+ 12 -y a b = a Nat.+ b Nat.+ z 10 - - - - -main : '{IO, Exception} (Nat -> Nat -> Nat) -main _ = y -``` - -``` ucm :added-by-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`: - - main : '{IO, Exception} (Nat -> Nat -> Nat) - y : Nat -> Nat -> Nat - z : Nat -> Nat -``` - -``` ucm -scratch/main> run main - - a b -> a Nat.+ b Nat.+ z 10 -scratch/main> add.run result - - ⍟ I've added these definitions: - - result : Nat -> Nat -> Nat - z : Nat -> Nat -``` - -## It resolves references within the codebase - -``` unison -inc : Nat -> Nat -inc x = x + 1 -``` - -``` ucm :added-by-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`: - - inc : Nat -> Nat -``` - -``` ucm -scratch/main> add inc - - ⍟ I've added these definitions: - - inc : Nat -> Nat -``` - -``` unison -main : '(Nat -> Nat) -main _ x = inc x -``` - -``` ucm :added-by-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`: - - main : '(Nat -> Nat) -``` - -``` ucm -scratch/main> run main - - inc -scratch/main> add.run natfoo - - ⍟ I've added these definitions: - - natfoo : Nat -> Nat -scratch/main> view natfoo - - natfoo : Nat -> Nat - natfoo = inc -``` - -## It captures scratch file dependencies at run time - -``` unison -x = 1 -y = x + x -main = 'y -``` - -``` ucm :added-by-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`: - - main : 'Nat - x : Nat - y : Nat -``` - -``` ucm -scratch/main> run main - - 2 -``` - -``` unison -x = 50 -``` - -``` ucm :added-by-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 -``` - -this saves 2 to xres, rather than 100 - -``` ucm -scratch/main> add.run xres - - ⍟ I've added these definitions: - - xres : Nat -scratch/main> view xres - - xres : Nat - xres = 2 -``` - -## It fails with a message if add cannot complete cleanly - -``` unison -main = '5 -``` - -``` ucm :added-by-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`: - - main : 'Nat -``` - -``` ucm :error -scratch/main> run main - - 5 -scratch/main> add.run xres - - x These definitions failed: - - Reason - needs update xres : Nat - - Tip: Use `help filestatus` to learn more. -``` - -## It works with absolute names - -``` unison -main = '5 -``` - -``` ucm :added-by-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`: - - main : 'Nat -``` - -``` ucm -scratch/main> run main - - 5 -scratch/main> add.run .an.absolute.name - - ⍟ I've added these definitions: - - .an.absolute.name : Nat -scratch/main> view .an.absolute.name - - .an.absolute.name : Nat - .an.absolute.name = 5 -``` diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md deleted file mode 100644 index c2ce7b7fb3..0000000000 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ /dev/null @@ -1,23 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -test> foo : [Test.Result] -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 -scratch/main> add - - ⍟ I've added these definitions: - - foo : [Result] -scratch/main> view foo - - foo : [Result] - foo : [Result] - foo = [] -``` diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md deleted file mode 100644 index 3cf4b245f2..0000000000 --- a/unison-src/transcripts/addupdatemessages.output.md +++ /dev/null @@ -1,156 +0,0 @@ -# Adds and updates - -Let's set up some definitions to start: - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -x = 1 -y = 2 - -structural type X = One Nat -structural type Y = Two Nat Nat -``` - -``` ucm :added-by-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 X - structural type Y - x : Nat - y : Nat -``` - -Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type X - structural type Y - x : Nat - y : Nat -``` - -Let's add an alias for `1` and `One`: - -``` unison -z = 1 - -structural type Z = One Nat -``` - -``` ucm :added-by-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 Z - (also named X) - z : Nat - (also named x) -``` - -Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. -Also, `Z` is an alias for `X`. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Z - (also named X) - z : Nat - (also named x) -``` - -Let's update something that has an alias (to a value that doesn't have a name already): - -``` unison -x = 3 -structural type X = Three Nat Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - structural type X - (The old definition is also named Z.) - x : Nat - (The old definition is also named z.) -``` - -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 -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` - -Update it to something that already exists with a different name: - -``` unison -x = 2 -structural type X = Two Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - structural type X - (also named Y) - x : Nat - (also named y) -``` - -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 -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` diff --git a/unison-src/transcripts/alias-term.output.md b/unison-src/transcripts/alias-term.output.md deleted file mode 100644 index 5fde538677..0000000000 --- a/unison-src/transcripts/alias-term.output.md +++ /dev/null @@ -1,45 +0,0 @@ -`alias.term` makes a new name for a term. - -``` ucm :hide -project/main> builtins.mergeio lib.builtins -``` - -``` ucm -project/main> alias.term lib.builtins.bug foo - - Done. -project/main> ls - - 1. foo (a -> b) - 2. lib/ (643 terms, 92 types) -``` - -It won't create a conflicted name, though. - -``` ucm :error -project/main> alias.term lib.builtins.todo foo - - ⚠️ - - A term by that name already exists. -``` - -``` ucm -project/main> ls - - 1. foo (a -> b) - 2. lib/ (643 terms, 92 types) -``` - -You can use `debug.alias.term.force` for that. - -``` ucm -project/main> debug.alias.term.force lib.builtins.todo foo - - Done. -project/main> ls - - 1. foo (a -> b) - 2. foo (a -> b) - 3. lib/ (643 terms, 92 types) -``` diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md deleted file mode 100644 index 2740753e46..0000000000 --- a/unison-src/transcripts/alias-type.output.md +++ /dev/null @@ -1,45 +0,0 @@ -`alias.type` makes a new name for a type. - -``` ucm :hide -project/main> builtins.mergeio lib.builtins -``` - -``` ucm -project/main> alias.type lib.builtins.Nat Foo - - Done. -project/main> ls - - 1. Foo (builtin type) - 2. lib/ (643 terms, 92 types) -``` - -It won't create a conflicted name, though. - -``` ucm :error -project/main> alias.type lib.builtins.Int Foo - - ⚠️ - - A type by that name already exists. -``` - -``` ucm -project/main> ls - - 1. Foo (builtin type) - 2. lib/ (643 terms, 92 types) -``` - -You can use `debug.alias.type.force` for that. - -``` ucm -project/main> debug.alias.type.force lib.builtins.Int Foo - - Done. -project/main> ls - - 1. Foo (builtin type) - 2. Foo (builtin type) - 3. lib/ (643 terms, 92 types) -``` diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md deleted file mode 100644 index 9bd5080fe3..0000000000 --- a/unison-src/transcripts/anf-tests.output.md +++ /dev/null @@ -1,58 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This tests a variable related bug in the ANF compiler. - -The nested let would get flattened out, resulting in: - -``` -bar = result -``` - -which would be handled by renaming. However, the *context* portion of -the rest of the code was not being renamed correctly, so `bar` would -remain in the definition of `baz`. - -``` unison -foo _ = - id x = x - void x = () - bar = let - void (Debug.watch "hello" "hello") - result = 5 - void (Debug.watch "goodbye" "goodbye") - result - baz = id bar - baz - -> !foo -``` - -``` ucm :added-by-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 : ∀ _. _ -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 12 | > !foo - ⧩ - 5 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : ∀ _. _ -> Nat -``` diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md deleted file mode 100644 index b17ca9b6f1..0000000000 --- a/unison-src/transcripts/any-extract.output.md +++ /dev/null @@ -1,47 +0,0 @@ -# Unit tests for Any.unsafeExtract - -``` ucm :hide -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. - -``` unison - -test> Any.unsafeExtract.works = - use Nat != - checks [1 == Any.unsafeExtract (Any 1), - not (1 == Any.unsafeExtract (Any 2)), - (Some 1) == Any.unsafeExtract (Any (Some 1)) - ] -``` - -``` ucm :added-by-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`: - - Any.unsafeExtract.works : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 4 | checks [1 == Any.unsafeExtract (Any 1), - - ✅ Passed Passed -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - Any.unsafeExtract.works : [Result] -``` diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md deleted file mode 100644 index a4ed862c42..0000000000 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ /dev/null @@ -1,951 +0,0 @@ -# Doc rendering - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -structural type Maybe a = Nothing | Just a -otherTerm = "text" - -otherDoc : (Text -> Doc2) -> Doc2 -otherDoc mkMsg = {{ -This doc should be embedded. - -{{mkMsg "message"}} - -}} - -{{ -# Heading - -## Heading 2 - -Term Link: {otherTerm} - -Type Link: {type Maybe} - -Term source: - -@source{term} - -Term signature: - -@signature{term} - -* List item - -1. Numbered list item - -> Block quote - - Code block - -Inline code: - -`` 1 + 2 `` - -`"doesn't typecheck" + 1` - -[Link](https://unison-lang.org) - -![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - -**Bold** - -*Italic* - -~~Strikethrough~~ - -Horizontal rule - ---- - -Table - -| Header 1 | Header 2 | -| -------- | -------- | -| Cell 1 | Cell 2 | -| Cell 3 | Cell 4 | - - -Video - -{{ Special (Embed (Any (Video [(MediaSource "test.mp4" None)] [("poster", "test.png")]))) }} - -Transclusion/evaluation: - -{{otherDoc (a -> Word a )}} - -}} -term = 42 -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> display term.doc - - # Heading - - # Heading 2 - - Term Link: otherTerm - - Type Link: Maybe - - Term source: - - term : Nat - term = 42 - - Term signature: - - term : Nat - - * List item - - 1. Numbered list item - - > Block quote - - Code block - - Inline code: - - `1 Nat.+ 2` - - `"doesn't typecheck" + 1` - - Link - - ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - - Bold - - Italic - - ~~Strikethrough~~ - - Horizontal rule - - --- - - Table - - | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | - Cell 2 | | Cell 3 | Cell 4 | - - Video - - - {{ embed {{ - Video - [MediaSource "test.mp4" Nothing] - [("poster", "test.png")] }} }} - - - Transclusion/evaluation: - - This doc should be embedded. - - message -``` - -``` api -GET /api/projects/scratch/branches/main/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" - ] - } - }, - "typeDefinitions": {} - } -``` diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md deleted file mode 100644 index d08334aa0a..0000000000 --- a/unison-src/transcripts/api-find.output.md +++ /dev/null @@ -1,255 +0,0 @@ -# find api - -``` unison -rachel.filesystem.x = 42 -ross.httpClient.y = 43 -joey.httpServer.z = 44 -joey.yaml.zz = 45 -``` - -``` ucm :added-by-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`: - - joey.httpServer.z : ##Nat - joey.yaml.zz : ##Nat - rachel.filesystem.x : ##Nat - ross.httpClient.y : ##Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - joey.httpServer.z : ##Nat - joey.yaml.zz : ##Nat - rachel.filesystem.x : ##Nat - ross.httpClient.y : ##Nat -``` - -``` api --- Namespace segment prefix search -GET /api/projects/scratch/branches/main/find?query=http - [ - [ - { - "result": { - "segments": [ - { - "contents": "ross.", - "tag": "Gap" - }, - { - "contents": "http", - "tag": "Match" - }, - { - "contents": "Client.y", - "tag": "Gap" - } - ] - }, - "score": 156 - }, - { - "contents": { - "bestFoundTermName": "y", - "namedTerm": { - "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", - "termName": "ross.httpClient.y", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ], - [ - { - "result": { - "segments": [ - { - "contents": "joey.", - "tag": "Gap" - }, - { - "contents": "http", - "tag": "Match" - }, - { - "contents": "Server.z", - "tag": "Gap" - } - ] - }, - "score": 156 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] - ] --- Namespace segment suffix search -GET /api/projects/scratch/branches/main/find?query=Server - [ - [ - { - "result": { - "segments": [ - { - "contents": "joey.http", - "tag": "Gap" - }, - { - "contents": "Server", - "tag": "Match" - }, - { - "contents": ".z", - "tag": "Gap" - } - ] - }, - "score": 223 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] - ] --- Substring search -GET /api/projects/scratch/branches/main/find?query=lesys - [ - [ - { - "result": { - "segments": [ - { - "contents": "rachel.fi", - "tag": "Gap" - }, - { - "contents": "lesys", - "tag": "Match" - }, - { - "contents": "tem.x", - "tag": "Gap" - } - ] - }, - "score": 175 - }, - { - "contents": { - "bestFoundTermName": "x", - "namedTerm": { - "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "termName": "rachel.filesystem.x", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] - ] --- Cross-segment search -GET /api/projects/scratch/branches/main/find?query=joey.http - [ - [ - { - "result": { - "segments": [ - { - "contents": "joey.http", - "tag": "Match" - }, - { - "contents": "Server.z", - "tag": "Gap" - } - ] - }, - "score": 300 - }, - { - "contents": { - "bestFoundTermName": "z", - "namedTerm": { - "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", - "termName": "joey.httpServer.z", - "termTag": "Plain", - "termType": [ - { - "annotation": { - "contents": "##Nat", - "tag": "HashQualifier" - }, - "segment": "##Nat" - } - ] - } - }, - "tag": "FoundTermResult" - } - ] - ] -``` diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md deleted file mode 100644 index 3093f55514..0000000000 --- a/unison-src/transcripts/api-getDefinition.output.md +++ /dev/null @@ -1,526 +0,0 @@ -# Get Definitions Test - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison :hide -nested.names.x.doc = {{ Documentation }} -nested.names.x = 42 -``` - -``` ucm :hide -scratch/main> add -``` - -``` api --- Should NOT find names by suffix -GET /api/projects/scratch/branches/main/getDefinition?names=x - { - "missingDefinitions": [ - "x" - ], - "termDefinitions": {}, - "typeDefinitions": {} - } --- Term names should strip relativeTo prefix. -GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested - { - "missingDefinitions": [], - "termDefinitions": { - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { - "bestTermName": "x", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doc", - "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", - { - "contents": [ - { - "contents": "Documentation", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "nested.names.x" - ] - } - }, - "typeDefinitions": {} - } --- Should find definitions by hash, names should be relative -GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested - { - "missingDefinitions": [], - "termDefinitions": { - "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { - "bestTermName": "x", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "x", - "tag": "HashQualifier" - }, - "segment": "x" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "42" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doc", - "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", - { - "contents": [ - { - "contents": "Documentation", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "nested.names.x" - ] - } - }, - "typeDefinitions": {} - } -``` - -``` unison :hide -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> 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/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest - { - "missingDefinitions": [], - "termDefinitions": { - "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { - "bestTermName": "doctest.thing", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "doctest.thing", - "tag": "HashQualifier" - }, - "segment": "doctest.thing" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "doctest.thing", - "tag": "HashQualifier" - }, - "segment": "doctest.thing" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"A thing\"" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doctest.thing.doc", - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", - { - "contents": [ - { - "contents": "The", - "tag": "Word" - }, - { - "contents": "correct", - "tag": "Word" - }, - { - "contents": "docs", - "tag": "Word" - }, - { - "contents": "for", - "tag": "Word" - }, - { - "contents": "the", - "tag": "Word" - }, - { - "contents": "thing", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "doctest.thing", - "doctest.thingalias" - ] - } - }, - "typeDefinitions": {} - } -``` - -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/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest - { - "missingDefinitions": [], - "termDefinitions": { - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { - "bestTermName": "doctest.thing.doc", - "defnTermTag": "Doc", - "signature": [ - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "doctest.thing.doc", - "tag": "HashQualifier" - }, - "segment": "doctest.thing.doc" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "doctest.thing.doc", - "tag": "HashQualifier" - }, - "segment": "doctest.thing.doc" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DocDelimiter" - }, - "segment": "{{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "The" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "correct" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "docs" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "for" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "the" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "thing" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DocDelimiter" - }, - "segment": "}}" - } - ], - "tag": "UserObject" - }, - "termDocs": [ - [ - "doctest.thing.doc", - "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", - { - "contents": [ - { - "contents": "The", - "tag": "Word" - }, - { - "contents": "correct", - "tag": "Word" - }, - { - "contents": "docs", - "tag": "Word" - }, - { - "contents": "for", - "tag": "Word" - }, - { - "contents": "the", - "tag": "Word" - }, - { - "contents": "thing", - "tag": "Word" - } - ], - "tag": "Paragraph" - } - ] - ], - "termNames": [ - "doctest.thing.doc" - ] - } - }, - "typeDefinitions": {} - } -``` diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md deleted file mode 100644 index 9d5952766b..0000000000 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ /dev/null @@ -1,65 +0,0 @@ -# List Projects And Branches Test - -``` ucm :hide -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 -``` - -``` api --- Should list all projects -GET /api/projects - [ - { - "projectName": "project-one" - }, - { - "projectName": "project-three" - }, - { - "projectName": "project-two" - }, - { - "projectName": "scratch" - } - ] --- Should list projects starting with project-t -GET /api/projects?prefix=project-t - [ - { - "projectName": "project-three" - }, - { - "projectName": "project-two" - } - ] --- Should list all branches -GET /api/projects/project-one/branches - [ - { - "branchName": "branch-one" - }, - { - "branchName": "branch-three" - }, - { - "branchName": "branch-two" - }, - { - "branchName": "main" - } - ] --- Should list all branches beginning with branch-t -GET /api/projects/project-one/branches?prefix=branch-t - [ - { - "branchName": "branch-three" - }, - { - "branchName": "branch-two" - } - ] -``` diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md deleted file mode 100644 index 5e2db50a07..0000000000 --- a/unison-src/transcripts/api-namespace-details.output.md +++ /dev/null @@ -1,85 +0,0 @@ -# Namespace Details Test - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison -{{ Documentation }} -nested.names.x = 42 - -nested.names.readme = {{ -Here's a *README*! -}} -``` - -``` ucm :added-by-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`: - - nested.names.readme : Doc2 - nested.names.x : Nat - nested.names.x.doc : Doc2 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - nested.names.readme : Doc2 - nested.names.x : Nat - nested.names.x.doc : Doc2 -``` - -``` api --- Should find names by suffix -GET /api/projects/scratch/branches/main/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" - } - } -``` diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md deleted file mode 100644 index 5139f87319..0000000000 --- a/unison-src/transcripts/api-namespace-list.output.md +++ /dev/null @@ -1,138 +0,0 @@ -# Namespace list api - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison -{{ Documentation }} -nested.names.x = 42 - -nested.names.readme = {{ I'm a readme! }} -``` - -``` ucm :added-by-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`: - - nested.names.readme : Doc2 - nested.names.x : Nat - nested.names.x.doc : Doc2 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - nested.names.readme : Doc2 - nested.names.x : Nat - nested.names.x.doc : Doc2 -``` - -``` api -GET /api/projects/scratch/branches/main/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" - } - ], - "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" - } -GET /api/projects/scratch/branches/main/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" - } - ], - "namespaceListingFQN": "nested.names", - "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" - } -``` diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md deleted file mode 100644 index 039efb04b9..0000000000 --- a/unison-src/transcripts/api-summaries.output.md +++ /dev/null @@ -1,838 +0,0 @@ -# Definition Summary APIs - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -nat : Nat -nat = 42 -doc : Doc2 -doc = {{ Hello }} -test> mytest = [Test.Result.Ok "ok"] -func : Text -> Text -func x = x ++ "hello" - -funcWithLongType : Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -funcWithLongType a b c d e f g h = a ++ b ++ c ++ d ++ e ++ f ++ g ++ h - -structural type Thing = This Nat | That -structural type Maybe a = Nothing | Just a - -structural ability Stream s where - send : s -> () -``` - -``` ucm :hide -scratch/main> add -scratch/main> alias.type ##Nat Nat -scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl -``` - -## Term Summary APIs - -``` api --- term -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat - { - "displayName": "nat", - "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" - } --- term without name uses hash -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary - { - "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" - } --- doc -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc - { - "displayName": "doc", - "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", - "summary": { - "contents": [ - { - "annotation": { - "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", - "tag": "TypeReference" - }, - "segment": "Doc2" - } - ], - "tag": "UserObject" - }, - "tag": "Doc" - } --- test -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest - { - "displayName": "mytest", - "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "[" - }, - { - "annotation": { - "contents": "#aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0", - "tag": "TypeReference" - }, - "segment": "Result" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "]" - } - ], - "tag": "UserObject" - }, - "tag": "Test" - } --- function -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func - { - "displayName": "func", - "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" - } --- constructor -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This - { - "displayName": "Thing.This", - "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", - "tag": "TypeReference" - }, - "segment": "Thing" - } - ], - "tag": "UserObject" - }, - "tag": "DataConstructor" - } --- Long type signature -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType - { - "displayName": "funcWithLongType", - "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" - } --- Long type signature with render width -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType - { - "displayName": "funcWithLongType", - "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "tag": "Plain" - } --- Builtin Term -GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl - { - "displayName": "putBytesImpl", - "hash": "##IO.putBytes.impl.v3", - "summary": { - "contents": [ - { - "annotation": { - "contents": "##Handle", - "tag": "TypeReference" - }, - "segment": "Handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Bytes", - "tag": "TypeReference" - }, - "segment": "Bytes" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "contents": "##IO", - "tag": "TypeReference" - }, - "segment": "IO" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#0o7mf021foma9acqdaibmlh1jidlijq08uf7f5se9tssttqs546pfunjpk6s31mqoq8s2o1natede8hkk6he45l95fibglidikt44v8", - "tag": "TypeReference" - }, - "segment": "Either" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8", - "tag": "TypeReference" - }, - "segment": "Failure" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": "(" - }, - { - "annotation": null, - "segment": ")" - } - ], - "tag": "BuiltinObject" - }, - "tag": "Plain" - } -``` - -## Type Summary APIs - -``` api --- data -GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing - { - "displayName": "Thing", - "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Thing", - "tag": "HashQualifier" - }, - "segment": "Thing" - } - ], - "tag": "UserObject" - }, - "tag": "Data" - } --- data with type args -GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe - { - "displayName": "Maybe", - "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Maybe", - "tag": "HashQualifier" - }, - "segment": "Maybe" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - } - ], - "tag": "UserObject" - }, - "tag": "Data" - } --- ability -GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream - { - "displayName": "Stream", - "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", - "summary": { - "contents": [ - { - "annotation": { - "tag": "DataTypeModifier" - }, - "segment": "structural" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "ability" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Stream", - "tag": "HashQualifier" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "s" - } - ], - "tag": "UserObject" - }, - "tag": "Ability" - } --- builtin type -GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat - { - "displayName": "Nat", - "hash": "##Nat", - "summary": { - "contents": [ - { - "annotation": null, - "segment": "Nat" - } - ], - "tag": "BuiltinObject" - }, - "tag": "Data" - } -``` diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md deleted file mode 100644 index be0e05764d..0000000000 --- a/unison-src/transcripts/block-on-required-update.output.md +++ /dev/null @@ -1,71 +0,0 @@ -# Block on required update - -Should block an `add` if it requires an update on an in-file dependency. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -x = 1 -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - x : Nat -``` - -Update `x`, and add a new `y` which depends on the update - -``` unison -x = 10 -y = x + 1 -``` - -``` ucm :added-by-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 - - ⍟ These names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -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 -scratch/main> add y - - x These definitions failed: - - Reason - needs update x : Nat - blocked y : Nat - - Tip: Use `help filestatus` to learn more. -``` diff --git a/unison-src/transcripts/blocks.output.md b/unison-src/transcripts/blocks.output.md deleted file mode 100644 index 9645fffd9b..0000000000 --- a/unison-src/transcripts/blocks.output.md +++ /dev/null @@ -1,365 +0,0 @@ -## Blocks and scoping - -``` ucm :hide -scratch/main> builtins.merge -``` - -### Names introduced by a block shadow names introduced in outer scopes - -For example: - -``` unison -ex thing = - thing y = y - -- refers to `thing` in this block - -- not the argument to `ex` - bar x = thing x + 1 - bar 42 - -> ex "hello" -``` - -``` ucm :added-by-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`: - - ex : thing -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 8 | > ex "hello" - ⧩ - 43 -``` - -### Whether a block shadows outer names doesn't depend on the order of bindings in the block - -The `thing` reference in `bar` refers to the one declared locally in the block that `bar` is part of. This is true even if the declaration which shadows the outer name appears later in the block, for instance: - -``` unison -ex thing = - bar x = thing x + 1 - thing y = y - bar 42 - -> ex "hello" -``` - -``` ucm :added-by-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`: - - ex : thing -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 6 | > ex "hello" - ⧩ - 43 -``` - -### Blocks use lexical scoping and can only reference definitions in parent scopes or in the same block - -This is just the normal lexical scoping behavior. For example: - -``` unison -ex thing = - bar x = thing x + 1 -- references outer `thing` - baz z = - thing y = y -- shadows the outer `thing` - thing z -- references the inner `thing` - bar 42 - -> ex (x -> x * 100) -``` - -``` ucm :added-by-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`: - - ex : (Nat ->{g} Nat) ->{g} Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 8 | > ex (x -> x * 100) - ⧩ - 4201 -``` - -Here's another example, showing that bindings cannot reference bindings declared in blocks nested in the *body* (the final expression) of a block: - -``` unison -ex thing = - bar x = thing x + 1 -- refers to outer thing - let - thing y = y - bar 42 - -> ex (x -> x * 100) -``` - -``` ucm :added-by-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`: - - ex : (Nat ->{g} Nat) ->{g} Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 7 | > ex (x -> x * 100) - ⧩ - 4201 -``` - -### Blocks can define one or more functions which are recursive or mutually recursive - -We call these groups of definitions that reference each other in a block *cycles*. For instance: - -``` unison -sumTo n = - -- A recursive function, defined inside a block - go acc n = - if n == 0 then acc - else go (acc + n) (drop n 1) - go 0 n - -ex n = - -- Two mutually recursive functions, defined in a block - ping x = pong (x + 1) - pong x = ping (x + 2) - ping 42 -``` - -``` ucm :added-by-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`: - - ex : n -> r - sumTo : Nat -> Nat -``` - -The `go` function is a one-element cycle (it reference itself), and `ping` and `pong` form a two-element cycle. - -### Cyclic references or forward reference must be guarded - -For instance, this works: - -``` unison -ex n = - ping x = pong + 1 + x - pong = 42 - ping 0 -``` - -``` ucm :added-by-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`: - - ex : n -> Nat -``` - -Since the forward reference to `pong` appears inside `ping`. - -This, however, will not compile: - -``` unison :error -ex n = - pong = ping + 1 - ping = 42 - pong -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 - 2 | pong = ping + 1 - 3 | ping = 42 -``` - -This also won't compile; it's a cyclic reference that isn't guarded: - -``` unison :error -ex n = - loop = loop - loop -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 - 2 | loop = loop -``` - -This, however, will compile. This also shows that `'expr` is another way of guarding a definition. - -``` unison -ex n = - loop = '(!loop) - !loop -``` - -``` ucm :added-by-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`: - - ex : n -> r -``` - -Just don't try to run it as it's an infinite loop\! - -### Cyclic definitions in a block don't have access to any abilities - -The reason is it's unclear what the order should be of any requests that are made. It can also be viewed of a special case of the restriction that elements of a cycle must all be guarded. Here's an example: - -``` unison :error -structural ability SpaceAttack where - launchMissiles : Text -> Nat - -ex n = - zap1 = launchMissiles "neptune" + zap2 - zap2 = launchMissiles "pluto" + zap1 - zap1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. - - 5 | zap1 = launchMissiles "neptune" + zap2 -``` - -### The *body* of recursive functions can certainly access abilities - -For instance, this works fine: - -``` unison -structural ability SpaceAttack where - launchMissiles : Text -> Nat - -ex n = - zap1 planet = launchMissiles planet + zap2 planet - zap2 planet = launchMissiles planet + zap1 planet - zap1 "pluto" -``` - -``` ucm :added-by-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 ability SpaceAttack - ex : n ->{SpaceAttack} Nat -``` - -### Unrelated definitions not part of a cycle and are moved after the cycle - -For instance, `zap` here isn't considered part of the cycle (it doesn't reference `ping` or `pong`), so this typechecks fine: - -``` unison -structural ability SpaceAttack where - launchMissiles : Text -> Nat - -ex n = - ping x = pong (x + 1) - zap = launchMissiles "neptune" - pong x = ping (x + 2) - ping 42 -``` - -``` ucm :added-by-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 ability SpaceAttack - ex : n ->{SpaceAttack} r -``` - -This is actually parsed as if you moved `zap` after the cycle it find itself a part of: - -``` unison -structural ability SpaceAttack where - launchMissiles : Text -> Nat - -ex n = - ping x = pong (x + 1) - pong x = ping (x + 2) - zap = launchMissiles "neptune" - ping 42 -``` - -``` ucm :added-by-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 ability SpaceAttack - ex : n ->{SpaceAttack} r -``` diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md deleted file mode 100644 index 4af3c7d061..0000000000 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ /dev/null @@ -1,39 +0,0 @@ -Regression test for https://github.com/unisonweb/unison/pull/2819 - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -hangExample : Boolean -hangExample = - ("a long piece of text to hang the line" == "") - && ("a long piece of text to hang the line" == "") -``` - -``` ucm :added-by-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`: - - hangExample : Boolean -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - hangExample : Boolean -scratch/main> view hangExample - - hangExample : Boolean - hangExample = - "a long piece of text to hang the line" == "" - && "a long piece of text to hang the line" == "" -``` diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md deleted file mode 100644 index 00ad35f4e5..0000000000 --- a/unison-src/transcripts/branch-command.output.md +++ /dev/null @@ -1,164 +0,0 @@ -The `branch` command creates a new branch. - -``` ucm :hide -scratch/main> project.create-empty foo -scratch/main> project.create-empty bar -``` - -First, we'll create a term to include in the branches. - -``` unison :hide -someterm = 18 -``` - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -scratch/main> add - - ⍟ I've added these definitions: - - someterm : Nat -``` - -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. It can also create an empty branch. - -``` ucm -foo/main> branch topic1 - - Done. I've created the topic1 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic1`. -foo/main> branch /topic2 - - Done. I've created the topic2 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic2`. -foo/main> branch foo/topic3 - - Done. I've created the topic3 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic3`. -foo/main> branch main topic4 - - Done. I've created the topic4 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic4`. -foo/main> branch main /topic5 - - Done. I've created the topic5 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic5`. -foo/main> branch main foo/topic6 - - Done. I've created the topic6 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic6`. -foo/main> branch /main topic7 - - Done. I've created the topic7 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic7`. -foo/main> branch /main /topic8 - - Done. I've created the topic8 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic8`. -foo/main> branch /main foo/topic9 - - Done. I've created the topic9 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic9`. -foo/main> branch foo/main topic10 - - Done. I've created the topic10 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic10`. -foo/main> branch foo/main /topic11 - - Done. I've created the topic11 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic11`. -scratch/main> branch foo/main foo/topic12 - - Done. I've created the topic12 branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /topic12`. -foo/main> branch bar/topic - - Done. I've created the bar/topic branch based off foo/main. -bar/main> branch foo/main topic2 - - Done. I've created the bar/topic2 branch based off foo/main. -bar/main> branch foo/main /topic3 - - Done. I've created the bar/topic3 branch based off foo/main. -scratch/main> branch foo/main bar/topic4 - - Done. I've created the bar/topic4 branch based off foo/main. -foo/main> branch.empty empty1 - - Done. I've created an empty branch foo/empty1. - - Tip: Use `merge /somebranch` to initialize this branch. -foo/main> branch.empty /empty2 - - Done. I've created an empty branch foo/empty2. - - Tip: Use `merge /somebranch` to initialize this branch. -foo/main> branch.empty foo/empty3 - - Done. I've created an empty branch foo/empty3. - - Tip: Use `merge /somebranch` to initialize this branch. -scratch/main> branch.empty foo/empty4 - - Done. I've created an empty branch foo/empty4. - - Tip: Use `merge /somebranch` to initialize this branch. -``` - -The `branch` command can create branches named `releases/drafts/*` (because why not). - -``` ucm -foo/main> branch releases/drafts/1.2.3 - - Done. I've created the releases/drafts/1.2.3 branch based off - of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /releases/drafts/1.2.3`. -foo/main> switch /releases/drafts/1.2.3 -``` - -The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`. - -``` ucm :error -foo/main> branch releases/1.2.3 - - Branch names like releases/1.2.3 are reserved for releases. - - Tip: to download an existing release, try - `clone /releases/1.2.3`. - - Tip: to draft a new release, try `release.draft 1.2.3`. -foo/main> switch /releases/1.2.3 - - foo/releases/1.2.3 does not exist. -``` diff --git a/unison-src/transcripts/branch-relative-path.output.md b/unison-src/transcripts/branch-relative-path.output.md deleted file mode 100644 index 336d4c232b..0000000000 --- a/unison-src/transcripts/branch-relative-path.output.md +++ /dev/null @@ -1,86 +0,0 @@ -``` unison -foo = 5 -foo.bar = 1 -``` - -``` ucm :added-by-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 : ##Nat - foo.bar : ##Nat -``` - -``` ucm -p0/main> add - - ⍟ I've added these definitions: - - foo : ##Nat - foo.bar : ##Nat -``` - -``` unison -bonk = 5 -donk.bonk = 1 -``` - -``` ucm :added-by-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 - (also named foo) - donk.bonk : ##Nat - (also named foo.bar) -``` - -``` ucm -p1/main> add - - ⍟ I've added these definitions: - - bonk : ##Nat - donk.bonk : ##Nat -p1/main> fork p0/main: zzz - - Done. -p1/main> find zzz - - 1. zzz.foo : ##Nat - 2. zzz.foo.bar : ##Nat -p1/main> fork p0/main:foo yyy - - Done. -p1/main> find yyy - - 1. yyy.bar : ##Nat -p0/main> fork p1/main: p0/main:p1 - - Done. -p0/main> ls p1 - - 1. bonk (##Nat) - 2. donk/ (1 term) - 3. yyy/ (1 term) - 4. zzz/ (2 terms) -p0/main> ls p1.zzz - - 1. foo (##Nat) - 2. foo/ (1 term) -p0/main> ls p1.yyy - - 1. bar (##Nat) -``` diff --git a/unison-src/transcripts/bug-fix-4354.output.md b/unison-src/transcripts/bug-fix-4354.output.md deleted file mode 100644 index d662783099..0000000000 --- a/unison-src/transcripts/bug-fix-4354.output.md +++ /dev/null @@ -1,26 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -bonk : forall a. a -> a -bonk x = - zonk : forall a. a -> a - zonk z = z - honk : a - honk = x - x -``` - -``` ucm :added-by-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 : a -> a -``` diff --git a/unison-src/transcripts/bug-strange-closure.output.md b/unison-src/transcripts/bug-strange-closure.output.md deleted file mode 100644 index 23a5fc90db..0000000000 --- a/unison-src/transcripts/bug-strange-closure.output.md +++ /dev/null @@ -1,4522 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -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 -scratch/main> display doc.guide - - # Unison computable documentation - - # Basic formatting - - Paragraphs are separated by one or more blanklines. - Sections have a title and 0 or more paragraphs or other - section elements. - - Text can be bold, *italicized*, ~~strikethrough~~, or - `monospaced` (or `monospaced`). - - You can link to Unison terms, types, and external URLs: - - * An external url - * Some is a term link; Optional is a type link - * A named type link and a named term link. Term links are - handy for linking to other documents! - - You can use `{{ .. }}` to escape out to regular Unison - syntax, for instance __not bold__. This is useful for - creating documents programmatically or just including - other documents. - - *Next up:* lists - - # Lists - - # Bulleted lists - - Bulleted lists can use `+`, `-`, or `*` for the bullets - (though the choice will be normalized away by the - pretty-printer). They can be nested, to any depth: - - * A - * B - * C - * C1 - * C2 - - # Numbered lists - - 1. A - 2. B - 3. C - - The first number of the list determines the starting - number in the rendered output. The other numbers are - ignored: - - 10. A - 11. B - 12. C - - Numbered lists can be nested as well, and combined with - bulleted lists: - - 1. Wake up. - * What am I doing here? - * In this nested list. - 2. Take shower. - 3. Get dressed. - - # Evaluation - - Expressions can be evaluated inline, for instance `2`. - - Blocks of code can be evaluated as well, for instance: - - id x = x - id (sqr 10) - ⧨ - 100 - - also: - - match 1 with - 1 -> "hi" - _ -> "goodbye" - ⧨ - "hi" - - To include a typechecked snippet of code without - evaluating it, you can do: - - use Nat * - cube : Nat -> Nat - cube x = x * x * x - - # Including Unison source code - - Unison definitions can be included in docs. For instance: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - Some rendering targets also support folded source: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - You can also include just a signature, inline, with - `sqr : Nat -> Nat`, or you can include one or more - signatures as a block: - - sqr : Nat -> Nat - - Nat.+ : Nat -> Nat -> Nat - - Or alternately: - - List.map : (a ->{e} b) -> [a] ->{e} [b] - - # Inline snippets - - You can include typechecked code snippets inline, for - instance: - - * `f x Nat.+ sqr 1` - the `2` says to ignore the first - two arguments when rendering. In richer renderers, the - `sqr` link will be clickable. - * If your snippet expression is just a single function - application, you can put it in double backticks, like - so: `sqr x`. This is equivalent to `sqr x`. - - # Non-Unison code blocks - - Use three or more single quotes to start a block with no - syntax highlighting: - - ``` raw - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - ``` - - You can use three or more backticks plus a language name - for blocks with syntax highlighting: - - ``` Haskell - -- A fenced code block which isn't parsed by Unison - reverse = foldl (flip (:)) [] - ``` - - ``` Scala - // A fenced code block which isn't parsed by Unison - def reverse[A](xs: List[A]) = - xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) - ``` - - There are also asides, callouts, tables, tooltips, and more. - These don't currently have special syntax; just use the - `{{ }}` syntax to call these functions directly. - - docAside : Doc2 -> Doc2 - - docCallout : Optional Doc2 -> Doc2 -> Doc2 - - docBlockquote : Doc2 -> Doc2 - - docTooltip : Doc2 -> Doc2 -> Doc2 - - docTable : [[Doc2]] -> Doc2 - - This is an aside. ( - Some extra detail that doesn't belong in main text. ) - - | This is an important callout, with no icon. - - | 🌻 - | - | This is an important callout, with an icon. The text - | wraps onto multiple lines. - - > "And what is the use of a book," thought Alice, "without - > pictures or conversation?" - > - > *Lewis Carroll, Alice's Adventures in Wonderland* - - Hover over me - - a b A longer paragraph that will split - onto multiple lines, such that this - row occupies multiple lines in the - rendered table. - Some text More text Zounds! -scratch/main> add - - ⍟ I've added these definitions: - - basicFormatting : Doc2 - doc.guide : Doc2 - evaluation : Doc2 - includingSource : Doc2 - lists : Doc2 - nonUnisonCodeBlocks : Doc2 - otherElements : Doc2 - sqr : Nat -> Nat -scratch/main> display doc.guide - - # Unison computable documentation - - # Basic formatting - - Paragraphs are separated by one or more blanklines. - Sections have a title and 0 or more paragraphs or other - section elements. - - Text can be bold, *italicized*, ~~strikethrough~~, or - `monospaced` (or `monospaced`). - - You can link to Unison terms, types, and external URLs: - - * An external url - * Some is a term link; Optional is a type link - * A named type link and a named term link. Term links are - handy for linking to other documents! - - You can use `{{ .. }}` to escape out to regular Unison - syntax, for instance __not bold__. This is useful for - creating documents programmatically or just including - other documents. - - *Next up:* lists - - # Lists - - # Bulleted lists - - Bulleted lists can use `+`, `-`, or `*` for the bullets - (though the choice will be normalized away by the - pretty-printer). They can be nested, to any depth: - - * A - * B - * C - * C1 - * C2 - - # Numbered lists - - 1. A - 2. B - 3. C - - The first number of the list determines the starting - number in the rendered output. The other numbers are - ignored: - - 10. A - 11. B - 12. C - - Numbered lists can be nested as well, and combined with - bulleted lists: - - 1. Wake up. - * What am I doing here? - * In this nested list. - 2. Take shower. - 3. Get dressed. - - # Evaluation - - Expressions can be evaluated inline, for instance `2`. - - Blocks of code can be evaluated as well, for instance: - - id x = x - id (sqr 10) - ⧨ - 100 - - also: - - match 1 with - 1 -> "hi" - _ -> "goodbye" - ⧨ - "hi" - - To include a typechecked snippet of code without - evaluating it, you can do: - - use Nat * - cube : Nat -> Nat - cube x = x * x * x - - # Including Unison source code - - Unison definitions can be included in docs. For instance: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - Some rendering targets also support folded source: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - You can also include just a signature, inline, with - `sqr : Nat -> Nat`, or you can include one or more - signatures as a block: - - sqr : Nat -> Nat - - Nat.+ : Nat -> Nat -> Nat - - Or alternately: - - List.map : (a ->{e} b) -> [a] ->{e} [b] - - # Inline snippets - - You can include typechecked code snippets inline, for - instance: - - * `f x Nat.+ sqr 1` - the `2` says to ignore the first - two arguments when rendering. In richer renderers, the - `sqr` link will be clickable. - * If your snippet expression is just a single function - application, you can put it in double backticks, like - so: `sqr x`. This is equivalent to `sqr x`. - - # Non-Unison code blocks - - Use three or more single quotes to start a block with no - syntax highlighting: - - ``` raw - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - ``` - - You can use three or more backticks plus a language name - for blocks with syntax highlighting: - - ``` Haskell - -- A fenced code block which isn't parsed by Unison - reverse = foldl (flip (:)) [] - ``` - - ``` Scala - // A fenced code block which isn't parsed by Unison - def reverse[A](xs: List[A]) = - xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) - ``` - - There are also asides, callouts, tables, tooltips, and more. - These don't currently have special syntax; just use the - `{{ }}` syntax to call these functions directly. - - docAside : Doc2 -> Doc2 - - docCallout : Optional Doc2 -> Doc2 -> Doc2 - - docBlockquote : Doc2 -> Doc2 - - docTooltip : Doc2 -> Doc2 -> Doc2 - - docTable : [[Doc2]] -> Doc2 - - This is an aside. ( - Some extra detail that doesn't belong in main text. ) - - | This is an important callout, with no icon. - - | 🌻 - | - | This is an important callout, with an icon. The text - | wraps onto multiple lines. - - > "And what is the use of a book," thought Alice, "without - > pictures or conversation?" - > - > *Lewis Carroll, Alice's Adventures in Wonderland* - - Hover over me - - a b A longer paragraph that will split - onto multiple lines, such that this - row occupies multiple lines in the - rendered table. - Some text More text Zounds! -```` - -But we can't display this due to a decompilation problem. - -``` unison -rendered = Pretty.get (docFormatConsole doc.guide) -``` - -``` ucm :added-by-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`: - - rendered : Annotated () (Either SpecialForm ConsoleText) -``` - -```` ucm -scratch/main> display rendered - - # Unison computable documentation - - # Basic formatting - - Paragraphs are separated by one or more blanklines. - Sections have a title and 0 or more paragraphs or other - section elements. - - Text can be bold, *italicized*, ~~strikethrough~~, or - `monospaced` (or `monospaced`). - - You can link to Unison terms, types, and external URLs: - - * An external url - * Some is a term link; Optional is a type link - * A named type link and a named term link. Term links are - handy for linking to other documents! - - You can use `{{ .. }}` to escape out to regular Unison - syntax, for instance __not bold__. This is useful for - creating documents programmatically or just including - other documents. - - *Next up:* lists - - # Lists - - # Bulleted lists - - Bulleted lists can use `+`, `-`, or `*` for the bullets - (though the choice will be normalized away by the - pretty-printer). They can be nested, to any depth: - - * A - * B - * C - * C1 - * C2 - - # Numbered lists - - 1. A - 2. B - 3. C - - The first number of the list determines the starting - number in the rendered output. The other numbers are - ignored: - - 10. A - 11. B - 12. C - - Numbered lists can be nested as well, and combined with - bulleted lists: - - 1. Wake up. - * What am I doing here? - * In this nested list. - 2. Take shower. - 3. Get dressed. - - # Evaluation - - Expressions can be evaluated inline, for instance `2`. - - Blocks of code can be evaluated as well, for instance: - - id x = x - id (sqr 10) - ⧨ - 100 - - also: - - match 1 with - 1 -> "hi" - _ -> "goodbye" - ⧨ - "hi" - - To include a typechecked snippet of code without - evaluating it, you can do: - - use Nat * - cube : Nat -> Nat - cube x = x * x * x - - # Including Unison source code - - Unison definitions can be included in docs. For instance: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - Some rendering targets also support folded source: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - You can also include just a signature, inline, with - `sqr : Nat -> Nat`, or you can include one or more - signatures as a block: - - sqr : Nat -> Nat - - Nat.+ : Nat -> Nat -> Nat - - Or alternately: - - List.map : (a ->{e} b) -> [a] ->{e} [b] - - # Inline snippets - - You can include typechecked code snippets inline, for - instance: - - * `f x Nat.+ sqr 1` - the `2` says to ignore the first - two arguments when rendering. In richer renderers, the - `sqr` link will be clickable. - * If your snippet expression is just a single function - application, you can put it in double backticks, like - so: `sqr x`. This is equivalent to `sqr x`. - - # Non-Unison code blocks - - Use three or more single quotes to start a block with no - syntax highlighting: - - ``` raw - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - ``` - - You can use three or more backticks plus a language name - for blocks with syntax highlighting: - - ``` Haskell - -- A fenced code block which isn't parsed by Unison - reverse = foldl (flip (:)) [] - ``` - - ``` Scala - // A fenced code block which isn't parsed by Unison - def reverse[A](xs: List[A]) = - xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) - ``` - - There are also asides, callouts, tables, tooltips, and more. - These don't currently have special syntax; just use the - `{{ }}` syntax to call these functions directly. - - docAside : Doc2 -> Doc2 - - docCallout : Optional Doc2 -> Doc2 -> Doc2 - - docBlockquote : Doc2 -> Doc2 - - docTooltip : Doc2 -> Doc2 -> Doc2 - - docTable : [[Doc2]] -> Doc2 - - This is an aside. ( - Some extra detail that doesn't belong in main text. ) - - | This is an important callout, with no icon. - - | 🌻 - | - | This is an important callout, with an icon. The text - | wraps onto multiple lines. - - > "And what is the use of a book," thought Alice, "without - > pictures or conversation?" - > - > *Lewis Carroll, Alice's Adventures in Wonderland* - - Hover over me - - a b A longer paragraph that will split - onto multiple lines, such that this - row occupies multiple lines in the - rendered table. - Some text More text Zounds! -scratch/main> add - - ⍟ I've added these definitions: - - rendered : Annotated () (Either SpecialForm ConsoleText) -scratch/main> display rendered - - # Unison computable documentation - - # Basic formatting - - Paragraphs are separated by one or more blanklines. - Sections have a title and 0 or more paragraphs or other - section elements. - - Text can be bold, *italicized*, ~~strikethrough~~, or - `monospaced` (or `monospaced`). - - You can link to Unison terms, types, and external URLs: - - * An external url - * Some is a term link; Optional is a type link - * A named type link and a named term link. Term links are - handy for linking to other documents! - - You can use `{{ .. }}` to escape out to regular Unison - syntax, for instance __not bold__. This is useful for - creating documents programmatically or just including - other documents. - - *Next up:* lists - - # Lists - - # Bulleted lists - - Bulleted lists can use `+`, `-`, or `*` for the bullets - (though the choice will be normalized away by the - pretty-printer). They can be nested, to any depth: - - * A - * B - * C - * C1 - * C2 - - # Numbered lists - - 1. A - 2. B - 3. C - - The first number of the list determines the starting - number in the rendered output. The other numbers are - ignored: - - 10. A - 11. B - 12. C - - Numbered lists can be nested as well, and combined with - bulleted lists: - - 1. Wake up. - * What am I doing here? - * In this nested list. - 2. Take shower. - 3. Get dressed. - - # Evaluation - - Expressions can be evaluated inline, for instance `2`. - - Blocks of code can be evaluated as well, for instance: - - id x = x - id (sqr 10) - ⧨ - 100 - - also: - - match 1 with - 1 -> "hi" - _ -> "goodbye" - ⧨ - "hi" - - To include a typechecked snippet of code without - evaluating it, you can do: - - use Nat * - cube : Nat -> Nat - cube x = x * x * x - - # Including Unison source code - - Unison definitions can be included in docs. For instance: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - Some rendering targets also support folded source: - - structural type Optional a = Some a | None - - sqr : Nat -> Nat - sqr x = - use Nat * - x * x - - You can also include just a signature, inline, with - `sqr : Nat -> Nat`, or you can include one or more - signatures as a block: - - sqr : Nat -> Nat - - Nat.+ : Nat -> Nat -> Nat - - Or alternately: - - List.map : (a ->{e} b) -> [a] ->{e} [b] - - # Inline snippets - - You can include typechecked code snippets inline, for - instance: - - * `f x Nat.+ sqr 1` - the `2` says to ignore the first - two arguments when rendering. In richer renderers, the - `sqr` link will be clickable. - * If your snippet expression is just a single function - application, you can put it in double backticks, like - so: `sqr x`. This is equivalent to `sqr x`. - - # Non-Unison code blocks - - Use three or more single quotes to start a block with no - syntax highlighting: - - ``` raw - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - ``` - - You can use three or more backticks plus a language name - for blocks with syntax highlighting: - - ``` Haskell - -- A fenced code block which isn't parsed by Unison - reverse = foldl (flip (:)) [] - ``` - - ``` Scala - // A fenced code block which isn't parsed by Unison - def reverse[A](xs: List[A]) = - xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) - ``` - - There are also asides, callouts, tables, tooltips, and more. - These don't currently have special syntax; just use the - `{{ }}` syntax to call these functions directly. - - docAside : Doc2 -> Doc2 - - docCallout : Optional Doc2 -> Doc2 -> Doc2 - - docBlockquote : Doc2 -> Doc2 - - docTooltip : Doc2 -> Doc2 -> Doc2 - - docTable : [[Doc2]] -> Doc2 - - This is an aside. ( - Some extra detail that doesn't belong in main text. ) - - | This is an important callout, with no icon. - - | 🌻 - | - | This is an important callout, with an icon. The text - | wraps onto multiple lines. - - > "And what is the use of a book," thought Alice, "without - > pictures or conversation?" - > - > *Lewis Carroll, Alice's Adventures in Wonderland* - - Hover over me - - a b A longer paragraph that will split - onto multiple lines, such that this - row occupies multiple lines in the - rendered table. - Some text More text Zounds! -scratch/main> undo - - Here are the changes I undid - - Added definitions: - - 1. rendered : Annotated () (Either SpecialForm ConsoleText) -```` - -And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. - -``` unison -rendered = Pretty.get (docFormatConsole doc.guide) - -> rendered -``` - -```` ucm :added-by-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`: - - rendered : Annotated () (Either SpecialForm ConsoleText) - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 3 | > rendered - ⧩ - Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold (Plain "Unison"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "computable"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "documentation"))) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain "Basic"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "formatting"))) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "Paragraphs")) - , Lit - () (Right (Plain "are")) - , Lit - () - (Right - (Plain "separated")) - , Lit - () (Right (Plain "by")) - , Lit - () (Right (Plain "one")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "more")) - , Lit - () - (Right - (Plain "blanklines.")) - , Lit - () - (Right - (Plain "Sections")) - , Lit - () - (Right (Plain "have")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right (Plain "title")) - , Lit - () (Right (Plain "and")) - , Lit () (Right (Plain "0")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "more")) - , Lit - () - (Right - (Plain "paragraphs")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "other")) - , Lit - () - (Right (Plain "section")) - , Lit - () - (Right - (Plain "elements.")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "Text")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "be")) - , Annotated.Group - () - (Annotated.Append - () - [ Wrap - () - (Lit - () - (Right - (ConsoleText.Bold - (Plain - "bold")))) - , Lit - () - (Right (Plain ",")) - ]) - , Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "*")) - , Wrap - () - (Lit - () - (Right - (Plain - "italicized"))) - , Lit - () - (Right - (Plain "*")) - ]) - , Lit - () - (Right (Plain ",")) - ]) - , Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "~~")) - , Wrap - () - (Lit - () - (Right - (Plain - "strikethrough"))) - , Lit - () - (Right - (Plain - "~~")) - ]) - , Lit - () - (Right (Plain ",")) - ]) - , Lit - () (Right (Plain "or")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "`")) - , Lit - () - (Right - (Plain - "monospaced")) - , Lit - () - (Right (Plain "`")) - ]) - , Lit - () (Right (Plain "(or")) - , Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "`")) - , Lit - () - (Right - (Plain - "monospaced")) - , Lit - () - (Right - (Plain "`")) - ]) - , Lit - () - (Right - (Plain ").")) - ]) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "You")) - , Lit - () (Right (Plain "can")) - , Lit - () - (Right (Plain "link")) - , Lit - () (Right (Plain "to")) - , Lit - () - (Right (Plain "Unison")) - , Lit - () - (Right (Plain "terms,")) - , Lit - () - (Right (Plain "types,")) - , Lit - () (Right (Plain "and")) - , Lit - () - (Right - (Plain "external")) - , Lit - () - (Right (Plain "URLs:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right (Plain "* "))) - (Lit - () - (Right (Plain " "))) - (Wrap - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Underline - (Plain - "An"))) - , Lit - () - (Right - (Underline - (Plain - "external"))) - , Lit - () - (Right - (Underline - (Plain - "url"))) - ]))) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain "* "))) - (Lit - () - (Right (Plain " "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Left - (SpecialForm.Link - (Right - (Term.Term - (Any - (do - Some)))))) - , Lit - () - (Right - (Plain "is")) - , Lit - () - (Right - (Plain "a")) - , Lit - () - (Right - (Plain "term")) - , Lit - () - (Right - (Plain "link;")) - , Lit - () - (Left - (SpecialForm.Link - (Left - (typeLink Optional)))) - , Lit - () - (Right - (Plain "is")) - , Lit - () - (Right - (Plain "a")) - , Lit - () - (Right - (Plain "type")) - , Lit - () - (Right - (Plain "link")) - ])) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain "* "))) - (Lit - () - (Right (Plain " "))) - (Wrap - () - (Annotated.Append - () - [ Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Underline - (Plain - "A"))) - , Lit - () - (Right - (Underline - (Plain - "named"))) - , Lit - () - (Right - (Underline - (Plain - "type"))) - , Lit - () - (Right - (Underline - (Plain - "link"))) - ]) - , Lit - () - (Right - (Plain "and")) - , Annotated.Group - () - (Annotated.Append - () - [ Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Underline - (Plain - "a"))) - , Lit - () - (Right - (Underline - (Plain - "named"))) - , Lit - () - (Right - (Underline - (Plain - "term"))) - , Lit - () - (Right - (Underline - (Plain - "link"))) - ]) - , Lit - () - (Right - (Plain - ".")) - ]) - , Lit - () - (Right - (Plain "Term")) - , Lit - () - (Right - (Plain "links")) - , Lit - () - (Right - (Plain "are")) - , Lit - () - (Right - (Plain "handy")) - , Lit - () - (Right - (Plain "for")) - , Lit - () - (Right - (Plain - "linking")) - , Lit - () - (Right - (Plain "to")) - , Lit - () - (Right - (Plain "other")) - , Lit - () - (Right - (Plain - "documents!")) - ])) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "You")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "use")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "`")) - , Lit - () - (Right - (Plain - "{{ .. }}")) - , Lit - () - (Right (Plain "`")) - ]) - , Lit - () (Right (Plain "to")) - , Lit - () - (Right (Plain "escape")) - , Lit - () (Right (Plain "out")) - , Lit - () (Right (Plain "to")) - , Lit - () - (Right (Plain "regular")) - , Lit - () - (Right (Plain "Unison")) - , Lit - () - (Right (Plain "syntax,")) - , Lit - () (Right (Plain "for")) - , Lit - () - (Right - (Plain "instance")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "__not bold__")) - , Lit - () - (Right (Plain ".")) - ]) - , Lit - () - (Right (Plain "This")) - , Lit - () (Right (Plain "is")) - , Lit - () - (Right (Plain "useful")) - , Lit - () (Right (Plain "for")) - , Lit - () - (Right - (Plain "creating")) - , Lit - () - (Right - (Plain "documents")) - , Lit - () - (Right - (Plain - "programmatically")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "just")) - , Lit - () - (Right - (Plain "including")) - , Lit - () - (Right (Plain "other")) - , Lit - () - (Right - (Plain "documents.")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "*")) - , Lit - () - (Right - (Plain "Next")) - ]) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "up:")) - , Lit - () - (Right (Plain "*")) - ]) - , Lit - () - (Left - (SpecialForm.Link - (Right - (Term.Term - (Any (do lists)))))) - ]))) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Right - (ConsoleText.Bold - (Plain "Lists")))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right (Plain "# "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain - "Bulleted"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain - "lists"))) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Bulleted")) - , Lit - () - (Right - (Plain - "lists")) - , Lit - () - (Right - (Plain "can")) - , Lit - () - (Right - (Plain "use")) - , Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "`")) - , Lit - () - (Right - (Plain - "+")) - , Lit - () - (Right - (Plain - "`")) - ]) - , Lit - () - (Right - (Plain - ",")) - ]) - , Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "`")) - , Lit - () - (Right - (Plain - "-")) - , Lit - () - (Right - (Plain - "`")) - ]) - , Lit - () - (Right - (Plain - ",")) - ]) - , Lit - () - (Right - (Plain "or")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "`")) - , Lit - () - (Right - (Plain - "*")) - , Lit - () - (Right - (Plain - "`")) - ]) - , Lit - () - (Right - (Plain "for")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "bullets")) - , Lit - () - (Right - (Plain - "(though")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "choice")) - , Lit - () - (Right - (Plain - "will")) - , Lit - () - (Right - (Plain "be")) - , Lit - () - (Right - (Plain - "normalized")) - , Lit - () - (Right - (Plain - "away")) - , Lit - () - (Right - (Plain "by")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "pretty-printer).")) - , Lit - () - (Right - (Plain - "They")) - , Lit - () - (Right - (Plain "can")) - , Lit - () - (Right - (Plain "be")) - , Lit - () - (Right - (Plain - "nested,")) - , Lit - () - (Right - (Plain "to")) - , Lit - () - (Right - (Plain "any")) - , Lit - () - (Right - (Plain - "depth:")) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right - (Plain - "* "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "A")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "* "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "B")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "* "))) - (Lit - () - (Right - (Plain - " "))) - (Annotated.Append - () - [ Wrap - () - (Lit - () - (Right - (Plain - "C"))) - , Lit - () - (Right - (Plain - "\n")) - , Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - ( - ) - (Right - (Plain - "* "))) - (Lit - ( - ) - (Right - (Plain - " "))) - (Wrap - ( - ) - (Lit - ( - ) - (Right - (Plain - "C1")))) - , Lit - () - (Right - (Plain - "\n")) - , Indent - () - (Lit - ( - ) - (Right - (Plain - "* "))) - (Lit - ( - ) - (Right - (Plain - " "))) - (Wrap - ( - ) - (Lit - ( - ) - (Right - (Plain - "C2")))) - ]) - ]) - ]))) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right (Plain "# "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain - "Numbered"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain - "lists"))) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right - (Plain - "1. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "A")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "2. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "B")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "3. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "C")))) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "The")) - , Lit - () - (Right - (Plain - "first")) - , Lit - () - (Right - (Plain - "number")) - , Lit - () - (Right - (Plain "of")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "list")) - , Lit - () - (Right - (Plain - "determines")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "starting")) - , Lit - () - (Right - (Plain - "number")) - , Lit - () - (Right - (Plain "in")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "rendered")) - , Lit - () - (Right - (Plain - "output.")) - , Lit - () - (Right - (Plain "The")) - , Lit - () - (Right - (Plain - "other")) - , Lit - () - (Right - (Plain - "numbers")) - , Lit - () - (Right - (Plain "are")) - , Lit - () - (Right - (Plain - "ignored:")) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right - (Plain - "10. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "A")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "11. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "B")))) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "12. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Lit - () - (Right - (Plain - "C")))) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Numbered")) - , Lit - () - (Right - (Plain - "lists")) - , Lit - () - (Right - (Plain "can")) - , Lit - () - (Right - (Plain "be")) - , Lit - () - (Right - (Plain - "nested")) - , Lit - () - (Right - (Plain "as")) - , Lit - () - (Right - (Plain - "well,")) - , Lit - () - (Right - (Plain "and")) - , Lit - () - (Right - (Plain - "combined")) - , Lit - () - (Right - (Plain - "with")) - , Lit - () - (Right - (Plain - "bulleted")) - , Lit - () - (Right - (Plain - "lists:")) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right - (Plain - "1. "))) - (Lit - () - (Right - (Plain - " "))) - (Annotated.Append - () - [ Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Wake")) - , Lit - () - (Right - (Plain - "up.")) - ]) - , Lit - () - (Right - (Plain - "\n")) - , Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - ( - ) - (Right - (Plain - "* "))) - (Lit - ( - ) - (Right - (Plain - " "))) - (Wrap - ( - ) - (Annotated.Append - ( - ) - [ Lit - ( - ) - (Right - (Plain - "What")) - , Lit - ( - ) - (Right - (Plain - "am")) - , Lit - ( - ) - (Right - (Plain - "I")) - , Lit - ( - ) - (Right - (Plain - "doing")) - , Lit - ( - ) - (Right - (Plain - "here?")) - ])) - , Lit - () - (Right - (Plain - "\n")) - , Indent - () - (Lit - ( - ) - (Right - (Plain - "* "))) - (Lit - ( - ) - (Right - (Plain - " "))) - (Wrap - ( - ) - (Annotated.Append - ( - ) - [ Lit - ( - ) - (Right - (Plain - "In")) - , Lit - ( - ) - (Right - (Plain - "this")) - , Lit - ( - ) - (Right - (Plain - "nested")) - , Lit - ( - ) - (Right - (Plain - "list.")) - ])) - ]) - ]) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "2. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Take")) - , Lit - () - (Right - (Plain - "shower.")) - ])) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "3. "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Get")) - , Lit - () - (Right - (Plain - "dressed.")) - ])) - ]))) - ]))) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Right - (ConsoleText.Bold - (Plain "Evaluation")))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "Expressions")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "be")) - , Lit - () - (Right - (Plain "evaluated")) - , Lit - () - (Right (Plain "inline,")) - , Lit - () (Right (Plain "for")) - , Lit - () - (Right - (Plain "instance")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Left - (EvalInline - (Term.Term - (Any - (do - 1 - Nat.+ 1))))) - , Lit - () - (Right (Plain ".")) - ]) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "Blocks")) - , Lit - () (Right (Plain "of")) - , Lit - () - (Right (Plain "code")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "be")) - , Lit - () - (Right - (Plain "evaluated")) - , Lit - () (Right (Plain "as")) - , Lit - () - (Right (Plain "well,")) - , Lit - () (Right (Plain "for")) - , Lit - () - (Right - (Plain "instance:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () (Lit - () (Left - (Eval - (Term.Term - (Any - (do - id x = x - id (sqr 10)))))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () (Right (Plain "also:"))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () (Lit - () (Left - (Eval - (Term.Term - (Any - (do match 1 with - 1 -> "hi" - _ -> "goodbye"))))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "To")) - , Lit - () - (Right (Plain "include")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right - (Plain "typechecked")) - , Lit - () - (Right (Plain "snippet")) - , Lit - () (Right (Plain "of")) - , Lit - () - (Right (Plain "code")) - , Lit - () - (Right (Plain "without")) - , Lit - () - (Right - (Plain "evaluating")) - , Lit - () (Right (Plain "it,")) - , Lit - () (Right (Plain "you")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "do:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () (Lit - () (Left - (ExampleBlock - 0 (Term.Term - (Any - (do - use Nat * - cube : Nat -> Nat - cube x = x * x * x - ()))))))) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain "Including"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "Unison"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "source"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "code"))) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "Unison")) - , Lit - () - (Right - (Plain "definitions")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "be")) - , Lit - () - (Right - (Plain "included")) - , Lit - () (Right (Plain "in")) - , Lit - () - (Right (Plain "docs.")) - , Lit - () (Right (Plain "For")) - , Lit - () - (Right - (Plain "instance:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Left - (SpecialForm.Source - [ ( Left - (typeLink Optional) - , [] - ) - , ( Right - (Term.Term - (Any (do sqr))) - , [] - ) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "Some")) - , Lit - () - (Right - (Plain "rendering")) - , Lit - () - (Right (Plain "targets")) - , Lit - () - (Right (Plain "also")) - , Lit - () - (Right (Plain "support")) - , Lit - () - (Right (Plain "folded")) - , Lit - () - (Right (Plain "source:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Left - (FoldedSource - [ ( Left - (typeLink Optional) - , [] - ) - , ( Right - (Term.Term - (Any (do sqr))) - , [] - ) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "You")) - , Lit - () (Right (Plain "can")) - , Lit - () - (Right (Plain "also")) - , Lit - () - (Right (Plain "include")) - , Lit - () - (Right (Plain "just")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right - (Plain "signature,")) - , Lit - () - (Right (Plain "inline,")) - , Lit - () - (Right (Plain "with")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Left - (SignatureInline - (Term.Term - (Any - (do sqr))))) - , Lit - () - (Right (Plain ",")) - ]) - , Lit - () (Right (Plain "or")) - , Lit - () (Right (Plain "you")) - , Lit - () (Right (Plain "can")) - , Lit - () - (Right (Plain "include")) - , Lit - () (Right (Plain "one")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "more")) - , Lit - () - (Right - (Plain "signatures")) - , Lit - () (Right (Plain "as")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right (Plain "block:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Left - (SpecialForm.Signature - [ Term.Term - (Any (do sqr)) - , Term.Term - (Any (do (Nat.+))) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "Or")) - , Lit - () - (Right - (Plain "alternately:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Lit - () - (Left - (SpecialForm.Signature - [ Term.Term - (Any (do List.map)) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right (Plain "# "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain - "Inline"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain - "snippets"))) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "You")) - , Lit - () - (Right - (Plain "can")) - , Lit - () - (Right - (Plain - "include")) - , Lit - () - (Right - (Plain - "typechecked")) - , Lit - () - (Right - (Plain - "code")) - , Lit - () - (Right - (Plain - "snippets")) - , Lit - () - (Right - (Plain - "inline,")) - , Lit - () - (Right - (Plain "for")) - , Lit - () - (Right - (Plain - "instance:")) - ]))) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "\n")) - , Indent - () - (Lit - () - (Right (Plain " "))) - (Lit - () - (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit - () - (Right - (Plain - "* "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Left - (Example - 2 - (Term.Term - (Any - (do - f - x -> - f - x - Nat.+ sqr - 1))))) - , Lit - () - (Right - (Plain - "-")) - , Lit - () - (Right - (Plain - "the")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - ( - ) - (Right - (Plain - "`")) - , Lit - ( - ) - (Right - (Plain - "2")) - , Lit - ( - ) - (Right - (Plain - "`")) - ]) - , Lit - () - (Right - (Plain - "says")) - , Lit - () - (Right - (Plain - "to")) - , Lit - () - (Right - (Plain - "ignore")) - , Lit - () - (Right - (Plain - "the")) - , Lit - () - (Right - (Plain - "first")) - , Lit - () - (Right - (Plain - "two")) - , Lit - () - (Right - (Plain - "arguments")) - , Lit - () - (Right - (Plain - "when")) - , Lit - () - (Right - (Plain - "rendering.")) - , Lit - () - (Right - (Plain - "In")) - , Lit - () - (Right - (Plain - "richer")) - , Lit - () - (Right - (Plain - "renderers,")) - , Lit - () - (Right - (Plain - "the")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - ( - ) - (Right - (Plain - "`")) - , Lit - ( - ) - (Right - (Plain - "sqr")) - , Lit - ( - ) - (Right - (Plain - "`")) - ]) - , Lit - () - (Right - (Plain - "link")) - , Lit - () - (Right - (Plain - "will")) - , Lit - () - (Right - (Plain - "be")) - , Lit - () - (Right - (Plain - "clickable.")) - ])) - , Lit - () - (Right - (Plain "\n")) - , Indent - () - (Lit - () - (Right - (Plain - "* "))) - (Lit - () - (Right - (Plain - " "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "If")) - , Lit - () - (Right - (Plain - "your")) - , Lit - () - (Right - (Plain - "snippet")) - , Lit - () - (Right - (Plain - "expression")) - , Lit - () - (Right - (Plain - "is")) - , Lit - () - (Right - (Plain - "just")) - , Lit - () - (Right - (Plain - "a")) - , Lit - () - (Right - (Plain - "single")) - , Lit - () - (Right - (Plain - "function")) - , Lit - () - (Right - (Plain - "application,")) - , Lit - () - (Right - (Plain - "you")) - , Lit - () - (Right - (Plain - "can")) - , Lit - () - (Right - (Plain - "put")) - , Lit - () - (Right - (Plain - "it")) - , Lit - () - (Right - (Plain - "in")) - , Lit - () - (Right - (Plain - "double")) - , Lit - () - (Right - (Plain - "backticks,")) - , Lit - () - (Right - (Plain - "like")) - , Lit - () - (Right - (Plain - "so:")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - ( - ) - (Left - (Example - 1 - (Term.Term - (Any - (do - x -> - sqr - x))))) - , Lit - ( - ) - (Right - (Plain - ".")) - ]) - , Lit - () - (Right - (Plain - "This")) - , Lit - () - (Right - (Plain - "is")) - , Lit - () - (Right - (Plain - "equivalent")) - , Lit - () - (Right - (Plain - "to")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - ( - ) - (Left - (Example - 1 - (Term.Term - (Any - (do - x -> - sqr - x))))) - , Lit - ( - ) - (Right - (Plain - ".")) - ]) - ])) - ]))) - ]))) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Indent - () - (Lit () (Right (Plain "# "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (ConsoleText.Bold - (Plain "Non-Unison"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "code"))) - , Lit - () - (Right - (ConsoleText.Bold - (Plain "blocks"))) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "Use")) - , Lit - () - (Right (Plain "three")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "more")) - , Lit - () - (Right (Plain "single")) - , Lit - () - (Right (Plain "quotes")) - , Lit - () (Right (Plain "to")) - , Lit - () - (Right (Plain "start")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right (Plain "block")) - , Lit - () - (Right (Plain "with")) - , Lit - () (Right (Plain "no")) - , Lit - () - (Right (Plain "syntax")) - , Lit - () - (Right - (Plain "highlighting:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "``` ")) - , Annotated.Group - () - (Lit - () - (Right (Plain "raw"))) - , Lit - () - (Right (Plain "\n")) - , Lit - () - (Right - (Plain - " _____ _ \n | | |___|_|___ ___ ___ \n | | | | |_ -| . | |\n |_____|_|_|_|___|___|_|_|\n ")) - , Lit - () - (Right (Plain "\n")) - , Lit - () - (Right (Plain "```")) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "You")) - , Lit - () (Right (Plain "can")) - , Lit - () (Right (Plain "use")) - , Lit - () - (Right (Plain "three")) - , Lit - () (Right (Plain "or")) - , Lit - () - (Right (Plain "more")) - , Lit - () - (Right - (Plain "backticks")) - , Lit - () - (Right (Plain "plus")) - , Lit () (Right (Plain "a")) - , Lit - () - (Right - (Plain "language")) - , Lit - () - (Right (Plain "name")) - , Lit - () (Right (Plain "for")) - , Lit - () - (Right (Plain "blocks")) - , Lit - () - (Right (Plain "with")) - , Lit - () - (Right (Plain "syntax")) - , Lit - () - (Right - (Plain "highlighting:")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "``` ")) - , Annotated.Group - () - (Lit - () - (Right - (Plain "Haskell"))) - , Lit - () (Right (Plain "\n")) - , Lit - () - (Right - (Plain - "-- A fenced code block which isn't parsed by Unison\nreverse = foldl (flip (:)) []")) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "```")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "``` ")) - , Annotated.Group - () - (Lit - () - (Right (Plain "Scala"))) - , Lit - () (Right (Plain "\n")) - , Lit - () - (Right - (Plain - "// A fenced code block which isn't parsed by Unison\ndef reverse[A](xs: List[A]) = \n xs.foldLeft(Nil : List[A])((acc,a) => a +: acc)")) - , Lit - () (Right (Plain "\n")) - , Lit - () (Right (Plain "```")) - ]))) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Indent - () - (Lit () (Right (Plain " "))) - (Lit () (Right (Plain " "))) - (Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "There")) - , Lit () (Right (Plain "are")) - , Lit - () (Right (Plain "also")) - , Lit - () - (Right (Plain "asides,")) - , Lit - () - (Right (Plain "callouts,")) - , Lit - () - (Right (Plain "tables,")) - , Lit - () - (Right (Plain "tooltips,")) - , Lit () (Right (Plain "and")) - , Lit - () (Right (Plain "more.")) - , Lit - () (Right (Plain "These")) - , Lit - () (Right (Plain "don't")) - , Lit - () - (Right (Plain "currently")) - , Lit - () (Right (Plain "have")) - , Lit - () - (Right (Plain "special")) - , Lit - () - (Right (Plain "syntax;")) - , Lit - () (Right (Plain "just")) - , Lit () (Right (Plain "use")) - , Lit () (Right (Plain "the")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "`")) - , Lit - () - (Right - (Plain "{{ }}")) - , Lit - () - (Right (Plain "`")) - ]) - , Lit - () - (Right (Plain "syntax")) - , Lit () (Right (Plain "to")) - , Lit - () (Right (Plain "call")) - , Lit - () (Right (Plain "these")) - , Lit - () - (Right (Plain "functions")) - , Lit - () - (Right (Plain "directly.")) - ])) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Lit - () - (Left - (SpecialForm.Signature - [ Term.Term - (Any (do docAside)) - , Term.Term - (Any (do docCallout)) - , Term.Term - (Any - (do docBlockquote)) - , Term.Term - (Any (do docTooltip)) - , Term.Term - (Any (do docTable)) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () (Right (Plain "This")) - , Lit () (Right (Plain "is")) - , Lit () (Right (Plain "an")) - , Lit - () - (Right (Plain "aside.")) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "("))) - , Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Foreground - BrightBlack - (Plain "Some"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "extra"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "detail"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "that"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "doesn't"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "belong"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "in"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "main"))) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain "text."))) - ]) - , Lit - () - (Right - (Foreground - BrightBlack - (Plain ")"))) - ])) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Indent - () - (Lit - () (Right (Plain " | "))) - (Lit - () (Right (Plain " | "))) - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "This")) - , Lit - () - (Right (Plain "is")) - , Lit - () - (Right (Plain "an")) - , Lit - () - (Right - (Plain "important")) - , Lit - () - (Right - (Plain "callout,")) - , Lit - () - (Right - (Plain "with")) - , Lit - () - (Right (Plain "no")) - , Lit - () - (Right - (Plain "icon.")) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Indent - () - (Lit - () (Right (Plain " | "))) - (Lit - () (Right (Plain " | "))) - (Annotated.Append - () - [ Wrap - () - (Lit - () - (Right - (ConsoleText.Bold - (Plain "🌻")))) - , Lit - () - (Right (Plain "\n")) - , Lit - () (Right (Plain "")) - , Lit - () - (Right (Plain "\n")) - , Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "This")) - , Lit - () - (Right - (Plain "is")) - , Lit - () - (Right - (Plain "an")) - , Lit - () - (Right - (Plain - "important")) - , Lit - () - (Right - (Plain - "callout,")) - , Lit - () - (Right - (Plain "with")) - , Lit - () - (Right - (Plain "an")) - , Lit - () - (Right - (Plain "icon.")) - , Lit - () - (Right - (Plain "The")) - , Lit - () - (Right - (Plain "text")) - , Lit - () - (Right - (Plain "wraps")) - , Lit - () - (Right - (Plain "onto")) - , Lit - () - (Right - (Plain - "multiple")) - , Lit - () - (Right - (Plain - "lines.")) - ]) - ])))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Group - () - (Indent - () - (Lit () (Right (Plain "> "))) - (Lit () (Right (Plain "> "))) - (Annotated.Group - () - (Annotated.Append - () - [ Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "\"And")) - , Lit - () - (Right - (Plain - "what")) - , Lit - () - (Right - (Plain - "is")) - , Lit - () - (Right - (Plain - "the")) - , Lit - () - (Right - (Plain - "use")) - , Lit - () - (Right - (Plain - "of")) - , Lit - () - (Right - (Plain "a")) - , Lit - () - (Right - (Plain - "book,\"")) - , Lit - () - (Right - (Plain - "thought")) - , Lit - () - (Right - (Plain - "Alice,")) - , Lit - () - (Right - (Plain - "\"without")) - , Lit - () - (Right - (Plain - "pictures")) - , Lit - () - (Right - (Plain - "or")) - , Lit - () - (Right - (Plain - "conversation?\"")) - ])) - , Lit - () - (Right (Plain "\n")) - , Lit - () - (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Append - () - [ Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "*")) - , Lit - () - (Right - (Plain - "Lewis")) - ]) - , Lit - () - (Right - (Plain - "Carroll,")) - , Lit - () - (Right - (Plain - "Alice's")) - , Lit - () - (Right - (Plain - "Adventures")) - , Lit - () - (Right - (Plain - "in")) - , Annotated.Group - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain - "Wonderland")) - , Lit - () - (Right - (Plain - "*")) - ]) - ])) - ]))))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "Hover")) - , Lit - () - (Right (Plain "over")) - , Lit - () (Right (Plain "me")) - ]))) - , Lit () (Right (Plain "\n")) - , Lit () (Right (Plain "\n")) - , Annotated.Group - () - (Wrap - () - (Annotated.Table - () - [ [ Wrap - () - (Lit - () (Right (Plain "a"))) - , Wrap - () - (Lit - () (Right (Plain "b"))) - , Wrap - () - (Annotated.Append - () - [ Lit - () - (Right (Plain "A")) - , Lit - () - (Right - (Plain "longer")) - , Lit - () - (Right - (Plain - "paragraph")) - , Lit - () - (Right - (Plain "that")) - , Lit - () - (Right - (Plain "will")) - , Lit - () - (Right - (Plain "split")) - , Lit - () - (Right - (Plain "onto")) - , Lit - () - (Right - (Plain - "multiple")) - , Lit - () - (Right - (Plain "lines,")) - , Lit - () - (Right - (Plain "such")) - , Lit - () - (Right - (Plain "that")) - , Lit - () - (Right - (Plain "this")) - , Lit - () - (Right - (Plain "row")) - , Lit - () - (Right - (Plain - "occupies")) - , Lit - () - (Right - (Plain - "multiple")) - , Lit - () - (Right - (Plain "lines")) - , Lit - () - (Right - (Plain "in")) - , Lit - () - (Right - (Plain "the")) - , Lit - () - (Right - (Plain - "rendered")) - , Lit - () - (Right - (Plain "table.")) - ]) - ] - , [ Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "Some")) - , Lit - () - (Right - (Plain "text")) - ]) - , Wrap - () - (Annotated.Append - () - [ Lit - () - (Right - (Plain "More")) - , Lit - () - (Right - (Plain "text")) - ]) - , Wrap - () - (Lit - () - (Right - (Plain "Zounds!"))) - ] - ])) - ])))) - ]) -```` diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md deleted file mode 100644 index 0c709fe1d3..0000000000 --- a/unison-src/transcripts/builtins-merge.output.md +++ /dev/null @@ -1,89 +0,0 @@ -The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace. - -``` ucm -scratch/main> builtins.merge builtins - - Done. -scratch/main> ls builtins - - 1. Any (builtin type) - 2. Any/ (2 terms) - 3. Boolean (builtin type) - 4. Boolean/ (1 term) - 5. Bytes (builtin type) - 6. Bytes/ (34 terms) - 7. Char (builtin type) - 8. Char/ (22 terms, 1 type) - 9. ClientSockAddr (builtin type) - 10. Code (builtin type) - 11. Code/ (9 terms) - 12. Debug/ (3 terms) - 13. Doc (type) - 14. Doc/ (6 terms) - 15. Either (type) - 16. Either/ (2 terms) - 17. Exception (type) - 18. Exception/ (1 term) - 19. Float (builtin type) - 20. Float/ (38 terms) - 21. Handle/ (1 term) - 22. ImmutableArray (builtin type) - 23. ImmutableArray/ (3 terms) - 24. ImmutableByteArray (builtin type) - 25. ImmutableByteArray/ (8 terms) - 26. Int (builtin type) - 27. Int/ (31 terms) - 28. IsPropagated (type) - 29. IsPropagated/ (1 term) - 30. IsTest (type) - 31. IsTest/ (1 term) - 32. Link (type) - 33. Link/ (3 terms, 2 types) - 34. List (builtin type) - 35. List/ (10 terms) - 36. ListenSocket (builtin type) - 37. MutableArray (builtin type) - 38. MutableArray/ (6 terms) - 39. MutableByteArray (builtin type) - 40. MutableByteArray/ (14 terms) - 41. Nat (builtin type) - 42. Nat/ (28 terms) - 43. Optional (type) - 44. Optional/ (2 terms) - 45. Pattern (builtin type) - 46. Pattern/ (9 terms) - 47. Ref (builtin type) - 48. Ref/ (2 terms) - 49. Request (builtin type) - 50. RewriteCase (type) - 51. RewriteCase/ (1 term) - 52. RewriteSignature (type) - 53. RewriteSignature/ (1 term) - 54. RewriteTerm (type) - 55. RewriteTerm/ (1 term) - 56. Rewrites (type) - 57. Rewrites/ (1 term) - 58. Scope (builtin type) - 59. Scope/ (6 terms) - 60. SeqView (type) - 61. SeqView/ (2 terms) - 62. Socket/ (1 term) - 63. Test/ (2 terms, 1 type) - 64. Text (builtin type) - 65. Text/ (34 terms) - 66. ThreadId/ (1 term) - 67. Tuple (type) - 68. Tuple/ (1 term) - 69. UDPSocket (builtin type) - 70. Unit (type) - 71. Unit/ (1 term) - 72. Universal/ (7 terms) - 73. Value (builtin type) - 74. Value/ (5 terms) - 75. bug (a -> b) - 76. crypto/ (17 terms, 2 types) - 77. io2/ (146 terms, 32 types) - 78. metadata/ (2 terms) - 79. todo (a -> b) - 80. unsafe/ (1 term) -``` diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md deleted file mode 100644 index 298ac7816e..0000000000 --- a/unison-src/transcripts/builtins.output.md +++ /dev/null @@ -1,616 +0,0 @@ -# Unit tests for builtin functions - -``` ucm :hide -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 `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. - -## `Int` functions - -``` unison :hide -use Int - --- used for some take/drop tests later -bigN = Nat.shiftLeft 1 63 - --- Note: you can make the tests more fine-grained if you --- want to be able to tell which one is failing -test> Int.tests.arithmetic = - checks [ - eq (+1 + +1) +2, - +10 - +4 == +6, - eq (+11 * +6) +66, - eq (+11 * +6) +66, - +10 / +3 == +3, - +10 / +5 == +2, - mod +10 +3 == +1, - mod +10 +2 == +0, - mod -13 +3 == +2, - mod -13 -3 == -1, - mod -13 -5 == -3, - mod -13 +5 == +2, - negate +99 == -99, - increment +99 == +100, - not (isEven +99), - isEven +100, - isOdd +105, - not (isOdd +108), - signum +99 == +1, - signum -3949 == -1, - signum +0 == +0, - gt +42 -1, - lt +42 +1000, - lteq +43 +43, - lteq +43 +44, - gteq +43 +43, - gteq +43 +41 - ] - -test> Int.tests.bitTwiddling = - checks [ - and +5 +4 == +4, - and +5 +1 == +1, - or +4 +1 == +5, - xor +5 +1 == +4, - complement -1 == +0, - popCount +1 == 1, - popCount +2 == 1, - popCount +4 == 1, - popCount +5 == 2, - popCount -1 == 64, - leadingZeros +1 == 63, - trailingZeros +1 == 0, - leadingZeros +2 == 62, - trailingZeros +2 == 1, - pow +2 6 == +64, - shiftLeft +1 6 == +64, - shiftRight +64 6 == +1 - ] - -test> Int.tests.conversions = - checks [ - truncate0 -2438344 == 0, - truncate0 +999 == 999, - toText +0 == "0", - toText +10 == "10", - toText -1039 == "-1039", - fromText "+0" == Some +0, - fromText "a8f9djasdlfkj" == None, - fromText "3940" == Some +3940, - fromText "1000000000000000000000000000" == None, - fromText "-1000000000000000000000000000" == None, - toFloat +9394 == 9394.0, - toFloat -20349 == -20349.0 - ] -``` - -``` ucm :hide -scratch/main> add -``` - -## `Nat` functions - -``` unison :hide -use Nat - -test> Nat.tests.arithmetic = - checks [ - eq (1 + 1) 2, - drop 10 4 == 6, - sub 10 12 == -2, - eq (11 * 6) 66, - 10 / 3 == 3, - 10 / 5 == 2, - mod 10 3 == 1, - mod 10 2 == 0, - 18446744073709551615 / 2 == 9223372036854775807, - mod 18446744073709551615 2 == 1, - increment 99 == 100, - not (isEven 99), - isEven 100, - isOdd 105, - not (isOdd 108), - gt 42 1, - lt 42 1000, - lteq 43 43, - lteq 43 44, - gteq 43 43, - gteq 43 41, - ] - -test> Nat.tests.bitTwiddling = - checks [ - and 5 4 == 4, - and 5 1 == 1, - or 4 1 == 5, - xor 5 1 == 4, - complement (complement 0) == 0, - popCount 1 == 1, - popCount 2 == 1, - popCount 4 == 1, - popCount 5 == 2, - popCount (complement 0) == 64, - leadingZeros 1 == 63, - trailingZeros 1 == 0, - leadingZeros 2 == 62, - trailingZeros 2 == 1, - pow 2 6 == 64, - shiftLeft 1 6 == 64, - shiftRight 64 6 == 1 - ] - -test> Nat.tests.conversions = - checks [ - toFloat 2438344 == 2438344.0, - toFloat 0 == 0.0, - toText 0 == "0", - toText 32939 == "32939", - toText 10 == "10", - fromText "ooga" == None, - fromText "90" == Some 90, - fromText "-1" == None, - fromText "100000000000000000000000000" == None, - unsnoc "abc" == Some ("ab", ?c), - uncons "abc" == Some (?a, "bc"), - unsnoc "" == None, - uncons "" == None, - Text.fromCharList (Text.toCharList "abc") == "abc", - Bytes.fromList (Bytes.toList 0xsACE0BA5E) == 0xsACE0BA5E - ] -``` - -``` ucm :hide -scratch/main> add -``` - -## `Boolean` functions - -``` unison :hide -test> Boolean.tests.orTable = - checks [ - (true || true) == true, - (true || false) == true, - (false || true) == true, - (false || false) == false - ] -test> Boolean.tests.andTable = - checks [ - (true && true) == true, - (false && true) == false, - (true && false) == false, - (false && false) == false - ] -test> Boolean.tests.notTable = - checks [ - not true == false, - not false == true - ] -``` - -``` ucm :hide -scratch/main> add -``` - -## `Text` functions - -``` unison :hide -test> Text.tests.takeDropAppend = - checks [ - "yabba" ++ "dabba" == "yabbadabba", - Text.take 0 "yabba" == "", - Text.take 2 "yabba" == "ya", - Text.take 99 "yabba" == "yabba", - Text.drop 0 "yabba" == "yabba", - Text.drop 2 "yabba" == "bba", - Text.drop 99 "yabba" == "", - Text.take bigN "yabba" == "yabba", - Text.drop bigN "yabba" == "" - ] - -test> Text.tests.repeat = - checks [ - Text.repeat 4 "o" == "oooo", - Text.repeat 0 "o" == "" - ] - -test> Text.tests.alignment = - checks [ - Text.alignLeftWith 5 ?\s "a" == "a ", - Text.alignRightWith 5 ?_ "ababa" == "ababa", - Text.alignRightWith 5 ?_ "ab" == "___ab" - ] - -test> Text.tests.literalsEq = checks [":)" == ":)"] - -test> Text.tests.patterns = - use Pattern many or run isMatch capture join replicate - use Text.patterns literal digit letter anyChar space punctuation notCharIn charIn charRange notCharRange eof - l = literal - checks [ - run digit "1abc" == Some ([], "abc"), - run (capture (many digit)) "11234abc" == Some (["11234"], "abc"), - run (many letter) "abc11234abc" == Some ([], "11234abc"), - run (join [many space, capture (many anyChar)]) " abc123" == Some (["abc123"], ""), - run (many punctuation) "!!!!,,,..." == Some ([], ""), - run (charIn [?0,?1]) "0" == Some ([], ""), - run (notCharIn [?0,?1]) "0" == None, - run (many (notCharIn [?0,?1])) "asjdfskdfjlskdjflskdjf011" == Some ([], "011"), - run (capture (many (charRange ?a ?z))) "hi123" == Some (["hi"], "123"), - run (capture (many (notCharRange ?, ?,))) "abc123," == Some (["abc123"], ","), - run (capture (many (notCharIn [?,,]))) "abracadabra,123" == Some (["abracadabra"], ",123"), - run (capture (many (or digit letter))) "11234abc,remainder" == Some (["11234abc"], ",remainder"), - run (capture (replicate 1 5 (or digit letter))) "1a2ba aaa" == Some (["1a2ba"], " aaa"), - run (captureAs "foo" (many (or digit letter))) "11234abc,remainder" == Some (["foo"], ",remainder"), - run (join [(captureAs "foo" (many digit)), captureAs "bar" (many letter)]) "11234abc,remainder" == Some (["foo", "bar"], ",remainder"), - -- Regression test for: https://github.com/unisonweb/unison/issues/3530 - run (capture (replicate 0 1 (join [literal "a", literal "b"]))) "ac" == Some ([""], "ac"), - isMatch (join [many letter, eof]) "aaaaabbbb" == true, - isMatch (join [many letter, eof]) "aaaaabbbb1" == false, - isMatch (join [l "abra", many (l "cadabra")]) "abracadabracadabra" == true, - - ] - - -test> Text.tests.indexOf = - haystack = "01020304" ++ "05060708" ++ "090a0b0c01" - needle1 = "01" - needle2 = "02" - needle3 = "0304" - needle4 = "05" - needle5 = "0405" - needle6 = "0c" - needle7 = haystack - needle8 = "lopez" - needle9 = "" - checks [ - Text.indexOf needle1 haystack == Some 0, - Text.indexOf needle2 haystack == Some 2, - Text.indexOf needle3 haystack == Some 4, - Text.indexOf needle4 haystack == Some 8, - Text.indexOf needle5 haystack == Some 6, - Text.indexOf needle6 haystack == Some 22, - Text.indexOf needle7 haystack == Some 0, - Text.indexOf needle8 haystack == None, - Text.indexOf needle9 haystack == Some 0, - ] - -test> Text.tests.indexOfEmoji = - haystack = "clap 👏 your 👏 hands 👏 if 👏 you 👏 love 👏 unison" - needle1 = "👏" - needle2 = "👏 " - checks [ - Text.indexOf needle1 haystack == Some 5, - Text.indexOf needle2 haystack == Some 5, - ] - -``` - -``` ucm :hide -scratch/main> add -``` - -## `Bytes` functions - -``` unison :hide -test> Bytes.tests.at = - bs = Bytes.fromList [77, 13, 12] - checks [ - Bytes.at 1 bs == Some 13, - Bytes.at 0 bs == Some 77, - Bytes.at 99 bs == None, - Bytes.take bigN bs == bs, - Bytes.drop bigN bs == empty - ] - -test> Bytes.tests.compression = - roundTrip b = - (Bytes.zlib.decompress (Bytes.zlib.compress b) == Right b) - && (Bytes.gzip.decompress (Bytes.gzip.compress b) == Right b) - - checks [ - roundTrip 0xs2093487509823745709827345789023457892345, - roundTrip 0xs00000000000000000000000000000000000000000000, - roundTrip 0xs, - roundTrip 0xs11111111111111111111111111, - roundTrip 0xsffffffffffffffffffffffffffffff, - roundTrip 0xs222222222fffffffffffffffffffffffffffffff, - -- these fail due to bad checksums and/or headers - isLeft (zlib.decompress 0xs2093487509823745709827345789023457892345), - isLeft (gzip.decompress 0xs201209348750982374593939393939709827345789023457892345) - ] - -test> Bytes.tests.fromBase64UrlUnpadded = - checks [Exception.catch - '(fromUtf8 - (raiseMessage () (Bytes.fromBase64UrlUnpadded (toUtf8 "aGVsbG8gd29ybGQ")))) == Right "hello world" - , isLeft (Bytes.fromBase64UrlUnpadded (toUtf8 "aGVsbG8gd29ybGQ="))] - -test> Bytes.tests.indexOf = - haystack = 0xs01020304 ++ 0xs05060708 ++ 0xs090a0b0c01 - needle1 = 0xs01 - needle2 = 0xs02 - needle3 = 0xs0304 - needle4 = 0xs05 - needle5 = 0xs0405 - needle6 = 0xs0c - needle7 = haystack - needle8 = 0xsffffff - checks [ - Bytes.indexOf needle1 haystack == Some 0, - Bytes.indexOf needle2 haystack == Some 1, - Bytes.indexOf needle3 haystack == Some 2, - Bytes.indexOf needle4 haystack == Some 4, - Bytes.indexOf needle5 haystack == Some 3, - Bytes.indexOf needle6 haystack == Some 11, - Bytes.indexOf needle7 haystack == Some 0, - Bytes.indexOf needle8 haystack == None, - - ] - -``` - -``` ucm :hide -scratch/main> add -``` - -## `List` comparison - -``` unison :hide -test> checks [ - compare [] [1,2,3] == -1, - compare [1,2,3] [1,2,3,4] == -1, - compare [1,2,3,4] [1,2,3] == +1, - compare [1,2,3] [1,2,3] == +0, - compare [3] [1,2,3] == +1, - compare [1,2,3] [1,2,4] == -1, - compare [1,2,2] [1,2,1,2] == +1, - compare [1,2,3,4] [3,2,1] == -1 - ] -``` - -``` ucm :hide -scratch/main> add -``` - -Other list functions - -``` unison :hide -test> checks [ - List.take bigN [1,2,3] == [1,2,3], - List.drop bigN [1,2,3] == [] - ] -``` - -## `Any` functions - -``` unison -> [Any "hi", Any (41 + 1)] - -test> Any.test1 = checks [(Any "hi" == Any "hi")] -test> Any.test2 = checks [(not (Any "hi" == Any 42))] -``` - -``` ucm :added-by-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`: - - Any.test1 : [Result] - Any.test2 : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > [Any "hi", Any (41 + 1)] - ⧩ - [Any "hi", Any 42] - - 3 | test> Any.test1 = checks [(Any "hi" == Any "hi")] - - ✅ Passed Passed - - 4 | test> Any.test2 = checks [(not (Any "hi" == Any 42))] - - ✅ Passed Passed -``` - -``` ucm :hide -scratch/main> add -``` - -## Sandboxing functions - -``` unison -openFile1 t = openFile t -openFile2 t = openFile1 t - -validateSandboxedSimpl ok v = - match Value.validateSandboxed ok v with - Right [] -> true - _ -> false - -openFiles = - [ not (validateSandboxed [] openFile) - , not (validateSandboxed [] openFile1) - , not (validateSandboxed [] openFile2) - ] - -test> Sandbox.test1 = checks [validateSandboxed [] "hello"] -test> Sandbox.test2 = checks openFiles -test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] -openFile] -``` - -``` ucm :added-by-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`: - - Sandbox.test1 : [Result] - Sandbox.test2 : [Result] - Sandbox.test3 : [Result] - openFile1 : Text - -> FileMode - ->{IO, Exception} Handle - openFile2 : Text - -> FileMode - ->{IO, Exception} Handle - openFiles : [Boolean] - validateSandboxedSimpl : [Link.Term] - -> Value - ->{IO} Boolean - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 15 | test> Sandbox.test1 = checks [validateSandboxed [] "hello"] - - ✅ Passed Passed - - 16 | test> Sandbox.test2 = checks openFiles - - ✅ Passed Passed - - 17 | test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] - - ✅ Passed Passed -``` - -``` ucm :hide -scratch/main> add -``` - -``` unison -openFilesIO = do - checks - [ not (validateSandboxedSimpl [] (value openFile)) - , not (validateSandboxedSimpl [] (value openFile1)) - , not (validateSandboxedSimpl [] (value openFile2)) - , sandboxLinks (termLink openFile) - == sandboxLinks (termLink openFile1) - , sandboxLinks (termLink openFile1) - == sandboxLinks (termLink openFile2) - ] -``` - -``` ucm :added-by-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`: - - openFilesIO : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - openFilesIO : '{IO} [Result] -scratch/main> io.test openFilesIO - - New test results: - - 1. openFilesIO ◉ Passed - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -## Universal hash functions - -Just exercises the function - -``` unison -> Universal.murmurHash 1 -test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] -``` - -``` ucm :added-by-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`: - - Universal.murmurHash.tests : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > Universal.murmurHash 1 - ⧩ - 1208954131003843843 - - 2 | test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] - - ✅ Passed Passed -``` - -``` ucm :hide -scratch/main> add -``` - -## Run the tests - -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 -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. Any.test1 ◉ Passed - 2. Any.test2 ◉ Passed - 3. Boolean.tests.andTable ◉ Passed - 4. Boolean.tests.notTable ◉ Passed - 5. Boolean.tests.orTable ◉ Passed - 6. Bytes.tests.at ◉ Passed - 7. Bytes.tests.compression ◉ Passed - 8. Bytes.tests.fromBase64UrlUnpadded ◉ Passed - 9. Bytes.tests.indexOf ◉ Passed - 10. Int.tests.arithmetic ◉ Passed - 11. Int.tests.bitTwiddling ◉ Passed - 12. Int.tests.conversions ◉ Passed - 13. Nat.tests.arithmetic ◉ Passed - 14. Nat.tests.bitTwiddling ◉ Passed - 15. Nat.tests.conversions ◉ Passed - 16. Sandbox.test1 ◉ Passed - 17. Sandbox.test2 ◉ Passed - 18. Sandbox.test3 ◉ Passed - 19. test.rtjqan7bcs ◉ Passed - 20. Text.tests.alignment ◉ Passed - 21. Text.tests.indexOf ◉ Passed - 22. Text.tests.indexOfEmoji ◉ Passed - 23. Text.tests.literalsEq ◉ Passed - 24. Text.tests.patterns ◉ Passed - 25. Text.tests.repeat ◉ Passed - 26. Text.tests.takeDropAppend ◉ Passed - 27. Universal.murmurHash.tests ◉ Passed - - ✅ 27 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/bytesFromList.output.md b/unison-src/transcripts/bytesFromList.output.md deleted file mode 100644 index 664c9dff1b..0000000000 --- a/unison-src/transcripts/bytesFromList.output.md +++ /dev/null @@ -1,25 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`: - -``` unison -> Bytes.fromList [1,2,3,4] -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > Bytes.fromList [1,2,3,4] - ⧩ - 0xs01020304 -``` diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md deleted file mode 100644 index e7943b6b20..0000000000 --- a/unison-src/transcripts/check763.output.md +++ /dev/null @@ -1,37 +0,0 @@ -Regression test for https://github.com/unisonweb/unison/issues/763 - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -(+-+) : Nat -> Nat -> Nat -(+-+) x y = x * y -``` - -``` ucm :added-by-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`: - - +-+ : Nat -> Nat -> Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - +-+ : Nat -> Nat -> Nat -scratch/main> move.term +-+ boppitybeep - - Done. -scratch/main> move.term boppitybeep +-+ - - Done. -``` diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md deleted file mode 100644 index 64b5b383be..0000000000 --- a/unison-src/transcripts/check873.output.md +++ /dev/null @@ -1,47 +0,0 @@ -See [this ticket](https://github.com/unisonweb/unison/issues/873); the point being, this shouldn't crash the runtime. :) - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -(-) = builtin.Nat.sub -``` - -``` ucm :added-by-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`: - - - : Nat -> Nat -> Int -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - - : Nat -> Nat -> Int -``` - -``` unison -baz x = x - 1 -``` - -``` ucm :added-by-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`: - - baz : Nat -> Int -``` diff --git a/unison-src/transcripts/constructor-applied-to-unit.output.md b/unison-src/transcripts/constructor-applied-to-unit.output.md deleted file mode 100644 index 875b92c07f..0000000000 --- a/unison-src/transcripts/constructor-applied-to-unit.output.md +++ /dev/null @@ -1,60 +0,0 @@ -``` ucm :hide -scratch/main> alias.type ##Nat Nat -scratch/main> alias.term ##Any.Any Any -``` - -``` unison -structural type Zoink a b c = Zoink a b c - -> Any () -> [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] -``` - -``` ucm :added-by-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 Zoink a b c - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 3 | > Any () - ⧩ - Any () - - 4 | > [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] - ⧩ - [ Zoink - [0, 1, 2, 3, 4, 5] - [ 6 - , 3 - , 3 - , 3 - , 3 - , 3 - , 3 - , 3 - , 3 - , 3 - , 3 - , 4 - , 4 - , 4 - , 4 - , 4 - , 4 - , 4 - , 4 - , 4 - , 3 - ] - () - ] -``` diff --git a/unison-src/transcripts/contrabilities.output.md b/unison-src/transcripts/contrabilities.output.md deleted file mode 100644 index 0694f0e14a..0000000000 --- a/unison-src/transcripts/contrabilities.output.md +++ /dev/null @@ -1,21 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -f : (() -> a) -> Nat -f x = 42 -``` - -``` ucm :added-by-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`: - - f : '{g} a -> Nat -``` diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md deleted file mode 100644 index c440dad44a..0000000000 --- a/unison-src/transcripts/create-author.output.md +++ /dev/null @@ -1,22 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -Demonstrating `create.author`: - -``` ucm -scratch/main> create.author alicecoder "Alice McGee" - - Added definitions: - - 1. metadata.authors.alicecoder : Author - 2. metadata.copyrightHolders.alicecoder : CopyrightHolder - 3. metadata.authors.alicecoder.guid : GUID - - Tip: Add License values for alicecoder under metadata. -scratch/main> find alicecoder - - 1. metadata.authors.alicecoder : Author - 2. metadata.copyrightHolders.alicecoder : CopyrightHolder - 3. metadata.authors.alicecoder.guid : GUID -``` diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md deleted file mode 100644 index 84ecc32e3d..0000000000 --- a/unison-src/transcripts/cycle-update-1.output.md +++ /dev/null @@ -1,79 +0,0 @@ -Update a member of a cycle, but retain the cycle. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -ping : 'Nat -ping _ = !pong + 1 - -pong : 'Nat -pong _ = !ping + 2 -``` - -``` ucm :added-by-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`: - - ping : 'Nat - pong : 'Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat -``` - -``` unison -ping : 'Nat -ping _ = !pong + 3 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - ping : 'Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view ping pong - - ping : 'Nat - ping _ = - use Nat + - pong() + 3 - - pong : 'Nat - pong _ = - use Nat + - ping() + 2 -``` diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md deleted file mode 100644 index 9e35071030..0000000000 --- a/unison-src/transcripts/cycle-update-2.output.md +++ /dev/null @@ -1,77 +0,0 @@ -Update a member of a cycle with a type-preserving update, but sever the cycle. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -ping : 'Nat -ping _ = !pong + 1 - -pong : 'Nat -pong _ = !ping + 2 -``` - -``` ucm :added-by-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`: - - ping : 'Nat - pong : 'Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat -``` - -``` unison -ping : 'Nat -ping _ = 3 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - ping : 'Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view ping pong - - ping : 'Nat - ping _ = 3 - - pong : 'Nat - pong _ = - use Nat + - ping() + 2 -``` diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md deleted file mode 100644 index 3047e61a1e..0000000000 --- a/unison-src/transcripts/cycle-update-3.output.md +++ /dev/null @@ -1,72 +0,0 @@ -Update a member of a cycle with a type-changing update, thus severing the cycle. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -ping : 'Nat -ping _ = !pong + 1 - -pong : 'Nat -pong _ = !ping + 2 -``` - -``` ucm :added-by-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`: - - ping : 'Nat - pong : 'Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat -``` - -``` unison -ping : Nat -ping = 3 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - ping : Nat -``` - -``` ucm -scratch/main> update.old - - ⍟ I've updated these names to your new definition: - - ping : Nat -scratch/main> view ping pong - - ping : Nat - ping = 3 - - pong : 'Nat - pong _ = - use Nat + - #4t465jk908.1() + 2 -``` diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md deleted file mode 100644 index 77b977c934..0000000000 --- a/unison-src/transcripts/cycle-update-4.output.md +++ /dev/null @@ -1,91 +0,0 @@ -`update` properly discovers and establishes new cycles. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -ping : 'Nat -ping _ = 1 - -pong : 'Nat -pong _ = !ping + 2 -``` - -``` ucm :added-by-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`: - - ping : 'Nat - pong : 'Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat -``` - -``` unison -ping : 'Nat -ping _ = !clang + 1 - -clang : 'Nat -clang _ = !pong + 3 -``` - -``` ucm :added-by-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`: - - clang : 'Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - ping : 'Nat -``` - -``` ucm -scratch/main> update.old ping - - ⍟ I've added these definitions: - - clang : 'Nat - - ⍟ I've updated these names to your new definition: - - ping : 'Nat - pong : 'Nat -scratch/main> view ping pong clang - - clang : 'Nat - clang _ = - use Nat + - pong() + 3 - - ping : 'Nat - ping _ = - use Nat + - clang() + 1 - - pong : 'Nat - pong _ = - use Nat + - ping() + 2 -``` diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md deleted file mode 100644 index f6aa5a0228..0000000000 --- a/unison-src/transcripts/debug-definitions.output.md +++ /dev/null @@ -1,150 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -x = 30 - -y : Nat -y = - z = x + 2 - z + 10 - -structural type Optional a = Some a | None - -ability Ask a where - ask : a -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ability Ask a - structural type Optional a - (also named builtin.Optional) - x : Nat - y : Nat -scratch/main> debug.term.abt Nat.+ - - Builtin term: ##Nat.+ -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" -scratch/main> debug.term.abt Some - - Constructor #0 of the following type: - DataDeclaration - { modifier = Structural - , annotation = External - , bound = - [ User "a" ] - , constructors' = - [ - ( External - , User "Constructor0" - , - ( User "a". Var User "a" -> ReferenceDerived - ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) - ( Var User "a" ) - ) - ) - , - ( External - , User "Constructor1" - , - ( User "a". ReferenceDerived - ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) - ( Var User "a" ) - ) - ) - ] - } -scratch/main> debug.term.abt ask - - Constructor #0 of the following type: - EffectDeclaration - { toDataDecl = DataDeclaration - { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" - , annotation = External - , bound = - [ User "a" ] - , constructors' = - [ - ( External - , User "Constructor0" - , - ( User "a". - ( - { - [ ReferenceDerived - ( Id "d8m1kmiscgfrl5n9ruvq1432lntfntl7nnao45qlk2uqhparm0uq2im0kbspu6u6kv65hd0i5oljq9m4b78peh5ekpma7gkihtsmfh0" 0 ) - ( Var User "a" ) - ] - } Var User "a" - ) - ) - ) - ] - } - } -scratch/main> debug.type.abt Nat - - Builtin type: ##Nat -scratch/main> debug.type.abt Optional - - DataDeclaration - { modifier = Structural - , annotation = External - , bound = - [ User "a" ] - , constructors' = - [ - ( External - , User "Constructor0" - , - ( User "a". Var User "a" -> ReferenceDerived - ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) - ( Var User "a" ) - ) - ) - , - ( External - , User "Constructor1" - , - ( User "a". ReferenceDerived - ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) - ( Var User "a" ) - ) - ) - ] - } -scratch/main> debug.type.abt Ask - - EffectDeclaration - { toDataDecl = DataDeclaration - { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" - , annotation = External - , bound = - [ User "a" ] - , constructors' = - [ - ( External - , User "Constructor0" - , - ( User "a". - ( - { - [ ReferenceDerived - ( Id "d8m1kmiscgfrl5n9ruvq1432lntfntl7nnao45qlk2uqhparm0uq2im0kbspu6u6kv65hd0i5oljq9m4b78peh5ekpma7gkihtsmfh0" 0 ) - ( Var User "a" ) - ] - } Var User "a" - ) - ) - ) - ] - } - } -``` diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md deleted file mode 100644 index 6a452995f4..0000000000 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ /dev/null @@ -1,104 +0,0 @@ -``` unison -a.b.one = 1 -a.two = 2 - -a.x.three = 3 -a.x.four = 4 - -structural type a.x.Foo = Foo | Bar -structural type a.b.Baz = Boo -``` - -``` ucm :added-by-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 a.b.Baz - structural type a.x.Foo - a.b.one : ##Nat - a.two : ##Nat - a.x.four : ##Nat - a.x.three : ##Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type a.b.Baz - structural type a.x.Foo - a.b.one : ##Nat - a.two : ##Nat - a.x.four : ##Nat - a.x.three : ##Nat -scratch/main> delete.term.verbose a.b.one - - Removed definitions: - - 1. a.b.one : ##Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> alias.term a.two a.newtwo - - Done. -scratch/main> move.namespace a.x a.y - - Done. -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #tteooc9j2d - - > Moves: - - Original name New name - a.x.Foo a.y.Foo - a.x.Foo.Bar a.y.Foo.Bar - a.x.Foo.Foo a.y.Foo.Foo - a.x.four a.y.four - a.x.three a.y.three - - ⊙ 2. #bicrtgqj12 - - + Adds / updates: - - a.newtwo - - = Copies: - - Original name New name(s) - a.two a.newtwo - - ⊙ 3. #bofp4huk1j - - - Deletes: - - a.b.one - - □ 4. #gss5s88mo3 (start of history) -scratch/main> debug.name-diff 4 1 - - Kind Name Change Ref - Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg - Term a.y.four Added #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 - Term a.y.three Added #f3lgjvjqoocpt8v6kdgd2bgthh11a7md3qdp9rf5datccmo580btjd5bt5dro3irqs0is7vm7s1dphddjbtufch620te7ef7canmjj8 - Term a.y.Foo.Bar Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d1 - Term a.y.Foo.Foo Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d0 - Term a.b.one Removed #gjmq673r1vrurfotlnirv7vutdhm6sa3s02em5g22kk606mv6duvv8be402dv79312i4a0onepq5bo7citsodvq2g720nttj0ee9p0g - Term a.x.four Removed #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 - Term a.x.three Removed #f3lgjvjqoocpt8v6kdgd2bgthh11a7md3qdp9rf5datccmo580btjd5bt5dro3irqs0is7vm7s1dphddjbtufch620te7ef7canmjj8 - Term a.x.Foo.Bar Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d1 - Term a.x.Foo.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d0 - Type a.y.Foo Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 - Type a.x.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 -``` diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md deleted file mode 100644 index e40dda1c04..0000000000 --- a/unison-src/transcripts/deep-names.output.md +++ /dev/null @@ -1,100 +0,0 @@ -First we'll set up two libraries, and then we'll use them in some projects and show what `names` are deep-loaded for them. - -Our two "libraries": - -``` unison :hide -text.a = 1 -text.b = 2 -text.c = 3 - -http.x = 6 -http.y = 7 -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 -scratch/app1> fork text lib.text_v1 - - Done. -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 -scratch/app1> names a - - Term - Hash: #gjmq673r1v - Names: lib.text_v1.a lib.text_v2.a -scratch/app1> names x - - Term - Hash: #nsmc4p1ra4 - Names: lib.http_v3.x lib.http_v4.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 -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 - - 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 -scratch/app2> names x - - Term - Hash: #nsmc4p1ra4 - Names: lib.http_v1.x lib.http_v2.x -``` diff --git a/unison-src/transcripts/definition-diff-api.output.md b/unison-src/transcripts/definition-diff-api.output.md deleted file mode 100644 index d8ecc6fb35..0000000000 --- a/unison-src/transcripts/definition-diff-api.output.md +++ /dev/null @@ -1,3598 +0,0 @@ -``` ucm -diffs/main> builtins.mergeio lib.builtins - - Done. -diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> - - Done. -diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- - - Done. -``` - -``` unison -term = - _ = "Here's some text" - 1 + 1 - -type Type = Type Nat - -ability Stream a where - emit : a -> () - -take n s = - use Nat > - - h n = cases - { emit a -> k } -> if n > 0 - then - emit a - handle k() with h (n - 1) - else None - { r } -> Some r - handle s() with h n -``` - -``` ucm :added-by-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`: - - ability Stream a - type Type - take : Nat -> '{g} t ->{g, Stream a} Optional t - term : Nat -``` - -``` ucm -diffs/main> add - - ⍟ I've added these definitions: - - ability Stream a - type Type - take : Nat -> '{g} t ->{g, Stream a} Optional t - term : Nat -diffs/main> branch.create new - - Done. I've created the new branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /new`. -``` - -``` unison -term = - _ = "Here's some different text" - 1 + 2 - -type Type a = Type a Text - -ability Stream a where - emit : a -> () - -take n s = - use Nat > - - h n = cases - { emit a -> k } -> - emit a - if n > 0 - then handle k() with h (n - 1) - else None - { r } -> Some r - if n > 0 - then handle s () with h (n - 1) - else None -``` - -``` ucm :added-by-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: - - ⊡ Previously added definitions will be ignored: Stream - - ⍟ These names already exist. You can `update` them to your - new definition: - - type Type a - take : Nat -> '{g} t ->{g, Stream a} Optional t - term : Nat -``` - -``` ucm -diffs/new> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -Diff terms - -``` api -GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=term&newTerm=term - { - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "diffTag": "segmentChange", - "fromSegment": "\"Here's some text\"", - "toSegment": "\"Here's some different text\"" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "diffTag": "segmentChange", - "fromSegment": "1", - "toSegment": "2" - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newTerm": { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"Here's some different text\"" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "2" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "term" - ] - }, - "oldBranchRef": "main", - "oldTerm": { - "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": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "_", - "tag": "HashQualifier" - }, - "segment": "_" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TextLiteral" - }, - "segment": "\"Here's some text\"" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.+", - "tag": "TermReference" - }, - "segment": "+" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "term" - ] - }, - "project": "diffs" - } -``` - -More complex diff - -``` api -GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=take&newTerm=take - { - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": "\n" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "Var" - }, - "diffTag": "segmentChange", - "fromSegment": "a", - "toSegment": "n" - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": " " - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": " ", - "toSegment": " " - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - } - ] - }, - { - "annotation": null, - "diffTag": "segmentChange", - "fromSegment": "\n", - "toSegment": " " - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "diffTag": "segmentChange", - "fromSegment": "handle", - "toSegment": "if" - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "annotation": { - "tag": "Var" - }, - "diffTag": "segmentChange", - "fromSegment": "s", - "toSegment": "n" - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - } - ] - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newTerm": { - "bestTermName": "take", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "take" - ] - }, - "oldBranchRef": "main", - "oldTerm": { - "bestTermName": "take", - "defnTermTag": "Plain", - "signature": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - } - ], - "termDefinition": { - "contents": [ - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": { - "tag": "TypeAscriptionColon" - }, - "segment": " :" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelayForceChar" - }, - "segment": "'" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "TypeOperator" - }, - "segment": "->" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "{" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "g" - }, - { - "annotation": null, - "segment": "," - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", - "tag": "TypeReference" - }, - "segment": "Stream" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "AbilityBraces" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", - "tag": "TypeReference" - }, - "segment": "Optional" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "t" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": { - "contents": "take", - "tag": "HashQualifier" - }, - "segment": "take" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseKeyword" - }, - "segment": "use " - }, - { - "annotation": { - "tag": "UsePrefix" - }, - "segment": "Nat" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": "-" - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": " " - }, - { - "annotation": { - "tag": "UseSuffix" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "h", - "tag": "HashQualifier" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": { - "tag": "BindingEquals" - }, - "segment": " =" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "cases" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "if " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.>", - "tag": "TermReference" - }, - "segment": ">" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "0" - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": " then" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", - "tag": "TermReference" - }, - "segment": "emit" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "k" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": "(" - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat.drop", - "tag": "TermReference" - }, - "segment": "-" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "NumericLiteral" - }, - "segment": "1" - }, - { - "annotation": { - "tag": "Parenthesis" - }, - "segment": ")" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "else" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", - "tag": "TermReference" - }, - "segment": "None" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "{" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": "}" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "->" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", - "tag": "TermReference" - }, - "segment": "Some" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "r" - }, - { - "annotation": null, - "segment": "\n" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "handle" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "s" - }, - { - "annotation": { - "tag": "Unit" - }, - "segment": "()" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "ControlKeyword" - }, - "segment": "with" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "h" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "n" - } - ], - "tag": "UserObject" - }, - "termDocs": [], - "termNames": [ - "take" - ] - }, - "project": "diffs" - } -``` - -Diff types - -``` api -GET /api/projects/diffs/diff/types?oldBranchRef=main&newBranchRef=new&oldType=Type&newType=Type - { - "diff": { - "contents": [ - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - } - ] - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - } - ] - }, - { - "diffTag": "annotationChange", - "fromAnnotation": { - "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", - "tag": "TermReference" - }, - "segment": "Type", - "toAnnotation": { - "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", - "tag": "TermReference" - } - }, - { - "diffTag": "both", - "elements": [ - { - "annotation": null, - "segment": " " - } - ] - }, - { - "diffTag": "old", - "elements": [ - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ] - }, - { - "diffTag": "new", - "elements": [ - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ] - } - ], - "tag": "UserObject" - }, - "diffKind": "diff", - "newBranchRef": "new", - "newType": { - "bestTypeName": "Type", - "defnTypeTag": "Data", - "typeDefinition": { - "contents": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "DataTypeParams" - }, - "segment": "a" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - }, - { - "annotation": { - "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", - "tag": "TermReference" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "tag": "Var" - }, - "segment": "a" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Text", - "tag": "TypeReference" - }, - "segment": "Text" - } - ], - "tag": "UserObject" - }, - "typeDocs": [], - "typeNames": [ - "Type" - ] - }, - "oldBranchRef": "main", - "oldType": { - "bestTypeName": "Type", - "defnTypeTag": "Data", - "typeDefinition": { - "contents": [ - { - "annotation": { - "tag": "DataTypeKeyword" - }, - "segment": "type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "Type", - "tag": "HashQualifier" - }, - "segment": "Type" - }, - { - "annotation": { - "tag": "DelimiterChar" - }, - "segment": " = " - }, - { - "annotation": { - "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", - "tag": "TermReference" - }, - "segment": "Type" - }, - { - "annotation": null, - "segment": " " - }, - { - "annotation": { - "contents": "##Nat", - "tag": "TypeReference" - }, - "segment": "Nat" - } - ], - "tag": "UserObject" - }, - "typeDocs": [], - "typeNames": [ - "Type" - ] - }, - "project": "diffs" - } -``` diff --git a/unison-src/transcripts/delete-namespace-dependents-check.output.md b/unison-src/transcripts/delete-namespace-dependents-check.output.md deleted file mode 100644 index 55bbbc526c..0000000000 --- a/unison-src/transcripts/delete-namespace-dependents-check.output.md +++ /dev/null @@ -1,62 +0,0 @@ - - -# Delete namespace dependents check - -This is a regression test, previously `delete.namespace` allowed a delete as long as the deletions had a name *anywhere* in your codebase, it should only check the current project branch. - -``` ucm :hide -myproject/main> builtins.merge -``` - -``` unison -sub.dependency = 123 - -dependent = dependency + 99 -``` - -``` ucm :added-by-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`: - - dependent : Nat - sub.dependency : Nat -``` - -``` ucm :error -myproject/main> add - - ⍟ I've added these definitions: - - dependent : Nat - sub.dependency : Nat -myproject/main> branch /new - - Done. I've created the new branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /new`. -myproject/new> delete.namespace sub - - ⚠️ - - I didn't delete the namespace because the following - definitions are still in use. - - Dependency Referenced In - dependency 1. dependent - - If you want to proceed anyways and leave those definitions - without names, use delete.namespace.force -myproject/new> view dependent - - dependent : Nat - dependent = - use Nat + - dependency + 99 -``` diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md deleted file mode 100644 index 3360102d47..0000000000 --- a/unison-src/transcripts/delete-namespace.output.md +++ /dev/null @@ -1,124 +0,0 @@ -# delete.namespace.force - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -no_dependencies.thing = "no dependents on this term" - -dependencies.term1 = 1 -dependencies.term2 = 2 - -dependents.usage1 = dependencies.term1 + dependencies.term2 -dependents.usage2 = dependencies.term1 * dependencies.term2 -``` - -``` ucm :hide -scratch/main> add -``` - -Deleting a namespace with no external dependencies should succeed. - -``` ucm -scratch/main> delete.namespace no_dependencies - - Done. -``` - -Deleting a namespace with external dependencies should fail and list all dependents. - -``` ucm :error -scratch/main> delete.namespace dependencies - - ⚠️ - - I didn't delete the namespace because the following - definitions are still in use. - - Dependency Referenced In - term2 1. dependents.usage1 - 2. dependents.usage2 - - term1 3. dependents.usage1 - 4. dependents.usage2 - - If you want to proceed anyways and leave those definitions - without names, use delete.namespace.force -``` - -Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` - -``` ucm -scratch/main> delete.namespace.force dependencies - - Done. - - ⚠️ - - Of the things I deleted, the following are still used in the - following definitions. They now contain un-named references. - - Dependency Referenced In - term2 1. dependents.usage1 - 2. dependents.usage2 - - term1 3. dependents.usage1 - 4. dependents.usage2 -``` - -I should be able to view an affected dependency by number - -``` ucm -scratch/main> view 2 - - dependents.usage2 : Nat - dependents.usage2 = - use Nat * - #gjmq673r1v * #dcgdua2lj6 -``` - -Deleting the root namespace should require confirmation if not forced. - -``` ucm -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, or delete the current branch with `delete.branch` -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 -scratch/main> history . - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` - -Deleting the root namespace shouldn't require confirmation if forced. - -``` ucm -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 -scratch/main> history . - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md deleted file mode 100644 index 9ed4a06a7e..0000000000 --- a/unison-src/transcripts/delete-project-branch.output.md +++ /dev/null @@ -1,65 +0,0 @@ -Deleting the branch you are on takes you to its parent (though this is impossible to see in a transcript, since we set -your working directory with each command). - -``` ucm -foo/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`. -foo/topic> delete.branch /topic -``` - -A branch need not be preceded by a forward slash. - -``` ucm -foo/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`. -foo/topic> delete.branch topic -``` - -You can precede the branch name by a project name. - -``` ucm -foo/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`. -scratch/main> delete.branch foo/topic -``` - -You can delete the only branch in a project. - -``` ucm -foo/main> delete.branch /main -``` - -You can delete the last branch in the project, a new one will be created. - -``` ucm -scratch/main> delete.branch scratch/main -scratch/main> branches - - Branch Remote branch - 1. main - 2. main2 -``` - -If the the last branch isn't /main, then /main will be created. - -``` ucm -scratch/main2> delete.branch /main -scratch/main2> delete.branch /main2 -scratch/other> branches - - Branch Remote branch - 1. main - 2. other -``` diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md deleted file mode 100644 index 3830718958..0000000000 --- a/unison-src/transcripts/delete-project.output.md +++ /dev/null @@ -1,58 +0,0 @@ -# delete.project - -``` ucm -scratch/main> project.create-empty foo - - 🎉 I've created the project foo. - - 🎨 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! -scratch/main> 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! --- I can delete the project I'm currently on -scratch/main> delete.project scratch -foo/main> projects - - 1. bar - 2. foo --- I can delete a different project -foo/main> delete.project bar -foo/main> projects - - 1. foo --- I can delete the last project, a new scratch project will be created -foo/main> delete.project foo -project/main> projects - - 1. project - 2. scratch --- If the last project is scratch, a scratch2 project will be created. -scratch/main> delete.project project -scratch/main> delete.project scratch -project/main> projects - - 1. project - 2. scratch2 -``` diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md deleted file mode 100644 index a12f718915..0000000000 --- a/unison-src/transcripts/delete-silent.output.md +++ /dev/null @@ -1,31 +0,0 @@ -``` ucm :error -scratch/main> delete foo - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - foo -``` - -``` unison :hide -foo = 1 -structural type Foo = Foo () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo - foo : ##Nat -scratch/main> delete foo - - Done. -scratch/main> delete.type Foo - - Done. -scratch/main> delete.term Foo.Foo - - Done. -``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md deleted file mode 100644 index 89e8019007..0000000000 --- a/unison-src/transcripts/delete.output.md +++ /dev/null @@ -1,414 +0,0 @@ -# Delete - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -The delete command can delete both terms and types. - -First, let's make sure it complains when we try to delete a name that doesn't -exist. - -``` ucm :error -scratch/main> delete.verbose foo - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - foo -``` - -Now for some easy cases. Deleting an unambiguous term, then deleting an -unambiguous type. - -``` unison :hide -foo = 1 -structural type Foo = Foo () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo - foo : Nat -scratch/main> delete.verbose foo - - Removed definitions: - - 1. foo : Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> delete.verbose Foo - - Removed definitions: - - 1. structural type Foo - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> delete.verbose Foo.Foo - - Removed definitions: - - 1. Foo.Foo : '#089vmor9c5 - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -How about an ambiguous term? - -``` unison :hide -a.foo = 1 -a.bar = 2 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a.bar : Nat - a.foo : Nat -scratch/main> debug.alias.term.force a.bar a.foo - - Done. -``` - -A delete should remove both versions of the term. - -``` ucm -scratch/main> delete.verbose a.foo - - Removed definitions: - - 1. a.foo#gjmq673r1v : Nat - - Name changes: - - Original Changes - 2. a.bar ┐ 3. a.foo#dcgdua2lj6 (removed) - 4. a.foo#dcgdua2lj6 ┘ - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> ls a - - 1. bar (Nat) -``` - -Let's repeat all that on a type, for completeness. - -``` unison :hide -structural type a.Foo = Foo () -structural type a.Bar = Bar -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type a.Bar - (also named lib.builtins.Unit) - structural type a.Foo -scratch/main> debug.alias.type.force a.Bar a.Foo - - Done. -scratch/main> delete.verbose a.Foo - - Removed definitions: - - 1. structural type a.Foo#089vmor9c5 - - Name changes: - - Original Changes - 2. a.Bar ┐ 3. a.Foo#00nv2kob8f (removed) - 4. lib.builtins.Unit │ - 5. a.Foo#00nv2kob8f ┘ - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> delete.verbose a.Foo.Foo - - Removed definitions: - - 1. a.Foo.Foo : '#089vmor9c5 - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -Finally, let's try to delete a term and a type with the same name. - -``` unison :hide -foo = 1 -structural type foo = Foo () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type foo - foo : Nat -scratch/main> delete.verbose foo - - Removed definitions: - - 1. structural type foo - 2. foo : Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -We want to be able to delete multiple terms at once - -``` unison :hide -a = "a" -b = "b" -c = "c" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a : Text - b : Text - c : Text -scratch/main> delete.verbose a b c - - Removed definitions: - - 1. a : Text - 2. b : Text - 3. c : Text - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -We can delete terms and types in the same invocation of delete - -``` unison :hide -structural type Foo = Foo () -a = "a" -b = "b" -c = "c" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo - a : Text - b : Text - c : Text -scratch/main> 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 use a hash from `reflog` to undo - this change. -scratch/main> delete.verbose Foo.Foo - - Name changes: - - Original Changes - 1. Foo.Foo ┐ 2. Foo.Foo (removed) - 3. foo.Foo ┘ - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -We can delete a type and its constructors - -``` unison :hide -structural type Foo = Foo () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo -scratch/main> 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 use a hash from `reflog` to undo - this change. -``` - -You should not be able to delete terms which are referenced by other terms - -``` unison :hide -a = 1 -b = 2 -c = 3 -d = a + b + c -``` - -``` ucm :error -scratch/main> add - - ⍟ I've added these definitions: - - a : Nat - b : Nat - (also named a.bar) - c : Nat - d : Nat -scratch/main> delete.verbose a b c - - ⚠️ - - 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 :hide -e = 11 -f = 12 + e -g = 13 + f -h = e + f + g -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - e : Nat - f : Nat - g : Nat - h : Nat -scratch/main> 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 use a hash from `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 :hide -structural type Foo = Foo Nat - -incrementFoo : Foo -> Nat -incrementFoo = cases - (Foo.Foo n) -> n + 1 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo - incrementFoo : Foo -> Nat -scratch/main> delete.verbose Foo Foo.Foo incrementFoo - - Removed definitions: - - 1. structural type Foo - 2. Foo.Foo : Nat -> Foo - 3. incrementFoo : Foo -> Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` - -If you mess up on one of the names of your command, delete short circuits - -``` unison :hide -e = 11 -f = 12 + e -g = 13 + f -h = e + f + g -``` - -``` ucm :error -scratch/main> add - - ⍟ I've added these definitions: - - e : Nat - f : Nat - g : Nat - h : Nat -scratch/main> 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 :hide -ping _ = 1 Nat.+ !pong -pong _ = 4 Nat.+ !ping -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ping : 'Nat - pong : 'Nat -scratch/main> delete.verbose ping - - Removed definitions: - - 1. ping : 'Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> view pong - - pong : 'Nat - pong _ = - use Nat + - 4 + #l9uq1dpl5v.1() -``` diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md deleted file mode 100644 index b41edea0f1..0000000000 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ /dev/null @@ -1,115 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -### `debug.file` - -I can use `debug.file` to see the hashes of the last typechecked file. - -Given this .u file: - -``` unison :hide -structural type outside.A = A Nat outside.B -structural type outside.B = B Int -outside.c = 3 -outside.d = c < (p + 1) - -structural type inside.M = M outside.A -inside.p = c -inside.q x = x + p * p -inside.r = d -``` - -``` ucm -scratch/main> debug.file - - type inside.M#h37a56c5ep - type outside.A#6l6krl7n4l - type outside.B#eo6rj0lj1b - inside.p#htoo5rnb54 - inside.q#1mqcoh3tnk - inside.r#nkgohbke6n - outside.c#f3lgjvjqoo - outside.d#ukd7tu6kds -``` - -This will help me make progress in some situations when UCM is being deficient or broken. - -### `dependents` / `dependencies` - -But wait, there's more. I can check the dependencies and dependents of a definition: - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type inside.M - structural type outside.A - structural type outside.B - inside.p : Nat - inside.q : Nat -> Nat - inside.r : Boolean - outside.c : Nat - outside.d : Boolean -scratch/main> dependents q - - q has no dependents. -scratch/main> dependencies q - - Dependencies of: q - - Types: - - 1. Nat - - Terms: - - 2. Nat.* - 3. Nat.+ - 4. p - - Tip: Try `view 4` to see the source of any numbered item in - the above list. -scratch/main> dependencies B - - Dependencies of: type B, B - - Types: - - 1. B - 2. Int - - Tip: Try `view 2` to see the source of any numbered item in - the above list. -scratch/main> dependencies d - - Dependencies of: d - - Types: - - 1. Boolean - 2. Nat - - Terms: - - 3. < - 4. c - 5. Nat.+ - 6. p - - Tip: Try `view 6` to see the source of any numbered item in - the above list. -scratch/main> dependents d - - Dependents of: d - - Terms: - - 1. r - - Tip: Try `view 1` to see the source of any numbered item in - the above list. -``` - -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/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md deleted file mode 100644 index fcaa949d26..0000000000 --- a/unison-src/transcripts/destructuring-binds.output.md +++ /dev/null @@ -1,177 +0,0 @@ -# Destructuring binds - -``` ucm :hide -scratch/main> builtins.merge -``` - -Here's a couple examples: - -``` unison -ex0 : Nat -> Nat -ex0 n = - (a, _, (c,d)) = ("uno", "dos", (n, 7)) - c + d - -ex1 : (a,b,(Nat,Nat)) -> Nat -ex1 tup = - (a, b, (c,d)) = tup - c + d -``` - -``` ucm :added-by-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`: - - ex0 : Nat -> Nat - ex1 : (a, b, (Nat, Nat)) -> Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ex0 : Nat -> Nat - ex1 : (a, b, (Nat, Nat)) -> Nat -scratch/main> view ex0 ex1 - - ex0 : Nat -> Nat - ex0 n = - use Nat + - (a, _, (c, d)) = ("uno", "dos", (n, 7)) - c + d - - ex1 : (a, b, (Nat, Nat)) -> Nat - ex1 = cases (a, b, (c, d)) -> c Nat.+ d -``` - -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`. - -A destructuring bind is just syntax for a single branch pattern match. Notice that Unison detects this function as an alias of `ex1`: - -``` unison -ex2 : (a,b,(Nat,Nat)) -> Nat -ex2 tup = match tup with - (a, b, (c,d)) -> c + d -``` - -``` ucm :added-by-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`: - - ex2 : (a, b, (Nat, Nat)) -> Nat - (also named ex1) -``` - -## Corner cases - -Destructuring binds can't be recursive: the left-hand side bound variables aren't available on the right hand side. For instance, this doesn't typecheck: - -``` unison :error -ex4 = - (a,b) = (a Nat.+ b, 19) - "Doesn't typecheck" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what a refers to here: - - 2 | (a,b) = (a Nat.+ b, 19) - - I think its type should be: - - Nat - - Some common causes of this error include: - * Your current namespace is too deep to contain the - definition in its subtree - * The definition is part of a library which hasn't been - added to this project - * You have a typo in the name -``` - -Even though the parser accepts any pattern on the LHS of a bind, it looks pretty weird to see things like `12 = x`, so we avoid showing a destructuring bind when the LHS is a "literal" pattern (like `42` or "hi"). Again these examples wouldn't compile with coverage checking. - -``` unison -ex5 : 'Text -ex5 _ = match 99 + 1 with - 12 -> "Hi" - _ -> "Bye" - -ex5a : 'Text -ex5a _ = match (99 + 1, "hi") with - (x, "hi") -> "Not printed as a destructuring bind." - _ -> "impossible" -``` - -``` ucm :added-by-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`: - - ex5 : 'Text - ex5a : 'Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ex5 : 'Text - ex5a : 'Text -scratch/main> view ex5 ex5a - - ex5 : 'Text - ex5 _ = match 99 Nat.+ 1 with - 12 -> "Hi" - _ -> "Bye" - - ex5a : 'Text - ex5a _ = match (99 Nat.+ 1, "hi") with - (x, "hi") -> "Not printed as a destructuring bind." - _ -> "impossible" -``` - -Notice how it prints both an ordinary match. - -Also, for clarity, the pretty-printer shows a single-branch match if the match shadows free variables of the scrutinee, for example: - -``` unison :hide -ex6 x = match x with - (x, y) -> x Nat.+ y -``` - -For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`: - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ex6 : (Nat, Nat) -> Nat -scratch/main> view ex6 - - ex6 : (Nat, Nat) -> Nat - ex6 = cases (x, y) -> x Nat.+ y -``` diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md deleted file mode 100644 index 08f325a6d6..0000000000 --- a/unison-src/transcripts/diff-namespace.output.md +++ /dev/null @@ -1,548 +0,0 @@ -``` ucm :hide -scratch/b1> builtins.merge lib.builtins -scratch/b2> builtins.merge lib.builtins -scratch/nsx> builtins.merge lib.builtins -scratch/main> builtins.merge lib.builtins -scratch/ns1> builtins.merge lib.builtins -``` - -``` unison :hide -x = 23 -fslkdjflskdjflksjdf = 663 -``` - -``` ucm -scratch/b1> add - - ⍟ I've added these definitions: - - fslkdjflskdjflksjdf : Nat - x : Nat -``` - -``` unison :hide -x = 23 -fslkdjflskdjflksjdf = 23 -abc = 23 -``` - -``` ucm -scratch/b2> add - - ⍟ I've added these definitions: - - abc : Nat - fslkdjflskdjflksjdf : Nat - x : Nat -scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf - - Done. -``` - -``` ucm -scratch/main> 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) -``` - -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 :hide -fromJust = 1 -b = 2 -bdependent = b -c = 3 -helloWorld = "Hello, world!" - -structural type A a = A () -structural ability X a1 a2 where x : () -``` - -``` ucm -scratch/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 -scratch/ns1> alias.term fromJust fromJust' - - Done. -scratch/ns1> alias.term helloWorld helloWorld2 - - Done. -scratch/ns1> branch /ns2 - - Done. I've created the ns2 branch based off of ns1. - - Tip: To merge your work back into the ns1 branch, first - `switch /ns1` then `merge /ns2`. -``` - -Here's what we've done so far: - -``` ucm :error -scratch/main> diff.namespace .nothing /ns1: - - ⚠️ - - The namespace scratch/main:.nothing is empty. Was there a typo? -``` - -``` ucm :error -scratch/main> diff.namespace /ns1: /ns2: - - The namespaces are identical. -``` - -``` unison :hide -junk = "asldkfjasldkfj" -``` - -``` ucm -scratch/ns1> add - - ⍟ I've added these definitions: - - junk : Text -scratch/ns1> debug.alias.term.force junk fromJust - - Done. -scratch/ns1> delete.term junk - - Done. -``` - -``` unison :hide -fromJust = 99 -b = 999999999 -d = 4 -e = 5 -f = 6 -unique type Y a b = Y a b -``` - -``` ucm -scratch/ns2> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> 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 : Nat - - 6. bdependent : Nat - ↓ - 7. bdependent : 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 - - Name changes: - - Original Changes - 13. fromJust' ┐ 14. fromJust#gjmq673r1v (removed) - 15. fromJust#gjmq673r1v ┘ -scratch/ns2> alias.term d d' - - Done. -scratch/ns2> alias.type A A' - - Done. -scratch/ns2> alias.term A.A A'.A - - Done. -scratch/ns2> alias.type X X' - - Done. -scratch/ns2> alias.term X.x X'.x - - Done. -scratch/main> 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 : Nat - - 6. bdependent : Nat - ↓ - 7. bdependent : 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 - - Name changes: - - Original Changes - 14. A 15. A' (added) - - 16. X 17. X' (added) - - 18. A.A 19. A'.A (added) - - 20. fromJust' ┐ 21. fromJust#gjmq673r1v (removed) - 22. fromJust#gjmq673r1v ┘ - - 23. X.x 24. X'.x (added) -scratch/ns1> alias.type X X2 - - Done. -scratch/ns1> alias.term X.x X2.x - - Done. -scratch/ns2> alias.type A' A'' - - Done. -scratch/ns2> alias.term A'.A A''.A - - Done. -scratch/ns2> branch /ns3 - - Done. I've created the ns3 branch based off of ns2. - - Tip: To merge your work back into the ns2 branch, first - `switch /ns2` then `merge /ns3`. -scratch/ns2> alias.term fromJust' yoohoo - - Done. -scratch/ns2> delete.term.verbose fromJust' - - Name changes: - - Original Changes - 1. fromJust' ┐ 2. fromJust' (removed) - 3. yoohoo ┘ - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -scratch/main> diff.namespace /ns3: /ns2: - - Name changes: - - Original Changes - 1. fromJust' 2. yoohoo (added) - 3. fromJust' (removed) -``` - -``` unison :hide -bdependent = "banana" -``` - -``` ucm -scratch/ns3> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> diff.namespace /ns2: /ns3: - - Updates: - - 1. bdependent : Nat - ↓ - 2. bdependent : Text - - Name changes: - - Original Changes - 3. yoohoo 4. fromJust' (added) - 5. 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 :hide -a = 333 -b = a + 1 - -forconflicts = 777 -``` - -``` ucm -scratch/nsx> add - - ⍟ I've added these definitions: - - a : Nat - b : Nat - forconflicts : Nat -scratch/nsx> branch /nsy - - Done. I've created the nsy branch based off of nsx. - - Tip: To merge your work back into the nsx branch, first - `switch /nsx` then `merge /nsy`. -scratch/nsx> branch /nsz - - Done. I've created the nsz branch based off of nsx. - - Tip: To merge your work back into the nsx branch, first - `switch /nsx` then `merge /nsz`. -``` - -``` unison :hide -a = 444 -``` - -``` ucm -scratch/nsy> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` - -``` unison :hide -a = 555 -``` - -``` ucm -scratch/nsz> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/nsy> branch /nsw - - Done. I've created the nsw branch based off of nsy. - - Tip: To merge your work back into the nsy branch, first - `switch /nsy` then `merge /nsw`. -scratch/nsw> debug.alias.term.force .forconflicts .a - - Done. -scratch/nsw> debug.alias.term.force .forconflicts .b - - Done. -``` - -``` ucm -scratch/main> diff.namespace /nsx: /nsw: - - New name conflicts: - - 1. a#uiiiv8a86s : Nat - ↓ - 2. ┌ a#mdl4vqtu00 : Nat - 3. └ a#r3msrbpp1v : Nat - - 4. b#lhigeb1let : Nat - ↓ - 5. ┌ b#r3msrbpp1v : Nat - 6. └ b#unkqhuu66p : Nat - - Name changes: - - Original Changes - 7. forconflicts 8. a#r3msrbpp1v (added) - 9. b#r3msrbpp1v (added) -scratch/nsw> view a - - a#mdl4vqtu00 : Nat - a#mdl4vqtu00 = 444 - - a#r3msrbpp1v : Nat - a#r3msrbpp1v = 777 -scratch/nsw> view b - - b#r3msrbpp1v : Nat - b#r3msrbpp1v = 777 - - b#unkqhuu66p : Nat - b#unkqhuu66p = - use Nat + - a#mdl4vqtu00 + 1 -``` - -## Should be able to diff a namespace hash from history. - -``` unison -x = 1 -``` - -``` ucm :added-by-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 -scratch/hashdiff> add - - ⍟ I've added these definitions: - - x : ##Nat -``` - -``` unison -y = 2 -``` - -``` ucm :added-by-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 -scratch/hashdiff> add - - ⍟ I've added these definitions: - - y : ##Nat -scratch/hashdiff> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #ru1hnjofdj - - + Adds / updates: - - y - - □ 2. #i52j9fd57b (start of history) -scratch/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 - - - \[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.output.md b/unison-src/transcripts/doc-formatting.output.md deleted file mode 100644 index f6404dee11..0000000000 --- a/unison-src/transcripts/doc-formatting.output.md +++ /dev/null @@ -1,591 +0,0 @@ -This transcript explains a few minor details about doc parsing and pretty-printing, both from a user point of view and with some implementation notes. The later stuff is meant more as unit testing than for human consumption. (The ucm `add` commands and their output are hidden for brevity.) - -Docs can be used as inline code comments. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -foo : Nat -> Nat -foo n = - _ = [: do the thing :] - n + 1 -``` - -``` ucm :added-by-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 : Nat -> Nat -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view foo - - foo : Nat -> Nat - foo n = - use Nat + - _ = [: do the thing :] - n + 1 -``` - -Note that `@` and `:]` must be escaped within docs. - -``` unison -escaping = [: Docs look [: like \@this \:] :] -``` - -``` ucm :added-by-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`: - - escaping : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view escaping - - escaping : Doc - escaping = [: Docs look [: like \@this \:] :] -``` - -(Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) - -``` unison --- Note that -- comments are preserved within doc literals. -commented = [: - example: - - -- a comment - f x = x + 1 -:] -``` - -``` ucm :added-by-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`: - - commented : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view commented - - commented : Doc - commented = - [: example: - - -- a comment f x = x + 1 - :] -``` - -### Indenting, and paragraph reflow - -Handling of indenting in docs between the parser and pretty-printer is a bit fiddly. - -``` unison --- The leading and trailing spaces are stripped from the stored Doc by the --- lexer, and one leading and trailing space is inserted again on view/edit --- by the pretty-printer. -doc1 = [: hi :] -``` - -``` ucm :added-by-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 -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc1 - - doc1 : Doc - doc1 = [: hi :] -``` - -``` unison --- Lines (apart from the first line, i.e. the bit between the [: and the --- first newline) are unindented until at least one of --- them hits the left margin (by a post-processing step in the parser). --- You may not notice this because the pretty-printer indents them again on --- view/edit. -doc2 = [: hello - - foo - - bar - and the rest. :] -``` - -``` ucm :added-by-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`: - - doc2 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc2 - - doc2 : Doc - doc2 = - [: hello - - foo - - bar - and the rest. :] -``` - -``` unison -doc3 = [: When Unison identifies a paragraph, it removes any newlines from it before storing it, and then reflows the paragraph text to fit the display window on display/view/edit. - -For these purposes, a paragraph is any sequence of non-empty lines that have zero indent (after the unindenting mentioned above.) - - - So this is not a paragraph, even - though you might want it to be. - - And this text | as a paragraph - is not treated | either. - -Note that because of the special treatment of the first line mentioned above, where its leading space is removed, it is always treated as a paragraph. - :] -``` - -``` ucm :added-by-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`: - - doc3 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc3 - - doc3 : Doc - doc3 = - [: When Unison identifies a paragraph, it removes any - newlines from it before storing it, and then reflows the - paragraph text to fit the display window on - display/view/edit. - - For these purposes, a paragraph is any sequence of non-empty - lines that have zero indent (after the unindenting mentioned - above.) - - - So this is not a paragraph, even - though you might want it to be. - - And this text | as a paragraph - is not treated | either. - - Note that because of the special treatment of the first line - mentioned above, where its leading space is removed, it is - always treated as a paragraph. - :] -``` - -``` unison -doc4 = [: Here's another example of some paragraphs. - - All these lines have zero indent. - - - Apart from this one. :] -``` - -``` ucm :added-by-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`: - - doc4 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc4 - - doc4 : Doc - doc4 = - [: Here's another example of some paragraphs. - - All these lines have zero indent. - - - Apart from this one. :] -``` - -``` unison --- The special treatment of the first line does mean that the following --- is pretty-printed not so prettily. To fix that we'd need to get the --- lexer to help out with interpreting doc literal indentation (because --- it knows what columns the `[:` was in.) -doc5 = [: - foo - - bar - and the rest. :] -``` - -``` ucm :added-by-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`: - - doc5 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc5 - - doc5 : Doc - doc5 = - [: - foo - - bar - and the rest. :] -``` - -``` unison --- You can do the following to avoid that problem. -doc6 = [: - - foo - - bar - and the rest. - :] -``` - -``` ucm :added-by-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`: - - doc6 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view doc6 - - doc6 : Doc - doc6 = - [: - foo - - bar - and the rest. - :] -``` - -### More testing - -``` unison --- Check empty doc works. -empty = [::] - -expr = foo 1 -``` - -``` ucm :added-by-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`: - - empty : Doc - expr : Nat -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view empty - - empty : Doc - empty = [: :] -``` - -``` unison -test1 = [: -The internal logic starts to get hairy when you use the \@ features, for example referencing a name like @List.take. Internally, the text between each such usage is its own blob (blob ends here --> @List.take), so paragraph reflow has to be aware of multiple blobs to do paragraph reflow (or, more accurately, to do the normalization step where newlines with a paragraph are removed.) - -Para to reflow: lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor ending in ref @List.take - -@List.take starting para lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor. - -Middle of para: lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor @List.take lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor. - - - non-para line (@List.take) with ref @List.take - Another non-para line - @List.take starting non-para line - - - non-para line with ref @List.take -before a para-line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor. - - - non-para line followed by a para line starting with ref -@List.take lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor. - -a para-line ending with ref lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor @List.take - - non-para line - -para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor - @List.take followed by non-para line starting with ref. - -@[signature] List.take - -@[source] foo - -@[evaluate] expr - -@[include] doc1 - --- note the leading space below - @[signature] List.take - -:] -``` - -``` ucm :added-by-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`: - - test1 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view test1 - - test1 : Doc - test1 = - [: The internal logic starts to get hairy when you use the - \@ features, for example referencing a name like @List.take. - Internally, the text between each such usage is its own blob - (blob ends here --> @List.take), so paragraph reflow has to - be aware of multiple blobs to do paragraph reflow (or, more - accurately, to do the normalization step where newlines with - a paragraph are removed.) - - Para to reflow: lorem ipsum dolor lorem ipsum dolor lorem - ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum - dolor lorem ipsum dolor ending in ref @List.take - - @List.take starting para lorem ipsum dolor lorem ipsum dolor - lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem - ipsum dolor lorem ipsum dolor. - - Middle of para: lorem ipsum dolor lorem ipsum dolor lorem - ipsum dolor @List.take lorem ipsum dolor lorem ipsum dolor - lorem ipsum dolor lorem ipsum dolor. - - - non-para line (@List.take) with ref @List.take - Another non-para line - @List.take starting non-para line - - - non-para line with ref @List.take - before a para-line lorem ipsum dolor lorem ipsum dolor lorem - ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum - dolor lorem ipsum dolor lorem ipsum dolor. - - - non-para line followed by a para line starting with ref - @List.take lorem ipsum dolor lorem ipsum dolor lorem ipsum - dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor - lorem ipsum dolor lorem ipsum dolor. - - a para-line ending with ref lorem ipsum dolor lorem ipsum - dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor - lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor @List.take - - non-para line - - para line lorem ipsum dolor lorem ipsum dolor lorem ipsum - dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor - lorem ipsum dolor lorem ipsum dolor - @List.take followed by non-para line starting with ref. - - @[signature] List.take - - @[source] foo - - @[evaluate] expr - - @[include] doc1 - - -- note the leading space below - @[signature] List.take - - :] -``` - -``` unison --- Regression test for #1363 - preservation of spaces after @ directives in first line when unindenting -reg1363 = [: `@List.take foo` bar - baz :] -``` - -``` ucm :added-by-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`: - - reg1363 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view reg1363 - - reg1363 : Doc - reg1363 = [: `@List.take foo` bar baz :] -``` - -``` unison --- Demonstrate doc display when whitespace follows a @[source] or @[evaluate] --- whose output spans multiple lines. - -test2 = [: - Take a look at this: - @[source] foo ▶ bar -:] -``` - -``` ucm :added-by-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`: - - test2 : Doc -``` - -``` ucm :hide -scratch/main> add -``` - -View is fine. - -``` ucm -scratch/main> view test2 - - test2 : Doc - test2 = - [: Take a look at this: - @[source] foo ▶ bar - :] -``` - -But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: - -``` ucm -scratch/main> display test2 - - Take a look at this: - foo : Nat -> Nat - foo n = - use Nat + - _ = [: do the thing :] - n + 1 ▶ bar -``` diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md deleted file mode 100644 index 8e9fdb7c99..0000000000 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ /dev/null @@ -1,49 +0,0 @@ -Regression test to ensure that `type` and `ability` in embedded doc links are -lexed properly when they occur at the start of identifiers. - -That is, `{abilityPatterns}` should be a link to the **term** `abilityPatterns`, -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 -scratch/main> builtins.mergeio -``` - -``` unison :hide -abilityPatterns : () -abilityPatterns = () - -structural ability Patterns where p : () - -typeLabels : Nat -typeLabels = 5 - -structural type Labels = Labels - -docs.example1 = {{A doc that links to the {abilityPatterns} term}} -docs.example2 = {{A doc that links to the {ability Patterns} ability}} -docs.example3 = {{A doc that links to the {typeLabels} term}} -docs.example4 = {{A doc that links to the {type Labels} type}} -``` - -``` ucm :hide -scratch/main> add -``` - -Now we check that each doc links to the object of the correct name: - -``` ucm -scratch/main> display docs.example1 - - A doc that links to the abilityPatterns term -scratch/main> display docs.example2 - - A doc that links to the Patterns ability -scratch/main> display docs.example3 - - A doc that links to the typeLabels term -scratch/main> display docs.example4 - - A doc that links to the Labels type -``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md deleted file mode 100644 index 1c95c14626..0000000000 --- a/unison-src/transcripts/doc1.output.md +++ /dev/null @@ -1,161 +0,0 @@ -# Documenting Unison code - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -Unison documentation is written in Unison. Documentation is a value of the following type: - -``` ucm -scratch/main> view lib.builtins.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 :added-by-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 :added-by-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: - - 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 :added-by-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 -scratch/main> 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. - -``` 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] -``` diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md deleted file mode 100644 index 1e164c14ce..0000000000 --- a/unison-src/transcripts/doc2.output.md +++ /dev/null @@ -1,220 +0,0 @@ -# Test parsing and round-trip of doc2 syntax elements - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -otherDoc : a -> Doc2 -otherDoc _ = {{ yo }} - -otherTerm : Nat -otherTerm = 99 - -fulldoc : Doc2 -fulldoc = - use Nat + - {{ -Heres some text with a -soft line break - -hard line break - -Here's a cool **BOLD** __italic__ ~~strikethrough~~ thing with an inline code block `1 + 2` - -Should print with appropriate fences for the contents: - -`No fancy quotes` - -'' There are `backticks` in here '' - -''' There are `backticks` and ''quotes'' in here ''' - -# Heading - -## Heading 2 - -Term Link: {otherTerm} - -Type Link: {type Optional} - -Term source: - -@source{term} - -Term signature: - -@signature{term} - -* List item - -Inline code: - -`` 1 + 2 `` - -` "doesn't typecheck" + 1 ` - -[Link](https://unison-lang.org) - -![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - -Horizontal rule - ---- - -Video - -{{ -Special - (Embed - (Any (Video [MediaSource "test.mp4" None] [("poster", "test.png")]))) -}} - -Transclusion/evaluation: - -{{ otherDoc (a -> Word a) }} - ---- - -The following markdown features aren't supported by the Doc format yet, but maybe will someday - - -> Block quote - - -Table - -| Header 1 | Header 2 | -| -------- | -------- | -| Cell 1 | Cell 2 | - - - Indented Code block - -''' - Exact whitespace should be preserved across multiple updates. Don't mess with the logo! - - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - Line with no whitespace: - - Should have one full trailing newline below here: - -''' - -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 -scratch/main> debug.format -``` - -``` unison :added-by-ucm scratch.u -otherDoc : a -> Doc2 -otherDoc _ = {{ yo }} - -otherTerm : Nat -otherTerm = 99 - -fulldoc : Doc2 -fulldoc = - use Nat + - {{ - Heres some text with a soft line break - - hard line break - - Here's a cool **BOLD** __italic__ ~~strikethrough~~ thing with an inline code - block `1 + 2` - - Should print with appropriate fences for the contents: - - `No fancy quotes` - - '' There are `backticks` in here '' - - ''' There are `backticks` and ''quotes'' in here ''' - - # Heading - - ## Heading 2 - - Term Link: {otherTerm} - - Type Link: {type Optional} - - Term source: - - @source{term} - - Term signature: - - @signature{term} - - * List item - - Inline code: - - `` 1 + 2 `` - - ` "doesn't typecheck" + 1 ` - - [Link](https://unison-lang.org) - - ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - - Horizontal rule - - --- - - Video - - {{ - Special - (Embed - (Any (Video [MediaSource "test.mp4" None] [("poster", "test.png")]))) - }} - - Transclusion/evaluation: - - {{ otherDoc (a -> Word a) }} - - --- - - The following markdown features aren't supported by the Doc format yet, - but maybe will someday - - > Block quote - - Table - - | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | - - Indented Code block - - ''' - Exact whitespace should be preserved across multiple updates. Don't mess with the logo! - - _____ _ - | | |___|_|___ ___ ___ - | | | | |_ -| . | | - |_____|_|_|_|___|___|_|_| - - Line with no whitespace: - - Should have one full trailing newline below here: - - ''' - - Inline ` text literal with 1 space of padding ` in the middle of a - sentence. - }} -``` diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md deleted file mode 100644 index 9f8a946c0f..0000000000 --- a/unison-src/transcripts/doc2markdown.output.md +++ /dev/null @@ -1,203 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -otherDoc : a -> Doc2 -otherDoc _ = {{ yo }} - -otherTerm : Nat -otherTerm = 99 - -fulldoc : Doc2 -fulldoc = - use Nat + - {{ -Heres some text with a -soft line break - -hard line break - -Here's a cool **BOLD** __italic__ ~~strikethrough~~ thing with an inline code block ''1 + 2'' - -# Heading - -## Heading 2 - -Term Link: {otherTerm} - -Type Link: {type Optional} - -Term source: - -@source{term} - -Term signature: - -@signature{term} - -* List item - -Inline code: - -`` 1 + 2 `` - -` "doesn't typecheck" + 1 ` - -[Link](https://unison-lang.org) - -![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - -Horizontal rule - ---- - -Video - -{{ -Special - (Embed - (Any (Video [MediaSource "test.mp4" None] [("poster", "test.png")]))) -}} - -Transclusion/evaluation: - -{{ otherDoc (a -> Word a) }} - ---- - -The following markdown features aren't supported by the Doc format yet, but maybe will someday - - -> Block quote - - -Table - -| Header 1 | Header 2 | -| -------- | -------- | -| Cell 1 | Cell 2 | - - - Indented Code block - - -}} -``` - -``` ucm :hide -scratch/main> add -``` - -```` ucm -scratch/main> debug.doc-to-markdown fulldoc - - Heres some text with a soft line break - - hard line break - - Here's a cool **BOLD** _italic_ ~~strikethrough~~ thing with an inline code block `1 + 2` - - # Heading - - ## Heading 2 - - Term Link: `otherTerm` - - Type Link: `Optional` - - Term source: - - ```unison - term : '{g} a -> Doc2.Term - term a = Term.Term (Any a) - ``` - - - - Term signature: - - ```unison - term : '{g} a -> Doc2.Term - ``` - - - - - List item - - Inline code: - - `1 Nat.+ 2` - - ` "doesn't typecheck" + 1 ` - - [Link](https://unison-lang.org) - - ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) - - Horizontal rule - - --- - - Video - - ![](test.mp4) - - Transclusion/evaluation: - - yo - - - - --- - - The following markdown features aren't supported by the Doc format yet, but maybe will someday - - > Block quote - - Table - - | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | - - Indented Code block - - -```` - -You can add docs to a term or type with a top-level doc literal above the binding: - -``` unison -{{ This is a term doc }} -myTerm = 10 - --- Regression tests for https://github.com/unisonweb/unison/issues/4634 -{{ This is a type doc }} -type MyType = MyType - -{{ This is a unique type doc }} -unique type MyUniqueType = MyUniqueType - -{{ This is a structural type doc }} -structural type MyStructuralType = MyStructuralType -``` - -``` ucm :added-by-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 MyStructuralType - (also named builtin.Unit) - type MyType - type MyUniqueType - MyStructuralType.doc : Doc2 - MyType.doc : Doc2 - MyUniqueType.doc : Doc2 - myTerm : Nat - myTerm.doc : Doc2 -``` diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md b/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md deleted file mode 100644 index 6672495a0b..0000000000 --- a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.output.md +++ /dev/null @@ -1,49 +0,0 @@ -If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrade old new` would rewrite references to -`#old` with references to `#new`. And it will... \!\!unless\!\! `#old` still exists in new. - -``` ucm :hide -foo/main> builtins.merge lib.builtin -``` - -``` unison -lib.old.foo = 18 -lib.new.other = 18 -lib.new.foo = 19 -mything = lib.old.foo + lib.old.foo -``` - -``` ucm :added-by-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`: - - lib.new.foo : Nat - lib.new.other : Nat - lib.old.foo : Nat - mything : Nat -``` - -``` ucm -foo/main> add - - ⍟ I've added these definitions: - - lib.new.foo : Nat - lib.new.other : Nat - lib.old.foo : Nat - mything : Nat -foo/main> upgrade old new - - I upgraded old to new, and removed old. -foo/main> view mything - - mything : Nat - mything = - use Nat + - other + other -``` diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md deleted file mode 100644 index c1834160e3..0000000000 --- a/unison-src/transcripts/duplicate-names.output.md +++ /dev/null @@ -1,141 +0,0 @@ -# Duplicate names in scratch file. - -``` ucm :hide -scratch/main> builtins.merge -``` - -Term and ability constructor collisions should cause a parse error. - -``` unison :error -structural ability Stream where - send : a -> () - -Stream.send : a -> () -Stream.send _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name Stream.send: - 2 | send : a -> () - 3 | - 4 | Stream.send : a -> () - 5 | Stream.send _ = () -``` - -Term and type constructor collisions should cause a parse error. - -``` unison :error -structural type X = x - -X.x : a -> () -X.x _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name X.x: - 1 | structural type X = x - 2 | - 3 | X.x : a -> () - 4 | X.x _ = () -``` - -Ability and type constructor collisions should cause a parse error. - -``` unison :error -structural type X = x -structural ability X where - x : () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found two types called X: - - 1 | structural type X = x - 2 | structural ability X where - 3 | x : () -``` - -Field accessors and terms with the same name should cause a parse error. - -``` unison :error -structural type X = {x : ()} -X.x.modify = () -X.x.set = () -X.x = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name X.x: - 1 | structural type X = {x : ()} - 2 | X.x.modify = () - 3 | X.x.set = () - 4 | X.x = () - - - I found multiple bindings with the name X.x.modify: - 1 | structural type X = {x : ()} - 2 | X.x.modify = () - - - I found multiple bindings with the name X.x.set: - 1 | structural type X = {x : ()} - 2 | X.x.modify = () - 3 | X.x.set = () -``` - -Types and terms with the same name are allowed. - -``` unison -structural type X = Z - -X = () -``` - -``` ucm :added-by-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 X - (also named builtin.Unit) - X : () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type X - (also named builtin.Unit) - X : () -scratch/main> view X - - structural type X = Z - - X : () - X = () -``` diff --git a/unison-src/transcripts/duplicate-term-detection.output.md b/unison-src/transcripts/duplicate-term-detection.output.md deleted file mode 100644 index 0e3eeebe0f..0000000000 --- a/unison-src/transcripts/duplicate-term-detection.output.md +++ /dev/null @@ -1,105 +0,0 @@ -# Duplicate Term Detection - -``` ucm :hide -scratch/main> builtins.merge -``` - -Trivial duplicate terms should be detected: - -``` unison :error -x = 1 -x = 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name x: - 1 | x = 1 - 2 | x = 2 -``` - -Equivalent duplicate terms should be detected: - -``` unison :error -x = 1 -x = 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name x: - 1 | x = 1 - 2 | x = 1 -``` - -Duplicates from record accessors/setters should be detected - -``` unison :error -structural type Record = {x: Nat, y: Nat} -Record.x = 1 -Record.x.set = 2 -Record.x.modify = 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name Record.x: - 1 | structural type Record = {x: Nat, y: Nat} - 2 | Record.x = 1 - - - I found multiple bindings with the name Record.x.modify: - 1 | structural type Record = {x: Nat, y: Nat} - 2 | Record.x = 1 - 3 | Record.x.set = 2 - 4 | Record.x.modify = 2 - - - I found multiple bindings with the name Record.x.set: - 1 | structural type Record = {x: Nat, y: Nat} - 2 | Record.x = 1 - 3 | Record.x.set = 2 -``` - -Duplicate terms and constructors should be detected: - -``` unison :error -structural type SumType = X - -SumType.X = 1 - -structural ability AnAbility where - thing : Nat -> () - -AnAbility.thing = 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ❗️ - - I found multiple bindings with the name AnAbility.thing: - 6 | thing : Nat -> () - 7 | - 8 | AnAbility.thing = 2 - - - I found multiple bindings with the name SumType.X: - 1 | structural type SumType = X - 2 | - 3 | SumType.X = 1 -``` diff --git a/unison-src/transcripts/ed25519.output.md b/unison-src/transcripts/ed25519.output.md deleted file mode 100644 index 11bfafdd77..0000000000 --- a/unison-src/transcripts/ed25519.output.md +++ /dev/null @@ -1,56 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison - -up = 0xs0123456789abcdef -down = 0xsfedcba9876543210 - -secret = 0xs3885da624f4430c01326d96764da85647d403dae1fcdc9856c51037f9c647032 - -public = 0xsb14dbcf139c0e73d942a184b419e4f4fab726102bfe2b65c060b113bb379c77c - - -message = up ++ down ++ up ++ down ++ down ++ up ++ down ++ up - -signature = crypto.Ed25519.sign.impl secret public message - -sigOkay = match signature with - Left err -> Left err - Right sg -> crypto.Ed25519.verify.impl public message sg - -> signature -> sigOkay -``` - -``` ucm :added-by-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`: - - down : Bytes - message : Bytes - public : Bytes - secret : Bytes - sigOkay : Either Failure Boolean - signature : Either Failure Bytes - up : Bytes - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 18 | > signature - ⧩ - Right - 0xs0b76988ce7e5147d36597d2a526ec7b8e178b3ae29083598c33c9fbcdf0f84b4ff2f8c5409123dd9a0c54447861c07e21296500a98540f5d5f15d927eaa6d30a - - 19 | > sigOkay - ⧩ - Right true -``` diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md deleted file mode 100644 index 70bcc562c9..0000000000 --- a/unison-src/transcripts/edit-command.output.md +++ /dev/null @@ -1,75 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison /private/tmp/scratch.u -foo = 123 - -bar = 456 - -mytest = [Ok "ok"] -``` - -``` ucm :added-by-ucm - - Loading changes detected in /private/tmp/scratch.u. - - I found and typechecked these definitions in - /private/tmp/scratch.u. If you do an `add` or `update`, here's - how your codebase would change: - - ⍟ These new definitions are ok to `add`: - - bar : Nat - foo : Nat - mytest : [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat - mytest : [Result] -scratch/main> edit foo bar - - ☝️ - - I added 2 definitions to the top of /private/tmp/scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -scratch/main> edit mytest - - ☝️ - - I added 1 definitions to the top of /private/tmp/scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -``` - -``` unison :added-by-ucm /private/tmp/scratch.u -bar : Nat -bar = 456 - -foo : Nat -foo = 123 -``` - -``` unison :added-by-ucm /private/tmp/scratch.u -test> mytest = [Ok "ok"] -``` - -``` ucm :error -scratch/main> edit missing - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - missing -``` diff --git a/unison-src/transcripts/edit-namespace.output.md b/unison-src/transcripts/edit-namespace.output.md deleted file mode 100644 index 78e8f6aa2f..0000000000 --- a/unison-src/transcripts/edit-namespace.output.md +++ /dev/null @@ -1,150 +0,0 @@ -``` ucm :hide -project/main> builtins.mergeio lib.builtin -``` - -``` unison -{{ ping doc }} -nested.cycle.ping n = n Nat.+ pong n - -{{ pong doc }} -nested.cycle.pong n = n Nat.+ ping n - -toplevel = "hi" - -simple.x = 10 -simple.y = 20 - --- Shouldn't edit things in lib -lib.project.ignoreMe = 30 - --- Shouldn't render record accessors -unique type Foo = { bar : Nat, baz : Nat } -``` - -``` ucm :added-by-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 - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo - Foo.baz : Foo -> Nat - Foo.baz.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.baz.set : Nat -> Foo -> Foo - lib.project.ignoreMe : Nat - nested.cycle.ping : Nat -> Nat - nested.cycle.ping.doc : Doc2 - nested.cycle.pong : Nat -> Nat - nested.cycle.pong.doc : Doc2 - simple.x : Nat - simple.y : Nat - toplevel : Text -``` - -``` ucm -project/main> add - - ⍟ I've added these definitions: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo - Foo.baz : Foo -> Nat - Foo.baz.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.baz.set : Nat -> Foo -> Foo - lib.project.ignoreMe : Nat - nested.cycle.ping : Nat -> Nat - nested.cycle.ping.doc : Doc2 - nested.cycle.pong : Nat -> Nat - nested.cycle.pong.doc : Doc2 - simple.x : Nat - simple.y : Nat - toplevel : Text -``` - -`edit.namespace` edits the whole namespace (minus the top-level `lib`). - -``` ucm -project/main> edit.namespace - - ☝️ - - I added 8 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -``` - -``` unison :added-by-ucm scratch.u -type Foo = { bar : Nat, baz : Nat } - -nested.cycle.ping : Nat -> Nat -nested.cycle.ping n = - use Nat + - n + nested.cycle.pong n - -nested.cycle.ping.doc : Doc2 -nested.cycle.ping.doc = {{ ping doc }} - -nested.cycle.pong : Nat -> Nat -nested.cycle.pong n = - use Nat + - n + nested.cycle.ping n - -nested.cycle.pong.doc : Doc2 -nested.cycle.pong.doc = {{ pong doc }} - -simple.x : Nat -simple.x = 10 - -simple.y : Nat -simple.y = 20 - -toplevel : Text -toplevel = "hi" -``` - -`edit.namespace` can also accept explicit paths - -``` ucm -project/main> edit.namespace nested simple - - ☝️ - - I added 6 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -``` - -``` unison :added-by-ucm scratch.u -nested.cycle.ping : Nat -> Nat -nested.cycle.ping n = - use Nat + - n + nested.cycle.pong n - -nested.cycle.ping.doc : Doc2 -nested.cycle.ping.doc = {{ ping doc }} - -nested.cycle.pong : Nat -> Nat -nested.cycle.pong n = - use Nat + - n + nested.cycle.ping n - -nested.cycle.pong.doc : Doc2 -nested.cycle.pong.doc = {{ pong doc }} - -simple.x : Nat -simple.x = 10 - -simple.y : Nat -simple.y = 20 -``` diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md deleted file mode 100644 index 51807308a4..0000000000 --- a/unison-src/transcripts/empty-namespaces.output.md +++ /dev/null @@ -1,149 +0,0 @@ -# Empty namespace behaviours - -``` unison :hide -mynamespace.x = 1 -``` - -``` ucm :hide -scratch/main> add -scratch/main> delete.namespace mynamespace -``` - -The deleted namespace shouldn't appear in `ls` output. - -``` ucm :error -scratch/main> ls - - nothing to show -``` - -``` ucm :error -scratch/main> find.verbose - - ☝️ - - 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. - - `debug.find.global` can be used to search outside the current - namespace. -``` - -``` ucm :error -scratch/main> find mynamespace - - ☝️ - - 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. - - `debug.find.global` can be used to search outside the current - namespace. -``` - -## history - -The history of the namespace should be empty. - -``` ucm -scratch/main> history mynamespace - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` - -Add and then delete a term to add some history to a deleted namespace. - -``` unison :hide -deleted.x = 1 -stuff.thing = 2 -``` - -``` ucm :hide -scratch/main> add -scratch/main> delete.namespace deleted -``` - -## fork - -I should be allowed to fork over a deleted namespace - -``` ucm -scratch/main> fork stuff deleted - - Done. -``` - -The history from the `deleted` namespace should have been overwritten by the history from `stuff`. - -``` ucm -scratch/main> history stuff - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #q2dq4tsno1 (start of history) -scratch/main> history deleted - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #q2dq4tsno1 (start of history) -``` - -## move.namespace - -``` unison :hide -moveoverme.x = 1 -moveme.y = 2 -``` - -``` ucm :hide -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 -scratch/main> delete.namespace moveoverme - - Done. -scratch/main> history moveme - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #c5uisu4kll (start of history) -scratch/main> move.namespace moveme moveoverme - - Done. -scratch/main> history moveoverme - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #c5uisu4kll (start of history) -``` diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md deleted file mode 100644 index 6492740f26..0000000000 --- a/unison-src/transcripts/emptyCodebase.output.md +++ /dev/null @@ -1,38 +0,0 @@ -# The empty codebase - -The Unison codebase, when first initialized, contains no definitions in its namespace. - -Not even `Nat` or `+`\! - -BEHOLD\!\!\! - -``` ucm :error -scratch/main> ls - - nothing to show -``` - -Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -scratch/main> ls lib - - 1. builtins/ (469 terms, 74 types) -``` - -And for a limited time, you can get even more builtin goodies: - -``` ucm -scratch/main> builtins.mergeio lib.builtinsio - - Done. -scratch/main> ls lib - - 1. builtins/ (469 terms, 74 types) - 2. builtinsio/ (643 terms, 92 types) -``` - -More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/error-messages.output.md b/unison-src/transcripts/error-messages.output.md deleted file mode 100644 index 1496829a52..0000000000 --- a/unison-src/transcripts/error-messages.output.md +++ /dev/null @@ -1,391 +0,0 @@ -``` ucm :hide -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. - -## Parse errors - -Some basic errors of literals. - -### Floating point literals - -``` unison :error -x = 1. -- missing some digits after the decimal -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 1. -- missing some digits after the decimal - - I was expecting some digits after the `.` , for example: `1.0` - or `1.1e37`. -``` - -``` unison :error -x = 1e -- missing an exponent -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 1e -- missing an exponent - - I was expecting some digits for the exponent, for example: - `1e37`. -``` - -``` unison :error -x = 1e- -- missing an exponent -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 1e- -- missing an exponent - - I was expecting some digits for the exponent, for example: - `1e-37`. -``` - -``` unison :error -x = 1E+ -- missing an exponent -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 1E+ -- missing an exponent - - I was expecting some digits for the exponent, for example: - `1e+37`. -``` - -### Hex, octal, binary, and bytes literals - -``` unison :error -x = 0xoogabooga -- invalid hex chars -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 0xoogabooga -- invalid hex chars - - I was expecting only hexidecimal characters (one of - 0123456789abcdefABCDEF) after the 0x. -``` - -``` unison :error -x = 0o987654321 -- 9 and 8 are not valid octal char -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 0o987654321 -- 9 and 8 are not valid octal char - - I was expecting only octal characters (one of 01234567) after - the 0o. -``` - -``` unison :error -x = 0b3201 -- 3 and 2 are not valid binary chars -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This number isn't valid syntax: - - 1 | x = 0b3201 -- 3 and 2 are not valid binary chars - - I was expecting only binary characters (one of 01) after the - 0b. -``` - -``` unison :error -x = 0xsf -- odd number of hex chars in a bytes literal -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This bytes literal isn't valid syntax: 0xsf - - 1 | x = 0xsf -- odd number of hex chars in a bytes literal - - I was expecting an even number of hexidecimal characters (one - of 0123456789abcdefABCDEF) after the 0xs. -``` - -``` unison :error -x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This bytes literal isn't valid syntax: 0xsnotvalidhexchars - - 1 | x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal - - I was expecting an even number of hexidecimal characters (one - of 0123456789abcdefABCDEF) after the 0xs. -``` - -### Layout errors - -``` unison :error -foo = else -- not matching if -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a closing 'else' here without a matching 'then'. - - 1 | foo = else -- not matching if -``` - -``` unison :error -foo = then -- unclosed -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a closing 'then' here without a matching 'if'. - - 1 | foo = then -- unclosed -``` - -``` unison :error -foo = with -- unclosed -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a closing 'with' here without a matching 'handle' or 'match'. - - 1 | foo = with -- unclosed -``` - -### Matching - -``` unison :error --- No cases -foo = match 1 with -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | foo = match 1 with - - - Patterns not matched: - * _ -``` - -``` unison :error -foo = match 1 with - 2 -- no right-hand-side -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 3 | - - I was surprised to find an end of section here. - I was expecting one of these instead: - - * "," - * case match - * pattern guard -``` - -``` unison :error --- Mismatched arities -foo = cases - 1, 2 -> () - 3 -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - 😶 - - Not all the branches of this pattern matching have the same - number of arguments. I was assuming they'd all have 2 - arguments (based on the previous patterns) but this one has - 1 arguments: - 4 | 3 -> () - -``` - -``` unison :error --- Missing a '->' -x = match Some a with - None -> - 1 - Some _ - 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 7 | - - I was surprised to find an end of section here. - I was expecting one of these instead: - - * "," - * blank - * case match - * false - * pattern guard - * true -``` - -``` unison :error --- Missing patterns -x = match Some a with - None -> 1 - -> 2 - -> 3 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 4 | -> 2 - - - I was surprised to find a -> here. - I was expecting one of these instead: - - * end of input - * newline or semicolon -``` - -``` unison :error --- Guards following an unguarded case -x = match Some a with - None -> 1 - | true -> 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 4 | | true -> 2 - - - I was surprised to find a '|' here. - I was expecting one of these instead: - - * end of input - * newline or semicolon -``` - -### Watches - -``` unison :error --- Empty watch -> -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I expected a non-empty watch expression and not just ">" - - 2 | > -``` - -### Keywords - -``` unison :error -use.keyword.in.namespace = 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - The identifier `namespace` used here is a reserved keyword: - - 1 | use.keyword.in.namespace = 1 - - You can avoid this problem either by renaming the identifier - or wrapping it in backticks (like `namespace` ). -``` - -``` unison :error --- reserved operator -a ! b = 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This looks like the start of an expression here - - 2 | a ! b = 1 - - but at the file top-level, I expect one of the following: - - - A binding, like a = 42 OR - a : Nat - a = 42 - - A watch expression, like > a + 1 - - An `ability` declaration, like unique ability Foo where ... - - A `type` declaration, like structural type Optional a = None | Some a -``` diff --git a/unison-src/transcripts/escape-sequences.output.md b/unison-src/transcripts/escape-sequences.output.md deleted file mode 100644 index fdc05a5045..0000000000 --- a/unison-src/transcripts/escape-sequences.output.md +++ /dev/null @@ -1,29 +0,0 @@ -``` unison -> "Rúnar" -> "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" -> "古池や蛙飛びこむ水の音" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > "Rúnar" - ⧩ - "Rúnar" - - 2 | > "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" - ⧩ - "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" - - 3 | > "古池や蛙飛びこむ水の音" - ⧩ - "古池や蛙飛びこむ水の音" -``` diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md deleted file mode 100644 index d4a8f1a26f..0000000000 --- a/unison-src/transcripts/find-by-type.output.md +++ /dev/null @@ -1,51 +0,0 @@ -``` ucm :hide -scratch/main> alias.type ##Text builtin.Text -``` - -``` unison :hide -unique type A = A Text - -foo : A -foo = A "foo!" - -bar : Text -> A -bar = A - -baz : A -> Text -baz = cases - A t -> t -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type A - bar : Text -> A - baz : A -> Text - foo : A -scratch/main> find : Text -> A - - 1. bar : Text -> A - 2. A.A : Text -> A -scratch/main> find : A -> Text - - 1. baz : A -> Text -scratch/main> find : A - - 1. foo : A -``` - -``` ucm :error -scratch/main> find : Text - - ☝️ - - I couldn't find exact type matches, resorting to fuzzy - matching... - - 1. bar : Text -> A - 2. baz : A -> Text - 3. A.A : Text -> A -``` diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md deleted file mode 100644 index ad1cb6727f..0000000000 --- a/unison-src/transcripts/find-command.output.md +++ /dev/null @@ -1,91 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison :hide -foo = 1 -lib.foo = 2 -lib.bar = 3 -cat.foo = 4 -cat.lib.foo = 5 -cat.lib.bar = 6 -somewhere.bar = 7 -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> find foo - - 1. cat.foo : Nat - 2. foo : Nat -scratch/main> view 1 - - cat.foo : Nat - cat.foo = 4 -scratch/main> find.all foo - - 1. cat.foo : Nat - 2. cat.lib.foo : Nat - 3. lib.foo : Nat - 4. foo : Nat -scratch/main> view 1 - - cat.foo : Nat - cat.foo = 4 -``` - -``` ucm -scratch/main> find-in cat foo - - 1. foo : Nat -scratch/main> view 1 - - cat.foo : Nat - cat.foo = 4 -scratch/main> find-in.all cat foo - - 1. lib.foo : Nat - 2. foo : Nat -scratch/main> view 1 - - cat.lib.foo : Nat - cat.lib.foo = 5 -``` - -Finding within a namespace - -``` ucm -scratch/main> find bar - - 1. somewhere.bar : Nat -scratch/other> debug.find.global bar - - Found results in scratch/main - - 1. .cat.lib.bar : Nat - 2. .lib.bar : Nat - 3. .somewhere.bar : Nat -scratch/main> find-in somewhere bar - - 1. bar : Nat -``` - -``` ucm :error -scratch/main> find baz - - ☝️ - - 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. - - `debug.find.global` can be used to search outside the current - namespace. -``` diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md deleted file mode 100644 index b724b01f05..0000000000 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ /dev/null @@ -1,55 +0,0 @@ -We were seeing an issue where (it seemed) that every namespace that was visited during a propagate would get a new history node, even when it didn't contain any dependents. - -Example: - -``` unison :hide -a = "a term" -X.foo = "a namespace" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - X.foo : ##Text - a : ##Text -``` - -Here is an update which should not affect `X`: - -``` unison :hide -a = "an update" -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; - -``` ucm -scratch/main> history X - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #das1se4g2i (start of history) -``` - -however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: - -``` ucm :error -scratch/main> history #7nl6ppokhg - - 😶 - - I don't know of a namespace with that hash. -``` diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.output.md b/unison-src/transcripts/fix-2258-if-as-list-element.output.md deleted file mode 100644 index 32224c32e3..0000000000 --- a/unison-src/transcripts/fix-2258-if-as-list-element.output.md +++ /dev/null @@ -1,65 +0,0 @@ -Tests that `if` statements can appear as list and tuple elements. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -> [ if true then 1 else 0 ] - -> [ if true then 1 else 0, 1] - -> [1, if true then 1 else 0] - -> (if true then 1 else 0, 0) - -> (0, if true then 1 else 0) - -> (1) - -> (1,2) - -> (1,2,3) - -> [1,2,3] - -> [] - -> [1] - -> [1,2] - -> [1,2,3] - -> [ - 1, - 2, - 3 - ] - -> [ - 1, - 2, - 3,] - -> (1,2,3,) - -> (1, - 2,) - -structural ability Zoot where zoot : () - -Zoot.handler : Request {Zoot} a -> a -Zoot.handler = cases - { a } -> a - { zoot -> k } -> handle !k with Zoot.handler - -fst = cases (x,_) -> x - -> List.size - [ if true then (x y -> y) - else handle (x y -> x) with fst (Zoot.handler, 42), - cases a, b -> a Nat.+ b, -- multi-arg cases lambda - cases x, y -> x Nat.+ y - ] -``` diff --git a/unison-src/transcripts/fix-5267.output.md b/unison-src/transcripts/fix-5267.output.md deleted file mode 100644 index 475180d672..0000000000 --- a/unison-src/transcripts/fix-5267.output.md +++ /dev/null @@ -1,82 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.direct.foo = 17 -lib.direct.lib.indirect.foo = 18 - -bar : Nat -bar = direct.foo + direct.foo -``` - -``` ucm :added-by-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`: - - bar : Nat - lib.direct.foo : Nat - lib.direct.lib.indirect.foo : Nat -``` - -Here, `bar` renders as `foo + foo`, even though there are two names with suffix `foo` in scope, because one is an -indirect dependency. It used to render as `direct.foo + direct.foo`. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - lib.direct.foo : Nat - lib.direct.lib.indirect.foo : Nat -scratch/main> view bar - - bar : Nat - bar = - use Nat + - foo + foo -``` - -Same test, but for types. - -``` unison -type lib.direct.Foo = MkFoo -type lib.direct.lib.indirect.Foo = MkFoo - -type Bar = MkBar direct.Foo -``` - -``` ucm :added-by-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 Bar - type lib.direct.Foo - type lib.direct.lib.indirect.Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Bar - type lib.direct.Foo - type lib.direct.lib.indirect.Foo -scratch/main> view Bar - - type Bar = MkBar Foo -``` diff --git a/unison-src/transcripts/fix-5301.output.md b/unison-src/transcripts/fix-5301.output.md deleted file mode 100644 index be2a126470..0000000000 --- a/unison-src/transcripts/fix-5301.output.md +++ /dev/null @@ -1,61 +0,0 @@ -This transcripts demonstrates that pattern matching on a "constructor" (defined as a variable that begins with a capital -letter) that is either not found or ambiguouus fails. Previously, it would be treated as a variable binding. - -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison :error -type Foo = Bar Nat - -foo : Foo -> Nat -foo = cases - Bar X -> 5 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - - ❓ - - I couldn't resolve any of these symbols: - - 5 | Bar X -> 5 - - - Symbol Suggestions - - X No matches -``` - -``` unison :error -type Foo = Bar A -type A = X -type B = X - -foo : Foo -> Nat -foo = cases - Bar X -> 5 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - - ❓ - - I couldn't resolve any of these symbols: - - 7 | Bar X -> 5 - - - Symbol Suggestions - - X A.X - B.X -``` diff --git a/unison-src/transcripts/fix-5312.output.md b/unison-src/transcripts/fix-5312.output.md deleted file mode 100644 index 710cf258c2..0000000000 --- a/unison-src/transcripts/fix-5312.output.md +++ /dev/null @@ -1,75 +0,0 @@ -This transcript demonstrates that dependents of an update are suffixified properly. Previously, `c = b.y + 1` would -render as `c = y + 1` (ambiguous). - -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison -x = 17 - -a.y = 18 -b.y = x + 1 - -c = b.y + 1 -``` - -``` ucm :added-by-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.y : Nat - b.y : Nat - c : Nat - x : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a.y : Nat - b.y : Nat - c : Nat - x : Nat -``` - -``` unison -x = 100 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` diff --git a/unison-src/transcripts/fix-5320.output.md b/unison-src/transcripts/fix-5320.output.md deleted file mode 100644 index a4142f5c3a..0000000000 --- a/unison-src/transcripts/fix-5320.output.md +++ /dev/null @@ -1,27 +0,0 @@ -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison :error -foo = cases - bar.Baz -> 5 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - - ❓ - - I couldn't resolve any of these symbols: - - 2 | bar.Baz -> 5 - - - Symbol Suggestions - - bar.Baz No matches -``` diff --git a/unison-src/transcripts/fix-5323.output.md b/unison-src/transcripts/fix-5323.output.md deleted file mode 100644 index 873797fadc..0000000000 --- a/unison-src/transcripts/fix-5323.output.md +++ /dev/null @@ -1,53 +0,0 @@ -This transcript demonstrates that dependents of an upgrade are suffixified properly. Previously, `c = b.y + 1` would -render as `c = y + 1` (ambiguous). - -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison -lib.old.x = 17 -lib.new.x = 100 - -a.y = 18 -b.y = lib.old.x + 1 - -c = b.y + 1 -``` - -``` ucm :added-by-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.y : Nat - b.y : Nat - c : Nat - lib.new.x : Nat - lib.old.x : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a.y : Nat - b.y : Nat - c : Nat - lib.new.x : Nat - lib.old.x : Nat -``` - -``` ucm -scratch/main> upgrade old new - - I upgraded old to new, and removed old. -``` diff --git a/unison-src/transcripts/fix-5326.output.md b/unison-src/transcripts/fix-5326.output.md deleted file mode 100644 index 71e7894ed9..0000000000 --- a/unison-src/transcripts/fix-5326.output.md +++ /dev/null @@ -1,233 +0,0 @@ -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison -x = 1 -``` - -``` ucm :added-by-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 -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> branch foo - - Done. I've created the foo branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /foo`. -``` - -``` -main, foo -| -A -``` - -``` unison -x = 2 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> branch bar - - Done. I've created the bar branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /bar`. -``` - -``` -main, bar -| -| foo -| | -B - A -``` - -``` unison -x = 3 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -``` -main -| -| bar foo -| | | -C - B - A -``` - -``` unison -x = 4 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -``` -main -| -| bar foo -| | | -D - C - B - A -``` - -``` unison -y = 5 -``` - -``` ucm :added-by-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 -scratch/foo> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -``` -main -| -| bar -| | -D - C - B - A - / - E - | - foo -``` - -``` ucm -scratch/main> merge /foo - - I merged scratch/foo into scratch/main. -``` - -``` -main -| -| bar -| | -F - D - C - B - A - \ / - ----------- E - | - foo -``` - -``` ucm -scratch/main> merge /bar - - 😶 - - scratch/main was already up-to-date with scratch/bar. -``` - -This should be a fast-forward, but we used to get this shape instead (which fails due to conflicts), because we -incorrectly computed `LCA(main, bar)` as `A`, not `B`. - -``` -main -| -| ------------ bar -| / \| -G - F - D - C - B - A - \ / - ----------- E - | - foo -``` diff --git a/unison-src/transcripts/fix-5340.output.md b/unison-src/transcripts/fix-5340.output.md deleted file mode 100644 index f4825dcdbc..0000000000 --- a/unison-src/transcripts/fix-5340.output.md +++ /dev/null @@ -1,81 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -type my.Foo = MkFoo -type lib.dep.lib.dep.Foo = MkFoo - -my.foo = 17 -lib.dep.lib.dep.foo = 18 -``` - -``` ucm :added-by-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 lib.dep.lib.dep.Foo - type my.Foo - lib.dep.lib.dep.foo : Nat - my.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type lib.dep.lib.dep.Foo - type my.Foo - lib.dep.lib.dep.foo : Nat - my.foo : Nat -``` - -These references to type `Foo` and term `foo` are unambiguous (resolving to the `my.Foo` and `my.foo` in the -file), even though indirect dependencies `lib.dep.lib.dep.Foo` and `lib.dep.lib.dep.foo` match by suffix. - -``` unison -type my.Foo = MkFoo -type Bar = MkBar Foo -``` - -``` ucm :added-by-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: - - ⊡ Previously added definitions will be ignored: my.Foo - - ⍟ These new definitions are ok to `add`: - - type Bar -``` - -``` unison -my.foo = 17 -bar = foo Nat.+ foo -``` - -``` ucm :added-by-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: - - ⊡ Previously added definitions will be ignored: my.foo - - ⍟ These new definitions are ok to `add`: - - bar : Nat -``` diff --git a/unison-src/transcripts/fix-5357.output.md b/unison-src/transcripts/fix-5357.output.md deleted file mode 100644 index ad9c45ca93..0000000000 --- a/unison-src/transcripts/fix-5357.output.md +++ /dev/null @@ -1,85 +0,0 @@ -``` unison -util.ignore : a -> () -util.ignore _ = () - -foo : () -foo = - ignore 3 - ignore 4 -``` - -``` ucm :added-by-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 : () - util.ignore : a -> () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : () - util.ignore : a -> () -``` - -``` unison -lib.base.ignore : a -> () -lib.base.ignore _ = () -``` - -``` ucm :added-by-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`: - - lib.base.ignore : a -> () - (also named util.ignore) -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.base.ignore : a -> () - (also named util.ignore) -scratch/main> edit.namespace - - ☝️ - - I added 2 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -scratch/main> load - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. -``` - -``` unison :added-by-ucm scratch.u -foo : () -foo = - use util ignore - ignore 3 - ignore 4 - -util.ignore : a -> () -util.ignore _ = () -``` diff --git a/unison-src/transcripts/fix-5369.output.md b/unison-src/transcripts/fix-5369.output.md deleted file mode 100644 index 6559b94f26..0000000000 --- a/unison-src/transcripts/fix-5369.output.md +++ /dev/null @@ -1,62 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -one.foo : Nat -one.foo = 17 - -two.foo : Text -two.foo = "blah" -``` - -``` ucm :added-by-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.foo : Nat - two.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - one.foo : Nat - two.foo : Text -``` - -``` unison -one.foo : Nat -one.foo = 18 - -bar : Nat -bar = foo + foo -``` - -``` ucm :added-by-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`: - - bar : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - one.foo : Nat -``` diff --git a/unison-src/transcripts/fix-5374.output.md b/unison-src/transcripts/fix-5374.output.md deleted file mode 100644 index a22dc8f370..0000000000 --- a/unison-src/transcripts/fix-5374.output.md +++ /dev/null @@ -1,60 +0,0 @@ -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison -lib.direct.foo = 17 -lib.direct.lib.indirect.foo = 18 - -thing = indirect.foo + indirect.foo -``` - -``` ucm :added-by-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`: - - lib.direct.foo : Nat - lib.direct.lib.indirect.foo : Nat - thing : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.direct.foo : Nat - lib.direct.lib.indirect.foo : Nat - thing : Nat -scratch/main> view thing - - thing : Nat - thing = - use Nat + - use indirect foo - foo + foo -scratch/main> edit thing - - ☝️ - - I added 1 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -``` - -``` unison :added-by-ucm scratch.u -thing : Nat -thing = - use Nat + - use indirect foo - foo + foo -``` diff --git a/unison-src/transcripts/fix-5380.output.md b/unison-src/transcripts/fix-5380.output.md deleted file mode 100644 index f24dcaa513..0000000000 --- a/unison-src/transcripts/fix-5380.output.md +++ /dev/null @@ -1,50 +0,0 @@ -``` ucm -scratch/main> builtins.merge lib.builtin - - Done. -``` - -``` unison -foo : Nat -foo = 17 - -bar : Nat -bar = - qux : Nat - qux = 18 - foo + qux -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -scratch/main> move.term foo qux - - Done. -scratch/main> view bar - - bar : Nat - bar = - use Nat + - qux : Nat - qux = 18 - .qux + qux -``` diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md deleted file mode 100644 index 1ab91c73a7..0000000000 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ /dev/null @@ -1,27 +0,0 @@ -#### Big list crash - -``` ucm :hide -scratch/main> builtins.merge -``` - -Big lists have been observed to crash, while in the garbage collection step. - -``` unison -unique type Direction = U | D | L | R - -x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U,336),(L,697),(D,682),(L,180),(U,951),(L,189),(D,547),(R,697),(U,583),(L,172),(D,859),(L,370),(D,114),(L,519),(U,829),(R,389),(U,608),(R,66),(D,634),(L,320),(D,49),(L,931),(U,137),(L,349),(D,689),(L,351),(D,829),(R,819),(D,138),(L,118),(D,849),(R,230),(U,858),(L,509),(D,311),(R,815),(U,217),(R,359),(U,840),(R,77),(U,230),(R,361),(U,322),(R,300),(D,646),(R,348),(U,815),(R,793),(D,752),(R,967),(U,128),(R,948),(D,499),(R,359),(U,572),(L,566),(U,815),(R,630),(D,290),(L,829),(D,736),(R,358),(U,778),(R,891),(U,941),(R,544),(U,889),(L,920),(U,913),(L,447),(D,604),(R,538),(U,818),(L,215),(D,437),(R,447),(U,576),(R,452),(D,794),(R,864),(U,269),(L,325),(D,35),(L,268),(D,639),(L,101),(U,777),(L,776),(U,958),(R,105),(U,517),(R,667),(D,423),(R,603),(U,469),(L,125),(D,919),(R,879),(U,994),(R,665),(D,377),(R,456),(D,570),(L,685),(U,291),(R,261),(U,846),(R,840),(U,418),(L,974),(D,270),(L,312),(D,426),(R,621),(D,334),(L,855),(D,378),(R,694),(U,845),(R,481),(U,895),(L,362),(D,840),(L,712),(U,57),(R,276),(D,643),(R,566),(U,348),(R,361),(D,144),(L,287),(D,864),(L,556),(U,610),(L,927),(U,322),(R,271),(D,90),(L,741),(U,446),(R,181),(D,527),(R,56),(U,805),(L,907),(D,406),(L,286),(U,873),(L,79),(D,280),(L,153),(D,377),(R,253),(D,61),(R,475),(D,804),(R,788),(U,393),(L,660),(U,314),(R,489),(D,491),(L,234),(D,712),(L,253),(U,651),(L,777),(D,726),(R,146),(U,47),(R,630),(U,517),(R,226),(U,624),(L,834),(D,153),(L,513),(U,799),(R,287),(D,868),(R,982),(U,390),(L,296),(D,373),(R,9),(U,994),(R,105),(D,673),(L,657),(D,868),(R,738),(D,277),(R,374),(U,828),(R,860),(U,247),(R,484),(U,986),(L,723),(D,847),(L,578),(U,487),(L,51),(D,865),(L,328),(D,199),(R,812),(D,726),(R,355),(D,463),(R,761),(U,69),(R,508),(D,753),(L,81),(D,50),(L,345),(D,66),(L,764),(D,466),(L,975),(U,619),(R,59),(D,788),(L,737),(D,360),(R,14),(D,253),(L,512),(D,417),(R,828),(D,188),(L,394),(U,212),(R,658),(U,369),(R,920),(U,927),(L,339),(U,552),(R,856),(D,458),(R,407),(U,41),(L,930),(D,460),(R,809),(U,467),(L,410),(D,800),(L,135),(D,596),(R,678),(D,4),(L,771),(D,637),(L,876),(U,192),(L,406),(D,136),(R,666),(U,730),(R,711),(D,291),(L,586),(U,845),(R,606),(U,2),(L,228),(D,759),(R,244),(U,946),(R,948),(U,160),(R,397),(U,134),(R,188),(U,850),(R,623),(D,315),(L,219),(D,450),(R,489),(U,374),(R,299),(D,474),(L,767),(D,679),(L,160),(D,403),(L,708)] -``` - -``` ucm :added-by-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 Direction - x : [(Direction, Nat)] -``` diff --git a/unison-src/transcripts/fix-ls.output.md b/unison-src/transcripts/fix-ls.output.md deleted file mode 100644 index a6b134972c..0000000000 --- a/unison-src/transcripts/fix-ls.output.md +++ /dev/null @@ -1,41 +0,0 @@ -``` ucm -test-ls/main> builtins.merge - - Done. -``` - -``` unison -foo.bar.add x y = x Int.+ y - -foo.bar.subtract x y = x Int.- y -``` - -``` ucm :added-by-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.bar.add : Int -> Int -> Int - foo.bar.subtract : Int -> Int -> Int -``` - -``` ucm -test-ls/main> add - - ⍟ I've added these definitions: - - foo.bar.add : Int -> Int -> Int - foo.bar.subtract : Int -> Int -> Int -test-ls/main> ls foo - - 1. bar/ (2 terms) -test-ls/main> ls 1 - - 1. add (Int -> Int -> Int) - 2. subtract (Int -> Int -> Int) -``` diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md deleted file mode 100644 index 03399ce4a0..0000000000 --- a/unison-src/transcripts/fix1063.output.md +++ /dev/null @@ -1,42 +0,0 @@ -Tests that functions named `.` are rendered correctly. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -(`.`) f g x = f (g x) - -use Boolean not - -noop = not `.` not -``` - -``` ucm :added-by-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`: - - `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o - noop : Boolean -> Boolean -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o - noop : Boolean -> Boolean -scratch/main> view noop - - noop : Boolean -> Boolean - noop = - use Boolean not - not `.` not -``` diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md deleted file mode 100644 index f93ab84b4c..0000000000 --- a/unison-src/transcripts/fix1327.output.md +++ /dev/null @@ -1,47 +0,0 @@ -``` unison -foo = 4 - -bar = 5 -``` - -``` ucm :added-by-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`: - - bar : ##Nat - foo : ##Nat -``` - -`alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones. - -Now `ls` returns a pair of the absolute search directory and the result relative to that search directory, so it can be used in both absolute and relative contexts. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : ##Nat - foo : ##Nat -scratch/main> ls - - 1. bar (##Nat) - 2. foo (##Nat) -scratch/main> alias.many 1-2 .ns1_nohistory - - Here's what changed in .ns1_nohistory : - - Added definitions: - - 1. bar : ##Nat - 2. foo : ##Nat - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. -``` diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md deleted file mode 100644 index f0475b4de6..0000000000 --- a/unison-src/transcripts/fix1334.output.md +++ /dev/null @@ -1,14 +0,0 @@ -Previously, the `alias.term` and `alias.type` would fail if the source argument was hash-only, and there was no way to create an alias for a definition that didn't already have a name. Also, the `replace.term` and `replace.type` *only* worked on hashes, and they had to be *full* hashes. - -With this PR, the source of an alias can be a short hash (even of a definition that doesn't currently have a name in the namespace) along with a name or hash-qualified name from the current namespace as usual. - -Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: - -``` ucm -scratch/main> alias.type ##Nat Cat - - Done. -scratch/main> alias.term ##Nat.+ please_fix_763.+ - - Done. -``` diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md deleted file mode 100644 index 40ae203bca..0000000000 --- a/unison-src/transcripts/fix1390.output.md +++ /dev/null @@ -1,66 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison --- List.map : (a -> b) -> [a] -> [b] -List.map f = - go acc = cases - [] -> acc - h +: t -> go (acc :+ f h) t - go [] -``` - -``` ucm :added-by-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.map : (i ->{g} o) -> [i] ->{g} [o] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - List.map : (i ->{g} o) -> [i] ->{g} [o] -scratch/main> view List.map - - List.map : (i ->{g} o) -> [i] ->{g} [o] - List.map f = - go acc = cases - [] -> acc - h +: t -> go (acc :+ f h) t - go [] -``` - -``` unison -List.map2 : (g -> g2) -> [g] -> [g2] -List.map2 f = - unused = "just to give this a different hash" - go acc = cases - [] -> acc - h +: t -> go (acc :+ f h) t - go [] -``` - -``` ucm :added-by-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.map2 : (g ->{h} g2) -> [g] ->{h} [g2] -``` diff --git a/unison-src/transcripts/fix1421.output.md b/unison-src/transcripts/fix1421.output.md deleted file mode 100644 index d372af4910..0000000000 --- a/unison-src/transcripts/fix1421.output.md +++ /dev/null @@ -1,27 +0,0 @@ -``` ucm -scratch/main> alias.type ##Nat Nat - - Done. -scratch/main> alias.term ##Nat.+ Nat.+ - - Done. -``` - -``` unison -unique type A = A Nat -unique type B = B Nat Nat -``` - -``` ucm :added-by-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 A - type B -``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md deleted file mode 100644 index 6d44d627e5..0000000000 --- a/unison-src/transcripts/fix1532.output.md +++ /dev/null @@ -1,87 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -First, lets create two namespaces. `foo` and `bar`, and add some definitions. - -``` unison -foo.x = 42 -foo.y = 100 -bar.z = x + y -``` - -``` ucm :added-by-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`: - - bar.z : Nat - foo.x : Nat - foo.y : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar.z : Nat - foo.x : Nat - foo.y : Nat -``` - -Let's see what we have created... - -``` ucm -scratch/main> ls - - 1. bar/ (1 term) - 2. builtin/ (469 terms, 74 types) - 3. foo/ (2 terms) -``` - -Now, if we try deleting the namespace `foo`, we get an error, as expected. - -``` ucm :error -scratch/main> delete.namespace foo - - ⚠️ - - I didn't delete the namespace because the following - definitions are still in use. - - Dependency Referenced In - x 1. bar.z - - y 2. bar.z - - If you want to proceed anyways and leave those definitions - without names, use delete.namespace.force -``` - -Any numbered arguments should refer to `bar.z`. - -``` ucm -scratch/main> debug.numberedArgs - - 1. bar.z - 2. bar.z -``` - -We can then delete the dependent term, and then delete `foo`. - -``` ucm -scratch/main> delete.term 1 - - Done. -scratch/main> delete.namespace foo - - Done. -``` diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md deleted file mode 100644 index 4461c47c64..0000000000 --- a/unison-src/transcripts/fix1696.output.md +++ /dev/null @@ -1,30 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :error -structural ability Ask where ask : Nat - -ability Zoot where - zoot : Nat - -Ask.provide : '{Zoot} Nat -> '{Ask} r -> r -Ask.provide answer asker = - h = cases - {r} -> r - {Ask.ask -> resume} -> handle resume !answer with h - handle !asker with h - -dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") - -> dialog -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. - - 13 | dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") -``` diff --git a/unison-src/transcripts/fix1709.output.md b/unison-src/transcripts/fix1709.output.md deleted file mode 100644 index 5b73cc3a96..0000000000 --- a/unison-src/transcripts/fix1709.output.md +++ /dev/null @@ -1,50 +0,0 @@ -``` unison -id x = x - -id2 x = - z = 384849 - id x -``` - -``` ucm :added-by-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`: - - id : x -> x - id2 : x -> x -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - id : x -> x - id2 : x -> x -``` - -``` unison -> id2 "hi" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > id2 "hi" - ⧩ - "hi" -``` diff --git a/unison-src/transcripts/fix1731.output.md b/unison-src/transcripts/fix1731.output.md deleted file mode 100644 index 45341bc675..0000000000 --- a/unison-src/transcripts/fix1731.output.md +++ /dev/null @@ -1,34 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -structural ability CLI where - print : Text ->{CLI} () - input : {CLI} Text -``` - -``` ucm :hide -scratch/main> add -``` - -The `input` here should parse as a wildcard, not as `CLI.input`. - -``` unison -repro : Text -> () -repro = cases - input -> () -``` - -``` ucm :added-by-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`: - - repro : Text -> () -``` diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md deleted file mode 100644 index ee969c0eed..0000000000 --- a/unison-src/transcripts/fix1800.output.md +++ /dev/null @@ -1,108 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -printLine : Text ->{IO} () -printLine msg = - _ = putBytes.impl (stdHandle StdOut) (Text.toUtf8 (msg ++ "\n")) - () - --- An unannotated main function -main1 = '(printLine "\nhello world!") - --- Another variation -main2 _ = printLine "🌹" - --- An annotated main function -main3 : '{IO} () -main3 _ = printLine "🦄 ☁️ 🌈" -``` - -Testing a few variations here: - - - Should be able to run annotated and unannotated main functions in the current file. - - Should be able to run annotated and unannotated main functions from the codebase. - -``` ucm -scratch/main> run main1 - - () -scratch/main> run main2 - - () -scratch/main> run main3 - - () -scratch/main> add - - ⍟ I've added these definitions: - - main1 : '{IO} () - main2 : ∀ _. _ ->{IO} () - main3 : '{IO} () - printLine : Text ->{IO} () -scratch/main> rename.term main1 code.main1 - - Done. -scratch/main> rename.term main2 code.main2 - - Done. -scratch/main> rename.term main3 code.main3 - - Done. -``` - -The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: - -``` ucm -scratch/main> run code.main1 - - () -scratch/main> run code.main2 - - () -scratch/main> run code.main3 - - () -``` - -Now testing a few variations that should NOT typecheck. - -``` unison :hide -main4 : Nat ->{IO} Nat -main4 n = n - -main5 : Nat ->{IO} () -main5 _ = () -``` - -This shouldn't work since `main4` and `main5` don't have the right type. - -``` ucm :error -scratch/main> run main4 - - 😶 - - I found this function: - - main4 : Nat ->{IO} Nat - - but in order for me to `run` it needs to be a subtype of: - - main4 : '{IO, Exception} result -``` - -``` ucm :error -scratch/main> run main5 - - 😶 - - I found this function: - - main5 : Nat ->{IO} () - - but in order for me to `run` it needs to be a subtype of: - - main5 : '{IO, Exception} result -``` diff --git a/unison-src/transcripts/fix1844.output.md b/unison-src/transcripts/fix1844.output.md deleted file mode 100644 index 60a97a6e2f..0000000000 --- a/unison-src/transcripts/fix1844.output.md +++ /dev/null @@ -1,33 +0,0 @@ -``` unison -structural type One a = One a -unique type Woot a b c = Woot a b c -unique type Z = Z - -snoc k aN = match k with - One a0 -> Woot (One a0) (One aN) 99 - -> snoc (One 1) 2 -``` - -``` ucm :added-by-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 One a - type Woot a b c - type Z - snoc : One a -> aN -> Woot (One a) (One aN) ##Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 8 | > snoc (One 1) 2 - ⧩ - Woot (One 1) (One 2) 99 -``` diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md deleted file mode 100644 index 0363045c97..0000000000 --- a/unison-src/transcripts/fix1926.output.md +++ /dev/null @@ -1,57 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -> 'sq - -sq = 2934892384 -``` - -``` ucm :added-by-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`: - - sq : Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > 'sq - ⧩ - do sq -``` - -``` unison -> 'sq - -sq = 2934892384 -``` - -``` ucm :added-by-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`: - - sq : Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > 'sq - ⧩ - do sq -``` diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md deleted file mode 100644 index eb9ec090e5..0000000000 --- a/unison-src/transcripts/fix2026.output.md +++ /dev/null @@ -1,74 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison -structural ability Exception where raise : Failure -> x - -ex = unsafeRun! '(printLine "hello world") - -printLine : Text ->{IO, Exception} () -printLine t = - putText stdOut t - putText stdOut "\n" - -stdOut : Handle -stdOut = stdHandle StdOut - -compose2 : (c ->{𝕖1} d) -> (a ->{𝕖2} b ->{𝕖3} c) -> a -> b ->{𝕖1,𝕖2,𝕖3} d -compose2 f g x y = f (g x y) - -putBytes : Handle -> Bytes ->{IO, Exception} () -putBytes = compose2 toException putBytes.impl - -toException : Either Failure a ->{Exception} a -toException = cases - Left e -> raise e - Right a -> a - -putText : Handle -> Text ->{IO, Exception} () -putText h t = putBytes h (toUtf8 t) - -Exception.unsafeRun! : '{Exception, g} a -> '{g} a -Exception.unsafeRun! e _ = - h : Request {Exception} a -> a - h = cases - {Exception.raise fail -> _ } -> - bug fail - {a} -> a - handle !e with h -``` - -``` ucm :added-by-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 ability Exception - (also named builtin.Exception) - Exception.unsafeRun! : '{g, Exception} a -> '{g} a - compose2 : (c ->{𝕖1} d) - -> (a ->{𝕖2} b ->{𝕖3} c) - -> a - -> b - ->{𝕖1, 𝕖2, 𝕖3} d - ex : '{IO} () - printLine : Text ->{IO, Exception} () - putBytes : Handle - -> Bytes - ->{IO, Exception} () - putText : Handle -> Text ->{IO, Exception} () - stdOut : Handle - toException : Either Failure a ->{Exception} a -``` - -``` ucm -scratch/main> run ex - - () -``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md deleted file mode 100644 index fe4095adbf..0000000000 --- a/unison-src/transcripts/fix2027.output.md +++ /dev/null @@ -1,97 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural ability Exception where raise : Failure -> x - -reraise = cases - Left e -> raise e - Right a -> a - -structural type Either a b = Left a | Right b - -putBytes h bs = reraise (putBytes.impl h bs) - -toException : Either Failure a ->{Exception} a -toException = cases - Left e -> raise e - Right a -> a - -putText : Handle -> Text ->{IO, Exception} () -putText h t = putBytes h (toUtf8 t) - -bugFail = cases - Failure typ _ _ -> bug (Failure typ "problem" (Any ())) - -Exception.unsafeRun! : '{Exception, g} a -> '{g} a -Exception.unsafeRun! e _ = - h : Request {Exception} a -> a - h = cases - {Exception.raise fail -> _ } -> - bugFail fail - {a} -> a - handle !e with h - -socketSend s bytes = reraise (socketSend.impl s bytes) -closeSocket s = reraise (closeSocket.impl s) -serverSocket host port = reraise (IO.serverSocket.impl host port) - -hello : Text -> Text -> {IO, Exception} () -hello host port = - socket = serverSocket (Some host) port - msg = toUtf8 "Hello there" - socketSend socket msg - closeSocket socket - -myServer = unsafeRun! '(hello "127.0.0.1" "0") - -``` - -``` ucm :added-by-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 Either a b - (also named builtin.Either) - structural ability Exception - (also named builtin.Exception) - Exception.unsafeRun! : '{g, Exception} a -> '{g} a - bugFail : Failure -> r - closeSocket : Socket ->{IO, Exception} () - hello : Text -> Text ->{IO, Exception} () - myServer : '{IO} () - putBytes : Handle - -> Bytes - ->{IO, Exception} () - putText : Handle -> Text ->{IO, Exception} () - reraise : Either Failure b ->{Exception} b - serverSocket : Optional Text - -> Text - ->{IO, Exception} Socket - socketSend : Socket - -> Bytes - ->{IO, Exception} () - toException : Either Failure a ->{Exception} a -``` - -``` ucm :error -scratch/main> run myServer - - 💔💥 - - I've encountered a call to builtin.bug with the following - value: - - Failure (typeLink IOFailure) "problem" (Any ()) - - Stack trace: - bug - #8ppr1tt4q2 -``` diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md deleted file mode 100644 index 21686574b7..0000000000 --- a/unison-src/transcripts/fix2049.output.md +++ /dev/null @@ -1,145 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -id x = x - -structural ability Stream a where - emit : a -> () - -Stream.foldl : (x ->{g} a ->{g} x) -> x -> '{g, Stream a} r -> '{g} x -Stream.foldl f z str _ = - h acc = cases - { emit x -> k } -> handle !k with h (f acc x) - { _ } -> acc - handle !str with h z - -Stream.range : Nat -> Nat -> '{Stream Nat} () -Stream.range m n = do - f : Nat ->{Stream Nat} () - f k = if k < n then emit k ; f (k+1) else () - f m - -unique type Fold' g a b x = Fold' (x -> {g} a -> {g} x) x (x -> {g} b) - -unique type Fold g a b = Fold (∀ g2 r. (∀ x. Fold' g a b x -> {g2} r) -> {g2} r) - -Fold.fromFold' : Fold' g a b x -> Fold g a b -Fold.fromFold' fold = Fold.Fold (f -> f fold) - -Fold.mkFold : (t -> {g} a -> {g} t) -> t -> (t -> {g} b) -> Fold g a b -Fold.mkFold step init extract = - Fold.fromFold' (Fold'.Fold' step init extract) - -folds.all : (a -> {g} Boolean) -> Fold g a Boolean -folds.all predicate = - Fold.mkFold (b -> a -> b && (predicate a)) true id - -Fold.Stream.fold : Fold g a b -> '{g, Stream a} r -> '{g} b -Fold.Stream.fold = - run: Fold' g a b x -> '{g, Stream a} r -> '{g} b - run = - cases Fold'.Fold' step init extract -> - stream -> _ -> extract !(foldl step init stream) - cases - Fold f -> stream -> f (f' -> run f' stream) - -> folds.all.tests.stream = - pred = n -> (Nat.gt n 2) - res : 'Boolean - res = Fold.Stream.fold (folds.all pred) (Stream.range 1 5) - !res Universal.== false -``` - -``` ucm :added-by-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 Fold g a b - type Fold' g a b x - structural ability Stream a - Fold.Stream.fold : Fold g a b - -> '{g, Stream a} r - -> '{g} b - Fold.fromFold' : Fold' g a b x -> Fold g a b - Fold.mkFold : (t ->{g} a ->{g} t) - -> t - -> (t ->{g} b) - -> Fold g a b - Stream.foldl : (x ->{g} a ->{g} x) - -> x - -> '{g, Stream a} r - -> '{g} x - Stream.range : Nat -> Nat -> '{Stream Nat} () - folds.all : (a ->{g} Boolean) -> Fold g a Boolean - id : x -> x - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 44 | pred = n -> (Nat.gt n 2) - ⧩ - true -``` - -Tests some capabilities for catching runtime exceptions. - -``` unison -catcher : '{IO} () ->{IO} Result -catcher act = - handle tryEval act with cases - { raise _ -> _ } -> Ok "caught" - { _ } -> Fail "nothing to catch" - -tests _ = - [ catcher do - _ = 1/0 - () - , catcher '(bug "testing") - , handle tryEval (do 1+1) with cases - { raise _ -> _ } -> Fail "1+1 failed" - { 2 } -> Ok "got the right answer" - { _ } -> Fail "got the wrong answer" - ] -``` - -``` ucm :added-by-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`: - - catcher : '{IO} () ->{IO} Result - tests : ∀ _. _ ->{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - catcher : '{IO} () ->{IO} Result - tests : ∀ _. _ ->{IO} [Result] -scratch/main> io.test tests - - New test results: - - 1. tests ◉ caught - ◉ caught - ◉ got the right answer - - ✅ 3 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md deleted file mode 100644 index 2d5f1ce62e..0000000000 --- a/unison-src/transcripts/fix2053.output.md +++ /dev/null @@ -1,15 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` ucm -scratch/main> display List.map - - f a -> - let - use Nat + - go i as acc = match List.at i as with - None -> acc - Some a -> go (i + 1) as (acc :+ f a) - go 0 a [] -``` diff --git a/unison-src/transcripts/fix2156.output.md b/unison-src/transcripts/fix2156.output.md deleted file mode 100644 index e0823b9652..0000000000 --- a/unison-src/transcripts/fix2156.output.md +++ /dev/null @@ -1,33 +0,0 @@ -Tests for a case where bad eta reduction was causing erroneous watch -output/caching. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -sqr : Nat -> Nat -sqr n = n * n - -> sqr -``` - -``` ucm :added-by-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`: - - sqr : Nat -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 4 | > sqr - ⧩ - n -> n Nat.* n -``` diff --git a/unison-src/transcripts/fix2167.output.md b/unison-src/transcripts/fix2167.output.md deleted file mode 100644 index 58613b9685..0000000000 --- a/unison-src/transcripts/fix2167.output.md +++ /dev/null @@ -1,43 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This is just a simple transcript to regression check an ability -inference/checking issue. - -``` unison -structural ability R t where - die : () -> x - near.impl : Nat -> Either () [Nat] - -R.near n = match near.impl n with - Left e -> die () - Right a -> a - -R.near1 region loc = match R.near 42 with - [loc] -> loc - ls -> R.die () -``` - -``` ucm :added-by-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 ability R t - R.near : Nat ->{R t} [Nat] - R.near1 : region -> loc ->{R t} Nat -``` - -The issue was that abilities with parameters like this were sometimes -causing failures like this because the variable in the parameter would -escape to a scope where it no longer made sense. Then solving would -fail because the type was invalid. - -The fix was to avoid dropping certain existential variables out of -scope. diff --git a/unison-src/transcripts/fix2187.output.md b/unison-src/transcripts/fix2187.output.md deleted file mode 100644 index 9357219032..0000000000 --- a/unison-src/transcripts/fix2187.output.md +++ /dev/null @@ -1,32 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison - -lexicalScopeEx: [Text] -lexicalScopeEx = - parent = "outer" - inner1 = let - child1 = "child1" - inner2 : [Text] - inner2 = let - child2 = "child2" - [parent, child1, child2] - inner2 - inner1 - -``` - -``` ucm :added-by-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`: - - lexicalScopeEx : [Text] -``` diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md deleted file mode 100644 index c6230bfa08..0000000000 --- a/unison-src/transcripts/fix2231.output.md +++ /dev/null @@ -1,52 +0,0 @@ -This transcript contains some cases that were problematic with the new -type checker. They were likely not discovered earlier because they -involve combining types inferred with the older strategy with the new -inference algorithm. Some code can be given multiple possible types, -and while they are all valid and some may be equivalently general, -the choices may not work equally well with the type checking -strategies. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -(<<) : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c -(<<) f g x = f (g x) - -f = atan << tan - -foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b -foldl f a = cases - [] -> a - x +: xs -> foldl f (f a x) xs - -txt = foldl (Text.++) "" ["a", "b", "c"] -``` - -``` ucm :added-by-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`: - - << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c - f : Float -> Float - foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b - txt : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c - f : Float -> Float - foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b - txt : Text -``` diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md deleted file mode 100644 index 454c80f56f..0000000000 --- a/unison-src/transcripts/fix2238.output.md +++ /dev/null @@ -1,32 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -This should not typecheck - the inline `@eval` expression uses abilities. - -``` unison :error -structural ability Abort where abort : x - -ex = {{ @eval{abort} }} -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - The expression in red needs the {Abort} ability, but this location does not have access to any abilities. - - 3 | ex = {{ @eval{abort} }} -``` - -This file should also not typecheck - it has a triple backticks block that uses abilities. - -``` ucm :error -scratch/main> load unison-src/transcripts/fix2238.u - - Loading changes detected in unison-src/transcripts/fix2238.u. - - The expression in red needs the {Abort} ability, but this location does not have access to any abilities. - - 7 | abort + 1 -``` diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md deleted file mode 100644 index d8d899bb9c..0000000000 --- a/unison-src/transcripts/fix2244.output.md +++ /dev/null @@ -1,24 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -Ensure closing token is emitted by closing brace in doc eval block. - -``` ucm -scratch/main> load ./unison-src/transcripts/fix2244.u - - Loading changes detected in - ./unison-src/transcripts/fix2244.u. - - I found and typechecked these definitions in - ./unison-src/transcripts/fix2244.u. If you do an `add` or - `update`, here's how your codebase would change: - - ⍟ These new definitions are ok to `add`: - - x : Doc2 -``` - -``` ucm :hide -scratch/main> add -``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md deleted file mode 100644 index dcb8e9668d..0000000000 --- a/unison-src/transcripts/fix2254.output.md +++ /dev/null @@ -1,221 +0,0 @@ -``` ucm :hide -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: - -``` unison :hide -unique type A a b c d - = A a - | B b - | C c - | D d - -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 = - n = f a - n + 1 - -f3 : NeedsA Nat Nat -> Nat -f3 = cases - NeedsA a -> f a + 20 - _ -> 0 - -g : A Nat Nat Nat Nat -> Nat -g = cases - D n -> n - _ -> 43 -``` - -We'll make our edits in a new branch. - -``` ucm -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 - f2 : A Nat Nat Nat Nat -> Nat - f3 : NeedsA Nat Nat -> Nat - g : A Nat Nat Nat Nat -> Nat -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 :hide -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 - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -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 - - You have no pending todo items. Good work! ✅ -``` - -## 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 :added-by-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 :added-by-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 -``` - -And checking that after updating this record, there's nothing `todo`: - -``` ucm -scratch/r2> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/r2> todo - - You have no pending todo items. Good work! ✅ -``` diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md deleted file mode 100644 index b75a1ac3c4..0000000000 --- a/unison-src/transcripts/fix2268.output.md +++ /dev/null @@ -1,35 +0,0 @@ -Tests for a TDNR case that wasn't working. The code wasn't 'relaxing' -inferred types that didn't contain arrows, so effects that just yield -a value weren't getting disambiguated. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -unique ability A where - a : Nat - -unique ability B where - a : Char - -test : () -> Nat -test _ = - x = a - toNat x -``` - -``` ucm :added-by-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`: - - ability A - ability B - test : '{B} Nat -``` diff --git a/unison-src/transcripts/fix2334.output.md b/unison-src/transcripts/fix2334.output.md deleted file mode 100644 index 7235d10d6b..0000000000 --- a/unison-src/transcripts/fix2334.output.md +++ /dev/null @@ -1,51 +0,0 @@ -Tests an issue where pattern matching matrices involving built-in -types was discarding default cases in some branches. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -f = cases - 0, 0 -> 0 - _, 1 -> 2 - 1, _ -> 3 - _, _ -> 1 - -> f 0 0 -> f 1 0 -> f 0 1 -> f 1 1 -``` - -``` ucm :added-by-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`: - - f : Nat -> Nat -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 7 | > f 0 0 - ⧩ - 0 - - 8 | > f 1 0 - ⧩ - 3 - - 9 | > f 0 1 - ⧩ - 2 - - 10 | > f 1 1 - ⧩ - 2 -``` diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md deleted file mode 100644 index ebf6ec6399..0000000000 --- a/unison-src/transcripts/fix2344.output.md +++ /dev/null @@ -1,35 +0,0 @@ -Checks a corner case with type checking involving destructuring binds. - -The binds were causing some sequences of lets to be unnecessarily -recursive. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -unique ability Nate where - nate: (Boolean, Nat) - antiNate: () - - -sneezy: (Nat -> {d} a) -> '{Nate,d} a -sneezy dee _ = - (_,_) = nate - antiNate - dee 1 -``` - -``` ucm :added-by-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`: - - ability Nate - sneezy : (Nat ->{d} a) -> '{d, Nate} a -``` diff --git a/unison-src/transcripts/fix2350.output.md b/unison-src/transcripts/fix2350.output.md deleted file mode 100644 index 4eda0fee4f..0000000000 --- a/unison-src/transcripts/fix2350.output.md +++ /dev/null @@ -1,43 +0,0 @@ -This tests an issue where ability variables were being defaulted over -eagerly. In general, we want to avoid collecting up variables from the -use of definitions with types like: - -``` -T ->{e} U -``` - -Since this type works for every `e`, it is, 'pure;' and we might as -well have `e = {}`, since `{}` is a subrow of every other row. -However, if `e` isn't just a quantified variable, but one involved in -ongoing inference, it's undesirable to default it. Previously there -was a check to see if `e` occurred in the context. However, the wanted -abilities being collected aren't in the context, so types like: - -``` -T ->{S e} U ->{e} V -``` - -were a corner case. We would add `S e` to the wanted abilities, then -not realize that `e` shouldn't be defaulted. - -``` unison -unique ability Storage d g where - save.impl : a ->{Storage d g} ('{g} (d a)) - -save : a ->{Storage d g, g} (d a) -save a = !(save.impl a) -``` - -``` ucm :added-by-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`: - - ability Storage d g - save : a ->{g, Storage d g} d a -``` diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md deleted file mode 100644 index 5d404425c2..0000000000 --- a/unison-src/transcripts/fix2353.output.md +++ /dev/null @@ -1,31 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -use builtin Scope -unique ability Async t g where async : {g} Nat -unique ability Exception where raise : Nat -> x - -pure.run : a -> (forall t . '{Async t g} a) ->{Exception, g} a -pure.run a0 a = - a' : forall s . '{Scope s, Exception, g} a - a' = 'a0 -- typechecks - -- make sure this builtin can still be referenced - Scope.run a' -``` - -``` ucm :added-by-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`: - - ability Async t g - ability Exception - pure.run : a -> (∀ t. '{Async t g} a) ->{g, Exception} a -``` diff --git a/unison-src/transcripts/fix2354.output.md b/unison-src/transcripts/fix2354.output.md deleted file mode 100644 index 7a0eeea719..0000000000 --- a/unison-src/transcripts/fix2354.output.md +++ /dev/null @@ -1,30 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests that delaying an un-annotated higher-rank type gives a normal -type error, rather than an internal compiler error. - -``` unison :error -f : (forall a . a -> a) -> Nat -f id = id 0 - -x = 'f -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat - where I expected to find: (a -> 𝕣1) -> 𝕣 - - 1 | f : (forall a . a -> a) -> Nat - 2 | f id = id 0 - 3 | - 4 | x = 'f - - from right here: - - 1 | f : (forall a . a -> a) -> Nat -``` diff --git a/unison-src/transcripts/fix2355.output.md b/unison-src/transcripts/fix2355.output.md deleted file mode 100644 index e04b76fa87..0000000000 --- a/unison-src/transcripts/fix2355.output.md +++ /dev/null @@ -1,43 +0,0 @@ -Tests for a loop that was previously occurring in the type checker. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :error -structural ability A t g where - fork : '{g, A t g} a -> t a - await : t a -> a - empty! : t a - put : a -> t a -> () - -example : '{A t {}} Nat -example = 'let - r = A.empty! - go u = - t = A.fork '(go (u + 1)) - A.await t - - go 0 - t2 = A.fork '(A.put 10 r) - A.await r -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I tried to infer a cyclic ability. - - The expression in red was inferred to require the ability: - - {A t25 {𝕖36, 𝕖18}} - - where `𝕖18` is its overall abilities. - - I need a type signature to help figure this out. - - 10 | go u = - 11 | t = A.fork '(go (u + 1)) - 12 | A.await t -``` diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md deleted file mode 100644 index e8003d95c4..0000000000 --- a/unison-src/transcripts/fix2378.output.md +++ /dev/null @@ -1,63 +0,0 @@ -Tests for an ability failure that was caused by order dependence of -checking wanted vs. provided abilities. It was necessary to re-check -rows until a fixed point is reached. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -unique ability C c where - new : c a - receive : c a -> a - send : a -> c a -> () - -unique ability A t g where - fork : '{A t g, g, Exception} a -> t a - await : t a -> a - -unique ability Ex where raise : () -> x - -Ex.catch : '{Ex, g} a ->{g} Either () a -Ex.catch _ = todo "Exception.catch" - -C.pure.run : (forall c . '{C c, g} r) ->{Ex, g} r -C.pure.run _ = todo "C.pure.run" - -A.pure.run : (forall t . '{A t g, g} a) ->{Ex,g} a -A.pure.run _ = todo "A.pure.run" - -ex : '{C c, A t {C c}} Nat -ex _ = - c = C.new - x = A.fork 'let - a = receive c - a + 10 - y = A.fork 'let - send 0 c - () - A.await x - -x : '{} (Either () Nat) -x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) -``` - -``` ucm :added-by-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`: - - ability A t g - ability C c - ability Ex - A.pure.run : (∀ t. '{g, A t g} a) ->{g, Ex} a - C.pure.run : (∀ c. '{g, C c} r) ->{g, Ex} r - Ex.catch : '{g, Ex} a ->{g} Either () a - ex : '{C c, A t {C c}} Nat - x : 'Either () Nat -``` diff --git a/unison-src/transcripts/fix2423.output.md b/unison-src/transcripts/fix2423.output.md deleted file mode 100644 index 4d80a93472..0000000000 --- a/unison-src/transcripts/fix2423.output.md +++ /dev/null @@ -1,51 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural ability Split where - skip! : x - both : a -> a -> a - -Split.append : '{Split, g} a -> '{Split, g} a -> '{Split, g} a -Split.append s1 s2 _ = force (both s1 s2) - -force a = !a - -Split.zipSame : '{Split, g} a -> '{Split, g} b -> '{Split, g} (a, b) -Split.zipSame sa sb _ = - go : '{Split,g2} y -> Request {Split} x ->{Split,g2} (x,y) - go sb = cases - { a } -> (a, !sb) - { skip! -> _ } -> skip! - { both la ra -> k } -> - handle !sb with cases - { _ } -> skip! - { skip! -> k } -> skip! - { both lb rb -> k2 } -> - force (Split.append - (zipSame '(k la) '(k2 lb)) - (zipSame '(k ra) '(k2 rb))) - - handle !sa with go sb -``` - -``` ucm :added-by-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 ability Split - Split.append : '{g, Split} a - -> '{g, Split} a - -> '{g, Split} a - Split.zipSame : '{g, Split} a - -> '{g, Split} b - -> '{g, Split} (a, b) - force : '{g} o ->{g} o -``` diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md deleted file mode 100644 index 6ddb859310..0000000000 --- a/unison-src/transcripts/fix2474.output.md +++ /dev/null @@ -1,53 +0,0 @@ -Tests an issue with a lack of generality of handlers. - -In general, a set of cases: - -``` -{ e ... -> k } -``` - -should be typed in the following way: - -1. The scrutinee has type `Request {E, g} r -> s` where `E` is all - the abilities being handled. `g` is a slack variable, because all - abilities that are used in the handled expression pass through - the handler. Previously this was being inferred as merely - `Request {E} r -> s` -2. The continuation variable `k` should have type `o ->{E, g} r`, - matching the above types (`o` is the result type of `e`). - Previously this was being checked as `o ->{E0} r`, where `E0` is - the ability that contains `e`. - -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -structural ability Stream a where - emit : a -> () - -Stream.uncons : '{Stream a, g} r ->{g} Either r (a, '{Stream a, g} r) -Stream.uncons s = - go : Request {Stream a,g} r -> Either r (a, '{Stream a,g} r) - go = cases - { r } -> Left r - { Stream.emit a -> tl } -> Right (a, tl : '{Stream a,g} r) - handle !s with go -``` - -``` ucm :added-by-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 ability Stream a - Stream.uncons : '{g, Stream a} r - ->{g} Either r (a, '{g, Stream a} r) -``` diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md deleted file mode 100644 index 02a9894f11..0000000000 --- a/unison-src/transcripts/fix2628.output.md +++ /dev/null @@ -1,27 +0,0 @@ -``` ucm :hide -scratch/main> alias.type ##Nat lib.base.Nat -``` - -``` unison :hide -unique type foo.bar.baz.MyRecord = { - value : Nat -} -``` - -``` 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 -scratch/main> find : Nat -> MyRecord - - 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord -``` diff --git a/unison-src/transcripts/fix2663.output.md b/unison-src/transcripts/fix2663.output.md deleted file mode 100644 index 59667660af..0000000000 --- a/unison-src/transcripts/fix2663.output.md +++ /dev/null @@ -1,46 +0,0 @@ -Tests a variable capture problem. - -After pattern compilation, the match would end up: - -``` -T p1 p3 p3 -``` - -and z would end up referring to the first p3 rather than the second. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural type Trip = T Nat Nat Nat - -bad : Nat -> (Nat, Nat) -bad x = match Some (Some x) with - Some (Some x) -> match T 3 4 5 with - T _ _ z -> (x, z) - _ -> (0,0) - -> bad 2 -``` - -``` ucm :added-by-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 Trip - bad : Nat -> (Nat, Nat) - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 9 | > bad 2 - ⧩ - (2, 5) -``` diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md deleted file mode 100644 index 31ca467e57..0000000000 --- a/unison-src/transcripts/fix2693.output.md +++ /dev/null @@ -1,4078 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -loop : List Nat -> Nat -> List Nat -loop l = cases - 0 -> l - n -> loop (n +: l) (drop n 1) - -range : Nat -> List Nat -range = loop [] -``` - -``` ucm :added-by-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`: - - loop : [Nat] -> Nat -> [Nat] - range : Nat -> [Nat] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - loop : [Nat] -> Nat -> [Nat] - range : Nat -> [Nat] -``` - -``` unison -> range 2000 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > range 2000 - ⧩ - [ 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - , 12 - , 13 - , 14 - , 15 - , 16 - , 17 - , 18 - , 19 - , 20 - , 21 - , 22 - , 23 - , 24 - , 25 - , 26 - , 27 - , 28 - , 29 - , 30 - , 31 - , 32 - , 33 - , 34 - , 35 - , 36 - , 37 - , 38 - , 39 - , 40 - , 41 - , 42 - , 43 - , 44 - , 45 - , 46 - , 47 - , 48 - , 49 - , 50 - , 51 - , 52 - , 53 - , 54 - , 55 - , 56 - , 57 - , 58 - , 59 - , 60 - , 61 - , 62 - , 63 - , 64 - , 65 - , 66 - , 67 - , 68 - , 69 - , 70 - , 71 - , 72 - , 73 - , 74 - , 75 - , 76 - , 77 - , 78 - , 79 - , 80 - , 81 - , 82 - , 83 - , 84 - , 85 - , 86 - , 87 - , 88 - , 89 - , 90 - , 91 - , 92 - , 93 - , 94 - , 95 - , 96 - , 97 - , 98 - , 99 - , 100 - , 101 - , 102 - , 103 - , 104 - , 105 - , 106 - , 107 - , 108 - , 109 - , 110 - , 111 - , 112 - , 113 - , 114 - , 115 - , 116 - , 117 - , 118 - , 119 - , 120 - , 121 - , 122 - , 123 - , 124 - , 125 - , 126 - , 127 - , 128 - , 129 - , 130 - , 131 - , 132 - , 133 - , 134 - , 135 - , 136 - , 137 - , 138 - , 139 - , 140 - , 141 - , 142 - , 143 - , 144 - , 145 - , 146 - , 147 - , 148 - , 149 - , 150 - , 151 - , 152 - , 153 - , 154 - , 155 - , 156 - , 157 - , 158 - , 159 - , 160 - , 161 - , 162 - , 163 - , 164 - , 165 - , 166 - , 167 - , 168 - , 169 - , 170 - , 171 - , 172 - , 173 - , 174 - , 175 - , 176 - , 177 - , 178 - , 179 - , 180 - , 181 - , 182 - , 183 - , 184 - , 185 - , 186 - , 187 - , 188 - , 189 - , 190 - , 191 - , 192 - , 193 - , 194 - , 195 - , 196 - , 197 - , 198 - , 199 - , 200 - , 201 - , 202 - , 203 - , 204 - , 205 - , 206 - , 207 - , 208 - , 209 - , 210 - , 211 - , 212 - , 213 - , 214 - , 215 - , 216 - , 217 - , 218 - , 219 - , 220 - , 221 - , 222 - , 223 - , 224 - , 225 - , 226 - , 227 - , 228 - , 229 - , 230 - , 231 - , 232 - , 233 - , 234 - , 235 - , 236 - , 237 - , 238 - , 239 - , 240 - , 241 - , 242 - , 243 - , 244 - , 245 - , 246 - , 247 - , 248 - , 249 - , 250 - , 251 - , 252 - , 253 - , 254 - , 255 - , 256 - , 257 - , 258 - , 259 - , 260 - , 261 - , 262 - , 263 - , 264 - , 265 - , 266 - , 267 - , 268 - , 269 - , 270 - , 271 - , 272 - , 273 - , 274 - , 275 - , 276 - , 277 - , 278 - , 279 - , 280 - , 281 - , 282 - , 283 - , 284 - , 285 - , 286 - , 287 - , 288 - , 289 - , 290 - , 291 - , 292 - , 293 - , 294 - , 295 - , 296 - , 297 - , 298 - , 299 - , 300 - , 301 - , 302 - , 303 - , 304 - , 305 - , 306 - , 307 - , 308 - , 309 - , 310 - , 311 - , 312 - , 313 - , 314 - , 315 - , 316 - , 317 - , 318 - , 319 - , 320 - , 321 - , 322 - , 323 - , 324 - , 325 - , 326 - , 327 - , 328 - , 329 - , 330 - , 331 - , 332 - , 333 - , 334 - , 335 - , 336 - , 337 - , 338 - , 339 - , 340 - , 341 - , 342 - , 343 - , 344 - , 345 - , 346 - , 347 - , 348 - , 349 - , 350 - , 351 - , 352 - , 353 - , 354 - , 355 - , 356 - , 357 - , 358 - , 359 - , 360 - , 361 - , 362 - , 363 - , 364 - , 365 - , 366 - , 367 - , 368 - , 369 - , 370 - , 371 - , 372 - , 373 - , 374 - , 375 - , 376 - , 377 - , 378 - , 379 - , 380 - , 381 - , 382 - , 383 - , 384 - , 385 - , 386 - , 387 - , 388 - , 389 - , 390 - , 391 - , 392 - , 393 - , 394 - , 395 - , 396 - , 397 - , 398 - , 399 - , 400 - , 401 - , 402 - , 403 - , 404 - , 405 - , 406 - , 407 - , 408 - , 409 - , 410 - , 411 - , 412 - , 413 - , 414 - , 415 - , 416 - , 417 - , 418 - , 419 - , 420 - , 421 - , 422 - , 423 - , 424 - , 425 - , 426 - , 427 - , 428 - , 429 - , 430 - , 431 - , 432 - , 433 - , 434 - , 435 - , 436 - , 437 - , 438 - , 439 - , 440 - , 441 - , 442 - , 443 - , 444 - , 445 - , 446 - , 447 - , 448 - , 449 - , 450 - , 451 - , 452 - , 453 - , 454 - , 455 - , 456 - , 457 - , 458 - , 459 - , 460 - , 461 - , 462 - , 463 - , 464 - , 465 - , 466 - , 467 - , 468 - , 469 - , 470 - , 471 - , 472 - , 473 - , 474 - , 475 - , 476 - , 477 - , 478 - , 479 - , 480 - , 481 - , 482 - , 483 - , 484 - , 485 - , 486 - , 487 - , 488 - , 489 - , 490 - , 491 - , 492 - , 493 - , 494 - , 495 - , 496 - , 497 - , 498 - , 499 - , 500 - , 501 - , 502 - , 503 - , 504 - , 505 - , 506 - , 507 - , 508 - , 509 - , 510 - , 511 - , 512 - , 513 - , 514 - , 515 - , 516 - , 517 - , 518 - , 519 - , 520 - , 521 - , 522 - , 523 - , 524 - , 525 - , 526 - , 527 - , 528 - , 529 - , 530 - , 531 - , 532 - , 533 - , 534 - , 535 - , 536 - , 537 - , 538 - , 539 - , 540 - , 541 - , 542 - , 543 - , 544 - , 545 - , 546 - , 547 - , 548 - , 549 - , 550 - , 551 - , 552 - , 553 - , 554 - , 555 - , 556 - , 557 - , 558 - , 559 - , 560 - , 561 - , 562 - , 563 - , 564 - , 565 - , 566 - , 567 - , 568 - , 569 - , 570 - , 571 - , 572 - , 573 - , 574 - , 575 - , 576 - , 577 - , 578 - , 579 - , 580 - , 581 - , 582 - , 583 - , 584 - , 585 - , 586 - , 587 - , 588 - , 589 - , 590 - , 591 - , 592 - , 593 - , 594 - , 595 - , 596 - , 597 - , 598 - , 599 - , 600 - , 601 - , 602 - , 603 - , 604 - , 605 - , 606 - , 607 - , 608 - , 609 - , 610 - , 611 - , 612 - , 613 - , 614 - , 615 - , 616 - , 617 - , 618 - , 619 - , 620 - , 621 - , 622 - , 623 - , 624 - , 625 - , 626 - , 627 - , 628 - , 629 - , 630 - , 631 - , 632 - , 633 - , 634 - , 635 - , 636 - , 637 - , 638 - , 639 - , 640 - , 641 - , 642 - , 643 - , 644 - , 645 - , 646 - , 647 - , 648 - , 649 - , 650 - , 651 - , 652 - , 653 - , 654 - , 655 - , 656 - , 657 - , 658 - , 659 - , 660 - , 661 - , 662 - , 663 - , 664 - , 665 - , 666 - , 667 - , 668 - , 669 - , 670 - , 671 - , 672 - , 673 - , 674 - , 675 - , 676 - , 677 - , 678 - , 679 - , 680 - , 681 - , 682 - , 683 - , 684 - , 685 - , 686 - , 687 - , 688 - , 689 - , 690 - , 691 - , 692 - , 693 - , 694 - , 695 - , 696 - , 697 - , 698 - , 699 - , 700 - , 701 - , 702 - , 703 - , 704 - , 705 - , 706 - , 707 - , 708 - , 709 - , 710 - , 711 - , 712 - , 713 - , 714 - , 715 - , 716 - , 717 - , 718 - , 719 - , 720 - , 721 - , 722 - , 723 - , 724 - , 725 - , 726 - , 727 - , 728 - , 729 - , 730 - , 731 - , 732 - , 733 - , 734 - , 735 - , 736 - , 737 - , 738 - , 739 - , 740 - , 741 - , 742 - , 743 - , 744 - , 745 - , 746 - , 747 - , 748 - , 749 - , 750 - , 751 - , 752 - , 753 - , 754 - , 755 - , 756 - , 757 - , 758 - , 759 - , 760 - , 761 - , 762 - , 763 - , 764 - , 765 - , 766 - , 767 - , 768 - , 769 - , 770 - , 771 - , 772 - , 773 - , 774 - , 775 - , 776 - , 777 - , 778 - , 779 - , 780 - , 781 - , 782 - , 783 - , 784 - , 785 - , 786 - , 787 - , 788 - , 789 - , 790 - , 791 - , 792 - , 793 - , 794 - , 795 - , 796 - , 797 - , 798 - , 799 - , 800 - , 801 - , 802 - , 803 - , 804 - , 805 - , 806 - , 807 - , 808 - , 809 - , 810 - , 811 - , 812 - , 813 - , 814 - , 815 - , 816 - , 817 - , 818 - , 819 - , 820 - , 821 - , 822 - , 823 - , 824 - , 825 - , 826 - , 827 - , 828 - , 829 - , 830 - , 831 - , 832 - , 833 - , 834 - , 835 - , 836 - , 837 - , 838 - , 839 - , 840 - , 841 - , 842 - , 843 - , 844 - , 845 - , 846 - , 847 - , 848 - , 849 - , 850 - , 851 - , 852 - , 853 - , 854 - , 855 - , 856 - , 857 - , 858 - , 859 - , 860 - , 861 - , 862 - , 863 - , 864 - , 865 - , 866 - , 867 - , 868 - , 869 - , 870 - , 871 - , 872 - , 873 - , 874 - , 875 - , 876 - , 877 - , 878 - , 879 - , 880 - , 881 - , 882 - , 883 - , 884 - , 885 - , 886 - , 887 - , 888 - , 889 - , 890 - , 891 - , 892 - , 893 - , 894 - , 895 - , 896 - , 897 - , 898 - , 899 - , 900 - , 901 - , 902 - , 903 - , 904 - , 905 - , 906 - , 907 - , 908 - , 909 - , 910 - , 911 - , 912 - , 913 - , 914 - , 915 - , 916 - , 917 - , 918 - , 919 - , 920 - , 921 - , 922 - , 923 - , 924 - , 925 - , 926 - , 927 - , 928 - , 929 - , 930 - , 931 - , 932 - , 933 - , 934 - , 935 - , 936 - , 937 - , 938 - , 939 - , 940 - , 941 - , 942 - , 943 - , 944 - , 945 - , 946 - , 947 - , 948 - , 949 - , 950 - , 951 - , 952 - , 953 - , 954 - , 955 - , 956 - , 957 - , 958 - , 959 - , 960 - , 961 - , 962 - , 963 - , 964 - , 965 - , 966 - , 967 - , 968 - , 969 - , 970 - , 971 - , 972 - , 973 - , 974 - , 975 - , 976 - , 977 - , 978 - , 979 - , 980 - , 981 - , 982 - , 983 - , 984 - , 985 - , 986 - , 987 - , 988 - , 989 - , 990 - , 991 - , 992 - , 993 - , 994 - , 995 - , 996 - , 997 - , 998 - , 999 - , 1000 - , 1001 - , 1002 - , 1003 - , 1004 - , 1005 - , 1006 - , 1007 - , 1008 - , 1009 - , 1010 - , 1011 - , 1012 - , 1013 - , 1014 - , 1015 - , 1016 - , 1017 - , 1018 - , 1019 - , 1020 - , 1021 - , 1022 - , 1023 - , 1024 - , 1025 - , 1026 - , 1027 - , 1028 - , 1029 - , 1030 - , 1031 - , 1032 - , 1033 - , 1034 - , 1035 - , 1036 - , 1037 - , 1038 - , 1039 - , 1040 - , 1041 - , 1042 - , 1043 - , 1044 - , 1045 - , 1046 - , 1047 - , 1048 - , 1049 - , 1050 - , 1051 - , 1052 - , 1053 - , 1054 - , 1055 - , 1056 - , 1057 - , 1058 - , 1059 - , 1060 - , 1061 - , 1062 - , 1063 - , 1064 - , 1065 - , 1066 - , 1067 - , 1068 - , 1069 - , 1070 - , 1071 - , 1072 - , 1073 - , 1074 - , 1075 - , 1076 - , 1077 - , 1078 - , 1079 - , 1080 - , 1081 - , 1082 - , 1083 - , 1084 - , 1085 - , 1086 - , 1087 - , 1088 - , 1089 - , 1090 - , 1091 - , 1092 - , 1093 - , 1094 - , 1095 - , 1096 - , 1097 - , 1098 - , 1099 - , 1100 - , 1101 - , 1102 - , 1103 - , 1104 - , 1105 - , 1106 - , 1107 - , 1108 - , 1109 - , 1110 - , 1111 - , 1112 - , 1113 - , 1114 - , 1115 - , 1116 - , 1117 - , 1118 - , 1119 - , 1120 - , 1121 - , 1122 - , 1123 - , 1124 - , 1125 - , 1126 - , 1127 - , 1128 - , 1129 - , 1130 - , 1131 - , 1132 - , 1133 - , 1134 - , 1135 - , 1136 - , 1137 - , 1138 - , 1139 - , 1140 - , 1141 - , 1142 - , 1143 - , 1144 - , 1145 - , 1146 - , 1147 - , 1148 - , 1149 - , 1150 - , 1151 - , 1152 - , 1153 - , 1154 - , 1155 - , 1156 - , 1157 - , 1158 - , 1159 - , 1160 - , 1161 - , 1162 - , 1163 - , 1164 - , 1165 - , 1166 - , 1167 - , 1168 - , 1169 - , 1170 - , 1171 - , 1172 - , 1173 - , 1174 - , 1175 - , 1176 - , 1177 - , 1178 - , 1179 - , 1180 - , 1181 - , 1182 - , 1183 - , 1184 - , 1185 - , 1186 - , 1187 - , 1188 - , 1189 - , 1190 - , 1191 - , 1192 - , 1193 - , 1194 - , 1195 - , 1196 - , 1197 - , 1198 - , 1199 - , 1200 - , 1201 - , 1202 - , 1203 - , 1204 - , 1205 - , 1206 - , 1207 - , 1208 - , 1209 - , 1210 - , 1211 - , 1212 - , 1213 - , 1214 - , 1215 - , 1216 - , 1217 - , 1218 - , 1219 - , 1220 - , 1221 - , 1222 - , 1223 - , 1224 - , 1225 - , 1226 - , 1227 - , 1228 - , 1229 - , 1230 - , 1231 - , 1232 - , 1233 - , 1234 - , 1235 - , 1236 - , 1237 - , 1238 - , 1239 - , 1240 - , 1241 - , 1242 - , 1243 - , 1244 - , 1245 - , 1246 - , 1247 - , 1248 - , 1249 - , 1250 - , 1251 - , 1252 - , 1253 - , 1254 - , 1255 - , 1256 - , 1257 - , 1258 - , 1259 - , 1260 - , 1261 - , 1262 - , 1263 - , 1264 - , 1265 - , 1266 - , 1267 - , 1268 - , 1269 - , 1270 - , 1271 - , 1272 - , 1273 - , 1274 - , 1275 - , 1276 - , 1277 - , 1278 - , 1279 - , 1280 - , 1281 - , 1282 - , 1283 - , 1284 - , 1285 - , 1286 - , 1287 - , 1288 - , 1289 - , 1290 - , 1291 - , 1292 - , 1293 - , 1294 - , 1295 - , 1296 - , 1297 - , 1298 - , 1299 - , 1300 - , 1301 - , 1302 - , 1303 - , 1304 - , 1305 - , 1306 - , 1307 - , 1308 - , 1309 - , 1310 - , 1311 - , 1312 - , 1313 - , 1314 - , 1315 - , 1316 - , 1317 - , 1318 - , 1319 - , 1320 - , 1321 - , 1322 - , 1323 - , 1324 - , 1325 - , 1326 - , 1327 - , 1328 - , 1329 - , 1330 - , 1331 - , 1332 - , 1333 - , 1334 - , 1335 - , 1336 - , 1337 - , 1338 - , 1339 - , 1340 - , 1341 - , 1342 - , 1343 - , 1344 - , 1345 - , 1346 - , 1347 - , 1348 - , 1349 - , 1350 - , 1351 - , 1352 - , 1353 - , 1354 - , 1355 - , 1356 - , 1357 - , 1358 - , 1359 - , 1360 - , 1361 - , 1362 - , 1363 - , 1364 - , 1365 - , 1366 - , 1367 - , 1368 - , 1369 - , 1370 - , 1371 - , 1372 - , 1373 - , 1374 - , 1375 - , 1376 - , 1377 - , 1378 - , 1379 - , 1380 - , 1381 - , 1382 - , 1383 - , 1384 - , 1385 - , 1386 - , 1387 - , 1388 - , 1389 - , 1390 - , 1391 - , 1392 - , 1393 - , 1394 - , 1395 - , 1396 - , 1397 - , 1398 - , 1399 - , 1400 - , 1401 - , 1402 - , 1403 - , 1404 - , 1405 - , 1406 - , 1407 - , 1408 - , 1409 - , 1410 - , 1411 - , 1412 - , 1413 - , 1414 - , 1415 - , 1416 - , 1417 - , 1418 - , 1419 - , 1420 - , 1421 - , 1422 - , 1423 - , 1424 - , 1425 - , 1426 - , 1427 - , 1428 - , 1429 - , 1430 - , 1431 - , 1432 - , 1433 - , 1434 - , 1435 - , 1436 - , 1437 - , 1438 - , 1439 - , 1440 - , 1441 - , 1442 - , 1443 - , 1444 - , 1445 - , 1446 - , 1447 - , 1448 - , 1449 - , 1450 - , 1451 - , 1452 - , 1453 - , 1454 - , 1455 - , 1456 - , 1457 - , 1458 - , 1459 - , 1460 - , 1461 - , 1462 - , 1463 - , 1464 - , 1465 - , 1466 - , 1467 - , 1468 - , 1469 - , 1470 - , 1471 - , 1472 - , 1473 - , 1474 - , 1475 - , 1476 - , 1477 - , 1478 - , 1479 - , 1480 - , 1481 - , 1482 - , 1483 - , 1484 - , 1485 - , 1486 - , 1487 - , 1488 - , 1489 - , 1490 - , 1491 - , 1492 - , 1493 - , 1494 - , 1495 - , 1496 - , 1497 - , 1498 - , 1499 - , 1500 - , 1501 - , 1502 - , 1503 - , 1504 - , 1505 - , 1506 - , 1507 - , 1508 - , 1509 - , 1510 - , 1511 - , 1512 - , 1513 - , 1514 - , 1515 - , 1516 - , 1517 - , 1518 - , 1519 - , 1520 - , 1521 - , 1522 - , 1523 - , 1524 - , 1525 - , 1526 - , 1527 - , 1528 - , 1529 - , 1530 - , 1531 - , 1532 - , 1533 - , 1534 - , 1535 - , 1536 - , 1537 - , 1538 - , 1539 - , 1540 - , 1541 - , 1542 - , 1543 - , 1544 - , 1545 - , 1546 - , 1547 - , 1548 - , 1549 - , 1550 - , 1551 - , 1552 - , 1553 - , 1554 - , 1555 - , 1556 - , 1557 - , 1558 - , 1559 - , 1560 - , 1561 - , 1562 - , 1563 - , 1564 - , 1565 - , 1566 - , 1567 - , 1568 - , 1569 - , 1570 - , 1571 - , 1572 - , 1573 - , 1574 - , 1575 - , 1576 - , 1577 - , 1578 - , 1579 - , 1580 - , 1581 - , 1582 - , 1583 - , 1584 - , 1585 - , 1586 - , 1587 - , 1588 - , 1589 - , 1590 - , 1591 - , 1592 - , 1593 - , 1594 - , 1595 - , 1596 - , 1597 - , 1598 - , 1599 - , 1600 - , 1601 - , 1602 - , 1603 - , 1604 - , 1605 - , 1606 - , 1607 - , 1608 - , 1609 - , 1610 - , 1611 - , 1612 - , 1613 - , 1614 - , 1615 - , 1616 - , 1617 - , 1618 - , 1619 - , 1620 - , 1621 - , 1622 - , 1623 - , 1624 - , 1625 - , 1626 - , 1627 - , 1628 - , 1629 - , 1630 - , 1631 - , 1632 - , 1633 - , 1634 - , 1635 - , 1636 - , 1637 - , 1638 - , 1639 - , 1640 - , 1641 - , 1642 - , 1643 - , 1644 - , 1645 - , 1646 - , 1647 - , 1648 - , 1649 - , 1650 - , 1651 - , 1652 - , 1653 - , 1654 - , 1655 - , 1656 - , 1657 - , 1658 - , 1659 - , 1660 - , 1661 - , 1662 - , 1663 - , 1664 - , 1665 - , 1666 - , 1667 - , 1668 - , 1669 - , 1670 - , 1671 - , 1672 - , 1673 - , 1674 - , 1675 - , 1676 - , 1677 - , 1678 - , 1679 - , 1680 - , 1681 - , 1682 - , 1683 - , 1684 - , 1685 - , 1686 - , 1687 - , 1688 - , 1689 - , 1690 - , 1691 - , 1692 - , 1693 - , 1694 - , 1695 - , 1696 - , 1697 - , 1698 - , 1699 - , 1700 - , 1701 - , 1702 - , 1703 - , 1704 - , 1705 - , 1706 - , 1707 - , 1708 - , 1709 - , 1710 - , 1711 - , 1712 - , 1713 - , 1714 - , 1715 - , 1716 - , 1717 - , 1718 - , 1719 - , 1720 - , 1721 - , 1722 - , 1723 - , 1724 - , 1725 - , 1726 - , 1727 - , 1728 - , 1729 - , 1730 - , 1731 - , 1732 - , 1733 - , 1734 - , 1735 - , 1736 - , 1737 - , 1738 - , 1739 - , 1740 - , 1741 - , 1742 - , 1743 - , 1744 - , 1745 - , 1746 - , 1747 - , 1748 - , 1749 - , 1750 - , 1751 - , 1752 - , 1753 - , 1754 - , 1755 - , 1756 - , 1757 - , 1758 - , 1759 - , 1760 - , 1761 - , 1762 - , 1763 - , 1764 - , 1765 - , 1766 - , 1767 - , 1768 - , 1769 - , 1770 - , 1771 - , 1772 - , 1773 - , 1774 - , 1775 - , 1776 - , 1777 - , 1778 - , 1779 - , 1780 - , 1781 - , 1782 - , 1783 - , 1784 - , 1785 - , 1786 - , 1787 - , 1788 - , 1789 - , 1790 - , 1791 - , 1792 - , 1793 - , 1794 - , 1795 - , 1796 - , 1797 - , 1798 - , 1799 - , 1800 - , 1801 - , 1802 - , 1803 - , 1804 - , 1805 - , 1806 - , 1807 - , 1808 - , 1809 - , 1810 - , 1811 - , 1812 - , 1813 - , 1814 - , 1815 - , 1816 - , 1817 - , 1818 - , 1819 - , 1820 - , 1821 - , 1822 - , 1823 - , 1824 - , 1825 - , 1826 - , 1827 - , 1828 - , 1829 - , 1830 - , 1831 - , 1832 - , 1833 - , 1834 - , 1835 - , 1836 - , 1837 - , 1838 - , 1839 - , 1840 - , 1841 - , 1842 - , 1843 - , 1844 - , 1845 - , 1846 - , 1847 - , 1848 - , 1849 - , 1850 - , 1851 - , 1852 - , 1853 - , 1854 - , 1855 - , 1856 - , 1857 - , 1858 - , 1859 - , 1860 - , 1861 - , 1862 - , 1863 - , 1864 - , 1865 - , 1866 - , 1867 - , 1868 - , 1869 - , 1870 - , 1871 - , 1872 - , 1873 - , 1874 - , 1875 - , 1876 - , 1877 - , 1878 - , 1879 - , 1880 - , 1881 - , 1882 - , 1883 - , 1884 - , 1885 - , 1886 - , 1887 - , 1888 - , 1889 - , 1890 - , 1891 - , 1892 - , 1893 - , 1894 - , 1895 - , 1896 - , 1897 - , 1898 - , 1899 - , 1900 - , 1901 - , 1902 - , 1903 - , 1904 - , 1905 - , 1906 - , 1907 - , 1908 - , 1909 - , 1910 - , 1911 - , 1912 - , 1913 - , 1914 - , 1915 - , 1916 - , 1917 - , 1918 - , 1919 - , 1920 - , 1921 - , 1922 - , 1923 - , 1924 - , 1925 - , 1926 - , 1927 - , 1928 - , 1929 - , 1930 - , 1931 - , 1932 - , 1933 - , 1934 - , 1935 - , 1936 - , 1937 - , 1938 - , 1939 - , 1940 - , 1941 - , 1942 - , 1943 - , 1944 - , 1945 - , 1946 - , 1947 - , 1948 - , 1949 - , 1950 - , 1951 - , 1952 - , 1953 - , 1954 - , 1955 - , 1956 - , 1957 - , 1958 - , 1959 - , 1960 - , 1961 - , 1962 - , 1963 - , 1964 - , 1965 - , 1966 - , 1967 - , 1968 - , 1969 - , 1970 - , 1971 - , 1972 - , 1973 - , 1974 - , 1975 - , 1976 - , 1977 - , 1978 - , 1979 - , 1980 - , 1981 - , 1982 - , 1983 - , 1984 - , 1985 - , 1986 - , 1987 - , 1988 - , 1989 - , 1990 - , 1991 - , 1992 - , 1993 - , 1994 - , 1995 - , 1996 - , 1997 - , 1998 - , 1999 - , 2000 - ] -``` - -Should be cached: - -``` unison -> range 2000 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > range 2000 - ⧩ - [ 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - , 12 - , 13 - , 14 - , 15 - , 16 - , 17 - , 18 - , 19 - , 20 - , 21 - , 22 - , 23 - , 24 - , 25 - , 26 - , 27 - , 28 - , 29 - , 30 - , 31 - , 32 - , 33 - , 34 - , 35 - , 36 - , 37 - , 38 - , 39 - , 40 - , 41 - , 42 - , 43 - , 44 - , 45 - , 46 - , 47 - , 48 - , 49 - , 50 - , 51 - , 52 - , 53 - , 54 - , 55 - , 56 - , 57 - , 58 - , 59 - , 60 - , 61 - , 62 - , 63 - , 64 - , 65 - , 66 - , 67 - , 68 - , 69 - , 70 - , 71 - , 72 - , 73 - , 74 - , 75 - , 76 - , 77 - , 78 - , 79 - , 80 - , 81 - , 82 - , 83 - , 84 - , 85 - , 86 - , 87 - , 88 - , 89 - , 90 - , 91 - , 92 - , 93 - , 94 - , 95 - , 96 - , 97 - , 98 - , 99 - , 100 - , 101 - , 102 - , 103 - , 104 - , 105 - , 106 - , 107 - , 108 - , 109 - , 110 - , 111 - , 112 - , 113 - , 114 - , 115 - , 116 - , 117 - , 118 - , 119 - , 120 - , 121 - , 122 - , 123 - , 124 - , 125 - , 126 - , 127 - , 128 - , 129 - , 130 - , 131 - , 132 - , 133 - , 134 - , 135 - , 136 - , 137 - , 138 - , 139 - , 140 - , 141 - , 142 - , 143 - , 144 - , 145 - , 146 - , 147 - , 148 - , 149 - , 150 - , 151 - , 152 - , 153 - , 154 - , 155 - , 156 - , 157 - , 158 - , 159 - , 160 - , 161 - , 162 - , 163 - , 164 - , 165 - , 166 - , 167 - , 168 - , 169 - , 170 - , 171 - , 172 - , 173 - , 174 - , 175 - , 176 - , 177 - , 178 - , 179 - , 180 - , 181 - , 182 - , 183 - , 184 - , 185 - , 186 - , 187 - , 188 - , 189 - , 190 - , 191 - , 192 - , 193 - , 194 - , 195 - , 196 - , 197 - , 198 - , 199 - , 200 - , 201 - , 202 - , 203 - , 204 - , 205 - , 206 - , 207 - , 208 - , 209 - , 210 - , 211 - , 212 - , 213 - , 214 - , 215 - , 216 - , 217 - , 218 - , 219 - , 220 - , 221 - , 222 - , 223 - , 224 - , 225 - , 226 - , 227 - , 228 - , 229 - , 230 - , 231 - , 232 - , 233 - , 234 - , 235 - , 236 - , 237 - , 238 - , 239 - , 240 - , 241 - , 242 - , 243 - , 244 - , 245 - , 246 - , 247 - , 248 - , 249 - , 250 - , 251 - , 252 - , 253 - , 254 - , 255 - , 256 - , 257 - , 258 - , 259 - , 260 - , 261 - , 262 - , 263 - , 264 - , 265 - , 266 - , 267 - , 268 - , 269 - , 270 - , 271 - , 272 - , 273 - , 274 - , 275 - , 276 - , 277 - , 278 - , 279 - , 280 - , 281 - , 282 - , 283 - , 284 - , 285 - , 286 - , 287 - , 288 - , 289 - , 290 - , 291 - , 292 - , 293 - , 294 - , 295 - , 296 - , 297 - , 298 - , 299 - , 300 - , 301 - , 302 - , 303 - , 304 - , 305 - , 306 - , 307 - , 308 - , 309 - , 310 - , 311 - , 312 - , 313 - , 314 - , 315 - , 316 - , 317 - , 318 - , 319 - , 320 - , 321 - , 322 - , 323 - , 324 - , 325 - , 326 - , 327 - , 328 - , 329 - , 330 - , 331 - , 332 - , 333 - , 334 - , 335 - , 336 - , 337 - , 338 - , 339 - , 340 - , 341 - , 342 - , 343 - , 344 - , 345 - , 346 - , 347 - , 348 - , 349 - , 350 - , 351 - , 352 - , 353 - , 354 - , 355 - , 356 - , 357 - , 358 - , 359 - , 360 - , 361 - , 362 - , 363 - , 364 - , 365 - , 366 - , 367 - , 368 - , 369 - , 370 - , 371 - , 372 - , 373 - , 374 - , 375 - , 376 - , 377 - , 378 - , 379 - , 380 - , 381 - , 382 - , 383 - , 384 - , 385 - , 386 - , 387 - , 388 - , 389 - , 390 - , 391 - , 392 - , 393 - , 394 - , 395 - , 396 - , 397 - , 398 - , 399 - , 400 - , 401 - , 402 - , 403 - , 404 - , 405 - , 406 - , 407 - , 408 - , 409 - , 410 - , 411 - , 412 - , 413 - , 414 - , 415 - , 416 - , 417 - , 418 - , 419 - , 420 - , 421 - , 422 - , 423 - , 424 - , 425 - , 426 - , 427 - , 428 - , 429 - , 430 - , 431 - , 432 - , 433 - , 434 - , 435 - , 436 - , 437 - , 438 - , 439 - , 440 - , 441 - , 442 - , 443 - , 444 - , 445 - , 446 - , 447 - , 448 - , 449 - , 450 - , 451 - , 452 - , 453 - , 454 - , 455 - , 456 - , 457 - , 458 - , 459 - , 460 - , 461 - , 462 - , 463 - , 464 - , 465 - , 466 - , 467 - , 468 - , 469 - , 470 - , 471 - , 472 - , 473 - , 474 - , 475 - , 476 - , 477 - , 478 - , 479 - , 480 - , 481 - , 482 - , 483 - , 484 - , 485 - , 486 - , 487 - , 488 - , 489 - , 490 - , 491 - , 492 - , 493 - , 494 - , 495 - , 496 - , 497 - , 498 - , 499 - , 500 - , 501 - , 502 - , 503 - , 504 - , 505 - , 506 - , 507 - , 508 - , 509 - , 510 - , 511 - , 512 - , 513 - , 514 - , 515 - , 516 - , 517 - , 518 - , 519 - , 520 - , 521 - , 522 - , 523 - , 524 - , 525 - , 526 - , 527 - , 528 - , 529 - , 530 - , 531 - , 532 - , 533 - , 534 - , 535 - , 536 - , 537 - , 538 - , 539 - , 540 - , 541 - , 542 - , 543 - , 544 - , 545 - , 546 - , 547 - , 548 - , 549 - , 550 - , 551 - , 552 - , 553 - , 554 - , 555 - , 556 - , 557 - , 558 - , 559 - , 560 - , 561 - , 562 - , 563 - , 564 - , 565 - , 566 - , 567 - , 568 - , 569 - , 570 - , 571 - , 572 - , 573 - , 574 - , 575 - , 576 - , 577 - , 578 - , 579 - , 580 - , 581 - , 582 - , 583 - , 584 - , 585 - , 586 - , 587 - , 588 - , 589 - , 590 - , 591 - , 592 - , 593 - , 594 - , 595 - , 596 - , 597 - , 598 - , 599 - , 600 - , 601 - , 602 - , 603 - , 604 - , 605 - , 606 - , 607 - , 608 - , 609 - , 610 - , 611 - , 612 - , 613 - , 614 - , 615 - , 616 - , 617 - , 618 - , 619 - , 620 - , 621 - , 622 - , 623 - , 624 - , 625 - , 626 - , 627 - , 628 - , 629 - , 630 - , 631 - , 632 - , 633 - , 634 - , 635 - , 636 - , 637 - , 638 - , 639 - , 640 - , 641 - , 642 - , 643 - , 644 - , 645 - , 646 - , 647 - , 648 - , 649 - , 650 - , 651 - , 652 - , 653 - , 654 - , 655 - , 656 - , 657 - , 658 - , 659 - , 660 - , 661 - , 662 - , 663 - , 664 - , 665 - , 666 - , 667 - , 668 - , 669 - , 670 - , 671 - , 672 - , 673 - , 674 - , 675 - , 676 - , 677 - , 678 - , 679 - , 680 - , 681 - , 682 - , 683 - , 684 - , 685 - , 686 - , 687 - , 688 - , 689 - , 690 - , 691 - , 692 - , 693 - , 694 - , 695 - , 696 - , 697 - , 698 - , 699 - , 700 - , 701 - , 702 - , 703 - , 704 - , 705 - , 706 - , 707 - , 708 - , 709 - , 710 - , 711 - , 712 - , 713 - , 714 - , 715 - , 716 - , 717 - , 718 - , 719 - , 720 - , 721 - , 722 - , 723 - , 724 - , 725 - , 726 - , 727 - , 728 - , 729 - , 730 - , 731 - , 732 - , 733 - , 734 - , 735 - , 736 - , 737 - , 738 - , 739 - , 740 - , 741 - , 742 - , 743 - , 744 - , 745 - , 746 - , 747 - , 748 - , 749 - , 750 - , 751 - , 752 - , 753 - , 754 - , 755 - , 756 - , 757 - , 758 - , 759 - , 760 - , 761 - , 762 - , 763 - , 764 - , 765 - , 766 - , 767 - , 768 - , 769 - , 770 - , 771 - , 772 - , 773 - , 774 - , 775 - , 776 - , 777 - , 778 - , 779 - , 780 - , 781 - , 782 - , 783 - , 784 - , 785 - , 786 - , 787 - , 788 - , 789 - , 790 - , 791 - , 792 - , 793 - , 794 - , 795 - , 796 - , 797 - , 798 - , 799 - , 800 - , 801 - , 802 - , 803 - , 804 - , 805 - , 806 - , 807 - , 808 - , 809 - , 810 - , 811 - , 812 - , 813 - , 814 - , 815 - , 816 - , 817 - , 818 - , 819 - , 820 - , 821 - , 822 - , 823 - , 824 - , 825 - , 826 - , 827 - , 828 - , 829 - , 830 - , 831 - , 832 - , 833 - , 834 - , 835 - , 836 - , 837 - , 838 - , 839 - , 840 - , 841 - , 842 - , 843 - , 844 - , 845 - , 846 - , 847 - , 848 - , 849 - , 850 - , 851 - , 852 - , 853 - , 854 - , 855 - , 856 - , 857 - , 858 - , 859 - , 860 - , 861 - , 862 - , 863 - , 864 - , 865 - , 866 - , 867 - , 868 - , 869 - , 870 - , 871 - , 872 - , 873 - , 874 - , 875 - , 876 - , 877 - , 878 - , 879 - , 880 - , 881 - , 882 - , 883 - , 884 - , 885 - , 886 - , 887 - , 888 - , 889 - , 890 - , 891 - , 892 - , 893 - , 894 - , 895 - , 896 - , 897 - , 898 - , 899 - , 900 - , 901 - , 902 - , 903 - , 904 - , 905 - , 906 - , 907 - , 908 - , 909 - , 910 - , 911 - , 912 - , 913 - , 914 - , 915 - , 916 - , 917 - , 918 - , 919 - , 920 - , 921 - , 922 - , 923 - , 924 - , 925 - , 926 - , 927 - , 928 - , 929 - , 930 - , 931 - , 932 - , 933 - , 934 - , 935 - , 936 - , 937 - , 938 - , 939 - , 940 - , 941 - , 942 - , 943 - , 944 - , 945 - , 946 - , 947 - , 948 - , 949 - , 950 - , 951 - , 952 - , 953 - , 954 - , 955 - , 956 - , 957 - , 958 - , 959 - , 960 - , 961 - , 962 - , 963 - , 964 - , 965 - , 966 - , 967 - , 968 - , 969 - , 970 - , 971 - , 972 - , 973 - , 974 - , 975 - , 976 - , 977 - , 978 - , 979 - , 980 - , 981 - , 982 - , 983 - , 984 - , 985 - , 986 - , 987 - , 988 - , 989 - , 990 - , 991 - , 992 - , 993 - , 994 - , 995 - , 996 - , 997 - , 998 - , 999 - , 1000 - , 1001 - , 1002 - , 1003 - , 1004 - , 1005 - , 1006 - , 1007 - , 1008 - , 1009 - , 1010 - , 1011 - , 1012 - , 1013 - , 1014 - , 1015 - , 1016 - , 1017 - , 1018 - , 1019 - , 1020 - , 1021 - , 1022 - , 1023 - , 1024 - , 1025 - , 1026 - , 1027 - , 1028 - , 1029 - , 1030 - , 1031 - , 1032 - , 1033 - , 1034 - , 1035 - , 1036 - , 1037 - , 1038 - , 1039 - , 1040 - , 1041 - , 1042 - , 1043 - , 1044 - , 1045 - , 1046 - , 1047 - , 1048 - , 1049 - , 1050 - , 1051 - , 1052 - , 1053 - , 1054 - , 1055 - , 1056 - , 1057 - , 1058 - , 1059 - , 1060 - , 1061 - , 1062 - , 1063 - , 1064 - , 1065 - , 1066 - , 1067 - , 1068 - , 1069 - , 1070 - , 1071 - , 1072 - , 1073 - , 1074 - , 1075 - , 1076 - , 1077 - , 1078 - , 1079 - , 1080 - , 1081 - , 1082 - , 1083 - , 1084 - , 1085 - , 1086 - , 1087 - , 1088 - , 1089 - , 1090 - , 1091 - , 1092 - , 1093 - , 1094 - , 1095 - , 1096 - , 1097 - , 1098 - , 1099 - , 1100 - , 1101 - , 1102 - , 1103 - , 1104 - , 1105 - , 1106 - , 1107 - , 1108 - , 1109 - , 1110 - , 1111 - , 1112 - , 1113 - , 1114 - , 1115 - , 1116 - , 1117 - , 1118 - , 1119 - , 1120 - , 1121 - , 1122 - , 1123 - , 1124 - , 1125 - , 1126 - , 1127 - , 1128 - , 1129 - , 1130 - , 1131 - , 1132 - , 1133 - , 1134 - , 1135 - , 1136 - , 1137 - , 1138 - , 1139 - , 1140 - , 1141 - , 1142 - , 1143 - , 1144 - , 1145 - , 1146 - , 1147 - , 1148 - , 1149 - , 1150 - , 1151 - , 1152 - , 1153 - , 1154 - , 1155 - , 1156 - , 1157 - , 1158 - , 1159 - , 1160 - , 1161 - , 1162 - , 1163 - , 1164 - , 1165 - , 1166 - , 1167 - , 1168 - , 1169 - , 1170 - , 1171 - , 1172 - , 1173 - , 1174 - , 1175 - , 1176 - , 1177 - , 1178 - , 1179 - , 1180 - , 1181 - , 1182 - , 1183 - , 1184 - , 1185 - , 1186 - , 1187 - , 1188 - , 1189 - , 1190 - , 1191 - , 1192 - , 1193 - , 1194 - , 1195 - , 1196 - , 1197 - , 1198 - , 1199 - , 1200 - , 1201 - , 1202 - , 1203 - , 1204 - , 1205 - , 1206 - , 1207 - , 1208 - , 1209 - , 1210 - , 1211 - , 1212 - , 1213 - , 1214 - , 1215 - , 1216 - , 1217 - , 1218 - , 1219 - , 1220 - , 1221 - , 1222 - , 1223 - , 1224 - , 1225 - , 1226 - , 1227 - , 1228 - , 1229 - , 1230 - , 1231 - , 1232 - , 1233 - , 1234 - , 1235 - , 1236 - , 1237 - , 1238 - , 1239 - , 1240 - , 1241 - , 1242 - , 1243 - , 1244 - , 1245 - , 1246 - , 1247 - , 1248 - , 1249 - , 1250 - , 1251 - , 1252 - , 1253 - , 1254 - , 1255 - , 1256 - , 1257 - , 1258 - , 1259 - , 1260 - , 1261 - , 1262 - , 1263 - , 1264 - , 1265 - , 1266 - , 1267 - , 1268 - , 1269 - , 1270 - , 1271 - , 1272 - , 1273 - , 1274 - , 1275 - , 1276 - , 1277 - , 1278 - , 1279 - , 1280 - , 1281 - , 1282 - , 1283 - , 1284 - , 1285 - , 1286 - , 1287 - , 1288 - , 1289 - , 1290 - , 1291 - , 1292 - , 1293 - , 1294 - , 1295 - , 1296 - , 1297 - , 1298 - , 1299 - , 1300 - , 1301 - , 1302 - , 1303 - , 1304 - , 1305 - , 1306 - , 1307 - , 1308 - , 1309 - , 1310 - , 1311 - , 1312 - , 1313 - , 1314 - , 1315 - , 1316 - , 1317 - , 1318 - , 1319 - , 1320 - , 1321 - , 1322 - , 1323 - , 1324 - , 1325 - , 1326 - , 1327 - , 1328 - , 1329 - , 1330 - , 1331 - , 1332 - , 1333 - , 1334 - , 1335 - , 1336 - , 1337 - , 1338 - , 1339 - , 1340 - , 1341 - , 1342 - , 1343 - , 1344 - , 1345 - , 1346 - , 1347 - , 1348 - , 1349 - , 1350 - , 1351 - , 1352 - , 1353 - , 1354 - , 1355 - , 1356 - , 1357 - , 1358 - , 1359 - , 1360 - , 1361 - , 1362 - , 1363 - , 1364 - , 1365 - , 1366 - , 1367 - , 1368 - , 1369 - , 1370 - , 1371 - , 1372 - , 1373 - , 1374 - , 1375 - , 1376 - , 1377 - , 1378 - , 1379 - , 1380 - , 1381 - , 1382 - , 1383 - , 1384 - , 1385 - , 1386 - , 1387 - , 1388 - , 1389 - , 1390 - , 1391 - , 1392 - , 1393 - , 1394 - , 1395 - , 1396 - , 1397 - , 1398 - , 1399 - , 1400 - , 1401 - , 1402 - , 1403 - , 1404 - , 1405 - , 1406 - , 1407 - , 1408 - , 1409 - , 1410 - , 1411 - , 1412 - , 1413 - , 1414 - , 1415 - , 1416 - , 1417 - , 1418 - , 1419 - , 1420 - , 1421 - , 1422 - , 1423 - , 1424 - , 1425 - , 1426 - , 1427 - , 1428 - , 1429 - , 1430 - , 1431 - , 1432 - , 1433 - , 1434 - , 1435 - , 1436 - , 1437 - , 1438 - , 1439 - , 1440 - , 1441 - , 1442 - , 1443 - , 1444 - , 1445 - , 1446 - , 1447 - , 1448 - , 1449 - , 1450 - , 1451 - , 1452 - , 1453 - , 1454 - , 1455 - , 1456 - , 1457 - , 1458 - , 1459 - , 1460 - , 1461 - , 1462 - , 1463 - , 1464 - , 1465 - , 1466 - , 1467 - , 1468 - , 1469 - , 1470 - , 1471 - , 1472 - , 1473 - , 1474 - , 1475 - , 1476 - , 1477 - , 1478 - , 1479 - , 1480 - , 1481 - , 1482 - , 1483 - , 1484 - , 1485 - , 1486 - , 1487 - , 1488 - , 1489 - , 1490 - , 1491 - , 1492 - , 1493 - , 1494 - , 1495 - , 1496 - , 1497 - , 1498 - , 1499 - , 1500 - , 1501 - , 1502 - , 1503 - , 1504 - , 1505 - , 1506 - , 1507 - , 1508 - , 1509 - , 1510 - , 1511 - , 1512 - , 1513 - , 1514 - , 1515 - , 1516 - , 1517 - , 1518 - , 1519 - , 1520 - , 1521 - , 1522 - , 1523 - , 1524 - , 1525 - , 1526 - , 1527 - , 1528 - , 1529 - , 1530 - , 1531 - , 1532 - , 1533 - , 1534 - , 1535 - , 1536 - , 1537 - , 1538 - , 1539 - , 1540 - , 1541 - , 1542 - , 1543 - , 1544 - , 1545 - , 1546 - , 1547 - , 1548 - , 1549 - , 1550 - , 1551 - , 1552 - , 1553 - , 1554 - , 1555 - , 1556 - , 1557 - , 1558 - , 1559 - , 1560 - , 1561 - , 1562 - , 1563 - , 1564 - , 1565 - , 1566 - , 1567 - , 1568 - , 1569 - , 1570 - , 1571 - , 1572 - , 1573 - , 1574 - , 1575 - , 1576 - , 1577 - , 1578 - , 1579 - , 1580 - , 1581 - , 1582 - , 1583 - , 1584 - , 1585 - , 1586 - , 1587 - , 1588 - , 1589 - , 1590 - , 1591 - , 1592 - , 1593 - , 1594 - , 1595 - , 1596 - , 1597 - , 1598 - , 1599 - , 1600 - , 1601 - , 1602 - , 1603 - , 1604 - , 1605 - , 1606 - , 1607 - , 1608 - , 1609 - , 1610 - , 1611 - , 1612 - , 1613 - , 1614 - , 1615 - , 1616 - , 1617 - , 1618 - , 1619 - , 1620 - , 1621 - , 1622 - , 1623 - , 1624 - , 1625 - , 1626 - , 1627 - , 1628 - , 1629 - , 1630 - , 1631 - , 1632 - , 1633 - , 1634 - , 1635 - , 1636 - , 1637 - , 1638 - , 1639 - , 1640 - , 1641 - , 1642 - , 1643 - , 1644 - , 1645 - , 1646 - , 1647 - , 1648 - , 1649 - , 1650 - , 1651 - , 1652 - , 1653 - , 1654 - , 1655 - , 1656 - , 1657 - , 1658 - , 1659 - , 1660 - , 1661 - , 1662 - , 1663 - , 1664 - , 1665 - , 1666 - , 1667 - , 1668 - , 1669 - , 1670 - , 1671 - , 1672 - , 1673 - , 1674 - , 1675 - , 1676 - , 1677 - , 1678 - , 1679 - , 1680 - , 1681 - , 1682 - , 1683 - , 1684 - , 1685 - , 1686 - , 1687 - , 1688 - , 1689 - , 1690 - , 1691 - , 1692 - , 1693 - , 1694 - , 1695 - , 1696 - , 1697 - , 1698 - , 1699 - , 1700 - , 1701 - , 1702 - , 1703 - , 1704 - , 1705 - , 1706 - , 1707 - , 1708 - , 1709 - , 1710 - , 1711 - , 1712 - , 1713 - , 1714 - , 1715 - , 1716 - , 1717 - , 1718 - , 1719 - , 1720 - , 1721 - , 1722 - , 1723 - , 1724 - , 1725 - , 1726 - , 1727 - , 1728 - , 1729 - , 1730 - , 1731 - , 1732 - , 1733 - , 1734 - , 1735 - , 1736 - , 1737 - , 1738 - , 1739 - , 1740 - , 1741 - , 1742 - , 1743 - , 1744 - , 1745 - , 1746 - , 1747 - , 1748 - , 1749 - , 1750 - , 1751 - , 1752 - , 1753 - , 1754 - , 1755 - , 1756 - , 1757 - , 1758 - , 1759 - , 1760 - , 1761 - , 1762 - , 1763 - , 1764 - , 1765 - , 1766 - , 1767 - , 1768 - , 1769 - , 1770 - , 1771 - , 1772 - , 1773 - , 1774 - , 1775 - , 1776 - , 1777 - , 1778 - , 1779 - , 1780 - , 1781 - , 1782 - , 1783 - , 1784 - , 1785 - , 1786 - , 1787 - , 1788 - , 1789 - , 1790 - , 1791 - , 1792 - , 1793 - , 1794 - , 1795 - , 1796 - , 1797 - , 1798 - , 1799 - , 1800 - , 1801 - , 1802 - , 1803 - , 1804 - , 1805 - , 1806 - , 1807 - , 1808 - , 1809 - , 1810 - , 1811 - , 1812 - , 1813 - , 1814 - , 1815 - , 1816 - , 1817 - , 1818 - , 1819 - , 1820 - , 1821 - , 1822 - , 1823 - , 1824 - , 1825 - , 1826 - , 1827 - , 1828 - , 1829 - , 1830 - , 1831 - , 1832 - , 1833 - , 1834 - , 1835 - , 1836 - , 1837 - , 1838 - , 1839 - , 1840 - , 1841 - , 1842 - , 1843 - , 1844 - , 1845 - , 1846 - , 1847 - , 1848 - , 1849 - , 1850 - , 1851 - , 1852 - , 1853 - , 1854 - , 1855 - , 1856 - , 1857 - , 1858 - , 1859 - , 1860 - , 1861 - , 1862 - , 1863 - , 1864 - , 1865 - , 1866 - , 1867 - , 1868 - , 1869 - , 1870 - , 1871 - , 1872 - , 1873 - , 1874 - , 1875 - , 1876 - , 1877 - , 1878 - , 1879 - , 1880 - , 1881 - , 1882 - , 1883 - , 1884 - , 1885 - , 1886 - , 1887 - , 1888 - , 1889 - , 1890 - , 1891 - , 1892 - , 1893 - , 1894 - , 1895 - , 1896 - , 1897 - , 1898 - , 1899 - , 1900 - , 1901 - , 1902 - , 1903 - , 1904 - , 1905 - , 1906 - , 1907 - , 1908 - , 1909 - , 1910 - , 1911 - , 1912 - , 1913 - , 1914 - , 1915 - , 1916 - , 1917 - , 1918 - , 1919 - , 1920 - , 1921 - , 1922 - , 1923 - , 1924 - , 1925 - , 1926 - , 1927 - , 1928 - , 1929 - , 1930 - , 1931 - , 1932 - , 1933 - , 1934 - , 1935 - , 1936 - , 1937 - , 1938 - , 1939 - , 1940 - , 1941 - , 1942 - , 1943 - , 1944 - , 1945 - , 1946 - , 1947 - , 1948 - , 1949 - , 1950 - , 1951 - , 1952 - , 1953 - , 1954 - , 1955 - , 1956 - , 1957 - , 1958 - , 1959 - , 1960 - , 1961 - , 1962 - , 1963 - , 1964 - , 1965 - , 1966 - , 1967 - , 1968 - , 1969 - , 1970 - , 1971 - , 1972 - , 1973 - , 1974 - , 1975 - , 1976 - , 1977 - , 1978 - , 1979 - , 1980 - , 1981 - , 1982 - , 1983 - , 1984 - , 1985 - , 1986 - , 1987 - , 1988 - , 1989 - , 1990 - , 1991 - , 1992 - , 1993 - , 1994 - , 1995 - , 1996 - , 1997 - , 1998 - , 1999 - , 2000 - ] -``` diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md deleted file mode 100644 index 2787499d1a..0000000000 --- a/unison-src/transcripts/fix2712.output.md +++ /dev/null @@ -1,59 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -unique type Map k v = Tip | Bin Nat k v (Map k v) (Map k v) - -mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b -mapWithKey f m = Tip -``` - -``` ucm :added-by-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 Map k v - mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Map k v - mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b -``` - -``` unison - -naiomi = - susan: Nat -> Nat -> () - susan a b = () - - pam: Map Nat Nat - pam = Tip - - mapWithKey susan pam - -``` - -``` ucm :added-by-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`: - - naiomi : Map Nat () -``` diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md deleted file mode 100644 index 9c62136a85..0000000000 --- a/unison-src/transcripts/fix2795.output.md +++ /dev/null @@ -1,28 +0,0 @@ -``` ucm -scratch/main> builtins.mergeio - - Done. -scratch/main> load unison-src/transcripts/fix2795/docs.u - - Loading changes detected in - unison-src/transcripts/fix2795/docs.u. - - I found and typechecked these definitions in - unison-src/transcripts/fix2795/docs.u. If you do an `add` or - `update`, here's how your codebase would change: - - ⍟ These new definitions are ok to `add`: - - t1 : Text - test : Doc2 -scratch/main> display test - - t : Text - t = "hi" - t - ⧨ - "hi" - - t1 : Text - t1 = "hi" -``` diff --git a/unison-src/transcripts/fix2822.output.md b/unison-src/transcripts/fix2822.output.md deleted file mode 100644 index 8dadc1c54c..0000000000 --- a/unison-src/transcripts/fix2822.output.md +++ /dev/null @@ -1,144 +0,0 @@ -# Inability to reference a term or type with a name that has segments starting with an underscore - -``` ucm :hide -scratch/main> builtins.mergeio -``` - -There should be no issue having terms with an underscore-led component - -``` unison -_a.blah = 2 - -b = _a.blah + 1 -``` - -``` ucm :added-by-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.blah : Nat - b : Nat -``` - -Or even that *are* a single “blank” component - -``` unison -_b = 2 - -x = _b + 1 -``` - -``` ucm :added-by-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`: - - _b : Nat - x : Nat -``` - -Types can also have underscore-led components. - -``` unison -unique type _a.Blah = A - -c : _a.Blah -c = A -``` - -``` ucm :added-by-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 _a.Blah - c : Blah -``` - -And we should also be able to access underscore-led fields. - -``` unison -type Hello = {_value : Nat} - -doStuff = _value.modify -``` - -``` ucm :added-by-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 Hello - Hello._value : Hello -> Nat - Hello._value.modify : (Nat ->{g} Nat) -> Hello ->{g} Hello - Hello._value.set : Nat -> Hello -> Hello - doStuff : (Nat ->{g} Nat) -> Hello ->{g} Hello -``` - -But pattern matching shouldn’t bind to underscore-led names. - -``` unison :error -dontMap f = cases - None -> false - Some _used -> f _used -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what _used refers to here: - - 3 | Some _used -> f _used - - I also don't know what type it should be. - - Some common causes of this error include: - * Your current namespace is too deep to contain the - definition in its subtree - * The definition is part of a library which hasn't been - added to this project - * You have a typo in the name -``` - -But we can use them as unbound patterns. - -``` unison -dontMap f = cases - None -> false - Some _unused -> f 2 -``` - -``` ucm :added-by-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`: - - dontMap : (Nat ->{g} Boolean) -> Optional a ->{g} Boolean -``` diff --git a/unison-src/transcripts/fix2826.output.md b/unison-src/transcripts/fix2826.output.md deleted file mode 100644 index 46ea907bad..0000000000 --- a/unison-src/transcripts/fix2826.output.md +++ /dev/null @@ -1,64 +0,0 @@ -``` ucm -scratch/main> builtins.mergeio - - Done. -``` - -Supports fences that are longer than three backticks. - -```` unison - -doc = {{ - @typecheck ``` - x = 3 - ``` -}} - -```` - -``` ucm :added-by-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`: - - doc : Doc2 -``` - -And round-trips properly. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - doc : Doc2 -scratch/main> edit doc - - ☝️ - - I added 1 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -scratch/main> load scratch.u - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. -``` - -```` unison :added-by-ucm scratch.u -doc : Doc2 -doc = - {{ - @typecheck ``` - x = 3 - ``` - }} -```` diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md deleted file mode 100644 index bcbbf93c4f..0000000000 --- a/unison-src/transcripts/fix2970.output.md +++ /dev/null @@ -1,25 +0,0 @@ -Also fixes \#1519 (it's the same issue). - -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo.+.doc : Nat -foo.+.doc = 10 -``` - -``` ucm :added-by-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.+.doc : Nat -``` diff --git a/unison-src/transcripts/fix3037.output.md b/unison-src/transcripts/fix3037.output.md deleted file mode 100644 index b3bd705af6..0000000000 --- a/unison-src/transcripts/fix3037.output.md +++ /dev/null @@ -1,65 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests for an unsound case of ability checking that was erroneously being -accepted before. In certain cases, abilities were able to be added to rows in -invariant positions. - -``` unison :error -structural type Runner g = Runner (forall a. '{g} a -> {} a) - -pureRunner : Runner {} -pureRunner = Runner base.force - --- this compiles, but shouldn't the effect type parameter on Runner be invariant? -runner : Runner {IO} -runner = pureRunner -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found an ability mismatch when checking the expression in red - - 3 | pureRunner : Runner {} - 4 | pureRunner = Runner base.force - 5 | - 6 | -- this compiles, but shouldn't the effect type parameter on Runner be invariant? - 7 | runner : Runner {IO} - 8 | runner = pureRunner - - - When trying to match Runner {} with Runner {IO} the right hand - side contained extra abilities: {IO} - -``` - -Application version: - -``` unison :error -structural type A g = A (forall a. '{g} a ->{} a) - -anA : A {} -anA = A base.force - -h : A {IO} -> () -h _ = () - -> h anA -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found an ability mismatch when checking the application - - 9 | > h anA - - - When trying to match A {} with A {IO} the right hand side - contained extra abilities: {IO} - -``` diff --git a/unison-src/transcripts/fix3171.output.md b/unison-src/transcripts/fix3171.output.md deleted file mode 100644 index e15ba83254..0000000000 --- a/unison-src/transcripts/fix3171.output.md +++ /dev/null @@ -1,38 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests an case where decompiling could cause function arguments to occur in the -opposite order for partially applied functions. - -``` unison -f : Nat -> Nat -> Nat -> () -> Nat -f x y z _ = x + y * z - -> f 1 2 -> f 1 2 3 -``` - -``` ucm :added-by-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`: - - f : Nat -> Nat -> Nat -> 'Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 4 | > f 1 2 - ⧩ - z _ -> 1 Nat.+ 2 Nat.* z - - 5 | > f 1 2 3 - ⧩ - _ -> 1 Nat.+ 2 Nat.* 3 -``` diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md deleted file mode 100644 index 02f78449f7..0000000000 --- a/unison-src/transcripts/fix3196.output.md +++ /dev/null @@ -1,60 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests ability checking in scenarios where one side is concrete and the other is -a variable. This was supposed to be covered, but the method wasn't actually -symmetric, so doing `equate l r` might work, but not `equate r l`. - -Below were cases that caused the failing order. - -``` unison -structural type W es = W - -unique ability Zoot where - zoot : () - --- here only to put a kind constraint on W -structural type C = C (W {}) - -woot : W {g} -> '{g, Zoot} a ->{Zoot} a -woot w a = todo () - -ex = do - w = (W : W {Zoot}) - woot w do bug "why don't you typecheck?" - -w1 : W {Zoot} -w1 = W - -w2 : W {g} -> W {g} -w2 = cases W -> W - -> w2 w1 -``` - -``` ucm :added-by-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 C - structural type W es - ability Zoot - ex : '{Zoot} r - w1 : W {Zoot} - w2 : W {g} -> W {g} - woot : W {g} -> '{g, Zoot} a ->{Zoot} a - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 22 | > w2 w1 - ⧩ - W -``` diff --git a/unison-src/transcripts/fix3215.output.md b/unison-src/transcripts/fix3215.output.md deleted file mode 100644 index 43f652eb67..0000000000 --- a/unison-src/transcripts/fix3215.output.md +++ /dev/null @@ -1,35 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests a case where concrete abilities were appearing multiple times in an -inferred type. This was due to the pre-pass that figures out which abilities -are being matched on. It was just concatenating the ability for each pattern -into a list, and not checking whether there were duplicates. - -``` unison -structural ability T where - nat : Nat - int : Int - flo : Float - -f = cases - {nat -> k} -> 5 - {int -> k} -> 5 - {flo -> k} -> 5 - {x} -> 5 -``` - -``` ucm :added-by-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 ability T - f : Request {g, T} x -> Nat -``` diff --git a/unison-src/transcripts/fix3244.output.md b/unison-src/transcripts/fix3244.output.md deleted file mode 100644 index 8159eb8b28..0000000000 --- a/unison-src/transcripts/fix3244.output.md +++ /dev/null @@ -1,41 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This tests an previously erroneous case in the pattern compiler. It was assuming -that the variables bound in a guard matched the variables bound in the rest of -the branch exactly, but apparently this needn't be the case. - -``` unison - -foo t = - (x, _) = t - f w = w + x - - match t with - (x, y) - | y < 5 -> f x - | otherwise -> x + y - -> foo (10,20) -``` - -``` ucm :added-by-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 : (Nat, Nat) -> Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 11 | > foo (10,20) - ⧩ - 30 -``` diff --git a/unison-src/transcripts/fix3265.output.md b/unison-src/transcripts/fix3265.output.md deleted file mode 100644 index 11547b8bf3..0000000000 --- a/unison-src/transcripts/fix3265.output.md +++ /dev/null @@ -1,93 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Tests cases that produced bad decompilation output previously. There -are three cases that need to be 'fixed up.' - -1. lambda expressions with free variables need to be beta reduced -2. let defined functions need to have arguments removed and - occurrences rewritten. -3. let-rec defined functions need to have arguments removed, but - it is a more complicated process. - -``` unison -> Any (w x -> let - f0 y = match y with - 0 -> x - n -> 1 + f1 (drop y 1) - f1 y = match y with - 0 -> w + x - n -> 1 + f0 (drop y 1) - f2 x = f2 x - f3 y = 1 + y + f2 x - g h = h 1 + x - g (z -> x + f0 z)) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > Any (w x -> let - ⧩ - Any - (w x -> - let - use Nat + drop - f1 y = match y with - 0 -> w + x - n -> 1 + f0 (drop y 1) - f0 y = match y with - 0 -> x - n -> 1 + f1 (drop y 1) - f2 x = f2 x - f3 x y = 1 + y + f2 x - g h = h 1 + x - g (z -> x + f0 z)) -``` - -Also check for some possible corner cases. - -`f` should not have its `x` argument eliminated, because it doesn't -always occur with `x` as the first argument, but if we aren't careful, -we might do that, because we find the first occurrence of `f`, and -discard its arguments, where `f` also occurs. - -``` unison -> Any (x -> let - f x y = match y with - 0 -> 0 - _ -> f x (f y (drop y 1)) - - f x 20) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > Any (x -> let - ⧩ - Any - (x -> - let - f x y = match y with - 0 -> 0 - _ -> f x (f y (Nat.drop y 1)) - f x 20) -``` diff --git a/unison-src/transcripts/fix3424.output.md b/unison-src/transcripts/fix3424.output.md deleted file mode 100644 index 95a1b880ea..0000000000 --- a/unison-src/transcripts/fix3424.output.md +++ /dev/null @@ -1,47 +0,0 @@ -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -``` - -``` unison :hide -a = do b -b = "Hello, " ++ c ++ "!" -c = "World" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a : 'Text - b : Text - c : Text -scratch/main> run a - - "Hello, World!" -``` - -``` unison :hide -a = do b -c = "Unison" -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> run a - - "Hello, Unison!" -``` - -The result should be "Hello, Unison\!". diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md deleted file mode 100644 index fcd46aade7..0000000000 --- a/unison-src/transcripts/fix3634.output.md +++ /dev/null @@ -1,45 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison -structural type M a = N | J a - -d = {{ - -{{ docExample 0 '(x -> J x) }} - -{J} - -}} -``` - -``` ucm :added-by-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 M a - (also named builtin.Optional) - d : Doc2 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type M a - (also named builtin.Optional) - d : Doc2 -scratch/main> display d - - `x -> J x` - - J -``` diff --git a/unison-src/transcripts/fix3678.output.md b/unison-src/transcripts/fix3678.output.md deleted file mode 100644 index f8c1dff0fb..0000000000 --- a/unison-src/transcripts/fix3678.output.md +++ /dev/null @@ -1,33 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Array comparison was indexing out of bounds. - -``` unison -arr = Scope.run do - ma = Scope.arrayOf "asdf" 0 - freeze! ma - -> compare arr arr -``` - -``` ucm :added-by-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`: - - arr : ImmutableArray Text - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 5 | > compare arr arr - ⧩ - +0 -``` diff --git a/unison-src/transcripts/fix3752.output.md b/unison-src/transcripts/fix3752.output.md deleted file mode 100644 index 25d17717ba..0000000000 --- a/unison-src/transcripts/fix3752.output.md +++ /dev/null @@ -1,35 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -These were failing to type check before, because id was not -generalized. - -``` unison - -foo = do - id x = - _ = 1 - x - id () - id "hello" - -bar = do - id x = x - id () - id "hello" -``` - -``` ucm :added-by-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`: - - bar : 'Text - foo : 'Text -``` diff --git a/unison-src/transcripts/fix3773.output.md b/unison-src/transcripts/fix3773.output.md deleted file mode 100644 index b781453bb3..0000000000 --- a/unison-src/transcripts/fix3773.output.md +++ /dev/null @@ -1,32 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -foo = - _ = 1 - _ = 22 - 42 - -> foo + 20 -``` - -``` ucm :added-by-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 : Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 6 | > foo + 20 - ⧩ - 62 -``` diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md deleted file mode 100644 index cac95349b6..0000000000 --- a/unison-src/transcripts/fix3977.output.md +++ /dev/null @@ -1,45 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”. - -``` unison :hide -failure msg context = Failure (typeLink Unit) msg (Any context) - -foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with concatenation") ()) -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - failure : Text -> context -> Failure - foo : Either Failure b -scratch/main> edit foo - - ☝️ - - I added 1 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -scratch/main> load scratch.u - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. -``` - -``` unison :added-by-ucm scratch.u -foo : Either Failure b -foo = - use Text ++ - Left - (failure - ("a loooooooooooooooooooooooooooooooooong" - ++ "message with concatenation") - ()) -``` diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md deleted file mode 100644 index e87835951c..0000000000 --- a/unison-src/transcripts/fix4172.output.md +++ /dev/null @@ -1,98 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -debug a = match Debug.toText a with - None -> "" - Some (Left a) -> a - Some (Right a) -> a - -test> t1 = if bool then [Ok "Yay"] - else [Fail (debug [1,2,3])] -bool = true - -allowDebug = debug [1,2,3] -``` - -``` ucm :added-by-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`: - - allowDebug : Text - bool : Boolean - debug : a -> Text - t1 : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 6 | test> t1 = if bool then [Ok "Yay"] - - ✅ Passed Yay -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - allowDebug : Text - bool : Boolean - debug : a -> Text - t1 : [Result] -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. t1 ◉ Yay - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -``` unison -bool = false -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - bool : Boolean -``` - -``` ucm :error -scratch/main> update.old - - ⍟ I've updated these names to your new definition: - - bool : Boolean -scratch/main> test - - ✅ - - - - New test results: - - 1. t1 ✗ [1, 2, 3] - - 🚫 1 test(s) failing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/fix4280.output.md b/unison-src/transcripts/fix4280.output.md deleted file mode 100644 index 8d7ff2c2d0..0000000000 --- a/unison-src/transcripts/fix4280.output.md +++ /dev/null @@ -1,26 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -foo.bar._baz = 5 - -bonk : Nat -bonk = - use foo.bar _baz - _baz -``` - -``` ucm :added-by-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 - foo.bar._baz : Nat -``` diff --git a/unison-src/transcripts/fix4397.output.md b/unison-src/transcripts/fix4397.output.md deleted file mode 100644 index fa95e4a577..0000000000 --- a/unison-src/transcripts/fix4397.output.md +++ /dev/null @@ -1,19 +0,0 @@ -``` unison :error -structural type Foo f - = Foo (f ()) -unique type Baz = Baz (Foo Bar) - -unique type Bar - = Bar Baz -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 3 | unique type Baz = Baz (Foo Bar) - - Foo expects an argument of kind: Type -> Type; however, it - is applied to Bar which has kind: Type. -``` diff --git a/unison-src/transcripts/fix4415.output.md b/unison-src/transcripts/fix4415.output.md deleted file mode 100644 index 541d736413..0000000000 --- a/unison-src/transcripts/fix4415.output.md +++ /dev/null @@ -1,18 +0,0 @@ -``` unison -unique type Foo = Foo -unique type sub.Foo = -``` - -``` ucm :added-by-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 - type sub.Foo -``` diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md deleted file mode 100644 index 8915119bd9..0000000000 --- a/unison-src/transcripts/fix4424.output.md +++ /dev/null @@ -1,42 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Some basics: - -``` unison :hide -unique type Cat.Dog = Mouse Nat -unique type Rat.Dog = Bird - -countCat = cases - Cat.Dog.Mouse x -> Bird -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Cat.Dog - type Rat.Dog - countCat : Cat.Dog -> Rat.Dog -``` - -Now I want to add a constructor. - -``` unison :hide -unique type Rat.Dog = Bird | Mouse -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md deleted file mode 100644 index 8cabe342e1..0000000000 --- a/unison-src/transcripts/fix4482.output.md +++ /dev/null @@ -1,65 +0,0 @@ -``` ucm :hide -myproj/main> builtins.merge -``` - -``` unison -lib.foo0.lib.bonk1.bar = 203 -lib.foo0.baz = 1 -lib.foo1.zonk = 204 -lib.foo1.lib.bonk2.qux = 1 -mybar = bar + bar -``` - -``` ucm :added-by-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`: - - lib.foo0.baz : Nat - lib.foo0.lib.bonk1.bar : Nat - lib.foo1.lib.bonk2.qux : Nat - lib.foo1.zonk : Nat - mybar : Nat -``` - -``` ucm :error -myproj/main> add - - ⍟ I've added these definitions: - - lib.foo0.baz : Nat - lib.foo0.lib.bonk1.bar : Nat - lib.foo1.lib.bonk2.qux : Nat - lib.foo1.zonk : Nat - mybar : Nat -myproj/main> upgrade foo0 foo1 - - I couldn't automatically upgrade foo0 to foo1. However, I've - added the definitions that need attention to the top of - scratch.u. - - When you're done, you can run - - upgrade.commit - - to merge your changes back into main and delete the temporary - branch. Or, if you decide to cancel the upgrade instead, you - can run - - delete.branch /upgrade-foo0-to-foo1 - - to delete the temporary branch and switch back to main. -``` - -``` unison :added-by-ucm scratch.u -mybar : Nat -mybar = - use Nat + - use lib.foo0.lib.bonk1 bar - bar + bar -``` diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md deleted file mode 100644 index 00614c6a9e..0000000000 --- a/unison-src/transcripts/fix4498.output.md +++ /dev/null @@ -1,43 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -lib.dep0.bonk.foo = 5 -lib.dep0.zonk.foo = "hi" -lib.dep0.lib.dep1.foo = 6 -myterm = foo + 2 -``` - -``` ucm :added-by-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`: - - lib.dep0.bonk.foo : Nat - lib.dep0.lib.dep1.foo : Nat - lib.dep0.zonk.foo : Text - myterm : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.dep0.bonk.foo : Nat - lib.dep0.lib.dep1.foo : Nat - lib.dep0.zonk.foo : Text - myterm : Nat -scratch/main> view myterm - - myterm : Nat - myterm = - use Nat + - bonk.foo + 2 -``` diff --git a/unison-src/transcripts/fix4515.output.md b/unison-src/transcripts/fix4515.output.md deleted file mode 100644 index 87e3c19cea..0000000000 --- a/unison-src/transcripts/fix4515.output.md +++ /dev/null @@ -1,71 +0,0 @@ -``` ucm :hide -myproject/main> builtins.merge -``` - -``` unison -unique type Foo = Foo1 -unique type Bar = X Foo -unique type Baz = X Foo - -useBar : Bar -> Nat -useBar = cases - Bar.X _ -> 1 -``` - -``` ucm :added-by-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 Bar - type Baz - type Foo - useBar : Bar -> Nat -``` - -``` ucm -myproject/main> add - - ⍟ I've added these definitions: - - type Bar - type Baz - type Foo - useBar : Bar -> Nat -``` - -``` unison -unique type Foo = Foo1 | Foo2 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -myproject/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` diff --git a/unison-src/transcripts/fix4528.output.md b/unison-src/transcripts/fix4528.output.md deleted file mode 100644 index 6c7f76915f..0000000000 --- a/unison-src/transcripts/fix4528.output.md +++ /dev/null @@ -1,36 +0,0 @@ -``` ucm :hide -foo/main> builtins.merge -``` - -``` unison -structural type Foo = MkFoo Nat - -main : () -> Foo -main _ = MkFoo 5 -``` - -``` ucm :added-by-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 Foo - main : 'Foo -``` - -``` ucm -foo/main> add - - ⍟ I've added these definitions: - - structural type Foo - main : 'Foo -foo/main> run main - - MkFoo 5 -``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md deleted file mode 100644 index 30048e4bb3..0000000000 --- a/unison-src/transcripts/fix4556.output.md +++ /dev/null @@ -1,68 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -thing = 3 -foo.hello = 5 + thing -bar.hello = 5 + thing -hey = foo.hello -``` - -``` ucm :added-by-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`: - - bar.hello : Nat - foo.hello : Nat - hey : Nat - thing : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar.hello : Nat - foo.hello : Nat - hey : Nat - thing : Nat -``` - -``` unison -thing = 2 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - thing : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -``` diff --git a/unison-src/transcripts/fix4592.output.md b/unison-src/transcripts/fix4592.output.md deleted file mode 100644 index 4379da14a5..0000000000 --- a/unison-src/transcripts/fix4592.output.md +++ /dev/null @@ -1,21 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison -doc = {{ {{ bug "bug" - 52 }} }} -``` - -``` ucm :added-by-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`: - - doc : Doc2 -``` diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md deleted file mode 100644 index b8e775dc2a..0000000000 --- a/unison-src/transcripts/fix4618.output.md +++ /dev/null @@ -1,63 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -foo = 5 -unique type Bugs.Zonk = Bugs -``` - -``` ucm :added-by-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 Bugs.Zonk - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Bugs.Zonk - foo : Nat -``` - -``` unison -foo = 4 -unique type Bugs = -``` - -``` ucm :added-by-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 Bugs - - ⍟ These names already exist. You can `update` them to your - new definition: - - foo : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` diff --git a/unison-src/transcripts/fix4711.output.md b/unison-src/transcripts/fix4711.output.md deleted file mode 100644 index 20c94397cf..0000000000 --- a/unison-src/transcripts/fix4711.output.md +++ /dev/null @@ -1,58 +0,0 @@ -# Delayed Int literal doesn't round trip - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -thisWorks = '(+1) - -thisDoesNotWork = ['(+1)] -``` - -``` ucm :added-by-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`: - - thisDoesNotWork : ['{g} Int] - thisWorks : 'Int -``` - -Since this is fixed, `thisDoesNotWork` now does work. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - thisDoesNotWork : ['{g} Int] - thisWorks : 'Int -scratch/main> edit thisWorks thisDoesNotWork - - ☝️ - - I added 2 definitions to the top of scratch.u - - You can edit them there, then run `update` to replace the - definitions currently in this namespace. -scratch/main> load - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. -``` - -``` unison :added-by-ucm scratch.u -thisDoesNotWork : ['{g} Int] -thisDoesNotWork = [do +1] - -thisWorks : 'Int -thisWorks = do +1 -``` diff --git a/unison-src/transcripts/fix4722.output.md b/unison-src/transcripts/fix4722.output.md deleted file mode 100644 index b7568064f7..0000000000 --- a/unison-src/transcripts/fix4722.output.md +++ /dev/null @@ -1,62 +0,0 @@ -Tests an improvement to type checking related to abilities. - -`foo` below typechecks fine as long as all the branches are *checked* -against their expected type. However, it's annoying to have to -annotate them. The old code was checking a match by just synthesizing -and subtyping, but we can instead check a match by pushing the -expected type into each case, allowing top-level annotations to act -like annotations on each case. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -ability X a where yield : {X a} () -ability Y where y : () - -type Foo b a = One a -type Bar a - = Leaf a - | Branch (Bar a) (Bar a) - -f : (a -> ()) -> '{g, X a} () -> '{g, X a} () -> '{g, X a} () -f _ x y = y - -abra : a -> '{Y, X z} r -abra = bug "" - -cadabra : (y -> z) -> '{g, X y} r -> '{g, X z} r -cadabra = bug "" - -foo : Bar (Optional b) -> '{Y, X (Foo z ('{Y} r))} () -foo = cases - Leaf a -> match a with - None -> abra a - Some _ -> cadabra One (abra a) - Branch l r -> - f (_ -> ()) (foo l) (foo r) -``` - -``` ucm :added-by-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 Bar a - type Foo b a - ability X a - ability Y - abra : a -> '{Y, X z} r - cadabra : (y ->{h} z) -> '{g, X y} r -> '{g, X z} r - f : (a ->{h} ()) - -> '{g, X a} () - -> '{g, X a} () - -> '{g, X a} () - foo : Bar (Optional b) -> '{Y, X (Foo z ('{Y} r))} () -``` diff --git a/unison-src/transcripts/fix4731.output.md b/unison-src/transcripts/fix4731.output.md deleted file mode 100644 index 23b743a42e..0000000000 --- a/unison-src/transcripts/fix4731.output.md +++ /dev/null @@ -1,97 +0,0 @@ -``` unison -structural type Void = -``` - -``` ucm :added-by-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 Void -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Void -``` - -We should be able to `match` on empty types like `Void`. - -``` unison -Void.absurdly : '{e} Void ->{e} a -Void.absurdly v = match !v with -``` - -``` ucm :added-by-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`: - - Void.absurdly : '{e} Void ->{e} a -``` - -``` unison -Void.absurdly : Void -> a -Void.absurdly v = match v with -``` - -``` ucm :added-by-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`: - - Void.absurdly : Void -> a -``` - -And empty `cases` should also work. - -``` unison -Void.absurdly : Void -> a -Void.absurdly = cases -``` - -``` ucm :added-by-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`: - - Void.absurdly : Void -> a -``` - -But empty function bodies are not allowed. - -``` unison :error -Void.absurd : Void -> a -Void.absurd x = -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I expected a block after this (in red), but there wasn't one. Maybe check your indentation: - 2 | Void.absurd x = -``` diff --git a/unison-src/transcripts/fix4780.output.md b/unison-src/transcripts/fix4780.output.md deleted file mode 100644 index 266ac610d6..0000000000 --- a/unison-src/transcripts/fix4780.output.md +++ /dev/null @@ -1,26 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Just a simple test case to see whether partially applied -builtins decompile properly. - -``` unison -> (+) 2 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > (+) 2 - ⧩ - (Nat.+) 2 -``` diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md deleted file mode 100644 index f8c1948545..0000000000 --- a/unison-src/transcripts/fix4898.output.md +++ /dev/null @@ -1,49 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -double : Int -> Int -double x = x + x - -redouble : Int -> Int -redouble x = double x + double x -``` - -``` ucm :added-by-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`: - - double : Int -> Int - redouble : Int -> Int -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - double : Int -> Int - redouble : Int -> Int -scratch/main> dependents double - - Dependents of: double - - Terms: - - 1. redouble - - Tip: Try `view 1` to see the source of any numbered item in - the above list. -scratch/main> delete.term 1 - - Done. -``` diff --git a/unison-src/transcripts/fix5055.output.md b/unison-src/transcripts/fix5055.output.md deleted file mode 100644 index a19493dce8..0000000000 --- a/unison-src/transcripts/fix5055.output.md +++ /dev/null @@ -1,44 +0,0 @@ -``` ucm -test-5055/main> builtins.merge - - Done. -``` - -``` unison -foo.add x y = x Int.+ y - -foo.subtract x y = x Int.- y -``` - -``` ucm :added-by-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.add : Int -> Int -> Int - foo.subtract : Int -> Int -> Int -``` - -``` ucm -test-5055/main> add - - ⍟ I've added these definitions: - - foo.add : Int -> Int -> Int - foo.subtract : Int -> Int -> Int -test-5055/main> ls foo - - 1. add (Int -> Int -> Int) - 2. subtract (Int -> Int -> Int) -test-5055/main> view 1 - - foo.add : Int -> Int -> Int - foo.add x y = - use Int + - x + y -``` diff --git a/unison-src/transcripts/fix5076.output.md b/unison-src/transcripts/fix5076.output.md deleted file mode 100644 index 4fadef5b75..0000000000 --- a/unison-src/transcripts/fix5076.output.md +++ /dev/null @@ -1,25 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -Nested call to code lexer wasn’t terminating inline examples containing blocks properly. - -``` unison -x = {{ - ``let "me"`` live - ``do "me"`` in - }} -``` - -``` ucm :added-by-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 : Doc2 -``` diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md deleted file mode 100644 index 97accafa83..0000000000 --- a/unison-src/transcripts/fix5080.output.md +++ /dev/null @@ -1,68 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -``` unison -test> fix5080.tests.success = [Ok "success"] -test> fix5080.tests.failure = [Fail "fail"] -``` - -``` ucm :added-by-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`: - - fix5080.tests.failure : [Result] - fix5080.tests.success : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | test> fix5080.tests.success = [Ok "success"] - - ✅ Passed success - - 2 | test> fix5080.tests.failure = [Fail "fail"] - - 🚫 FAILED fail -``` - -``` ucm :error -scratch/main> add - - ⍟ I've added these definitions: - - fix5080.tests.failure : [Result] - fix5080.tests.success : [Result] -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. fix5080.tests.success ◉ success - - 2. fix5080.tests.failure ✗ fail - - 🚫 1 test(s) failing, ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -``` ucm -scratch/main> delete.term 2 - - Done. -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. fix5080.tests.success ◉ success - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/fix5141.output.md b/unison-src/transcripts/fix5141.output.md deleted file mode 100644 index fd50da1091..0000000000 --- a/unison-src/transcripts/fix5141.output.md +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/unison-src/transcripts/fix5168.output.md b/unison-src/transcripts/fix5168.output.md deleted file mode 100644 index b5ece8dc7a..0000000000 --- a/unison-src/transcripts/fix5168.output.md +++ /dev/null @@ -1,18 +0,0 @@ -The `edit` seems to suppress a following ` ``` unison ` block: - -``` unison -b = 2 -``` - -``` ucm :added-by-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`: - - b : ##Nat -``` diff --git a/unison-src/transcripts/fix5349.output.md b/unison-src/transcripts/fix5349.output.md deleted file mode 100644 index 6d9b0d4b99..0000000000 --- a/unison-src/transcripts/fix5349.output.md +++ /dev/null @@ -1,80 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -Empty code blocks are invalid in Unison, but shouldn’t crash the parser. - -```` unison :error -README = {{ -``` -``` -}} -```` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I expected a block after this (in red), but there wasn't one. Maybe check your indentation: - 0 | README = {{ -``` - -``` unison :error -README = {{ {{ }} }} -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - - - I was surprised to find an end of input here. - I was expecting one of these instead: - - * bang - * do - * false - * force - * handle - * if - * lambda - * let - * quote - * termLink - * true - * tuple - * typeLink -``` - -``` unison :error -README = {{ `` `` }} -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - - - I was surprised to find an end of input here. - I was expecting one of these instead: - - * bang - * do - * false - * force - * handle - * if - * lambda - * let - * quote - * termLink - * true - * tuple - * typeLink -``` diff --git a/unison-src/transcripts/fix614.output.md b/unison-src/transcripts/fix614.output.md deleted file mode 100644 index ebd58ef50c..0000000000 --- a/unison-src/transcripts/fix614.output.md +++ /dev/null @@ -1,127 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. - -This works, as expected: - -``` unison -structural ability Stream a where emit : a -> () - -ex1 = do - Stream.emit 1 - Stream.emit 2 - 42 -``` - -``` ucm :added-by-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 ability Stream a - ex1 : '{Stream Nat} Nat -``` - -``` ucm :hide -scratch/main> add -``` - -This does not typecheck, we've accidentally underapplied `Stream.emit`: - -``` unison :error -ex2 = do - Stream.emit - 42 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a value of type: a ->{Stream a} Unit - where I expected to find: Unit - - 2 | Stream.emit - 3 | 42 - - Hint: Actions within a block must have type Unit. - Use _ = to ignore a result. -``` - -We can explicitly ignore an unused result like so: - -``` unison -ex3 = do - _ = Stream.emit - () -``` - -``` ucm :added-by-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`: - - ex3 : '() -``` - -Using a helper function like `void` also works fine: - -``` unison -void x = () - -ex4 = - void [1,2,3] - () -``` - -``` ucm :added-by-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`: - - ex4 : () - void : x -> () -``` - -One more example: - -``` unison :error -ex4 = - [1,2,3] -- no good - () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a value of type: [Nat] - where I expected to find: Unit - - 2 | [1,2,3] -- no good - 3 | () - - from right here: - - 2 | [1,2,3] -- no good - - Hint: Actions within a block must have type Unit. - Use _ = to ignore a result. -``` diff --git a/unison-src/transcripts/fix689.output.md b/unison-src/transcripts/fix689.output.md deleted file mode 100644 index c3ff7cdc80..0000000000 --- a/unison-src/transcripts/fix689.output.md +++ /dev/null @@ -1,26 +0,0 @@ -Tests the fix for https://github.com/unisonweb/unison/issues/689 - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural ability SystemTime where - systemTime : ##Nat - -tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) -``` - -``` ucm :added-by-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 ability SystemTime - tomorrow : '{SystemTime} Nat -``` diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md deleted file mode 100644 index 1680e443ca..0000000000 --- a/unison-src/transcripts/fix693.output.md +++ /dev/null @@ -1,136 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural ability X t where - x : t -> a -> a - -structural ability Abort where - abort : a -``` - -``` ucm :added-by-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 ability Abort - structural ability X t -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural ability Abort - structural ability X t -``` - -This code should not type check. The match on X.x ought to introduce a -skolem variable `a` such that `c : a` and the continuation has type -`a ->{X} b`. Thus, `handle c with h : Optional a`, which is not the -correct result type. - -``` unison :error -h0 : Request {X t} b -> Optional b -h0 req = match req with - { X.x _ c -> _ } -> handle c with h0 - { d } -> Some d -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Each case of a match / with expression need to have the same - type. - - Here, one is: Optional b - and another is: Optional a - - - 3 | { X.x _ c -> _ } -> handle c with h0 - - from these spots, respectively: - - 1 | h0 : Request {X t} b -> Optional b -``` - -This code should not check because `t` does not match `b`. - -``` unison :error -h1 : Request {X t} b -> Optional b -h1 req = match req with - { X.x t _ -> _ } -> handle t with h1 - { d } -> Some d -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Each case of a match / with expression need to have the same - type. - - Here, one is: Optional b - and another is: Optional t - - - 3 | { X.x t _ -> _ } -> handle t with h1 - - from these spots, respectively: - - 1 | h1 : Request {X t} b -> Optional b -``` - -This code should not check for reasons similar to the first example, -but with the continuation rather than a parameter. - -``` unison :error -h2 : Request {Abort} r -> r -h2 req = match req with - { Abort.abort -> k } -> handle k 5 with h2 - { r } -> r -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - The 1st argument to `k` - - has type: Nat - but I expected: a - - 3 | { Abort.abort -> k } -> handle k 5 with h2 -``` - -This should work fine. - -``` unison -h3 : Request {X b, Abort} b -> Optional b -h3 = cases - { r } -> Some r - { Abort.abort -> _ } -> None - { X.x b _ -> _ } -> Some b -``` - -``` ucm :added-by-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`: - - h3 : Request {X b, Abort} b -> Optional b -``` diff --git a/unison-src/transcripts/fix845.output.md b/unison-src/transcripts/fix845.output.md deleted file mode 100644 index d837030803..0000000000 --- a/unison-src/transcripts/fix845.output.md +++ /dev/null @@ -1,154 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Add `List.zonk` to the codebase: - -``` unison -List.zonk : [a] -> [a] -List.zonk xs = xs - -Text.zonk : Text -> Text -Text.zonk txt = txt ++ "!! " -``` - -``` ucm :added-by-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.zonk : [a] -> [a] - Text.zonk : Text -> Text -``` - -``` ucm :hide -scratch/main> add -``` - -Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: - -``` unison :error --- should not typecheck as there's no `Blah.zonk` in the codebase -> Blah.zonk [1,2,3] -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what Blah.zonk refers to here: - - 2 | > Blah.zonk [1,2,3] - - I think its type should be: - - [Nat] -> o - - Some common causes of this error include: - * Your current namespace is too deep to contain the - definition in its subtree - * The definition is part of a library which hasn't been - added to this project - * You have a typo in the name -``` - -Here's another example, just checking that TDNR works for definitions in the same file: - -``` unison -foo.bar.baz = 42 - -qux.baz = "hello" - -ex = baz ++ ", world!" - -> ex -``` - -``` ucm :added-by-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`: - - ex : Text - foo.bar.baz : Nat - qux.baz : Text - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 7 | > ex - ⧩ - "hello, world!" -``` - -Here's another example, checking that TDNR works when multiple codebase definitions have matching names: - -``` unison -ex = zonk "hi" - -> ex -``` - -``` ucm :added-by-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`: - - ex : Text - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 3 | > ex - ⧩ - "hi!! " -``` - -Last example, showing that TDNR works when there are multiple matching names in both the file and the codebase: - -``` unison -woot.zonk = "woot" -woot2.zonk = 9384 - -ex = zonk "hi" -- should resolve to Text.zonk, from the codebase - ++ zonk -- should resolve to the local `woot.zonk` from this file - -> ex -``` - -``` ucm :added-by-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`: - - ex : Text - woot.zonk : Text - woot2.zonk : Nat - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 7 | > ex - ⧩ - "hi!! woot" -``` diff --git a/unison-src/transcripts/fix849.output.md b/unison-src/transcripts/fix849.output.md deleted file mode 100644 index 12321025e4..0000000000 --- a/unison-src/transcripts/fix849.output.md +++ /dev/null @@ -1,31 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -See [this ticket](https://github.com/unisonweb/unison/issues/849). - -``` unison -x = 42 - -> x -``` - -``` ucm :added-by-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 - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 3 | > x - ⧩ - 42 -``` diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md deleted file mode 100644 index fc2522afef..0000000000 --- a/unison-src/transcripts/fix942.output.md +++ /dev/null @@ -1,126 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -First we add some code: - -``` unison -x = 0 -y = x + 1 -z = y + 2 -``` - -``` ucm :added-by-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 - y : Nat - z : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - x : Nat - y : Nat - z : Nat -``` - -Now we edit `x` to be `7`, which should make `z` equal `10`: - -``` unison -x = 7 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view x y z - - x : Nat - x = 7 - - y : Nat - y = - use Nat + - x + 1 - - z : Nat - z = - use Nat + - y + 2 -``` - -Uh oh\! `z` is still referencing the old version. Just to confirm: - -``` unison -test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] -``` - -``` ucm :added-by-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`: - - t1 : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] - - ✅ Passed great -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - t1 : [Result] -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. t1 ◉ great - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md deleted file mode 100644 index 524ade93ae..0000000000 --- a/unison-src/transcripts/fix987.output.md +++ /dev/null @@ -1,72 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -First we'll add a definition: - -``` unison -structural ability DeathStar where - attack : Text -> () - -spaceAttack1 x = - y = attack "saturn" - z = attack "neptune" - "All done" -``` - -``` ucm :added-by-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 ability DeathStar - spaceAttack1 : x ->{DeathStar} Text -``` - -Add it to the codebase: - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural ability DeathStar - spaceAttack1 : x ->{DeathStar} Text -``` - -Now we'll try to add a different definition that runs the actions in a different order. This should work fine: - -``` unison -spaceAttack2 x = - z = attack "neptune" - y = attack "saturn" - "All done" -``` - -``` ucm :added-by-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`: - - spaceAttack2 : x ->{DeathStar} Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - spaceAttack2 : x ->{DeathStar} Text -``` - -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/formatter.output.md b/unison-src/transcripts/formatter.output.md deleted file mode 100644 index 186695e07e..0000000000 --- a/unison-src/transcripts/formatter.output.md +++ /dev/null @@ -1,208 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide -{{ # Doc -This is a *doc*! - -term link {x} - -type link {type Optional} - -}} -x : - Nat - -> Nat -x y = - x = 1 + 1 - x + y --- Should keep comments after - --- symbolyDefinition -(<|>) : Nat -> Nat -> (Nat, Nat) -(<|>) a b = (a, b) - -symbolyEndOfBlock = - x = 1 - (+:) - - --- Test for a previous regression that added extra brackets. -oneLiner = {{ one liner }} --- After - --- Before -explicit.doc = {{ -# Here's a top-level doc - -With a paragraph - -Or two -}} --- After - -{{ A doc before an ability }} -ability Thing where - more : Nat -> Text -> Nat - doThing : Nat -> Int - - -{{ Ability with single constructor }} -structural ability Ask a where - ask : {Ask a} a - --- Regression test for: https://github.com/unisonweb/unison/issues/4666 -provide : a -> '{Ask a} r -> r -provide a action = - h = cases - {ask -> resume} -> handle resume a with h - {r} -> r - handle !action with h - -{{ -A Doc before a type -}} -structural type Optional a = More Text - | Some - | Other a - | None Nat - -{{ A doc before a type with no type-vars }} -type Two = One Nat | Two Text - --- Regression for https://github.com/unisonweb/unison/issues/4669 - -multilineBold = {{ - -**This paragraph is really really really really really long and spans multiple lines -with a strike-through block** - -_This paragraph is really really really really really long and spans multiple lines -with a strike-through block_ - -~This paragraph is really really really really really long and spans multiple lines -with a strike-through block~ - -}} -``` - -``` ucm -scratch/main> debug.format -``` - -``` unison :added-by-ucm scratch.u -x.doc = - {{ - # Doc This is a **doc**! - - term link {x} - - type link {type Optional} - }} -x : Nat -> Nat -x y = - use Nat + - x = 1 + 1 - x + y --- Should keep comments after - --- symbolyDefinition -(<|>) : Nat -> Nat -> (Nat, Nat) -a <|> b = (a, b) - -symbolyEndOfBlock = - x = 1 - (+:) - - --- Test for a previous regression that added extra brackets. -oneLiner = {{ one liner }} --- After - --- Before -explicit.doc = - {{ - # Here's a top-level doc - - With a paragraph - - Or two - }} --- After - -Thing.doc = {{ A doc before an ability }} -ability Thing where - more : Nat -> Text ->{Thing} Nat - doThing : Nat ->{Thing} Int - - -Ask.doc = {{ Ability with single constructor }} -structural ability Ask a where ask : {Ask a} a - --- Regression test for: https://github.com/unisonweb/unison/issues/4666 -provide : a -> '{Ask a} r -> r -provide a action = - h = cases - { ask -> resume } -> handle resume a with h - { r } -> r - handle action() with h - -Optional.doc = {{ A Doc before a type }} -structural type Optional a = More Text | Some | Other a | None Nat - -Two.doc = {{ A doc before a type with no type-vars }} -type Two = One Nat | Two Text - --- Regression for https://github.com/unisonweb/unison/issues/4669 - -multilineBold = - {{ - **This paragraph is really really really really really long and spans - multiple lines with a strike-through block** - - __This paragraph is really really really really really long and spans - multiple lines with a strike-through block__ - - ~~This paragraph is really really really really really long and spans - multiple lines with a strike-through block~~ - }} -``` - -Formatter should leave things alone if the file doesn't typecheck. - -``` unison :error -brokenDoc = {{ hello }} + 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what + refers to here: - - 1 | brokenDoc = {{ hello }} + 1 - - The name + is ambiguous. I tried to resolve it by type but no - term with that name would pass typechecking. I think its type - should be: - - Doc2 -> Nat -> o - - If that's not what you expected, you may have a type error - somewhere else in your code. - Help me out by using a more specific name here or adding a - type annotation. - - I found some terms in scope with matching names but different - types. If one of these is what you meant, try using its full - name: - - (Float.+) : Float -> Float -> Float - (Int.+) : Int -> Int -> Int - (Nat.+) : Nat -> Nat -> Nat -``` - -``` ucm -scratch/main> debug.format -``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md deleted file mode 100644 index bdc558c114..0000000000 --- a/unison-src/transcripts/fuzzy-options.output.md +++ /dev/null @@ -1,76 +0,0 @@ -# Test that the options selector for fuzzy finding is working as expected for different argument types. - -If an argument is required but doesn't have a fuzzy resolver, the command should just print the help. - -``` ucm :error --- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver -scratch/main> move.term - - `move.term foo bar` renames `foo` to `bar`. -``` - -If a fuzzy resolver doesn't have any options available it should print a message instead of -opening an empty fuzzy-select. - -``` ucm :error -scratch/empty> view - - ⚠️ - - Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 -``` - -``` unison :hide -optionOne = 1 - -nested.optionTwo = 2 -``` - -Definition args - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - nested.optionTwo : ##Nat - optionOne : ##Nat -scratch/main> debug.fuzzy-options view _ - - Select a definition to view: - * optionOne - * nested.optionTwo -``` - -Namespace args - -``` ucm -scratch/main> add - - ⊡ Ignored previously added definitions: nested.optionTwo - optionOne -scratch/main> debug.fuzzy-options find-in _ - - Select a namespace: - * nested -``` - -Project Branch args - -``` ucm -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`. -scratch/main> debug.fuzzy-options switch _ - - Select a project or branch to switch to: - * myproject/main - * myproject/mybranch - * scratch/empty - * scratch/main - * myproject - * scratch -``` diff --git a/unison-src/transcripts/generic-parse-errors.output.md b/unison-src/transcripts/generic-parse-errors.output.md deleted file mode 100644 index 38da7ff587..0000000000 --- a/unison-src/transcripts/generic-parse-errors.output.md +++ /dev/null @@ -1,145 +0,0 @@ -Just a bunch of random parse errors to test the error formatting. - -``` unison :error -x = - foo.123 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 2 | foo.123 - - - I was surprised to find a 1 here. - I was expecting one of these instead: - - * end of input - * hash (ex: #af3sj3) - * identifier (ex: abba1, snake_case, .foo.bar#xyz, .foo.++#xyz, or 🌻) -``` - -``` unison :error -namespace.blah = 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 1 | namespace.blah = 1 - - - I was surprised to find a = here. - I was expecting one of these instead: - - * ability - * bang - * binding - * do - * false - * force - * handle - * if - * lambda - * let - * newline or semicolon - * quote - * termLink - * true - * tuple - * type - * typeLink - * use -``` - -``` unison :error -x = 1 ] -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found a closing ']' here without a matching '['. - - 1 | x = 1 ] -``` - -``` unison :error -x = a.#abc -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 1 | x = a.#abc - - - I was surprised to find a '.' here. - I was expecting one of these instead: - - * and - * bang - * do - * false - * force - * handle - * if - * infixApp - * let - * newline or semicolon - * or - * quote - * termLink - * true - * tuple - * typeLink -``` - -``` unison :error -x = "hi -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 2 | - - I was surprised to find an end of input here. - I was expecting one of these instead: - - * " - * \s - * literal character -``` - -``` unison :error -y : a -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I got confused here: - - 2 | - - I was surprised to find an end of section here. - I was expecting one of these instead: - - * -> - * newline or semicolon -``` diff --git a/unison-src/transcripts/help.output.md b/unison-src/transcripts/help.output.md deleted file mode 100644 index 8180b08e21..0000000000 --- a/unison-src/transcripts/help.output.md +++ /dev/null @@ -1,1008 +0,0 @@ -# Shows `help` output - -``` ucm -scratch/main> help - - add - `add` adds to the codebase all the definitions from the most recently typechecked file. - - add.preview - `add.preview` previews additions to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. - - add.run - `add.run name` adds to the codebase the result of the most recent `run` command as `name`. - - alias.many (or copy) - `alias.many [relative2...] ` creates - aliases `relative1`, `relative2`, ... in the namespace - `namespace`. - `alias.many foo.foo bar.bar .quux` creates aliases - `.quux.foo.foo` and `.quux.bar.bar`. - - alias.term - `alias.term foo bar` introduces `bar` with the same definition as `foo`. - - alias.type - `alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`. - - api - `api` provides details about the API. - - auth.login - Obtain an authentication session with Unison Share. - `auth.login`authenticates ucm with Unison Share. - - back (or popd) - `back` undoes the last `switch` command. - - branch (or branch.create, create.branch) - `branch foo` forks the current project branch to a new - branch `foo` - `branch /bar foo` forks the branch `bar` of the current - project to a new branch `foo` - - branch.empty (or branch.create-empty, create.empty-branch) - Create a new empty branch. - - branch.rename (or rename.branch) - `branch.rename foo` renames the current branch to `foo` - - branches (or list.branch, ls.branch, branch.list) - `branches` lists all branches in the current project - `branches foo` lists all branches in the project `foo` - - clear - `clear` Clears the screen. - - clone - `clone @unison/json/topic json/my-topic` creates - `json/my-topic` from - the remote branch - `@unison/json/topic` - `clone @unison/base base/` creates `base/main` - from the remote - branch - `@unison/base/main` - `clone @unison/base /main2` creates the branch - `main2` in the - current project from - the remote branch - `@unison/base/main` - `clone /main /main2` creates the branch - `main2` in the - current project from - the remote branch - `main` of the - current project's - associated remote - (see - `help-topics remotes`) - `clone /main my-fork/` creates - `my-fork/main` from - the branch `main` of - the current - project's associated - remote (see - `help-topics remotes`) - - compile (or compile.output) - `compile main file` Outputs a stand alone file that can be - directly loaded and executed by unison. - Said execution will have the effect of - running `!main`. - - create.author - `create.author alicecoder "Alice McGee"` creates `alicecoder` - values in `metadata.authors` and `metadata.copyrightHolders.` - - debug.clear-cache - Clear the watch expression cache - - debug.doc-to-markdown - `debug.doc-to-markdown term.doc` Render a doc to markdown. - - debug.doctor - Analyze your codebase for errors and inconsistencies. - - debug.dump-namespace - Dump the namespace to a text file - - debug.dump-namespace-simple - Dump the namespace to a text file - - debug.file - View details about the most recent successfully typechecked file. - - debug.find.global - `find` lists all definitions in the - current namespace. - `find foo` lists all definitions with a - name similar to 'foo' in the - current namespace (excluding - those under 'lib'). - `find foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the current - namespace (excluding those - under 'lib'). - `find-in namespace` lists all definitions in the - specified subnamespace. - `find-in namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace. - find.all foo lists all definitions with a - name similar to 'foo' in the - current namespace (including - one level of 'lib'). - `find-in.all namespace` lists all definitions in the - specified subnamespace - (including one level of its - 'lib'). - `find-in.all namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace (including one - level of its 'lib'). - debug.find.global foo Iteratively searches all - projects and branches and - lists all definitions with a - name similar to 'foo'. Note - that this is a very slow - operation. - - debug.names.global - `debug.names.global foo` Iteratively search across all - projects and branches for names matching `foo`. Note that this - is expected to be quite slow and is primarily for debugging - issues with your codebase. - - debug.numberedArgs - Dump the contents of the numbered args state. - - delete - `delete foo` removes the term or type name `foo` from the namespace. - `delete foo bar` removes the term or type name `foo` and `bar` from the namespace. - - delete.branch (or branch.delete) - `delete.branch foo/bar` deletes the branch `bar` in the - project `foo` - `delete.branch /bar` deletes the branch `bar` in the - current project - - delete.namespace - `delete.namespace ` deletes the namespace `foo` - - delete.namespace.force - `delete.namespace.force ` deletes the namespace `foo`,deletion will proceed even if other code depends on definitions in foo. - - delete.project (or project.delete) - `delete.project foo` deletes the local project `foo` - - delete.term - `delete.term foo` removes the term name `foo` from the namespace. - `delete.term foo bar` removes the term name `foo` and `bar` from the namespace. - - delete.term.verbose - `delete.term.verbose foo` removes the term name `foo` from the namespace. - `delete.term.verbose foo bar` removes the term name `foo` and `bar` from the namespace. - - delete.type - `delete.type foo` removes the type name `foo` from the namespace. - `delete.type foo bar` removes the type name `foo` and `bar` from the namespace. - - delete.type.verbose - `delete.type.verbose foo` removes the type name `foo` from the namespace. - `delete.type.verbose foo bar` removes the type name `foo` and `bar` from the namespace. - - delete.verbose - `delete.verbose foo` removes the term or type name `foo` from the namespace. - `delete.verbose foo bar` removes the term or type name `foo` and `bar` from the namespace. - - dependencies - List the dependencies of the specified definition. - - dependents - List the named dependents of the specified definition. - - deprecated.cd (or deprecated.namespace) - Moves your perspective to a different namespace. Deprecated for now because too many important things depend on your perspective selection. - - `deprecated.cd foo.bar` descends into foo.bar from the - current namespace. - `deprecated.cd .cat.dog` sets the current namespace to the - absolute namespace .cat.dog. - `deprecated.cd ..` moves to the parent of the current - namespace. E.g. moves from - '.cat.dog' to '.cat' - `deprecated.cd` invokes a search to select which - namespace to move to, which requires - that `fzf` can be found within your - PATH. - - deprecated.root-reflog - `deprecated.root-reflog` lists the changes that have affected the root namespace. This has been deprecated in favor of `reflog` which shows the reflog for the current project. - - diff.namespace - `diff.namespace before after` shows how the namespace `after` - differs from the namespace - `before` - `diff.namespace before` shows how the current namespace - differs from the namespace - `before` - - display - `display foo` prints a rendered version of the term `foo`. - `display` without arguments invokes a search to select a definition to display, which requires that `fzf` can be found within your PATH. - - display.to - `display.to foo` prints a rendered version of the - term `foo` to the given file. - - docs - `docs foo` shows documentation for the definition `foo`. - `docs` without arguments invokes a search to select which definition to view documentation for, which requires that `fzf` can be found within your PATH. - - docs.to-html - `docs.to-html .path.to.ns doc-dir` Render - all docs - contained - within - the - namespace - `.path.to.ns`, - no matter - how deep, - to html - files in - `doc-dir` - in the - directory - UCM was - run from. - `docs.to-html project0/branch0:a.path /tmp/doc-dir` Renders - all docs - anywhere - in the - namespace - `a.path` - from - `branch0` - of - `project0` - to html - in - `/tmp/doc-dir`. - - edit - `edit foo` prepends the definition of `foo` to the top of the most recently saved file. - `edit` without arguments invokes a search to select a definition for editing, which requires that `fzf` can be found within your PATH. - - edit.namespace - `edit.namespace` will load all terms and types contained within the current namespace into your scratch file. This includes definitions in namespaces, but excludes libraries. - `edit.namespace ns1 ns2 ...` loads the terms and types contained within the provided namespaces. - - find - `find` lists all definitions in the - current namespace. - `find foo` lists all definitions with a - name similar to 'foo' in the - current namespace (excluding - those under 'lib'). - `find foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the current - namespace (excluding those - under 'lib'). - `find-in namespace` lists all definitions in the - specified subnamespace. - `find-in namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace. - find.all foo lists all definitions with a - name similar to 'foo' in the - current namespace (including - one level of 'lib'). - `find-in.all namespace` lists all definitions in the - specified subnamespace - (including one level of its - 'lib'). - `find-in.all namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace (including one - level of its 'lib'). - debug.find.global foo Iteratively searches all - projects and branches and - lists all definitions with a - name similar to 'foo'. Note - that this is a very slow - operation. - - find-in - `find` lists all definitions in the - current namespace. - `find foo` lists all definitions with a - name similar to 'foo' in the - current namespace (excluding - those under 'lib'). - `find foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the current - namespace (excluding those - under 'lib'). - `find-in namespace` lists all definitions in the - specified subnamespace. - `find-in namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace. - find.all foo lists all definitions with a - name similar to 'foo' in the - current namespace (including - one level of 'lib'). - `find-in.all namespace` lists all definitions in the - specified subnamespace - (including one level of its - 'lib'). - `find-in.all namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace (including one - level of its 'lib'). - debug.find.global foo Iteratively searches all - projects and branches and - lists all definitions with a - name similar to 'foo'. Note - that this is a very slow - operation. - - find-in.all - `find` lists all definitions in the - current namespace. - `find foo` lists all definitions with a - name similar to 'foo' in the - current namespace (excluding - those under 'lib'). - `find foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the current - namespace (excluding those - under 'lib'). - `find-in namespace` lists all definitions in the - specified subnamespace. - `find-in namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace. - find.all foo lists all definitions with a - name similar to 'foo' in the - current namespace (including - one level of 'lib'). - `find-in.all namespace` lists all definitions in the - specified subnamespace - (including one level of its - 'lib'). - `find-in.all namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace (including one - level of its 'lib'). - debug.find.global foo Iteratively searches all - projects and branches and - lists all definitions with a - name similar to 'foo'. Note - that this is a very slow - operation. - - find.all - `find` lists all definitions in the - current namespace. - `find foo` lists all definitions with a - name similar to 'foo' in the - current namespace (excluding - those under 'lib'). - `find foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the current - namespace (excluding those - under 'lib'). - `find-in namespace` lists all definitions in the - specified subnamespace. - `find-in namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace. - find.all foo lists all definitions with a - name similar to 'foo' in the - current namespace (including - one level of 'lib'). - `find-in.all namespace` lists all definitions in the - specified subnamespace - (including one level of its - 'lib'). - `find-in.all namespace foo bar` lists all definitions with a - name similar to 'foo' or - 'bar' in the specified - subnamespace (including one - level of its 'lib'). - debug.find.global foo Iteratively searches all - projects and branches and - lists all definitions with a - name similar to 'foo'. Note - that this is a very slow - operation. - - find.all.verbose - `find.all.verbose` searches for definitions like `find.all`, but includes hashes and aliases in the results. - - find.verbose - `find.verbose` searches for definitions like `find`, but includes hashes and aliases in the results. - - fork (or copy.namespace) - `fork src dest` creates - the - namespace - `dest` as - a copy of - `src`. - `fork project0/branch0:a.path project1/branch1:foo` creates - the - namespace - `foo` in - `branch1` - of - `project1` - as a copy - of - `a.path` - in - `project0/branch0`. - `fork srcproject/srcbranch dest` creates - the - namespace - `dest` as - a copy of - the - branch - `srcbranch` - of - `srcproject`. - - help (or ?) - `help` shows general help and `help ` shows help for one command. - - help-topics (or help-topic) - `help-topics` lists all topics and `help-topics ` shows an explanation of that topic. - - history - `history` Shows the history of the current - path. - `history .foo` Shows history of the path .foo. - `history #9dndk3kbsk13nbpeu` Shows the history of the - namespace with the given hash. - The full hash must be provided. - - io.test (or test.io) - `io.test mytest` Runs `!mytest`, where `mytest` is a delayed - test that can use the `IO` and `Exception` - abilities. - - io.test.all (or test.io.all) - `io.test.all` runs unit tests for the current branch that use - IO - - lib.install (or install.lib) - The `lib.install` command installs a dependency into the `lib` - namespace. - - `lib.install @unison/base/releases/latest` installs the - latest release of - `@unison/base` - `lib.install @unison/base/releases/3.0.0` installs version - 3.0.0 of - `@unison/base` - `lib.install @unison/base/topic` installs the - `topic` branch of - `@unison/base` - - list (or ls, dir) - `list` lists definitions and namespaces at the current - level of the current namespace. - `list foo` lists the 'foo' namespace. - `list .foo` lists the '.foo' namespace. - - load - `load` parses, typechecks, and evaluates the - most recent scratch file. - `load ` parses, typechecks, and evaluates the - given scratch file. - - merge - `merge /branch` merges `branch` into the current branch - - merge.commit (or commit.merge) - `merge.commit` merges a temporary branch created by the - `merge` command back into its parent branch, and removes the - temporary branch. - - For example, if you've done `merge topic` from main, then - `merge.commit` is equivalent to doing - - * switch /main - * merge /merge-topic-into-main - * delete.branch /merge-topic-into-main - - move (or rename) - `move foo bar` renames the term, type, and namespace foo to bar. - - move.namespace (or rename.namespace) - `move.namespace foo bar` renames the path `foo` to `bar`. - - move.term (or rename.term) - `move.term foo bar` renames `foo` to `bar`. - - move.type (or rename.type) - `move.type foo bar` renames `foo` to `bar`. - - names - `names foo` List all known names for `foo` in the current - branch. - - namespace.dependencies - List the external dependencies of the specified namespace. - - project.create (or create.project) - `project.create` creates a project with a random name - `project.create foo` creates a project named `foo` - - project.reflog (or reflog.project) - `project.reflog` lists all the changes that have affected any branches in the current project. - `project.reflog myproject` lists all the changes that have affected any branches in myproject. - - project.rename (or rename.project) - `project.rename foo` renames the current project to `foo` - - projects (or list.project, ls.project, project.list) - List projects. - - pull - The `pull` command merges a remote namespace into a local - branch - - `pull @unison/base/main` merges the branch - `main` of the Unison - Share hosted project - `@unison/base` into - the current branch - `pull @unison/base/main my-base/topic` merges the branch - `main` of the Unison - Share hosted project - `@unison/base` into - the branch `topic` of - the local `my-base` - project - - where `remote` is a project or project branch, such as: - Project (defaults to the /main branch) `@unison/base` - Project Branch `@unison/base/feature` - Contributor Branch `@unison/base/@johnsmith/feature` - Project Release `@unison/base/releases/1.0.0` - - pull.without-history - The `pull.without-history` command merges a remote namespace - into a local branch without including the remote's history. - This usually results in smaller codebase sizes. - - `pull.without-history @unison/base/main` merges - the - branch - `main` - of the - Unison - Share - hosted - project - `@unison/base` - into - the - current - branch - `pull.without-history @unison/base/main my-base/topic` merges - the - branch - `main` - of the - Unison - Share - hosted - project - `@unison/base` - into - the - branch - `topic` - of the - local - `my-base` - project - - where `remote` is a project or project branch, such as: - Project (defaults to the /main branch) `@unison/base` - Project Branch `@unison/base/feature` - Contributor Branch `@unison/base/@johnsmith/feature` - Project Release `@unison/base/releases/1.0.0` - - push - The `push` command merges a local project or namespace into a - remote project or namespace. - - `push ` publishes the contents of a local - namespace or branch into a remote - namespace or branch. - `push ` publishes the current namespace or - branch into a remote namespace or - branch - `push` publishes the current namespace or - branch. Remote mappings for - namespaces are configured in your - `.unisonConfig` at the key - `RemoteMappings.` where - `` is the current - namespace. Remote mappings for - branches default to the branch that - you cloned from or pushed to - initially. Otherwise, it is pushed to - @/ - - where `remote` is a project or project branch, such as: - Project (defaults to the /main branch) `@unison/base` - Project Branch `@unison/base/feature` - Contributor Branch `@unison/base/@johnsmith/feature` - - push.create - The `push.create` command pushes a local namespace to an empty - remote namespace. - - `push.create remote local` pushes the contents of the local - namespace `local` into the empty - remote namespace `remote`. - `push.create remote` publishes the current namespace - into the empty remote namespace - `remote` - `push.create` publishes the current namespace - into the remote namespace - configured in your `.unisonConfig` - at the key - `RemoteMappings.` where - `` is the current - namespace, then publishes the - current namespace to that - location. - - where `remote` is a project or project branch, such as: - Project (defaults to the /main branch) `@unison/base` - Project Branch `@unison/base/feature` - Contributor Branch `@unison/base/@johnsmith/feature` - - quit (or exit, :q) - Exits the Unison command line interface. - - reflog (or reflog.branch, branch.reflog) - `reflog` lists all the changes that have affected the current branch. - `reflog /mybranch` lists all the changes that have affected /mybranch. - - reflog.global - `reflog.global` lists all recent changes across all projects and branches. - - release.draft (or draft.release) - Draft a release. - - reset - `reset #pvfd222s8n` reset the current namespace to the - hash `#pvfd222s8n` - `reset foo` reset the current namespace to the - state of the `foo` namespace. - `reset #pvfd222s8n /topic` reset the branch `topic` of the - current project to the causal - `#pvfd222s8n`. - - If you make a mistake using reset, consult the `reflog` - command and use another `reset` command to return to a - previous state. - - rewrite (or sfind.replace) - `rewrite rule1` rewrites definitions in the latest scratch file. - - The argument `rule1` must refer to a `@rewrite` block or a - function that immediately returns a `@rewrite` block. It can - be in the codebase or scratch file. An example: - - rule1 x = @rewrite term x + 1 ==> Nat.increment x - - Here, `x` will stand in for any expression wherever this - rewrite is applied, so this rule will match `(42+10+11) + 1` - and replace it with `Nat.increment (42+10+11)`. - - See https://unison-lang.org/learn/structured-find to learn more. - - Also see the related command `rewrite.find` - - rewrite.find (or sfind) - `rewrite.find rule1` finds definitions that match any of the - left side(s) of `rule` in the current namespace. - - The argument `rule1` must refer to a `@rewrite` block or a - function that immediately returns a `@rewrite` block. It can - be in the codebase or scratch file. An example: - - -- right of ==> is ignored by this command - rule1 x = @rewrite term x + 1 ==> () - - Here, `x` will stand in for any expression, so this rule will - match `(42+10+11) + 1`. - - See https://unison-lang.org/learn/structured-find to learn more. - - Also see the related command `rewrite` - - run - `run mymain args...` Runs `!mymain`, where `mymain` is - searched for in the most recent - typechecked file, or in the codebase. - Any provided arguments will be passed as - program arguments as though they were - provided at the command line when - running mymain as an executable. - - run.native - `run.native main args` Executes !main using native - compilation via scheme. - - switch - `switch` opens an interactive selector to pick a - project and branch - `switch foo/bar` switches to the branch `bar` in the project - `foo` - `switch foo/` switches to the last branch you visited in - the project `foo` - `switch /bar` switches to the branch `bar` in the current - project - - test - `test` runs unit tests for the current branch - `test foo` runs unit tests for the current branch defined in - namespace `foo` - - test.all - `test.all` runs unit tests for the current branch (including the `lib` namespace). - - text.find (or grep) - `text.find token1 "99" token2` finds terms with literals (text - or numeric) containing `token1`, `99`, and `token2`. - - Numeric literals must be quoted (ex: "42") but single words - need not be quoted. - - Use `text.find.all` to include search of `lib`. - - text.find.all (or grep.all) - `text.find.all token1 "99" token2` finds terms with literals - (text or numeric) containing `token1`, `99`, and `token2`. - - Numeric literals must be quoted (ex: "42") but single words - need not be quoted. - - Use `text.find` to exclude `lib` from search. - - todo - `todo` lists the current namespace's outstanding issues, - including conflicted names, dependencies with missing names, - and merge precondition violations. - - ui - `ui` opens the Local UI in the default browser. - - undo - `undo` reverts the most recent change to the codebase. - - update - Adds everything in the most recently typechecked file to the - namespace, replacing existing definitions having the same - name, and attempts to update all the existing dependents - accordingly. If the process can't be completed automatically, - the dependents will be added back to the scratch file for your - review. - - update.old - `update.old` works like `add`, except that if a definition in - the file has the same name as an existing definition, the name - gets updated to point to the new definition. If the old - definition has any dependents, `update` will add those - dependents to a refactoring session, specified by an optional - patch.`update.old` adds all definitions in - the .u file, noting replacements - in the default patch for the - current namespace. - `update.old ` adds all definitions in the .u - file, noting replacements in the - specified patch. - `update.old foo bar` adds `foo`, `bar`, and their - dependents from the .u file, - noting any replacements into the - specified patch. - - update.old.nopatch - `update.old.nopatch` works like `update.old`, except it - doesn't add a patch entry for any updates. Use this when you - want to make changes to definitions without pushing those - changes to dependents beyond your codebase. An example is when - updating docs, or when updating a term you just added.`update.old.nopatch` updates - all definitions in the .u file. - `update.old.nopatch foo bar` updates `foo`, `bar`, and their - dependents from the .u file. - - update.old.preview - `update.old.preview` previews updates to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. - - upgrade - `upgrade old new` upgrades library dependency `lib.old` to - `lib.new`, and, if successful, deletes `lib.old`. - - upgrade.commit (or commit.upgrade) - `upgrade.commit` merges a temporary branch created by the - `upgrade` command back into its parent branch, and removes the - temporary branch. - - For example, if you've done `upgrade foo bar` from main, then - `upgrade.commit` is equivalent to doing - - * switch /main - * merge /upgrade-foo-to-bar - * delete.branch /upgrade-foo-to-bar - - version - Print the version of unison you're running - - view - `view foo` shows definitions named `foo` within your current - namespace. - `view` without arguments invokes a search to select - definitions to view, which requires that `fzf` can be found - within your PATH. - - Supports glob syntax, where ? acts a wildcard, so - `view List.?` will show `List.map`, `List.filter`, etc, but - not `List.map.doc` (since ? only matches 1 name segment). - - view.global - `view.global foo` prints definitions of `foo` within your codebase. - `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. -scratch/main> help-topics - - 🌻 - - Here's a list of topics I can tell you more about: - - filestatus - messages.disallowedAbsolute - namespaces - projects - remotes - testcache - - Example: use `help-topics filestatus` to learn more about that topic. -scratch/main> help-topic filestatus - - 📓 - - Here's a list of possible status messages you might see for - definitions in a .u file. - - needs update A definition with the same name as an - existing definition. Doing `update` - instead of `add` will turn this failure - into a successful update. - - term/ctor collision A definition with the same name as an - existing constructor for some data type. - Rename your definition or the data type - before trying again to `add` or `update`. - - ctor/term collision A type defined in the file has a - constructor that's named the same as an - existing term. Rename that term or your - constructor before trying again to `add` - or `update`. - - blocked This definition was blocked because it - dependended on a definition with a failed - status. - - extra dependency This definition was added because it was - a dependency of a definition explicitly - selected. -scratch/main> help-topic messages.disallowedAbsolute - - 🤖 - - Although I can understand absolute (ex: .foo.bar) or relative - (ex: util.math.sqrt) references to existing definitions - (help namespaces to learn more), I can't yet handle giving new - definitions with absolute names in a .u file. - - As a workaround, you can give definitions with a relative name - temporarily (like `exports.blah.foo`) and then use `move.*`. -scratch/main> help-topic namespaces - - 🧐 - - There are two kinds of namespaces, absolute, such as (.foo.bar - or .base.math.+) and relative, such as (math.sqrt or - util.List.++). - - Relative names are converted to absolute names by prepending - the current namespace. For example, if your Unison prompt - reads: - - .foo.bar> - - and your .u file looks like: - - x = 41 - - then doing an add will create the definition with the absolute - name .foo.bar.x = 41 - - and you can refer to x by its absolute name .foo.bar.x - elsewhere in your code. For instance: - - answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 -scratch/main> help-topic projects - - A project is a versioned collection of code that can be - edited, published, and depended on other projects. Unison - projects are analogous to Git repositories. - - project.create create a new project - projects list all your projects - branch create a new workstream - branches list all your branches - merge merge one branch into another - switch switch to a project or branch - push upload your changes to Unison Share - pull download code(/changes/updates) from Unison Share - clone download a Unison Share project or branch for contribution - - Tip: Use `help project.create` to learn more. - - For full documentation, see - https://unison-lang.org/learn/projects -scratch/main> help-topic remotes - - 🤖 - - Local projects may be associated with at most one remote - project on Unison Share. When this relationship is - established, it becomes the default argument for a number of - share commands. For example, running `push` or `pull` in a - project with no arguments will push to or pull from the - associated remote, if it exists. - - This association is created automatically on when a project is - created by `clone`. If the project was created locally then - the relationship will be established on the first `push`. -scratch/main> help-topic testcache - - 🎈 - - Unison caches the results of test> watch expressions. Since - these expressions are pure and always yield the same result - when evaluated, there's no need to run them more than once! - - A test is rerun only if it has changed, or if one of the - definitions it depends on has changed. -``` - -We should add a command to show help for hidden commands also. diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md deleted file mode 100644 index cedbd148dc..0000000000 --- a/unison-src/transcripts/higher-rank.output.md +++ /dev/null @@ -1,157 +0,0 @@ -This transcript does some testing of higher-rank types. Regression tests related to higher-rank types can be added here. - -``` ucm :hide -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: - -``` unison -f : (forall a . a -> a) -> (Nat, Text) -f id = (id 1, id "hi") - -> f (x -> x) -``` - -``` ucm :added-by-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`: - - f : (∀ a. a ->{g} a) ->{g} (Nat, Text) - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 4 | > f (x -> x) - ⧩ - (1, "hi") -``` - -Another example, involving abilities. Here the ability-polymorphic function is instantiated with two different ability lists, `{}` and `{IO}`: - -``` unison -f : (forall a g . '{g} a -> '{g} a) -> () -> () -f id _ = - _ = (id ('1 : '{} Nat), id ('("hi") : '{IO} Text)) - () -``` - -``` ucm :added-by-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`: - - f : (∀ a g. '{g} a ->{h} '{g} a) -> '{h} () -``` - -Here's an example, showing that polymorphic functions can be fields of a constructor, and the functions remain polymorphic even when the field is bound to a name during pattern matching: - -``` unison -unique type Functor f = Functor (forall a b . (a -> b) -> f a -> f b) - -Functor.map : Functor f -> (forall a b . (a -> b) -> f a -> f b) -Functor.map = cases Functor f -> f - -Functor.blah : Functor f -> () -Functor.blah = cases Functor f -> - g : forall a b . (a -> b) -> f a -> f b - g = f - () -``` - -``` ucm :added-by-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 Functor f - Functor.blah : Functor f -> () - Functor.map : Functor f - -> (∀ a b. (a -> b) -> f a -> f b) -``` - -This example is similar, but involves abilities: - -``` unison -unique ability Remote t where doRemoteStuff : t () -unique type Loc = Loc (forall t a . '{Remote t} a ->{Remote t} t a) - -Loc.blah : Loc -> () -Loc.blah = cases Loc f -> - f0 : '{Remote tx} ax ->{Remote tx} tx ax - f0 = f - () - --- In this case, no annotation is needed since the lambda --- is checked against a polymorphic type -Loc.transform : (forall t a . '{Remote t} a -> '{Remote t} a) - -> Loc -> Loc -Loc.transform nt = cases Loc f -> Loc (a -> f (nt a)) - --- In this case, the annotation is needed since f' is inferred --- on its own it won't infer the higher-rank type -Loc.transform2 : (forall t a . '{Remote t} a -> '{Remote t} a) - -> Loc -> Loc -Loc.transform2 nt = cases Loc f -> - f' : forall t a . '{Remote t} a ->{Remote t} t a - f' a = f (nt a) - Loc f' -``` - -``` ucm :added-by-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 Loc - ability Remote t - Loc.blah : Loc -> () - Loc.transform : (∀ t a. '{Remote t} a -> '{Remote t} a) - -> Loc - -> Loc - Loc.transform2 : (∀ t a. '{Remote t} a -> '{Remote t} a) - -> Loc - -> Loc -``` - -## Types with polymorphic fields - -``` unison :hide -structural type HigherRanked = HigherRanked (forall a. a -> a) -``` - -We should be able to add and view records with higher-rank fields. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type HigherRanked -scratch/main> view HigherRanked - - structural type HigherRanked = HigherRanked (∀ a. a -> a) -``` diff --git a/unison-src/transcripts/abilities.md b/unison-src/transcripts/idempotent/abilities.md similarity index 100% rename from unison-src/transcripts/abilities.md rename to unison-src/transcripts/idempotent/abilities.md diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md similarity index 100% rename from unison-src/transcripts/ability-order-doesnt-affect-hash.md rename to unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.md b/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md similarity index 100% rename from unison-src/transcripts/ability-term-conflicts-on-update.md rename to unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md diff --git a/unison-src/transcripts/add-run.md b/unison-src/transcripts/idempotent/add-run.md similarity index 100% rename from unison-src/transcripts/add-run.md rename to unison-src/transcripts/idempotent/add-run.md diff --git a/unison-src/transcripts/add-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md similarity index 100% rename from unison-src/transcripts/add-test-watch-roundtrip.md rename to unison-src/transcripts/idempotent/add-test-watch-roundtrip.md diff --git a/unison-src/transcripts/addupdatemessages.md b/unison-src/transcripts/idempotent/addupdatemessages.md similarity index 100% rename from unison-src/transcripts/addupdatemessages.md rename to unison-src/transcripts/idempotent/addupdatemessages.md diff --git a/unison-src/transcripts/alias-term.md b/unison-src/transcripts/idempotent/alias-term.md similarity index 100% rename from unison-src/transcripts/alias-term.md rename to unison-src/transcripts/idempotent/alias-term.md diff --git a/unison-src/transcripts/alias-type.md b/unison-src/transcripts/idempotent/alias-type.md similarity index 100% rename from unison-src/transcripts/alias-type.md rename to unison-src/transcripts/idempotent/alias-type.md diff --git a/unison-src/transcripts/anf-tests.md b/unison-src/transcripts/idempotent/anf-tests.md similarity index 100% rename from unison-src/transcripts/anf-tests.md rename to unison-src/transcripts/idempotent/anf-tests.md diff --git a/unison-src/transcripts/any-extract.md b/unison-src/transcripts/idempotent/any-extract.md similarity index 100% rename from unison-src/transcripts/any-extract.md rename to unison-src/transcripts/idempotent/any-extract.md diff --git a/unison-src/transcripts/api-doc-rendering.md b/unison-src/transcripts/idempotent/api-doc-rendering.md similarity index 100% rename from unison-src/transcripts/api-doc-rendering.md rename to unison-src/transcripts/idempotent/api-doc-rendering.md diff --git a/unison-src/transcripts/api-find.md b/unison-src/transcripts/idempotent/api-find.md similarity index 100% rename from unison-src/transcripts/api-find.md rename to unison-src/transcripts/idempotent/api-find.md diff --git a/unison-src/transcripts/api-getDefinition.md b/unison-src/transcripts/idempotent/api-getDefinition.md similarity index 100% rename from unison-src/transcripts/api-getDefinition.md rename to unison-src/transcripts/idempotent/api-getDefinition.md diff --git a/unison-src/transcripts/api-list-projects-branches.md b/unison-src/transcripts/idempotent/api-list-projects-branches.md similarity index 100% rename from unison-src/transcripts/api-list-projects-branches.md rename to unison-src/transcripts/idempotent/api-list-projects-branches.md diff --git a/unison-src/transcripts/api-namespace-details.md b/unison-src/transcripts/idempotent/api-namespace-details.md similarity index 100% rename from unison-src/transcripts/api-namespace-details.md rename to unison-src/transcripts/idempotent/api-namespace-details.md diff --git a/unison-src/transcripts/api-namespace-list.md b/unison-src/transcripts/idempotent/api-namespace-list.md similarity index 100% rename from unison-src/transcripts/api-namespace-list.md rename to unison-src/transcripts/idempotent/api-namespace-list.md diff --git a/unison-src/transcripts/api-summaries.md b/unison-src/transcripts/idempotent/api-summaries.md similarity index 100% rename from unison-src/transcripts/api-summaries.md rename to unison-src/transcripts/idempotent/api-summaries.md diff --git a/unison-src/transcripts/block-on-required-update.md b/unison-src/transcripts/idempotent/block-on-required-update.md similarity index 100% rename from unison-src/transcripts/block-on-required-update.md rename to unison-src/transcripts/idempotent/block-on-required-update.md diff --git a/unison-src/transcripts/blocks.md b/unison-src/transcripts/idempotent/blocks.md similarity index 100% rename from unison-src/transcripts/blocks.md rename to unison-src/transcripts/idempotent/blocks.md diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.md b/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md similarity index 100% rename from unison-src/transcripts/boolean-op-pretty-print-2819.md rename to unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md diff --git a/unison-src/transcripts/branch-command.md b/unison-src/transcripts/idempotent/branch-command.md similarity index 100% rename from unison-src/transcripts/branch-command.md rename to unison-src/transcripts/idempotent/branch-command.md diff --git a/unison-src/transcripts/branch-relative-path.md b/unison-src/transcripts/idempotent/branch-relative-path.md similarity index 100% rename from unison-src/transcripts/branch-relative-path.md rename to unison-src/transcripts/idempotent/branch-relative-path.md diff --git a/unison-src/transcripts/bug-fix-4354.md b/unison-src/transcripts/idempotent/bug-fix-4354.md similarity index 100% rename from unison-src/transcripts/bug-fix-4354.md rename to unison-src/transcripts/idempotent/bug-fix-4354.md diff --git a/unison-src/transcripts/bug-strange-closure.md b/unison-src/transcripts/idempotent/bug-strange-closure.md similarity index 100% rename from unison-src/transcripts/bug-strange-closure.md rename to unison-src/transcripts/idempotent/bug-strange-closure.md diff --git a/unison-src/transcripts/builtins-merge.md b/unison-src/transcripts/idempotent/builtins-merge.md similarity index 100% rename from unison-src/transcripts/builtins-merge.md rename to unison-src/transcripts/idempotent/builtins-merge.md diff --git a/unison-src/transcripts/builtins.md b/unison-src/transcripts/idempotent/builtins.md similarity index 100% rename from unison-src/transcripts/builtins.md rename to unison-src/transcripts/idempotent/builtins.md diff --git a/unison-src/transcripts/bytesFromList.md b/unison-src/transcripts/idempotent/bytesFromList.md similarity index 100% rename from unison-src/transcripts/bytesFromList.md rename to unison-src/transcripts/idempotent/bytesFromList.md diff --git a/unison-src/transcripts/check763.md b/unison-src/transcripts/idempotent/check763.md similarity index 100% rename from unison-src/transcripts/check763.md rename to unison-src/transcripts/idempotent/check763.md diff --git a/unison-src/transcripts/check873.md b/unison-src/transcripts/idempotent/check873.md similarity index 100% rename from unison-src/transcripts/check873.md rename to unison-src/transcripts/idempotent/check873.md diff --git a/unison-src/transcripts/constructor-applied-to-unit.md b/unison-src/transcripts/idempotent/constructor-applied-to-unit.md similarity index 100% rename from unison-src/transcripts/constructor-applied-to-unit.md rename to unison-src/transcripts/idempotent/constructor-applied-to-unit.md diff --git a/unison-src/transcripts/contrabilities.md b/unison-src/transcripts/idempotent/contrabilities.md similarity index 100% rename from unison-src/transcripts/contrabilities.md rename to unison-src/transcripts/idempotent/contrabilities.md diff --git a/unison-src/transcripts/create-author.md b/unison-src/transcripts/idempotent/create-author.md similarity index 100% rename from unison-src/transcripts/create-author.md rename to unison-src/transcripts/idempotent/create-author.md diff --git a/unison-src/transcripts/cycle-update-1.md b/unison-src/transcripts/idempotent/cycle-update-1.md similarity index 100% rename from unison-src/transcripts/cycle-update-1.md rename to unison-src/transcripts/idempotent/cycle-update-1.md diff --git a/unison-src/transcripts/cycle-update-2.md b/unison-src/transcripts/idempotent/cycle-update-2.md similarity index 100% rename from unison-src/transcripts/cycle-update-2.md rename to unison-src/transcripts/idempotent/cycle-update-2.md diff --git a/unison-src/transcripts/cycle-update-3.md b/unison-src/transcripts/idempotent/cycle-update-3.md similarity index 100% rename from unison-src/transcripts/cycle-update-3.md rename to unison-src/transcripts/idempotent/cycle-update-3.md diff --git a/unison-src/transcripts/cycle-update-4.md b/unison-src/transcripts/idempotent/cycle-update-4.md similarity index 100% rename from unison-src/transcripts/cycle-update-4.md rename to unison-src/transcripts/idempotent/cycle-update-4.md diff --git a/unison-src/transcripts/debug-definitions.md b/unison-src/transcripts/idempotent/debug-definitions.md similarity index 100% rename from unison-src/transcripts/debug-definitions.md rename to unison-src/transcripts/idempotent/debug-definitions.md diff --git a/unison-src/transcripts/debug-name-diffs.md b/unison-src/transcripts/idempotent/debug-name-diffs.md similarity index 100% rename from unison-src/transcripts/debug-name-diffs.md rename to unison-src/transcripts/idempotent/debug-name-diffs.md diff --git a/unison-src/transcripts/deep-names.md b/unison-src/transcripts/idempotent/deep-names.md similarity index 100% rename from unison-src/transcripts/deep-names.md rename to unison-src/transcripts/idempotent/deep-names.md diff --git a/unison-src/transcripts/definition-diff-api.md b/unison-src/transcripts/idempotent/definition-diff-api.md similarity index 100% rename from unison-src/transcripts/definition-diff-api.md rename to unison-src/transcripts/idempotent/definition-diff-api.md diff --git a/unison-src/transcripts/delete-namespace-dependents-check.md b/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md similarity index 100% rename from unison-src/transcripts/delete-namespace-dependents-check.md rename to unison-src/transcripts/idempotent/delete-namespace-dependents-check.md diff --git a/unison-src/transcripts/delete-namespace.md b/unison-src/transcripts/idempotent/delete-namespace.md similarity index 100% rename from unison-src/transcripts/delete-namespace.md rename to unison-src/transcripts/idempotent/delete-namespace.md diff --git a/unison-src/transcripts/delete-project-branch.md b/unison-src/transcripts/idempotent/delete-project-branch.md similarity index 100% rename from unison-src/transcripts/delete-project-branch.md rename to unison-src/transcripts/idempotent/delete-project-branch.md diff --git a/unison-src/transcripts/delete-project.md b/unison-src/transcripts/idempotent/delete-project.md similarity index 100% rename from unison-src/transcripts/delete-project.md rename to unison-src/transcripts/idempotent/delete-project.md diff --git a/unison-src/transcripts/delete-silent.md b/unison-src/transcripts/idempotent/delete-silent.md similarity index 100% rename from unison-src/transcripts/delete-silent.md rename to unison-src/transcripts/idempotent/delete-silent.md diff --git a/unison-src/transcripts/delete.md b/unison-src/transcripts/idempotent/delete.md similarity index 100% rename from unison-src/transcripts/delete.md rename to unison-src/transcripts/idempotent/delete.md diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.md b/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md similarity index 100% rename from unison-src/transcripts/dependents-dependencies-debugfile.md rename to unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md diff --git a/unison-src/transcripts/destructuring-binds.md b/unison-src/transcripts/idempotent/destructuring-binds.md similarity index 100% rename from unison-src/transcripts/destructuring-binds.md rename to unison-src/transcripts/idempotent/destructuring-binds.md diff --git a/unison-src/transcripts/diff-namespace.md b/unison-src/transcripts/idempotent/diff-namespace.md similarity index 100% rename from unison-src/transcripts/diff-namespace.md rename to unison-src/transcripts/idempotent/diff-namespace.md diff --git a/unison-src/transcripts/doc-formatting.md b/unison-src/transcripts/idempotent/doc-formatting.md similarity index 100% rename from unison-src/transcripts/doc-formatting.md rename to unison-src/transcripts/idempotent/doc-formatting.md diff --git a/unison-src/transcripts/doc-type-link-keywords.md b/unison-src/transcripts/idempotent/doc-type-link-keywords.md similarity index 100% rename from unison-src/transcripts/doc-type-link-keywords.md rename to unison-src/transcripts/idempotent/doc-type-link-keywords.md diff --git a/unison-src/transcripts/doc1.md b/unison-src/transcripts/idempotent/doc1.md similarity index 100% rename from unison-src/transcripts/doc1.md rename to unison-src/transcripts/idempotent/doc1.md diff --git a/unison-src/transcripts/doc2.md b/unison-src/transcripts/idempotent/doc2.md similarity index 100% rename from unison-src/transcripts/doc2.md rename to unison-src/transcripts/idempotent/doc2.md diff --git a/unison-src/transcripts/doc2markdown.md b/unison-src/transcripts/idempotent/doc2markdown.md similarity index 100% rename from unison-src/transcripts/doc2markdown.md rename to unison-src/transcripts/idempotent/doc2markdown.md diff --git a/unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.md b/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md similarity index 100% rename from unison-src/transcripts/dont-upgrade-refs-that-exist-in-old.md rename to unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md diff --git a/unison-src/transcripts/duplicate-names.md b/unison-src/transcripts/idempotent/duplicate-names.md similarity index 100% rename from unison-src/transcripts/duplicate-names.md rename to unison-src/transcripts/idempotent/duplicate-names.md diff --git a/unison-src/transcripts/duplicate-term-detection.md b/unison-src/transcripts/idempotent/duplicate-term-detection.md similarity index 100% rename from unison-src/transcripts/duplicate-term-detection.md rename to unison-src/transcripts/idempotent/duplicate-term-detection.md diff --git a/unison-src/transcripts/ed25519.md b/unison-src/transcripts/idempotent/ed25519.md similarity index 100% rename from unison-src/transcripts/ed25519.md rename to unison-src/transcripts/idempotent/ed25519.md diff --git a/unison-src/transcripts/edit-command.md b/unison-src/transcripts/idempotent/edit-command.md similarity index 100% rename from unison-src/transcripts/edit-command.md rename to unison-src/transcripts/idempotent/edit-command.md diff --git a/unison-src/transcripts/edit-namespace.md b/unison-src/transcripts/idempotent/edit-namespace.md similarity index 100% rename from unison-src/transcripts/edit-namespace.md rename to unison-src/transcripts/idempotent/edit-namespace.md diff --git a/unison-src/transcripts/empty-namespaces.md b/unison-src/transcripts/idempotent/empty-namespaces.md similarity index 100% rename from unison-src/transcripts/empty-namespaces.md rename to unison-src/transcripts/idempotent/empty-namespaces.md diff --git a/unison-src/transcripts/emptyCodebase.md b/unison-src/transcripts/idempotent/emptyCodebase.md similarity index 100% rename from unison-src/transcripts/emptyCodebase.md rename to unison-src/transcripts/idempotent/emptyCodebase.md diff --git a/unison-src/transcripts/error-messages.md b/unison-src/transcripts/idempotent/error-messages.md similarity index 100% rename from unison-src/transcripts/error-messages.md rename to unison-src/transcripts/idempotent/error-messages.md diff --git a/unison-src/transcripts/escape-sequences.md b/unison-src/transcripts/idempotent/escape-sequences.md similarity index 100% rename from unison-src/transcripts/escape-sequences.md rename to unison-src/transcripts/idempotent/escape-sequences.md diff --git a/unison-src/transcripts/find-by-type.md b/unison-src/transcripts/idempotent/find-by-type.md similarity index 100% rename from unison-src/transcripts/find-by-type.md rename to unison-src/transcripts/idempotent/find-by-type.md diff --git a/unison-src/transcripts/find-command.md b/unison-src/transcripts/idempotent/find-command.md similarity index 100% rename from unison-src/transcripts/find-command.md rename to unison-src/transcripts/idempotent/find-command.md diff --git a/unison-src/transcripts/fix-1381-excess-propagate.md b/unison-src/transcripts/idempotent/fix-1381-excess-propagate.md similarity index 100% rename from unison-src/transcripts/fix-1381-excess-propagate.md rename to unison-src/transcripts/idempotent/fix-1381-excess-propagate.md diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.md b/unison-src/transcripts/idempotent/fix-2258-if-as-list-element.md similarity index 100% rename from unison-src/transcripts/fix-2258-if-as-list-element.md rename to unison-src/transcripts/idempotent/fix-2258-if-as-list-element.md diff --git a/unison-src/transcripts/fix-5267.md b/unison-src/transcripts/idempotent/fix-5267.md similarity index 100% rename from unison-src/transcripts/fix-5267.md rename to unison-src/transcripts/idempotent/fix-5267.md diff --git a/unison-src/transcripts/fix-5301.md b/unison-src/transcripts/idempotent/fix-5301.md similarity index 100% rename from unison-src/transcripts/fix-5301.md rename to unison-src/transcripts/idempotent/fix-5301.md diff --git a/unison-src/transcripts/fix-5312.md b/unison-src/transcripts/idempotent/fix-5312.md similarity index 100% rename from unison-src/transcripts/fix-5312.md rename to unison-src/transcripts/idempotent/fix-5312.md diff --git a/unison-src/transcripts/fix-5320.md b/unison-src/transcripts/idempotent/fix-5320.md similarity index 100% rename from unison-src/transcripts/fix-5320.md rename to unison-src/transcripts/idempotent/fix-5320.md diff --git a/unison-src/transcripts/fix-5323.md b/unison-src/transcripts/idempotent/fix-5323.md similarity index 100% rename from unison-src/transcripts/fix-5323.md rename to unison-src/transcripts/idempotent/fix-5323.md diff --git a/unison-src/transcripts/fix-5326.md b/unison-src/transcripts/idempotent/fix-5326.md similarity index 100% rename from unison-src/transcripts/fix-5326.md rename to unison-src/transcripts/idempotent/fix-5326.md diff --git a/unison-src/transcripts/fix-5340.md b/unison-src/transcripts/idempotent/fix-5340.md similarity index 100% rename from unison-src/transcripts/fix-5340.md rename to unison-src/transcripts/idempotent/fix-5340.md diff --git a/unison-src/transcripts/fix-5357.md b/unison-src/transcripts/idempotent/fix-5357.md similarity index 100% rename from unison-src/transcripts/fix-5357.md rename to unison-src/transcripts/idempotent/fix-5357.md diff --git a/unison-src/transcripts/fix-5369.md b/unison-src/transcripts/idempotent/fix-5369.md similarity index 100% rename from unison-src/transcripts/fix-5369.md rename to unison-src/transcripts/idempotent/fix-5369.md diff --git a/unison-src/transcripts/fix-5374.md b/unison-src/transcripts/idempotent/fix-5374.md similarity index 100% rename from unison-src/transcripts/fix-5374.md rename to unison-src/transcripts/idempotent/fix-5374.md diff --git a/unison-src/transcripts/fix-5380.md b/unison-src/transcripts/idempotent/fix-5380.md similarity index 100% rename from unison-src/transcripts/fix-5380.md rename to unison-src/transcripts/idempotent/fix-5380.md diff --git a/unison-src/transcripts/fix-big-list-crash.md b/unison-src/transcripts/idempotent/fix-big-list-crash.md similarity index 100% rename from unison-src/transcripts/fix-big-list-crash.md rename to unison-src/transcripts/idempotent/fix-big-list-crash.md diff --git a/unison-src/transcripts/fix-ls.md b/unison-src/transcripts/idempotent/fix-ls.md similarity index 100% rename from unison-src/transcripts/fix-ls.md rename to unison-src/transcripts/idempotent/fix-ls.md diff --git a/unison-src/transcripts/fix1063.md b/unison-src/transcripts/idempotent/fix1063.md similarity index 100% rename from unison-src/transcripts/fix1063.md rename to unison-src/transcripts/idempotent/fix1063.md diff --git a/unison-src/transcripts/fix1327.md b/unison-src/transcripts/idempotent/fix1327.md similarity index 100% rename from unison-src/transcripts/fix1327.md rename to unison-src/transcripts/idempotent/fix1327.md diff --git a/unison-src/transcripts/fix1334.md b/unison-src/transcripts/idempotent/fix1334.md similarity index 100% rename from unison-src/transcripts/fix1334.md rename to unison-src/transcripts/idempotent/fix1334.md diff --git a/unison-src/transcripts/fix1390.md b/unison-src/transcripts/idempotent/fix1390.md similarity index 100% rename from unison-src/transcripts/fix1390.md rename to unison-src/transcripts/idempotent/fix1390.md diff --git a/unison-src/transcripts/fix1421.md b/unison-src/transcripts/idempotent/fix1421.md similarity index 100% rename from unison-src/transcripts/fix1421.md rename to unison-src/transcripts/idempotent/fix1421.md diff --git a/unison-src/transcripts/fix1532.md b/unison-src/transcripts/idempotent/fix1532.md similarity index 100% rename from unison-src/transcripts/fix1532.md rename to unison-src/transcripts/idempotent/fix1532.md diff --git a/unison-src/transcripts/fix1696.md b/unison-src/transcripts/idempotent/fix1696.md similarity index 100% rename from unison-src/transcripts/fix1696.md rename to unison-src/transcripts/idempotent/fix1696.md diff --git a/unison-src/transcripts/fix1709.md b/unison-src/transcripts/idempotent/fix1709.md similarity index 100% rename from unison-src/transcripts/fix1709.md rename to unison-src/transcripts/idempotent/fix1709.md diff --git a/unison-src/transcripts/fix1731.md b/unison-src/transcripts/idempotent/fix1731.md similarity index 100% rename from unison-src/transcripts/fix1731.md rename to unison-src/transcripts/idempotent/fix1731.md diff --git a/unison-src/transcripts/fix1800.md b/unison-src/transcripts/idempotent/fix1800.md similarity index 100% rename from unison-src/transcripts/fix1800.md rename to unison-src/transcripts/idempotent/fix1800.md diff --git a/unison-src/transcripts/fix1844.md b/unison-src/transcripts/idempotent/fix1844.md similarity index 100% rename from unison-src/transcripts/fix1844.md rename to unison-src/transcripts/idempotent/fix1844.md diff --git a/unison-src/transcripts/fix1926.md b/unison-src/transcripts/idempotent/fix1926.md similarity index 100% rename from unison-src/transcripts/fix1926.md rename to unison-src/transcripts/idempotent/fix1926.md diff --git a/unison-src/transcripts/fix2026.md b/unison-src/transcripts/idempotent/fix2026.md similarity index 100% rename from unison-src/transcripts/fix2026.md rename to unison-src/transcripts/idempotent/fix2026.md diff --git a/unison-src/transcripts/fix2027.md b/unison-src/transcripts/idempotent/fix2027.md similarity index 100% rename from unison-src/transcripts/fix2027.md rename to unison-src/transcripts/idempotent/fix2027.md diff --git a/unison-src/transcripts/fix2049.md b/unison-src/transcripts/idempotent/fix2049.md similarity index 100% rename from unison-src/transcripts/fix2049.md rename to unison-src/transcripts/idempotent/fix2049.md diff --git a/unison-src/transcripts/fix2053.md b/unison-src/transcripts/idempotent/fix2053.md similarity index 100% rename from unison-src/transcripts/fix2053.md rename to unison-src/transcripts/idempotent/fix2053.md diff --git a/unison-src/transcripts/fix2156.md b/unison-src/transcripts/idempotent/fix2156.md similarity index 100% rename from unison-src/transcripts/fix2156.md rename to unison-src/transcripts/idempotent/fix2156.md diff --git a/unison-src/transcripts/fix2167.md b/unison-src/transcripts/idempotent/fix2167.md similarity index 100% rename from unison-src/transcripts/fix2167.md rename to unison-src/transcripts/idempotent/fix2167.md diff --git a/unison-src/transcripts/fix2187.md b/unison-src/transcripts/idempotent/fix2187.md similarity index 100% rename from unison-src/transcripts/fix2187.md rename to unison-src/transcripts/idempotent/fix2187.md diff --git a/unison-src/transcripts/fix2231.md b/unison-src/transcripts/idempotent/fix2231.md similarity index 100% rename from unison-src/transcripts/fix2231.md rename to unison-src/transcripts/idempotent/fix2231.md diff --git a/unison-src/transcripts/fix2238.md b/unison-src/transcripts/idempotent/fix2238.md similarity index 100% rename from unison-src/transcripts/fix2238.md rename to unison-src/transcripts/idempotent/fix2238.md diff --git a/unison-src/transcripts/fix2238.u b/unison-src/transcripts/idempotent/fix2238.u similarity index 100% rename from unison-src/transcripts/fix2238.u rename to unison-src/transcripts/idempotent/fix2238.u diff --git a/unison-src/transcripts/fix2244.md b/unison-src/transcripts/idempotent/fix2244.md similarity index 100% rename from unison-src/transcripts/fix2244.md rename to unison-src/transcripts/idempotent/fix2244.md diff --git a/unison-src/transcripts/fix2244.u b/unison-src/transcripts/idempotent/fix2244.u similarity index 100% rename from unison-src/transcripts/fix2244.u rename to unison-src/transcripts/idempotent/fix2244.u diff --git a/unison-src/transcripts/fix2254.md b/unison-src/transcripts/idempotent/fix2254.md similarity index 100% rename from unison-src/transcripts/fix2254.md rename to unison-src/transcripts/idempotent/fix2254.md diff --git a/unison-src/transcripts/fix2268.md b/unison-src/transcripts/idempotent/fix2268.md similarity index 100% rename from unison-src/transcripts/fix2268.md rename to unison-src/transcripts/idempotent/fix2268.md diff --git a/unison-src/transcripts/fix2334.md b/unison-src/transcripts/idempotent/fix2334.md similarity index 100% rename from unison-src/transcripts/fix2334.md rename to unison-src/transcripts/idempotent/fix2334.md diff --git a/unison-src/transcripts/fix2344.md b/unison-src/transcripts/idempotent/fix2344.md similarity index 100% rename from unison-src/transcripts/fix2344.md rename to unison-src/transcripts/idempotent/fix2344.md diff --git a/unison-src/transcripts/fix2350.md b/unison-src/transcripts/idempotent/fix2350.md similarity index 100% rename from unison-src/transcripts/fix2350.md rename to unison-src/transcripts/idempotent/fix2350.md diff --git a/unison-src/transcripts/fix2353.md b/unison-src/transcripts/idempotent/fix2353.md similarity index 100% rename from unison-src/transcripts/fix2353.md rename to unison-src/transcripts/idempotent/fix2353.md diff --git a/unison-src/transcripts/fix2354.md b/unison-src/transcripts/idempotent/fix2354.md similarity index 100% rename from unison-src/transcripts/fix2354.md rename to unison-src/transcripts/idempotent/fix2354.md diff --git a/unison-src/transcripts/fix2355.md b/unison-src/transcripts/idempotent/fix2355.md similarity index 100% rename from unison-src/transcripts/fix2355.md rename to unison-src/transcripts/idempotent/fix2355.md diff --git a/unison-src/transcripts/fix2378.md b/unison-src/transcripts/idempotent/fix2378.md similarity index 100% rename from unison-src/transcripts/fix2378.md rename to unison-src/transcripts/idempotent/fix2378.md diff --git a/unison-src/transcripts/fix2423.md b/unison-src/transcripts/idempotent/fix2423.md similarity index 100% rename from unison-src/transcripts/fix2423.md rename to unison-src/transcripts/idempotent/fix2423.md diff --git a/unison-src/transcripts/fix2474.md b/unison-src/transcripts/idempotent/fix2474.md similarity index 100% rename from unison-src/transcripts/fix2474.md rename to unison-src/transcripts/idempotent/fix2474.md diff --git a/unison-src/transcripts/fix2628.md b/unison-src/transcripts/idempotent/fix2628.md similarity index 100% rename from unison-src/transcripts/fix2628.md rename to unison-src/transcripts/idempotent/fix2628.md diff --git a/unison-src/transcripts/fix2663.md b/unison-src/transcripts/idempotent/fix2663.md similarity index 100% rename from unison-src/transcripts/fix2663.md rename to unison-src/transcripts/idempotent/fix2663.md diff --git a/unison-src/transcripts/fix2693.md b/unison-src/transcripts/idempotent/fix2693.md similarity index 100% rename from unison-src/transcripts/fix2693.md rename to unison-src/transcripts/idempotent/fix2693.md diff --git a/unison-src/transcripts/fix2712.md b/unison-src/transcripts/idempotent/fix2712.md similarity index 100% rename from unison-src/transcripts/fix2712.md rename to unison-src/transcripts/idempotent/fix2712.md diff --git a/unison-src/transcripts/fix2795.md b/unison-src/transcripts/idempotent/fix2795.md similarity index 100% rename from unison-src/transcripts/fix2795.md rename to unison-src/transcripts/idempotent/fix2795.md diff --git a/unison-src/transcripts/fix2795/docs.u b/unison-src/transcripts/idempotent/fix2795/docs.u similarity index 100% rename from unison-src/transcripts/fix2795/docs.u rename to unison-src/transcripts/idempotent/fix2795/docs.u diff --git a/unison-src/transcripts/fix2822.md b/unison-src/transcripts/idempotent/fix2822.md similarity index 100% rename from unison-src/transcripts/fix2822.md rename to unison-src/transcripts/idempotent/fix2822.md diff --git a/unison-src/transcripts/fix2826.md b/unison-src/transcripts/idempotent/fix2826.md similarity index 100% rename from unison-src/transcripts/fix2826.md rename to unison-src/transcripts/idempotent/fix2826.md diff --git a/unison-src/transcripts/fix2970.md b/unison-src/transcripts/idempotent/fix2970.md similarity index 100% rename from unison-src/transcripts/fix2970.md rename to unison-src/transcripts/idempotent/fix2970.md diff --git a/unison-src/transcripts/fix3037.md b/unison-src/transcripts/idempotent/fix3037.md similarity index 100% rename from unison-src/transcripts/fix3037.md rename to unison-src/transcripts/idempotent/fix3037.md diff --git a/unison-src/transcripts/fix3171.md b/unison-src/transcripts/idempotent/fix3171.md similarity index 100% rename from unison-src/transcripts/fix3171.md rename to unison-src/transcripts/idempotent/fix3171.md diff --git a/unison-src/transcripts/fix3196.md b/unison-src/transcripts/idempotent/fix3196.md similarity index 100% rename from unison-src/transcripts/fix3196.md rename to unison-src/transcripts/idempotent/fix3196.md diff --git a/unison-src/transcripts/fix3215.md b/unison-src/transcripts/idempotent/fix3215.md similarity index 100% rename from unison-src/transcripts/fix3215.md rename to unison-src/transcripts/idempotent/fix3215.md diff --git a/unison-src/transcripts/fix3244.md b/unison-src/transcripts/idempotent/fix3244.md similarity index 100% rename from unison-src/transcripts/fix3244.md rename to unison-src/transcripts/idempotent/fix3244.md diff --git a/unison-src/transcripts/fix3265.md b/unison-src/transcripts/idempotent/fix3265.md similarity index 100% rename from unison-src/transcripts/fix3265.md rename to unison-src/transcripts/idempotent/fix3265.md diff --git a/unison-src/transcripts/fix3424.md b/unison-src/transcripts/idempotent/fix3424.md similarity index 100% rename from unison-src/transcripts/fix3424.md rename to unison-src/transcripts/idempotent/fix3424.md diff --git a/unison-src/transcripts/fix3634.md b/unison-src/transcripts/idempotent/fix3634.md similarity index 100% rename from unison-src/transcripts/fix3634.md rename to unison-src/transcripts/idempotent/fix3634.md diff --git a/unison-src/transcripts/fix3678.md b/unison-src/transcripts/idempotent/fix3678.md similarity index 100% rename from unison-src/transcripts/fix3678.md rename to unison-src/transcripts/idempotent/fix3678.md diff --git a/unison-src/transcripts/fix3752.md b/unison-src/transcripts/idempotent/fix3752.md similarity index 100% rename from unison-src/transcripts/fix3752.md rename to unison-src/transcripts/idempotent/fix3752.md diff --git a/unison-src/transcripts/fix3773.md b/unison-src/transcripts/idempotent/fix3773.md similarity index 100% rename from unison-src/transcripts/fix3773.md rename to unison-src/transcripts/idempotent/fix3773.md diff --git a/unison-src/transcripts/fix3977.md b/unison-src/transcripts/idempotent/fix3977.md similarity index 100% rename from unison-src/transcripts/fix3977.md rename to unison-src/transcripts/idempotent/fix3977.md diff --git a/unison-src/transcripts/fix4172.md b/unison-src/transcripts/idempotent/fix4172.md similarity index 100% rename from unison-src/transcripts/fix4172.md rename to unison-src/transcripts/idempotent/fix4172.md diff --git a/unison-src/transcripts/fix4280.md b/unison-src/transcripts/idempotent/fix4280.md similarity index 100% rename from unison-src/transcripts/fix4280.md rename to unison-src/transcripts/idempotent/fix4280.md diff --git a/unison-src/transcripts/fix4397.md b/unison-src/transcripts/idempotent/fix4397.md similarity index 100% rename from unison-src/transcripts/fix4397.md rename to unison-src/transcripts/idempotent/fix4397.md diff --git a/unison-src/transcripts/fix4415.md b/unison-src/transcripts/idempotent/fix4415.md similarity index 100% rename from unison-src/transcripts/fix4415.md rename to unison-src/transcripts/idempotent/fix4415.md diff --git a/unison-src/transcripts/fix4424.md b/unison-src/transcripts/idempotent/fix4424.md similarity index 100% rename from unison-src/transcripts/fix4424.md rename to unison-src/transcripts/idempotent/fix4424.md diff --git a/unison-src/transcripts/fix4482.md b/unison-src/transcripts/idempotent/fix4482.md similarity index 100% rename from unison-src/transcripts/fix4482.md rename to unison-src/transcripts/idempotent/fix4482.md diff --git a/unison-src/transcripts/fix4498.md b/unison-src/transcripts/idempotent/fix4498.md similarity index 100% rename from unison-src/transcripts/fix4498.md rename to unison-src/transcripts/idempotent/fix4498.md diff --git a/unison-src/transcripts/fix4515.md b/unison-src/transcripts/idempotent/fix4515.md similarity index 100% rename from unison-src/transcripts/fix4515.md rename to unison-src/transcripts/idempotent/fix4515.md diff --git a/unison-src/transcripts/fix4528.md b/unison-src/transcripts/idempotent/fix4528.md similarity index 100% rename from unison-src/transcripts/fix4528.md rename to unison-src/transcripts/idempotent/fix4528.md diff --git a/unison-src/transcripts/fix4556.md b/unison-src/transcripts/idempotent/fix4556.md similarity index 100% rename from unison-src/transcripts/fix4556.md rename to unison-src/transcripts/idempotent/fix4556.md diff --git a/unison-src/transcripts/fix4592.md b/unison-src/transcripts/idempotent/fix4592.md similarity index 100% rename from unison-src/transcripts/fix4592.md rename to unison-src/transcripts/idempotent/fix4592.md diff --git a/unison-src/transcripts/fix4618.md b/unison-src/transcripts/idempotent/fix4618.md similarity index 100% rename from unison-src/transcripts/fix4618.md rename to unison-src/transcripts/idempotent/fix4618.md diff --git a/unison-src/transcripts/fix4711.md b/unison-src/transcripts/idempotent/fix4711.md similarity index 100% rename from unison-src/transcripts/fix4711.md rename to unison-src/transcripts/idempotent/fix4711.md diff --git a/unison-src/transcripts/fix4722.md b/unison-src/transcripts/idempotent/fix4722.md similarity index 100% rename from unison-src/transcripts/fix4722.md rename to unison-src/transcripts/idempotent/fix4722.md diff --git a/unison-src/transcripts/fix4731.md b/unison-src/transcripts/idempotent/fix4731.md similarity index 100% rename from unison-src/transcripts/fix4731.md rename to unison-src/transcripts/idempotent/fix4731.md diff --git a/unison-src/transcripts/fix4780.md b/unison-src/transcripts/idempotent/fix4780.md similarity index 100% rename from unison-src/transcripts/fix4780.md rename to unison-src/transcripts/idempotent/fix4780.md diff --git a/unison-src/transcripts/fix4898.md b/unison-src/transcripts/idempotent/fix4898.md similarity index 100% rename from unison-src/transcripts/fix4898.md rename to unison-src/transcripts/idempotent/fix4898.md diff --git a/unison-src/transcripts/fix5055.md b/unison-src/transcripts/idempotent/fix5055.md similarity index 100% rename from unison-src/transcripts/fix5055.md rename to unison-src/transcripts/idempotent/fix5055.md diff --git a/unison-src/transcripts/fix5076.md b/unison-src/transcripts/idempotent/fix5076.md similarity index 100% rename from unison-src/transcripts/fix5076.md rename to unison-src/transcripts/idempotent/fix5076.md diff --git a/unison-src/transcripts/fix5080.md b/unison-src/transcripts/idempotent/fix5080.md similarity index 100% rename from unison-src/transcripts/fix5080.md rename to unison-src/transcripts/idempotent/fix5080.md diff --git a/unison-src/transcripts/fix5141.md b/unison-src/transcripts/idempotent/fix5141.md similarity index 100% rename from unison-src/transcripts/fix5141.md rename to unison-src/transcripts/idempotent/fix5141.md diff --git a/unison-src/transcripts/fix5168.md b/unison-src/transcripts/idempotent/fix5168.md similarity index 100% rename from unison-src/transcripts/fix5168.md rename to unison-src/transcripts/idempotent/fix5168.md diff --git a/unison-src/transcripts/fix5349.md b/unison-src/transcripts/idempotent/fix5349.md similarity index 100% rename from unison-src/transcripts/fix5349.md rename to unison-src/transcripts/idempotent/fix5349.md diff --git a/unison-src/transcripts/fix614.md b/unison-src/transcripts/idempotent/fix614.md similarity index 100% rename from unison-src/transcripts/fix614.md rename to unison-src/transcripts/idempotent/fix614.md diff --git a/unison-src/transcripts/fix689.md b/unison-src/transcripts/idempotent/fix689.md similarity index 100% rename from unison-src/transcripts/fix689.md rename to unison-src/transcripts/idempotent/fix689.md diff --git a/unison-src/transcripts/fix693.md b/unison-src/transcripts/idempotent/fix693.md similarity index 100% rename from unison-src/transcripts/fix693.md rename to unison-src/transcripts/idempotent/fix693.md diff --git a/unison-src/transcripts/fix845.md b/unison-src/transcripts/idempotent/fix845.md similarity index 100% rename from unison-src/transcripts/fix845.md rename to unison-src/transcripts/idempotent/fix845.md diff --git a/unison-src/transcripts/fix849.md b/unison-src/transcripts/idempotent/fix849.md similarity index 100% rename from unison-src/transcripts/fix849.md rename to unison-src/transcripts/idempotent/fix849.md diff --git a/unison-src/transcripts/fix942.md b/unison-src/transcripts/idempotent/fix942.md similarity index 100% rename from unison-src/transcripts/fix942.md rename to unison-src/transcripts/idempotent/fix942.md diff --git a/unison-src/transcripts/fix987.md b/unison-src/transcripts/idempotent/fix987.md similarity index 100% rename from unison-src/transcripts/fix987.md rename to unison-src/transcripts/idempotent/fix987.md diff --git a/unison-src/transcripts/formatter.md b/unison-src/transcripts/idempotent/formatter.md similarity index 100% rename from unison-src/transcripts/formatter.md rename to unison-src/transcripts/idempotent/formatter.md diff --git a/unison-src/transcripts/fuzzy-options.md b/unison-src/transcripts/idempotent/fuzzy-options.md similarity index 100% rename from unison-src/transcripts/fuzzy-options.md rename to unison-src/transcripts/idempotent/fuzzy-options.md diff --git a/unison-src/transcripts/generic-parse-errors.md b/unison-src/transcripts/idempotent/generic-parse-errors.md similarity index 100% rename from unison-src/transcripts/generic-parse-errors.md rename to unison-src/transcripts/idempotent/generic-parse-errors.md diff --git a/unison-src/transcripts/help.md b/unison-src/transcripts/idempotent/help.md similarity index 100% rename from unison-src/transcripts/help.md rename to unison-src/transcripts/idempotent/help.md diff --git a/unison-src/transcripts/higher-rank.md b/unison-src/transcripts/idempotent/higher-rank.md similarity index 100% rename from unison-src/transcripts/higher-rank.md rename to unison-src/transcripts/idempotent/higher-rank.md diff --git a/unison-src/transcripts/input-parse-errors.md b/unison-src/transcripts/idempotent/input-parse-errors.md similarity index 100% rename from unison-src/transcripts/input-parse-errors.md rename to unison-src/transcripts/idempotent/input-parse-errors.md diff --git a/unison-src/transcripts/io-test-command.md b/unison-src/transcripts/idempotent/io-test-command.md similarity index 100% rename from unison-src/transcripts/io-test-command.md rename to unison-src/transcripts/idempotent/io-test-command.md diff --git a/unison-src/transcripts/io.md b/unison-src/transcripts/idempotent/io.md similarity index 100% rename from unison-src/transcripts/io.md rename to unison-src/transcripts/idempotent/io.md diff --git a/unison-src/transcripts/keyword-identifiers.md b/unison-src/transcripts/idempotent/keyword-identifiers.md similarity index 100% rename from unison-src/transcripts/keyword-identifiers.md rename to unison-src/transcripts/idempotent/keyword-identifiers.md diff --git a/unison-src/transcripts/kind-inference.md b/unison-src/transcripts/idempotent/kind-inference.md similarity index 100% rename from unison-src/transcripts/kind-inference.md rename to unison-src/transcripts/idempotent/kind-inference.md diff --git a/unison-src/transcripts/lambdacase.md b/unison-src/transcripts/idempotent/lambdacase.md similarity index 100% rename from unison-src/transcripts/lambdacase.md rename to unison-src/transcripts/idempotent/lambdacase.md diff --git a/unison-src/transcripts/lsp-fold-ranges.md b/unison-src/transcripts/idempotent/lsp-fold-ranges.md similarity index 100% rename from unison-src/transcripts/lsp-fold-ranges.md rename to unison-src/transcripts/idempotent/lsp-fold-ranges.md diff --git a/unison-src/transcripts/lsp-name-completion.md b/unison-src/transcripts/idempotent/lsp-name-completion.md similarity index 100% rename from unison-src/transcripts/lsp-name-completion.md rename to unison-src/transcripts/idempotent/lsp-name-completion.md diff --git a/unison-src/transcripts/move-all.md b/unison-src/transcripts/idempotent/move-all.md similarity index 100% rename from unison-src/transcripts/move-all.md rename to unison-src/transcripts/idempotent/move-all.md diff --git a/unison-src/transcripts/move-namespace.md b/unison-src/transcripts/idempotent/move-namespace.md similarity index 100% rename from unison-src/transcripts/move-namespace.md rename to unison-src/transcripts/idempotent/move-namespace.md diff --git a/unison-src/transcripts/name-resolution.md b/unison-src/transcripts/idempotent/name-resolution.md similarity index 100% rename from unison-src/transcripts/name-resolution.md rename to unison-src/transcripts/idempotent/name-resolution.md diff --git a/unison-src/transcripts/name-segment-escape.md b/unison-src/transcripts/idempotent/name-segment-escape.md similarity index 100% rename from unison-src/transcripts/name-segment-escape.md rename to unison-src/transcripts/idempotent/name-segment-escape.md diff --git a/unison-src/transcripts/name-selection.md b/unison-src/transcripts/idempotent/name-selection.md similarity index 100% rename from unison-src/transcripts/name-selection.md rename to unison-src/transcripts/idempotent/name-selection.md diff --git a/unison-src/transcripts/names.md b/unison-src/transcripts/idempotent/names.md similarity index 100% rename from unison-src/transcripts/names.md rename to unison-src/transcripts/idempotent/names.md diff --git a/unison-src/transcripts/namespace-deletion-regression.md b/unison-src/transcripts/idempotent/namespace-deletion-regression.md similarity index 100% rename from unison-src/transcripts/namespace-deletion-regression.md rename to unison-src/transcripts/idempotent/namespace-deletion-regression.md diff --git a/unison-src/transcripts/namespace-dependencies.md b/unison-src/transcripts/idempotent/namespace-dependencies.md similarity index 100% rename from unison-src/transcripts/namespace-dependencies.md rename to unison-src/transcripts/idempotent/namespace-dependencies.md diff --git a/unison-src/transcripts/namespace-directive.md b/unison-src/transcripts/idempotent/namespace-directive.md similarity index 100% rename from unison-src/transcripts/namespace-directive.md rename to unison-src/transcripts/idempotent/namespace-directive.md diff --git a/unison-src/transcripts/numbered-args.md b/unison-src/transcripts/idempotent/numbered-args.md similarity index 100% rename from unison-src/transcripts/numbered-args.md rename to unison-src/transcripts/idempotent/numbered-args.md diff --git a/unison-src/transcripts/old-fold-right.md b/unison-src/transcripts/idempotent/old-fold-right.md similarity index 100% rename from unison-src/transcripts/old-fold-right.md rename to unison-src/transcripts/idempotent/old-fold-right.md diff --git a/unison-src/transcripts/pattern-match-coverage.md b/unison-src/transcripts/idempotent/pattern-match-coverage.md similarity index 100% rename from unison-src/transcripts/pattern-match-coverage.md rename to unison-src/transcripts/idempotent/pattern-match-coverage.md diff --git a/unison-src/transcripts/pattern-pretty-print-2345.md b/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md similarity index 100% rename from unison-src/transcripts/pattern-pretty-print-2345.md rename to unison-src/transcripts/idempotent/pattern-pretty-print-2345.md diff --git a/unison-src/transcripts/patternMatchTls.md b/unison-src/transcripts/idempotent/patternMatchTls.md similarity index 100% rename from unison-src/transcripts/patternMatchTls.md rename to unison-src/transcripts/idempotent/patternMatchTls.md diff --git a/unison-src/transcripts/patterns.md b/unison-src/transcripts/idempotent/patterns.md similarity index 100% rename from unison-src/transcripts/patterns.md rename to unison-src/transcripts/idempotent/patterns.md diff --git a/unison-src/transcripts/propagate.md b/unison-src/transcripts/idempotent/propagate.md similarity index 100% rename from unison-src/transcripts/propagate.md rename to unison-src/transcripts/idempotent/propagate.md diff --git a/unison-src/transcripts/pull-errors.md b/unison-src/transcripts/idempotent/pull-errors.md similarity index 100% rename from unison-src/transcripts/pull-errors.md rename to unison-src/transcripts/idempotent/pull-errors.md diff --git a/unison-src/transcripts/records.md b/unison-src/transcripts/idempotent/records.md similarity index 100% rename from unison-src/transcripts/records.md rename to unison-src/transcripts/idempotent/records.md diff --git a/unison-src/transcripts/reflog.md b/unison-src/transcripts/idempotent/reflog.md similarity index 100% rename from unison-src/transcripts/reflog.md rename to unison-src/transcripts/idempotent/reflog.md diff --git a/unison-src/transcripts/release-draft-command.md b/unison-src/transcripts/idempotent/release-draft-command.md similarity index 100% rename from unison-src/transcripts/release-draft-command.md rename to unison-src/transcripts/idempotent/release-draft-command.md diff --git a/unison-src/transcripts/reset.md b/unison-src/transcripts/idempotent/reset.md similarity index 100% rename from unison-src/transcripts/reset.md rename to unison-src/transcripts/idempotent/reset.md diff --git a/unison-src/transcripts/resolution-failures.md b/unison-src/transcripts/idempotent/resolution-failures.md similarity index 100% rename from unison-src/transcripts/resolution-failures.md rename to unison-src/transcripts/idempotent/resolution-failures.md diff --git a/unison-src/transcripts/rsa.md b/unison-src/transcripts/idempotent/rsa.md similarity index 100% rename from unison-src/transcripts/rsa.md rename to unison-src/transcripts/idempotent/rsa.md diff --git a/unison-src/transcripts/scope-ref.md b/unison-src/transcripts/idempotent/scope-ref.md similarity index 100% rename from unison-src/transcripts/scope-ref.md rename to unison-src/transcripts/idempotent/scope-ref.md diff --git a/unison-src/transcripts/suffixes.md b/unison-src/transcripts/idempotent/suffixes.md similarity index 100% rename from unison-src/transcripts/suffixes.md rename to unison-src/transcripts/idempotent/suffixes.md diff --git a/unison-src/transcripts/sum-type-update-conflicts.md b/unison-src/transcripts/idempotent/sum-type-update-conflicts.md similarity index 100% rename from unison-src/transcripts/sum-type-update-conflicts.md rename to unison-src/transcripts/idempotent/sum-type-update-conflicts.md diff --git a/unison-src/transcripts/switch-command.md b/unison-src/transcripts/idempotent/switch-command.md similarity index 100% rename from unison-src/transcripts/switch-command.md rename to unison-src/transcripts/idempotent/switch-command.md diff --git a/unison-src/transcripts/tab-completion.md b/unison-src/transcripts/idempotent/tab-completion.md similarity index 100% rename from unison-src/transcripts/tab-completion.md rename to unison-src/transcripts/idempotent/tab-completion.md diff --git a/unison-src/transcripts/tdnr.md b/unison-src/transcripts/idempotent/tdnr.md similarity index 100% rename from unison-src/transcripts/tdnr.md rename to unison-src/transcripts/idempotent/tdnr.md diff --git a/unison-src/transcripts/test-command.md b/unison-src/transcripts/idempotent/test-command.md similarity index 100% rename from unison-src/transcripts/test-command.md rename to unison-src/transcripts/idempotent/test-command.md diff --git a/unison-src/transcripts/text-literals.md b/unison-src/transcripts/idempotent/text-literals.md similarity index 100% rename from unison-src/transcripts/text-literals.md rename to unison-src/transcripts/idempotent/text-literals.md diff --git a/unison-src/transcripts/textfind.md b/unison-src/transcripts/idempotent/textfind.md similarity index 100% rename from unison-src/transcripts/textfind.md rename to unison-src/transcripts/idempotent/textfind.md diff --git a/unison-src/transcripts/todo-bug-builtins.md b/unison-src/transcripts/idempotent/todo-bug-builtins.md similarity index 100% rename from unison-src/transcripts/todo-bug-builtins.md rename to unison-src/transcripts/idempotent/todo-bug-builtins.md diff --git a/unison-src/transcripts/todo.md b/unison-src/transcripts/idempotent/todo.md similarity index 100% rename from unison-src/transcripts/todo.md rename to unison-src/transcripts/idempotent/todo.md diff --git a/unison-src/transcripts/top-level-exceptions.md b/unison-src/transcripts/idempotent/top-level-exceptions.md similarity index 100% rename from unison-src/transcripts/top-level-exceptions.md rename to unison-src/transcripts/idempotent/top-level-exceptions.md diff --git a/unison-src/transcripts/transcript-parser-commands.md b/unison-src/transcripts/idempotent/transcript-parser-commands.md similarity index 100% rename from unison-src/transcripts/transcript-parser-commands.md rename to unison-src/transcripts/idempotent/transcript-parser-commands.md diff --git a/unison-src/transcripts/type-deps.md b/unison-src/transcripts/idempotent/type-deps.md similarity index 100% rename from unison-src/transcripts/type-deps.md rename to unison-src/transcripts/idempotent/type-deps.md diff --git a/unison-src/transcripts/type-modifier-are-optional.md b/unison-src/transcripts/idempotent/type-modifier-are-optional.md similarity index 100% rename from unison-src/transcripts/type-modifier-are-optional.md rename to unison-src/transcripts/idempotent/type-modifier-are-optional.md diff --git a/unison-src/transcripts/undo.md b/unison-src/transcripts/idempotent/undo.md similarity index 100% rename from unison-src/transcripts/undo.md rename to unison-src/transcripts/idempotent/undo.md diff --git a/unison-src/transcripts/unique-type-churn.md b/unison-src/transcripts/idempotent/unique-type-churn.md similarity index 100% rename from unison-src/transcripts/unique-type-churn.md rename to unison-src/transcripts/idempotent/unique-type-churn.md diff --git a/unison-src/transcripts/unitnamespace.md b/unison-src/transcripts/idempotent/unitnamespace.md similarity index 100% rename from unison-src/transcripts/unitnamespace.md rename to unison-src/transcripts/idempotent/unitnamespace.md diff --git a/unison-src/transcripts/universal-cmp.md b/unison-src/transcripts/idempotent/universal-cmp.md similarity index 100% rename from unison-src/transcripts/universal-cmp.md rename to unison-src/transcripts/idempotent/universal-cmp.md diff --git a/unison-src/transcripts/unsafe-coerce.md b/unison-src/transcripts/idempotent/unsafe-coerce.md similarity index 100% rename from unison-src/transcripts/unsafe-coerce.md rename to unison-src/transcripts/idempotent/unsafe-coerce.md diff --git a/unison-src/transcripts/update-ignores-lib-namespace.md b/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md similarity index 100% rename from unison-src/transcripts/update-ignores-lib-namespace.md rename to unison-src/transcripts/idempotent/update-ignores-lib-namespace.md diff --git a/unison-src/transcripts/update-on-conflict.md b/unison-src/transcripts/idempotent/update-on-conflict.md similarity index 100% rename from unison-src/transcripts/update-on-conflict.md rename to unison-src/transcripts/idempotent/update-on-conflict.md diff --git a/unison-src/transcripts/update-suffixifies-properly.md b/unison-src/transcripts/idempotent/update-suffixifies-properly.md similarity index 100% rename from unison-src/transcripts/update-suffixifies-properly.md rename to unison-src/transcripts/idempotent/update-suffixifies-properly.md diff --git a/unison-src/transcripts/update-term-aliases-in-different-ways.md b/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md similarity index 100% rename from unison-src/transcripts/update-term-aliases-in-different-ways.md rename to unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md diff --git a/unison-src/transcripts/update-term-to-different-type.md b/unison-src/transcripts/idempotent/update-term-to-different-type.md similarity index 100% rename from unison-src/transcripts/update-term-to-different-type.md rename to unison-src/transcripts/idempotent/update-term-to-different-type.md diff --git a/unison-src/transcripts/update-term-with-alias.md b/unison-src/transcripts/idempotent/update-term-with-alias.md similarity index 100% rename from unison-src/transcripts/update-term-with-alias.md rename to unison-src/transcripts/idempotent/update-term-with-alias.md diff --git a/unison-src/transcripts/update-term-with-dependent-to-different-type.md b/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md similarity index 100% rename from unison-src/transcripts/update-term-with-dependent-to-different-type.md rename to unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md diff --git a/unison-src/transcripts/update-term-with-dependent.md b/unison-src/transcripts/idempotent/update-term-with-dependent.md similarity index 100% rename from unison-src/transcripts/update-term-with-dependent.md rename to unison-src/transcripts/idempotent/update-term-with-dependent.md diff --git a/unison-src/transcripts/update-term.md b/unison-src/transcripts/idempotent/update-term.md similarity index 100% rename from unison-src/transcripts/update-term.md rename to unison-src/transcripts/idempotent/update-term.md diff --git a/unison-src/transcripts/update-test-to-non-test.md b/unison-src/transcripts/idempotent/update-test-to-non-test.md similarity index 100% rename from unison-src/transcripts/update-test-to-non-test.md rename to unison-src/transcripts/idempotent/update-test-to-non-test.md diff --git a/unison-src/transcripts/update-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md similarity index 100% rename from unison-src/transcripts/update-test-watch-roundtrip.md rename to unison-src/transcripts/idempotent/update-test-watch-roundtrip.md diff --git a/unison-src/transcripts/update-type-add-constructor.md b/unison-src/transcripts/idempotent/update-type-add-constructor.md similarity index 100% rename from unison-src/transcripts/update-type-add-constructor.md rename to unison-src/transcripts/idempotent/update-type-add-constructor.md diff --git a/unison-src/transcripts/update-type-add-field.md b/unison-src/transcripts/idempotent/update-type-add-field.md similarity index 100% rename from unison-src/transcripts/update-type-add-field.md rename to unison-src/transcripts/idempotent/update-type-add-field.md diff --git a/unison-src/transcripts/update-type-add-new-record.md b/unison-src/transcripts/idempotent/update-type-add-new-record.md similarity index 100% rename from unison-src/transcripts/update-type-add-new-record.md rename to unison-src/transcripts/idempotent/update-type-add-new-record.md diff --git a/unison-src/transcripts/update-type-add-record-field.md b/unison-src/transcripts/idempotent/update-type-add-record-field.md similarity index 100% rename from unison-src/transcripts/update-type-add-record-field.md rename to unison-src/transcripts/idempotent/update-type-add-record-field.md diff --git a/unison-src/transcripts/update-type-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-constructor-alias.md similarity index 100% rename from unison-src/transcripts/update-type-constructor-alias.md rename to unison-src/transcripts/idempotent/update-type-constructor-alias.md diff --git a/unison-src/transcripts/update-type-delete-constructor-with-dependent.md b/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md similarity index 100% rename from unison-src/transcripts/update-type-delete-constructor-with-dependent.md rename to unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md diff --git a/unison-src/transcripts/update-type-delete-constructor.md b/unison-src/transcripts/idempotent/update-type-delete-constructor.md similarity index 100% rename from unison-src/transcripts/update-type-delete-constructor.md rename to unison-src/transcripts/idempotent/update-type-delete-constructor.md diff --git a/unison-src/transcripts/update-type-delete-record-field.md b/unison-src/transcripts/idempotent/update-type-delete-record-field.md similarity index 100% rename from unison-src/transcripts/update-type-delete-record-field.md rename to unison-src/transcripts/idempotent/update-type-delete-record-field.md diff --git a/unison-src/transcripts/update-type-missing-constructor.md b/unison-src/transcripts/idempotent/update-type-missing-constructor.md similarity index 100% rename from unison-src/transcripts/update-type-missing-constructor.md rename to unison-src/transcripts/idempotent/update-type-missing-constructor.md diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.md b/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md similarity index 100% rename from unison-src/transcripts/update-type-nested-decl-aliases.md rename to unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md diff --git a/unison-src/transcripts/update-type-no-op-record.md b/unison-src/transcripts/idempotent/update-type-no-op-record.md similarity index 100% rename from unison-src/transcripts/update-type-no-op-record.md rename to unison-src/transcripts/idempotent/update-type-no-op-record.md diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md similarity index 100% rename from unison-src/transcripts/update-type-stray-constructor-alias.md rename to unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md diff --git a/unison-src/transcripts/update-type-stray-constructor.md b/unison-src/transcripts/idempotent/update-type-stray-constructor.md similarity index 100% rename from unison-src/transcripts/update-type-stray-constructor.md rename to unison-src/transcripts/idempotent/update-type-stray-constructor.md diff --git a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md b/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md similarity index 100% rename from unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md rename to unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.md b/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md similarity index 100% rename from unison-src/transcripts/update-type-turn-non-record-into-record.md rename to unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md diff --git a/unison-src/transcripts/update-type-with-dependent-term.md b/unison-src/transcripts/idempotent/update-type-with-dependent-term.md similarity index 100% rename from unison-src/transcripts/update-type-with-dependent-term.md rename to unison-src/transcripts/idempotent/update-type-with-dependent-term.md diff --git a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md similarity index 100% rename from unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md rename to unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md diff --git a/unison-src/transcripts/update-type-with-dependent-type.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type.md similarity index 100% rename from unison-src/transcripts/update-type-with-dependent-type.md rename to unison-src/transcripts/idempotent/update-type-with-dependent-type.md diff --git a/unison-src/transcripts/update-watch.md b/unison-src/transcripts/idempotent/update-watch.md similarity index 100% rename from unison-src/transcripts/update-watch.md rename to unison-src/transcripts/idempotent/update-watch.md diff --git a/unison-src/transcripts/upgrade-happy-path.md b/unison-src/transcripts/idempotent/upgrade-happy-path.md similarity index 100% rename from unison-src/transcripts/upgrade-happy-path.md rename to unison-src/transcripts/idempotent/upgrade-happy-path.md diff --git a/unison-src/transcripts/upgrade-sad-path.md b/unison-src/transcripts/idempotent/upgrade-sad-path.md similarity index 100% rename from unison-src/transcripts/upgrade-sad-path.md rename to unison-src/transcripts/idempotent/upgrade-sad-path.md diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.md b/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md similarity index 100% rename from unison-src/transcripts/upgrade-suffixifies-properly.md rename to unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md diff --git a/unison-src/transcripts/upgrade-with-old-alias.md b/unison-src/transcripts/idempotent/upgrade-with-old-alias.md similarity index 100% rename from unison-src/transcripts/upgrade-with-old-alias.md rename to unison-src/transcripts/idempotent/upgrade-with-old-alias.md diff --git a/unison-src/transcripts/view.md b/unison-src/transcripts/idempotent/view.md similarity index 100% rename from unison-src/transcripts/view.md rename to unison-src/transcripts/idempotent/view.md diff --git a/unison-src/transcripts/watch-expressions.md b/unison-src/transcripts/idempotent/watch-expressions.md similarity index 100% rename from unison-src/transcripts/watch-expressions.md rename to unison-src/transcripts/idempotent/watch-expressions.md diff --git a/unison-src/transcripts/input-parse-errors.output.md b/unison-src/transcripts/input-parse-errors.output.md deleted file mode 100644 index 73f99779a3..0000000000 --- a/unison-src/transcripts/input-parse-errors.output.md +++ /dev/null @@ -1,209 +0,0 @@ -# demonstrating our new input parsing errors - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison :hide -x = 55 -``` - -``` ucm :hide -scratch/main> add -``` - -`handleNameArg` parse error in `add` - -``` ucm :error -scratch/main> add . - - ⚠️ - - Sorry, I wasn’t sure how to process your request: - - 1:2: - | - 1 | . - | ^ - unexpected end of input - expecting '`' or operator (valid characters: !$%&*+-/:<=>\^|~) - - - You can run `help add` for more information on using `add`. -scratch/main> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/main> add 1 - -scratch/main> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/main> add 2 - - ⊡ Ignored previously added definitions: x -``` - -todo: - -``` haskell - SA.Name name -> pure name - SA.NameWithBranchPrefix (Left _) name -> pure name - SA.NameWithBranchPrefix (Right prefix) name -> pure $ Path.prefixNameIfRel (Path.AbsolutePath' prefix) name - SA.HashQualified hqname -> maybe (Left "can’t find a name from the numbered arg") pure $ HQ.toName hqname - SA.HashQualifiedWithBranchPrefix (Left _) hqname -> pure $ HQ'.toName hqname - SA.HashQualifiedWithBranchPrefix (Right prefix) hqname -> - pure . Path.prefixNameIfRel (Path.AbsolutePath' prefix) $ HQ'.toName hqname - SA.ShallowListEntry prefix entry -> - pure . HQ'.toName . fmap (Path.prefixNameIfRel prefix) $ shallowListEntryToHQ' entry - SA.SearchResult mpath result -> - maybe (Left "can’t find a name from the numbered arg") pure . HQ.toName $ searchResultToHQ mpath result - otherNumArg -> Left . I.Formatted $ wrongStructuredArgument "a name" otherNumArg -``` - -aliasMany: skipped -- similar to `add` - -``` ucm :error -scratch/main> update arg - - ⚠️ - - Sorry, I wasn’t sure how to process your request: - - I expected no arguments, but received one. - - You can run `help update` for more information on using - `update`. -``` - -aliasTerm - -``` -scratch/main> alias.term ##Nat.+ Nat.+ -``` - -aliasTermForce, -aliasType, - -todo: - -``` - -aliasMany, -api, -authLogin, -back, -branchEmptyInputPattern, -branchInputPattern, -branchRenameInputPattern, -branchesInputPattern, -cd, -clear, -clone, -compileScheme, -createAuthor, -debugClearWatchCache, -debugDoctor, -debugDumpNamespace, -debugDumpNamespaceSimple, -debugTerm, -debugTermVerbose, -debugType, -debugLSPFoldRanges, -debugFileHashes, -debugNameDiff, -debugNumberedArgs, -debugTabCompletion, -debugFuzzyOptions, -debugFormat, -delete, -deleteBranch, -deleteProject, -deleteNamespace, -deleteNamespaceForce, -deleteTerm, -deleteTermVerbose, -deleteType, -deleteTypeVerbose, -deleteVerbose, -dependencies, -dependents, -diffNamespace, -display, -displayTo, -docToMarkdown, -docs, -docsToHtml, -edit, -editNamespace, -execute, -find, -findIn, -findAll, -findInAll, -findGlobal, -findShallow, -findVerbose, -findVerboseAll, -sfind, -sfindReplace, -forkLocal, -help, -helpTopics, -history, -ioTest, -ioTestAll, -libInstallInputPattern, -load, -makeStandalone, -mergeBuiltins, -mergeIOBuiltins, -mergeOldInputPattern, -mergeOldPreviewInputPattern, -mergeOldSquashInputPattern, -mergeInputPattern, -mergeCommitInputPattern, -names False, -- names -names True, -- names.global -namespaceDependencies, -previewAdd, -previewUpdate, -printVersion, -projectCreate, -projectCreateEmptyInputPattern, -projectRenameInputPattern, -projectSwitch, -projectsInputPattern, -pull, -pullWithoutHistory, -push, -pushCreate, -pushExhaustive, -pushForce, -quit, -releaseDraft, -renameBranch, -renameTerm, -renameType, -moveAll, -reset, -resetRoot, -runScheme, -saveExecuteResult, -test, -testAll, -todo, -ui, -undo, -up, -update, -updateBuiltins, -updateOld, -updateOldNoPatch, -upgrade, -upgradeCommitInputPattern, -view, -viewGlobal, -viewReflog -``` diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md deleted file mode 100644 index a2012915ba..0000000000 --- a/unison-src/transcripts/io-test-command.output.md +++ /dev/null @@ -1,80 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -The `io.test` command should run all of the tests within the current namespace, excluding libs. - -``` unison :hide --- We manually specify types so we don't need to pull in base to run IO and such -ioAndExceptionTest : '{IO, Exception} [Result] -ioAndExceptionTest = do - [Ok "Success"] - -ioTest : '{IO} [Result] -ioTest = do - [Ok "Success"] - -lib.ioAndExceptionTestInLib : '{IO, Exception} [Result] -lib.ioAndExceptionTestInLib = do - [Ok "Success"] -``` - -``` ucm :hide -scratch/main> add -``` - -Run a IO tests one by one - -``` ucm -scratch/main> io.test ioAndExceptionTest - - New test results: - - 1. ioAndExceptionTest ◉ Success - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -scratch/main> io.test ioTest - - New test results: - - 1. ioTest ◉ Success - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -`io.test` doesn't cache results - -``` ucm -scratch/main> io.test ioAndExceptionTest - - New test results: - - 1. ioAndExceptionTest ◉ Success - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -`io.test.all` will run all matching tests except those in the `lib` namespace. - -``` ucm -scratch/main> io.test.all - - - - - - New test results: - - 1. ioAndExceptionTest ◉ Success - 2. ioTest ◉ Success - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md deleted file mode 100644 index 4d0be24599..0000000000 --- a/unison-src/transcripts/io.output.md +++ /dev/null @@ -1,714 +0,0 @@ -# tests for built-in IO functions - -``` ucm :hide -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. - -## Setup - -You can skip the section which is just needed to make the transcript self-contained. - -TempDirs/autoCleaned is an ability/hanlder which allows you to easily -create a scratch directory which will automatically get cleaned up. - -``` ucm :hide -scratch/main> add -``` - -## Basic File Functions - -### Creating/Deleting/Renaming Directories - -Tests: - - - createDirectory, - - isDirectory, - - fileExists, - - renameDirectory, - - deleteDirectory - -``` unison -testCreateRename : '{io2.IO} [Result] -testCreateRename _ = - test = 'let - tempDir = newTempDir "fileio" - fooDir = tempDir ++ "/foo" - barDir = tempDir ++ "/bar" - void x = () - void (createDirectory.impl fooDir) - check "create a foo directory" (isDirectory fooDir) - check "directory should exist" (fileExists fooDir) - renameDirectory fooDir barDir - check "foo should no longer exist" (not (fileExists fooDir)) - check "directory should no longer exist" (not (fileExists fooDir)) - check "bar should now exist" (fileExists barDir) - - bazDir = barDir ++ "/baz" - void (createDirectory.impl bazDir) - void (removeDirectory.impl barDir) - - check "removeDirectory works recursively" (not (isDirectory barDir)) - check "removeDirectory works recursively" (not (isDirectory bazDir)) - - runTest test -``` - -``` ucm :added-by-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`: - - testCreateRename : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testCreateRename : '{IO} [Result] -scratch/main> io.test testCreateRename - - New test results: - - 1. testCreateRename ◉ create a foo directory - ◉ directory should exist - ◉ foo should no longer exist - ◉ directory should no longer exist - ◉ bar should now exist - ◉ removeDirectory works recursively - ◉ removeDirectory works recursively - - ✅ 7 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Opening / Closing files - -Tests: - - - openFile - - closeFile - - isFileOpen - -``` unison -testOpenClose : '{io2.IO} [Result] -testOpenClose _ = - test = 'let - tempDir = (newTempDir "seek") - fooFile = tempDir ++ "/foo" - handle1 = openFile fooFile FileMode.Write - check "file should be open" (isFileOpen handle1) - setBuffering handle1 (SizedBlockBuffering 1024) - check "file handle buffering should match what we just set." (getBuffering handle1 == SizedBlockBuffering 1024) - setBuffering handle1 (getBuffering handle1) - putBytes handle1 0xs01 - setBuffering handle1 NoBuffering - setBuffering handle1 (getBuffering handle1) - putBytes handle1 0xs23 - setBuffering handle1 BlockBuffering - setBuffering handle1 (getBuffering handle1) - putBytes handle1 0xs45 - setBuffering handle1 LineBuffering - setBuffering handle1 (getBuffering handle1) - putBytes handle1 0xs67 - closeFile handle1 - check "file should be closed" (not (isFileOpen handle1)) - - -- make sure the bytes have been written - handle2 = openFile fooFile FileMode.Read - check "bytes have been written" (getBytes handle2 4 == 0xs01234567) - closeFile handle2 - - -- checking that ReadWrite mode works fine - handle3 = openFile fooFile FileMode.ReadWrite - check "bytes have been written" (getBytes handle3 4 == 0xs01234567) - closeFile handle3 - - check "file should be closed" (not (isFileOpen handle1)) - - runTest test -``` - -``` ucm :added-by-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`: - - testOpenClose : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testOpenClose : '{IO} [Result] -scratch/main> io.test testOpenClose - - New test results: - - 1. testOpenClose ◉ file should be open - ◉ file handle buffering should match what we just set. - ◉ file should be closed - ◉ bytes have been written - ◉ bytes have been written - ◉ file should be closed - - ✅ 6 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Reading files with getSomeBytes - -Tests: - - - getSomeBytes - - putBytes - - isFileOpen - - seekHandle - -``` unison -testGetSomeBytes : '{io2.IO} [Result] -testGetSomeBytes _ = - test = 'let - tempDir = (newTempDir "getSomeBytes") - fooFile = tempDir ++ "/foo" - - testData = "0123456789" - testSize = size testData - - chunkSize = 7 - check "chunk size splits data into 2 uneven sides" ((chunkSize > (testSize / 2)) && (chunkSize < testSize)) - - - -- write testData to a temporary file - fooWrite = openFile fooFile Write - putBytes fooWrite (toUtf8 testData) - closeFile fooWrite - check "file should be closed" (not (isFileOpen fooWrite)) - - -- reopen for reading back the data in chunks - fooRead = openFile fooFile Read - - -- read first part of file - chunk1 = getSomeBytes fooRead chunkSize |> fromUtf8 - check "first chunk matches first part of testData" (chunk1 == take chunkSize testData) - - -- read rest of file - chunk2 = getSomeBytes fooRead chunkSize |> fromUtf8 - check "second chunk matches rest of testData" (chunk2 == drop chunkSize testData) - - check "should be at end of file" (isFileEOF fooRead) - - readAtEOF = getSomeBytes fooRead chunkSize - check "reading at end of file results in Bytes.empty" (readAtEOF == Bytes.empty) - - -- request many bytes from the start of the file - seekHandle fooRead AbsoluteSeek +0 - bigRead = getSomeBytes fooRead (testSize * 999) |> fromUtf8 - check "requesting many bytes results in what's available" (bigRead == testData) - - closeFile fooRead - check "file should be closed" (not (isFileOpen fooRead)) - - runTest test -``` - -``` ucm :added-by-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`: - - testGetSomeBytes : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testGetSomeBytes : '{IO} [Result] -scratch/main> io.test testGetSomeBytes - - New test results: - - 1. testGetSomeBytes ◉ chunk size splits data into 2 uneven sides - ◉ file should be closed - ◉ first chunk matches first part of testData - ◉ second chunk matches rest of testData - ◉ should be at end of file - ◉ reading at end of file results in Bytes.empty - ◉ requesting many bytes results in what's available - ◉ file should be closed - - ✅ 8 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Seeking in open files - -Tests: - - - openFile - - putBytes - - closeFile - - isSeekable - - isFileEOF - - seekHandle - - getBytes - - getLine - -``` unison -testSeek : '{io2.IO} [Result] -testSeek _ = - test = 'let - tempDir = newTempDir "seek" - emit (Ok "seeked") - fooFile = tempDir ++ "/foo" - handle1 = openFile fooFile FileMode.Append - putBytes handle1 (toUtf8 "12345678") - closeFile handle1 - - handle3 = openFile fooFile FileMode.Read - check "readable file should be seekable" (isSeekable handle3) - check "shouldn't be the EOF" (not (isFileEOF handle3)) - expectU "we should be at position 0" 0 (handlePosition handle3) - - seekHandle handle3 AbsoluteSeek +1 - expectU "we should be at position 1" 1 (handlePosition handle3) - bytes3a = getBytes handle3 1000 - text3a = Text.fromUtf8 bytes3a - expectU "should be able to read our temporary file after seeking" "2345678" text3a - closeFile handle3 - - barFile = tempDir ++ "/bar" - handle4 = openFile barFile FileMode.Append - putBytes handle4 (toUtf8 "foobar\n") - closeFile handle4 - - handle5 = openFile barFile FileMode.Read - expectU "getLine should get a line" "foobar" (getLine handle5) - closeFile handle5 - - runTest test - -testAppend : '{io2.IO} [Result] -testAppend _ = - test = 'let - tempDir = newTempDir "openFile" - fooFile = tempDir ++ "/foo" - handle1 = openFile fooFile FileMode.Write - putBytes handle1 (toUtf8 "test1") - closeFile handle1 - - handle2 = openFile fooFile FileMode.Append - putBytes handle2 (toUtf8 "test2") - closeFile handle2 - - handle3 = openFile fooFile FileMode.Read - bytes3 = getBytes handle3 1000 - text3 = Text.fromUtf8 bytes3 - - expectU "should be able to read our temporary file" "test1test2" text3 - - closeFile handle3 - - runTest test -``` - -``` ucm :added-by-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`: - - testAppend : '{IO} [Result] - testSeek : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testAppend : '{IO} [Result] - testSeek : '{IO} [Result] -scratch/main> io.test testSeek - - New test results: - - 1. testSeek ◉ seeked - ◉ readable file should be seekable - ◉ shouldn't be the EOF - ◉ we should be at position 0 - ◉ we should be at position 1 - ◉ should be able to read our temporary file after seeking - ◉ getLine should get a line - - ✅ 7 test(s) passing - - Tip: Use view 1 to view the source of a test. -scratch/main> io.test testAppend - - New test results: - - 1. testAppend ◉ should be able to read our temporary file - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### SystemTime - -``` unison -testSystemTime : '{io2.IO} [Result] -testSystemTime _ = - test = 'let - t = !systemTime - check "systemTime should be sane" ((t > 1600000000) && (t < 2000000000)) - - runTest test -``` - -``` ucm :added-by-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`: - - testSystemTime : '{IO} [Result] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testSystemTime : '{IO} [Result] -scratch/main> io.test testSystemTime - - New test results: - - 1. testSystemTime ◉ systemTime should be sane - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Get temp directory - -``` unison :hide -testGetTempDirectory : '{io2.IO} [Result] -testGetTempDirectory _ = - test = 'let - tempDir = reraise !getTempDirectory.impl - check "Temp directory is directory" (isDirectory tempDir) - check "Temp directory should exist" (fileExists tempDir) - runTest test -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testGetTempDirectory : '{IO} [Result] -scratch/main> io.test testGetTempDirectory - - New test results: - - 1. testGetTempDirectory ◉ Temp directory is directory - ◉ Temp directory should exist - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Get current directory - -``` unison :hide -testGetCurrentDirectory : '{io2.IO} [Result] -testGetCurrentDirectory _ = - test = 'let - currentDir = reraise !getCurrentDirectory.impl - check "Current directory is directory" (isDirectory currentDir) - check "Current directory should exist" (fileExists currentDir) - runTest test -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testGetCurrentDirectory : '{IO} [Result] -scratch/main> io.test testGetCurrentDirectory - - New test results: - - 1. testGetCurrentDirectory ◉ Current directory is directory - ◉ Current directory should exist - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Get directory contents - -``` unison :hide -testDirContents : '{io2.IO} [Result] -testDirContents _ = - test = 'let - tempDir = newTempDir "dircontents" - c = reraise (directoryContents.impl tempDir) - check "directory size should be" (size c == 2) - check "directory contents should have current directory and parent" let - (c == [".", ".."]) || (c == ["..", "."]) - runTest test -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testDirContents : '{IO} [Result] -scratch/main> io.test testDirContents - - New test results: - - 1. testDirContents ◉ directory size should be - ◉ directory contents should have current directory and parent - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Read environment variables - -``` unison :hide -testGetEnv : '{io2.IO} [Result] -testGetEnv _ = - test = 'let - path = reraise (getEnv.impl "PATH") -- PATH exists on windows, mac and linux. - check "PATH environent variable should be set" (size path > 0) - match getEnv.impl "DOESNTEXIST" with - Right _ -> emit (Fail "env var shouldn't exist") - Left _ -> emit (Ok "DOESNTEXIST didn't exist") - runTest test -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testGetEnv : '{IO} [Result] -scratch/main> io.test testGetEnv - - New test results: - - 1. testGetEnv ◉ PATH environent variable should be set - ◉ DOESNTEXIST didn't exist - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -### Read command line args - -`runMeWithNoArgs`, `runMeWithOneArg`, and `runMeWithTwoArgs` raise exceptions -unless they called with the right number of arguments. - -``` unison :hide -testGetArgs.fail : Text -> Failure -testGetArgs.fail descr = Failure (typeLink IOFailure) descr !Any - -testGetArgs.runMeWithNoArgs : '{io2.IO, Exception} () -testGetArgs.runMeWithNoArgs = 'let - args = reraise !getArgs.impl - match args with - [] -> printLine "called with no args" - _ -> raise (testGetArgs.fail "called with args") - -testGetArgs.runMeWithOneArg : '{io2.IO, Exception} () -testGetArgs.runMeWithOneArg = 'let - args = reraise !getArgs.impl - match args with - [] -> raise (testGetArgs.fail "called with no args") - [_] -> printLine "called with one arg" - _ -> raise (testGetArgs.fail "called with too many args") - -testGetArgs.runMeWithTwoArgs : '{io2.IO, Exception} () -testGetArgs.runMeWithTwoArgs = 'let - args = reraise !getArgs.impl - match args with - [] -> raise (testGetArgs.fail "called with no args") - [_] -> raise (testGetArgs.fail "called with one arg") - [_, _] -> printLine "called with two args" - _ -> raise (testGetArgs.fail "called with too many args") -``` - -Test that they can be run with the right number of args. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testGetArgs.fail : Text -> Failure - testGetArgs.runMeWithNoArgs : '{IO, Exception} () - testGetArgs.runMeWithOneArg : '{IO, Exception} () - testGetArgs.runMeWithTwoArgs : '{IO, Exception} () -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 -scratch/main> run runMeWithNoArgs foo - - 💔💥 - - The program halted with an unhandled exception: - - Failure (typeLink IOFailure) "called with args" (Any ()) - - Stack trace: - ##raise -``` - -``` ucm :error -scratch/main> run runMeWithOneArg - - 💔💥 - - The program halted with an unhandled exception: - - Failure (typeLink IOFailure) "called with no args" (Any ()) - - Stack trace: - ##raise -``` - -``` ucm :error -scratch/main> run runMeWithOneArg foo bar - - 💔💥 - - The program halted with an unhandled exception: - - Failure - (typeLink IOFailure) "called with too many args" (Any ()) - - Stack trace: - ##raise -``` - -``` ucm :error -scratch/main> run runMeWithTwoArgs - - 💔💥 - - The program halted with an unhandled exception: - - Failure (typeLink IOFailure) "called with no args" (Any ()) - - Stack trace: - ##raise -``` - -### Get the time zone - -``` unison :hide -testTimeZone = do - (offset, summer, name) = Clock.internals.systemTimeZone +0 - _ = (offset : Int, summer : Nat, name : Text) - () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testTimeZone : '{IO} () -scratch/main> run testTimeZone - - () -``` - -### Get some random bytes - -``` unison :hide -testRandom : '{io2.IO} [Result] -testRandom = do - test = do - bytes = IO.randomBytes 10 - check "randomBytes returns the right number of bytes" (size bytes == 10) - runTest test -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - testRandom : '{IO} [Result] -scratch/main> io.test testGetEnv - - New test results: - - 1. testGetEnv ◉ PATH environent variable should be set - ◉ DOESNTEXIST didn't exist - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/keyword-identifiers.output.md b/unison-src/transcripts/keyword-identifiers.output.md deleted file mode 100644 index d8574e0995..0000000000 --- a/unison-src/transcripts/keyword-identifiers.output.md +++ /dev/null @@ -1,271 +0,0 @@ -Regression tests to make sure keywords are allowed to start identifiers in terms and types. - -In particular, following a keyword with a `wordyIdChar` should be a valid identifier. - -Related issues: - - - https://github.com/unisonweb/unison/issues/2091 - - https://github.com/unisonweb/unison/issues/2727 - -## Keyword list - -Checks the following keywords: - - - `type` - - `ability` - - `structural` - - `unique` - - `if` - - `then` - - `else` - - `forall` - - `handle` - - `with` - - `where` - - `use` - - `true` - - `false` - - `alias` - - `typeLink` - - `termLink` - - `let` - - `namespace` - - `match` - - `cases` - -Note that although `∀` is a keyword, it cannot actually appear at the start of -identifier. - -## Tests - -`type`: - -``` unison :hide -typeFoo = 99 -type1 = "I am a variable" -type_ = 292 -type! = 3943 -type' = 238448 --- this type is the same as `structural type Optional a = Some a | None`, but with very confusing names -structural type type! type_ = type' type_ | type'' -``` - -`ability`: - -``` unison :hide -abilityFoo = 99 -ability1 = "I am a variable" -ability_ = 292 -ability! = 3943 -ability' = 238448 -structural type ability! ability_ = ability' ability_ | ability'' -``` - -`structural` - -``` unison :hide -structuralFoo = 99 -structural1 = "I am a variable" -structural_ = 292 -structural! = 3943 -structural' = 238448 -structural type structural! structural_ = structural' structural_ | structural'' -``` - -`unique` - -``` unison :hide -uniqueFoo = 99 -unique1 = "I am a variable" -unique_ = 292 -unique! = 3943 -unique' = 238448 -structural type unique! unique_ = unique' unique_ | unique'' -``` - -`if` - -``` unison :hide -ifFoo = 99 -if1 = "I am a variable" -if_ = 292 -if! = 3943 -if' = 238448 -structural type if! if_ = if' if_ | if'' -``` - -`then` - -``` unison :hide -thenFoo = 99 -then1 = "I am a variable" -then_ = 292 -then! = 3943 -then' = 238448 -structural type then! then_ = then' then_ | then'' -``` - -`else` - -``` unison :hide -elseFoo = 99 -else1 = "I am a variable" -else_ = 292 -else! = 3943 -else' = 238448 -structural type else! else_ = else' else_ | else'' -``` - -`forall` - -``` unison :hide -forallFoo = 99 -forall1 = "I am a variable" -forall_ = 292 -forall! = 3943 -forall' = 238448 -structural type forall! forall_ = forall' forall_ | forall'' -``` - -`handle` - -``` unison :hide -handleFoo = 99 -handle1 = "I am a variable" -handle_ = 292 -handle! = 3943 -handle' = 238448 -structural type handle! handle_ = handle' handle_ | handle'' -``` - -`with` - -``` unison :hide -withFoo = 99 -with1 = "I am a variable" -with_ = 292 -with! = 3943 -with' = 238448 -structural type with! with_ = with' with_ | with'' -``` - -`where` - -``` unison :hide -whereFoo = 99 -where1 = "I am a variable" -where_ = 292 -where! = 3943 -where' = 238448 -structural type where! where_ = where' where_ | where'' -``` - -`use` - -``` unison :hide -useFoo = 99 -use1 = "I am a variable" -use_ = 292 -use! = 3943 -use' = 238448 -structural type use! use_ = use' use_ | use'' -``` - -`true` - -``` unison :hide -trueFoo = 99 -true1 = "I am a variable" -true_ = 292 -true! = 3943 -true' = 238448 -structural type true! true_ = true' true_ | true'' -``` - -`false` - -``` unison :hide -falseFoo = 99 -false1 = "I am a variable" -false_ = 292 -false! = 3943 -false' = 238448 -structural type false! false_ = false' false_ | false'' -``` - -`alias` - -``` unison :hide -aliasFoo = 99 -alias1 = "I am a variable" -alias_ = 292 -alias! = 3943 -alias' = 238448 -structural type alias! alias_ = alias' alias_ | alias'' -``` - -`typeLink` - -``` unison :hide -typeLinkFoo = 99 -typeLink1 = "I am a variable" -typeLink_ = 292 -typeLink! = 3943 -typeLink' = 238448 -structural type typeLink! typeLink_ = typeLink' typeLink_ | typeLink'' -``` - -`termLink` - -``` unison :hide -termLinkFoo = 99 -termLink1 = "I am a variable" -termLink_ = 292 -termLink! = 3943 -termLink' = 238448 -structural type termLink! termLink_ = termLink' termLink_ | termLink'' -``` - -`let` - -``` unison :hide -letFoo = 99 -let1 = "I am a variable" -let_ = 292 -let! = 3943 -let' = 238448 -structural type let! let_ = let' let_ | let'' -``` - -`namespace` - -``` unison :hide -namespaceFoo = 99 -namespace1 = "I am a variable" -namespace_ = 292 -namespace! = 3943 -namespace' = 238448 -structural type namespace! namespace_ = namespace' namespace_ | namespace'' -``` - -`match` - -``` unison :hide -matchFoo = 99 -match1 = "I am a variable" -match_ = 292 -match! = 3943 -match' = 238448 -structural type match! match_ = match' match_ | match'' -``` - -`cases` - -``` unison :hide -casesFoo = 99 -cases1 = "I am a variable" -cases_ = 292 -cases! = 3943 -cases' = 238448 -structural type cases! cases_ = cases' cases_ | cases'' -``` diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md deleted file mode 100644 index eb80e6a616..0000000000 --- a/unison-src/transcripts/kind-inference.output.md +++ /dev/null @@ -1,364 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -## A type param cannot have conflicting kind constraints within a single decl - -conflicting constraints on the kind of `a` in a product - -``` unison :error -unique type T a = T a (a Nat) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 1 | unique type T a = T a (a Nat) - - a doesn't expect an argument; however, it is applied to Nat. -``` - -conflicting constraints on the kind of `a` in a sum - -``` unison :error -unique type T a - = Star a - | StarStar (a Nat) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 3 | | StarStar (a Nat) - - a doesn't expect an argument; however, it is applied to Nat. -``` - -## Kinds are inferred by decl component - -Successfully infer `a` in `Ping a` to be of kind `* -> *` by -inspecting its component-mate `Pong`. - -``` unison -unique type Ping a = Ping Pong -unique type Pong = Pong (Ping Optional) -``` - -``` ucm :added-by-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 Ping a - type Pong -``` - -Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts -`a` to `*`, whereas `Pong` restricts `a` to `* -> *`. - -``` unison :error -unique type Ping a = Ping a Pong -unique type Pong = Pong (Ping Optional) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 1 | unique type Ping a = Ping a Pong - - The arrow type (->) expects arguments of kind Type; however, - it is applied to a which has kind: Type -> Type. -``` - -Successful example between mutually recursive type and ability - -``` unison -unique type Ping a = Ping (a Nat -> {Pong Nat} ()) -unique ability Pong a where - pong : Ping Optional -> () -``` - -``` ucm :added-by-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 Ping a - ability Pong a -``` - -Catch conflict between mutually recursive type and ability - -``` unison :error -unique type Ping a = Ping (a -> {Pong Nat} ()) -unique ability Pong a where - pong : Ping Optional -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 3 | pong : Ping Optional -> () - - Ping expects an argument of kind: Type; however, it is - applied to Optional which has kind: Type -> Type. -``` - -Consistent instantiation of `T`'s `a` parameter in `S` - -``` unison -unique type T a = T a - -unique type S = S (T Nat) -``` - -``` ucm :added-by-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 S - type T a -``` - -Delay kind defaulting until all components are processed. Here `S` -constrains the kind of `T`'s `a` parameter, although `S` is not in -the same component as `T`. - -``` unison -unique type T a = T - -unique type S = S (T Optional) -``` - -``` ucm :added-by-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 S - type T a -``` - -Catch invalid instantiation of `T`'s `a` parameter in `S` - -``` unison :error -unique type T a = T a - -unique type S = S (T Optional) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 3 | unique type S = S (T Optional) - - T expects an argument of kind: Type; however, it is applied - to Optional which has kind: Type -> Type. -``` - -## Checking annotations - -Catch kind error in type annotation - -``` unison :error -test : Nat Nat -test = 0 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 1 | test : Nat Nat - - Nat doesn't expect an argument; however, it is applied to - Nat. -``` - -Catch kind error in annotation example 2 - -``` unison :error -test : Optional -> () -test _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 1 | test : Optional -> () - - The arrow type (->) expects arguments of kind Type; however, - it is applied to Optional which has kind: Type -> Type. -``` - -Catch kind error in annotation example 3 - -``` unison :error -unique type T a = T (a Nat) - -test : T Nat -> () -test _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 3 | test : T Nat -> () - - T expects an argument of kind: Type -> Type; however, it is - applied to Nat which has kind: Type. -``` - -Catch kind error in scoped type variable annotation - -``` unison :error -unique type StarStar a = StarStar (a Nat) -unique type Star a = Star a - -test : StarStar a -> () -test _ = - buggo : Star a - buggo = bug "" - () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 6 | buggo : Star a - - Star expects an argument of kind: Type; however, it is - applied to a which has kind: Type -> Type. -``` - -## Effect/type mismatch - -Effects appearing where types are expected - -``` unison :error -unique ability Foo where - foo : () - -test : Foo -> () -test _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 4 | test : Foo -> () - - The arrow type (->) expects arguments of kind Type; however, - it is applied to Foo which has kind: Ability. -``` - -Types appearing where effects are expected - -``` unison :error -test : {Nat} () -test _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Kind mismatch arising from - 1 | test : {Nat} () - - An ability list must consist solely of abilities; however, - this list contains Nat which has kind Type. Abilities are of - kind Ability. -``` - -## Cyclic kinds - -``` unison :error -unique type T a = T (a a) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Cannot construct infinite kind - 1 | unique type T a = T (a a) - - The above application constrains the kind of a to be - infinite, generated by the constraint k = k -> Type where k - is the kind of a. -``` - -``` unison :error -unique type T a b = T (a b) (b a) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Cannot construct infinite kind - 1 | unique type T a b = T (a b) (b a) - - The above application constrains the kind of b to be - infinite, generated by the constraint - k = (k -> Type) -> Type where k is the kind of b. -``` - -``` unison :error -unique type Ping a = Ping (a Pong) -unique type Pong a = Pong (a Ping) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Cannot construct infinite kind - 1 | unique type Ping a = Ping (a Pong) - - The above application constrains the kind of a to be - infinite, generated by the constraint - k = (((k -> Type) -> Type) -> Type) -> Type where k is the - kind of a. -``` diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md deleted file mode 100644 index 28f46ed248..0000000000 --- a/unison-src/transcripts/lambdacase.output.md +++ /dev/null @@ -1,244 +0,0 @@ -# Lambda case syntax - -``` ucm :hide -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: - -``` unison -isEmpty x = match x with - [] -> true - _ -> false -``` - -``` ucm :added-by-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`: - - isEmpty : [t] -> Boolean -``` - -``` ucm :hide -scratch/main> add -``` - -Here's the same function written using `cases` syntax: - -``` unison -isEmpty2 = cases - [] -> true - _ -> false -``` - -``` ucm :added-by-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`: - - isEmpty2 : [t] -> Boolean - (also named isEmpty) -``` - -Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` - -``` ucm -scratch/main> view isEmpty - - isEmpty : [t] -> Boolean - isEmpty = cases - [] -> true - _ -> false -``` - -it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. - -## Multi-argument cases - -Functions that take multiple arguments and immediately match on a tuple of arguments can also be rewritten to use `cases`. Here's a version using regular `match` syntax on a tuple: - -``` unison :hide -merge : [a] -> [a] -> [a] -merge xs ys = match (xs, ys) with - ([], ys) -> ys - (xs, []) -> xs - (h +: t, h2 +: t2) -> - if h <= h2 then h +: merge t (h2 +: t2) - else h2 +: merge (h +: t) t2 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - merge : [a] -> [a] -> [a] -``` - -And here's a version using `cases`. The patterns are separated by commas: - -``` unison -merge2 : [a] -> [a] -> [a] -merge2 = cases - [], ys -> ys - xs, [] -> xs - h +: t, h2 +: t2 -> - if h <= h2 then h +: merge2 t (h2 +: t2) - else h2 +: merge2 (h +: t) t2 -``` - -``` ucm :added-by-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`: - - merge2 : [a] -> [a] -> [a] - (also named merge) -``` - -Notice that Unison detects this as an alias of `merge`, and if we view `merge` - -``` ucm -scratch/main> view merge - - merge : [a] -> [a] -> [a] - merge = cases - [], ys -> ys - xs, [] -> xs - h +: t, h2 +: t2 -> - if h <= h2 then h +: merge t (h2 +: t2) - else h2 +: merge (h +: t) t2 -``` - -it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. - -Here's another example: - -``` unison -structural type B = T | F - -blah : B -> B -> Text -blah = cases - T, x -> "hi" - x, y -> "bye" - -blorf = cases - x, T -> x - x, y -> y - -> blah T F -> blah F F -> blorf T F -``` - -``` ucm :added-by-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 B - blah : B -> B -> Text - blorf : B -> B -> B - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 12 | > blah T F - ⧩ - "hi" - - 13 | > blah F F - ⧩ - "bye" - - 14 | > blorf T F - ⧩ - F -``` - -## Patterns with multiple guards - -``` unison -merge3 : [a] -> [a] -> [a] -merge3 = cases - [], ys -> ys - xs, [] -> xs - h +: t, h2 +: t2 | h <= h2 -> h +: merge3 t (h2 +: t2) - | otherwise -> h2 +: merge3 (h +: t) t2 -``` - -``` ucm :added-by-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`: - - merge3 : [a] -> [a] -> [a] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - merge3 : [a] -> [a] -> [a] -scratch/main> view merge3 - - merge3 : [a] -> [a] -> [a] - merge3 = cases - [], ys -> ys - xs, [] -> xs - h +: t, h2 +: t2 - | h <= h2 -> h +: merge3 t (h2 +: t2) - | otherwise -> h2 +: merge3 (h +: t) t2 -``` - -This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. - -``` unison -merge4 : [a] -> [a] -> [a] -merge4 a b = match (a,b) with - [], ys -> ys - xs, [] -> xs - h +: t, h2 +: t2 | h <= h2 -> h +: merge4 t (h2 +: t2) - h +: t, h2 +: t2 | otherwise -> h2 +: merge4 (h +: t) t2 -``` - -``` ucm :added-by-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`: - - merge4 : [a] -> [a] -> [a] - (also named merge3) -``` diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md deleted file mode 100644 index 50f3242b57..0000000000 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ /dev/null @@ -1,57 +0,0 @@ -``` ucm :hide -scratch/main> builtins.mergeio -``` - -``` unison :hide - -{{ Type doc }} -structural type Optional a = - None - | Some a - -{{ - Multi line - - Term doc -}} -List.map : - (a -> b) - -> [a] - -> [b] -List.map f = cases - (x +: xs) -> f x +: List.map f xs - [] -> [] - -test> z = let - x = "hello" - y = "world" - [Ok (x ++ y)] -``` - -``` ucm -scratch/main> debug.lsp.fold-ranges - - - 《{{ Type doc }}》 - 《structural type Optional a = - None - | Some a》 - - 《{{ - Multi line - - Term doc - }}》 - 《List.map : - (a -> b) - -> [a] - -> [b] - List.map f = cases - (x +: xs) -> f x +: List.map f xs - [] -> []》 - - 《test> z = let - x = "hello" - y = "world" - [Ok (x ++ y)]》 -``` diff --git a/unison-src/transcripts/lsp-name-completion.output.md b/unison-src/transcripts/lsp-name-completion.output.md deleted file mode 100644 index c3af7b2e61..0000000000 --- a/unison-src/transcripts/lsp-name-completion.output.md +++ /dev/null @@ -1,46 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -``` unison :hide -foldMap = "top-level" -nested.deeply.foldMap = "nested" -lib.base.foldMap = "lib" -lib.dep.lib.transitive.foldMap = "transitive-lib" --- A deeply nested definition with the same hash as the top level one. --- This should not be included in the completion results if a better name with the same hash IS included. -lib.dep.lib.transitive_same_hash.foldMap = "top-level" -foldMapWith = "partial match" - -other = "other" -``` - -``` ucm :hide -scratch/main> add -``` - -Completion should find all the `foldMap` definitions in the codebase, -sorted by number of name segments, shortest first. - -Individual LSP clients may still handle sorting differently, e.g. doing a fuzzy match over returned results, or -prioritizing exact matches over partial matches. We don't have any control over that. - -``` ucm -scratch/main> debug.lsp-name-completion foldMap - - Matching Path Name Hash - foldMap foldMap #o38ps8p4q6 - foldMapWith foldMapWith #r9rs4mcb0m - foldMap nested.deeply.foldMap #snrjegr5dk - foldMap lib.base.foldMap #jf4buul17k - foldMap lib.dep.lib.transitive.foldMap #0o01gvr3fi -``` - -Should still find the term which has a matching hash to a better name if the better name doesn't match. - -``` ucm -scratch/main> debug.lsp-name-completion transitive_same_hash.foldMap - - Matching Path Name Hash - transitive_same_hash.foldMap lib.dep.lib.transitive_same_hash.foldMap #o38ps8p4q6 -``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md deleted file mode 100644 index 927fadf5e0..0000000000 --- a/unison-src/transcripts/move-all.output.md +++ /dev/null @@ -1,198 +0,0 @@ -# Tests for `move` - -``` ucm :hide -scratch/main> builtins.merge -``` - -## Happy Path - namespace, term, and type - -Create a term, type, and namespace with history - -``` unison -Foo = 2 -unique type Foo = Foo -Foo.termInA = 1 -unique type Foo.T = T -``` - -``` ucm :added-by-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 - type Foo.T - Foo : Nat - Foo.termInA : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - type Foo.T - Foo : Nat - Foo.termInA : Nat -``` - -``` unison -Foo.termInA = 2 -unique type Foo.T = T1 | T2 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo.T - Foo.termInA : Nat - (also named Foo) -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. - -``` ucm -scratch/main> move Foo Bar - - Done. -scratch/main> ls - - 1. Bar (Nat) - 2. Bar (type) - 3. Bar/ (4 terms, 1 type) - 4. builtin/ (469 terms, 74 types) -scratch/main> ls Bar - - 1. Foo (Bar) - 2. T (type) - 3. T/ (2 terms) - 4. termInA (Nat) -scratch/main> history Bar - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #o7vuviel4c - - + Adds / updates: - - T T.T1 T.T2 termInA - - - Deletes: - - T.T - - □ 2. #c5cggiaumo (start of history) -``` - -## Happy Path - Just term - -``` unison -bonk = 5 -``` - -``` ucm :added-by-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 -z/main> builtins.merge - - Done. -z/main> add - - ⍟ I've added these definitions: - - bonk : Nat -z/main> move bonk zonk - - Done. -z/main> ls - - 1. builtin/ (469 terms, 74 types) - 2. zonk (Nat) -``` - -## Happy Path - Just namespace - -``` unison -bonk.zonk = 5 -``` - -``` ucm :added-by-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.zonk : Nat - (also named zonk) -``` - -``` ucm -a/main> builtins.merge - - Done. -a/main> add - - ⍟ I've added these definitions: - - bonk.zonk : Nat -a/main> move bonk zonk - - Done. -a/main> ls - - 1. builtin/ (469 terms, 74 types) - 2. zonk/ (1 term) -a/main> view zonk.zonk - - zonk.zonk : Nat - zonk.zonk = 5 -``` - -## Sad Path - No term, type, or namespace named src - -``` ucm :error -scratch/main> move doesntexist foo - - ⚠️ - - There is no term, type, or namespace at doesntexist. -``` diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md deleted file mode 100644 index 4a2fcd117e..0000000000 --- a/unison-src/transcripts/move-namespace.output.md +++ /dev/null @@ -1,362 +0,0 @@ -# Tests for `move.namespace` - -## Moving the Root - -I should be able to move the root into a sub-namespace - -``` unison :hide -foo = 1 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : ##Nat --- 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 - - 1. root/ (1 term) -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #g97lh1m2v7 (start of history) -``` - -``` ucm -scratch/main> ls .root.at.path - - 1. foo (##Nat) -scratch/main> 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 -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 - - 1. foo (##Nat) -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #08a6hgi6s4 (start of history) -``` - -``` ucm :error --- should be empty -scratch/main> ls .root.at.path - - nothing to show -scratch/main> history .root.at.path - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` - -``` ucm :hide -scratch/happy> builtins.merge lib.builtins -``` - -## Happy path - -Create a namespace and add some history to it - -``` unison -a.termInA = 1 -unique type a.T = T -``` - -``` ucm :added-by-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 a.T - a.termInA : Nat -``` - -``` ucm -scratch/happy> add - - ⍟ I've added these definitions: - - type a.T - a.termInA : Nat -``` - -``` unison -a.termInA = 2 -unique type a.T = T1 | T2 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type a.T - a.termInA : Nat -``` - -``` ucm -scratch/happy> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -Should be able to move the namespace, including its types, terms, and sub-namespaces. - -``` ucm -scratch/happy> move.namespace a b - - Done. -scratch/happy> ls b - - 1. T (type) - 2. T/ (2 terms) - 3. termInA (Nat) -scratch/happy> history b - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #rkvfe5p8fu - - + Adds / updates: - - T T.T1 T.T2 termInA - - - Deletes: - - T.T - - □ 2. #avlnmh0erc (start of history) -``` - -## Namespace history - -``` ucm :hide -scratch/history> builtins.merge lib.builtins -``` - -Create some namespaces and add some history to them - -``` unison -a.termInA = 1 -b.termInB = 10 -``` - -``` ucm :added-by-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.termInA : Nat - b.termInB : Nat -``` - -``` ucm -scratch/history> add - - ⍟ I've added these definitions: - - a.termInA : Nat - b.termInB : Nat -``` - -``` unison -a.termInA = 2 -b.termInB = 11 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - a.termInA : Nat - b.termInB : Nat -``` - -``` ucm -scratch/history> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` - -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. - -``` ucm -scratch/history> delete.namespace b - - Done. -scratch/history> move.namespace a b - - Done. --- Should be the history from 'a' -scratch/history> history b - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #j0cjjqepb3 - - + Adds / updates: - - termInA - - □ 2. #m8smmmgjso (start of history) --- Should be empty -scratch/history> history a - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` - -## Moving over an existing branch - -``` ucm :hide -scratch/existing> builtins.merge lib.builtins -``` - -Create some namespace and add some history to them - -``` unison -a.termInA = 1 -b.termInB = 10 -``` - -``` ucm :added-by-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.termInA : Nat - b.termInB : Nat -``` - -``` ucm -scratch/existing> add - - ⍟ I've added these definitions: - - a.termInA : Nat - b.termInB : Nat -``` - -``` unison -a.termInA = 2 -b.termInB = 11 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - a.termInA : Nat - b.termInB : Nat -``` - -``` ucm -scratch/existing> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/existing> move.namespace a b - - ⚠️ - - A branch existed at the destination: b so I over-wrote it. - - Tip: You can use `undo` or use a hash from `reflog` to undo - this change. - - Done. -``` diff --git a/unison-src/transcripts/name-resolution.output.md b/unison-src/transcripts/name-resolution.output.md deleted file mode 100644 index 59a40fdcc3..0000000000 --- a/unison-src/transcripts/name-resolution.output.md +++ /dev/null @@ -1,452 +0,0 @@ -# Example 1 - -We have a namespace type named `Namespace.Foo` and a file type named `File.Foo`. A reference to the type `Foo` is -ambiguous. A reference to `Namespace.Foo` or `File.Foo` work fine. - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -type Namespace.Foo = Bar -``` - -``` ucm :added-by-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 Namespace.Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Namespace.Foo -``` - -``` unison :error -type File.Foo = Baz -type UsesFoo = UsesFoo Foo -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - - ❓ - - I couldn't resolve any of these symbols: - - 2 | type UsesFoo = UsesFoo Foo - - - Symbol Suggestions - - Foo File.Foo - Namespace.Foo -``` - -``` unison -type File.Foo = Baz -type UsesFoo = UsesFoo Namespace.Foo File.Foo -``` - -``` ucm :added-by-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 File.Foo - type UsesFoo -``` - -``` ucm -scratch/main> project.delete scratch -``` - -# Example 2 - -We have a namespace type named `Foo` and a file type named `File.Foo`. A reference to the type `Foo` is not ambiguous: -it refers to the namespace type (because it is an exact match). - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -type Foo = Bar -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -``` - -``` unison -type File.Foo = Baz -type UsesFoo = UsesFoo Foo -``` - -``` ucm :added-by-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 File.Foo - type UsesFoo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type File.Foo - type UsesFoo -scratch/main> view UsesFoo - - type UsesFoo = UsesFoo Foo -``` - -``` ucm -scratch/main> project.delete scratch -``` - -# Example 3 - -We have a namespace type named `Namespace.Foo` and a file type named `Foo`. A reference to the type `Foo` is not ambiguous: -it refers to the file type (because it is an exact match). - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -type Namespace.Foo = Bar -``` - -``` ucm :added-by-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 Namespace.Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Namespace.Foo -``` - -``` unison -type Foo = Baz -type UsesFoo = UsesFoo Foo -``` - -``` ucm :added-by-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 - type UsesFoo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - type UsesFoo -scratch/main> view UsesFoo - - type UsesFoo = UsesFoo Foo -``` - -``` ucm -scratch/main> project.delete scratch -``` - -# Example 4 - -We have a namespace term `ns.foo : Nat` and a file term `file.foo : Text`. A reference to the term `foo` is ambiguous, -but resolves to `ns.foo` via TDNR. - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -ns.foo : Nat -ns.foo = 42 -``` - -``` ucm :added-by-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`: - - ns.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ns.foo : Nat -``` - -``` unison -file.foo : Text -file.foo = "foo" - -bar : Text -bar = foo ++ "bar" -``` - -``` ucm :added-by-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`: - - bar : Text - file.foo : Text -``` - -``` ucm -scratch/main> project.delete scratch -``` - -# Example 4 - -We have a namespace term `ns.foo : Nat` and a file term `file.foo : Text`. A reference to the term `foo` is ambiguous, -but resolves to `file.foo` via TDNR. - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -ns.foo : Nat -ns.foo = 42 -``` - -``` ucm :added-by-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`: - - ns.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ns.foo : Nat -``` - -``` unison -file.foo : Text -file.foo = "foo" - -bar : Nat -bar = foo + 42 -``` - -``` ucm :added-by-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`: - - bar : Nat - file.foo : Text -``` - -``` ucm -scratch/main> project.delete scratch -``` - -# Example 4 - -We have a namespace term `ns.foo : Nat` and a file term `file.foo : Nat`. A reference to the term `foo` is ambiguous. -A reference to `ns.foo` or `file.foo` work fine. - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -ns.foo : Nat -ns.foo = 42 -``` - -``` ucm :added-by-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`: - - ns.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - ns.foo : Nat -``` - -``` unison :error -file.foo : Nat -file.foo = 43 - -bar : Nat -bar = foo + 10 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what foo refers to here: - - 5 | bar = foo + 10 - - The name foo is ambiguous. Its type should be: Nat - - I found some terms in scope that have matching names and - types. Maybe you meant one of these: - - file.foo : Nat - ns.foo : Nat -``` - -``` unison -file.foo : Nat -file.foo = 43 - -bar : Nat -bar = file.foo + ns.foo -``` - -``` ucm :added-by-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`: - - bar : Nat - file.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - file.foo : Nat -scratch/main> view bar - - bar : Nat - bar = - use Nat + - file.foo + ns.foo -``` - -``` ucm -scratch/main> project.delete scratch -``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md deleted file mode 100644 index da62438c48..0000000000 --- a/unison-src/transcripts/name-segment-escape.output.md +++ /dev/null @@ -1,35 +0,0 @@ -You can use a keyword or reserved operator as a name segment if you surround it with backticks. - -``` ucm :error -scratch/main> view `match` - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - `match` -scratch/main> view `=` - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - `=` -``` - -You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` - -This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). - -``` ucm :error -scratch/main> view `.` - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - `.` -scratch/main> view `()` - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - `()` -``` diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md deleted file mode 100644 index 34690c9855..0000000000 --- a/unison-src/transcripts/name-selection.output.md +++ /dev/null @@ -1,197 +0,0 @@ -This transcript shows how the pretty-printer picks names for a hash when multiple are available. The algorithm is: - -1. Names that are "name-only" come before names that are hash qualified. So `List.map` comes before `List.map#2384a` and also `aaaa#xyz`. -2. Shorter names (in terms of segment count) come before longer ones, for instance `base.List.map` comes before `somelibrary.external.base.List.map`. -3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -scratch/biasing> builtins.merge lib.builtins -``` - -``` unison :hide -a.a = a.b + 1 -a.b = 0 + 1 -a.aaa.but.more.segments = 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 -scratch/main> add - - ⍟ I've added these definitions: - - a.a : Nat - a.aaa.but.more.segments : Nat - a.b : Nat -scratch/main> view a.a - - a.a : Nat - a.a = - use Nat + - b + 1 -``` - -Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: - -``` unison :hide -a2.a = a2.b + 1 -a2.b = 0 + 1 -a2.aaa.but.more.segments = 0 + 1 -a2.c = 1 -a2.d = a2.c + 10 -a2.long.name.but.shortest.suffixification = 1 - -a3.a = a3.b + 1 -a3.b = 0 + 1 -a3.aaa.but.more.segments = 0 + 1 -a3.c = 2 -a3.d = a3.c + 10 -a3.long.name.but.shortest.suffixification = 1 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - a2.a : Nat - (also named a.a) - a2.aaa.but.more.segments : Nat - (also named a.b and a.aaa.but.more.segments) - a2.b : Nat - (also named a.b and a.aaa.but.more.segments) - a2.c : Nat - a2.d : Nat - a2.long.name.but.shortest.suffixification : Nat - a3.a : Nat - (also named a.a) - a3.aaa.but.more.segments : Nat - (also named a.b and a.aaa.but.more.segments) - a3.b : Nat - (also named a.b and a.aaa.but.more.segments) - a3.c : Nat - a3.d : Nat - a3.long.name.but.shortest.suffixification : Nat -scratch/main> debug.alias.term.force a2.c a3.c - - Done. -scratch/main> debug.alias.term.force a2.d a3.d - - Done. -``` - -At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. -The original `a2` namespace has an unconflicted definition for `c` and `d`, but since there are multiple 'c's in scope, -`a2.c` is chosen because although the suffixified version has fewer segments, its fully-qualified name has the fewest segments. - -``` ucm -scratch/main> 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 :added-by-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 -scratch/biasing> add - - ⍟ 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. -scratch/biasing> view deeply.nested.term - - deeply.nested.term : Nat - deeply.nested.term = - use Nat + - num + 1 -``` - -Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` - -``` unison -other.num = 20 -``` - -``` ucm :added-by-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 -``` - -``` ucm -scratch/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. -scratch/biasing> view deeply.nested.term - - deeply.nested.term : Nat - deeply.nested.term = - use Nat + - nested.num + 1 -``` diff --git a/unison-src/transcripts/names.output.md b/unison-src/transcripts/names.output.md deleted file mode 100644 index 254a1cd2c8..0000000000 --- a/unison-src/transcripts/names.output.md +++ /dev/null @@ -1,106 +0,0 @@ -# `names` command - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -``` - -Example uses of the `names` command and output - -``` unison --- Some names with the same value -some.place.x = 1 -some.otherplace.y = 1 -some.otherplace.x = 10 -somewhere.z = 1 --- Some similar name with a different value -somewhere.y = 2 -``` - -``` ucm :added-by-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`: - - some.otherplace.x : Nat - some.otherplace.y : Nat - some.place.x : Nat - somewhere.y : Nat - somewhere.z : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - some.otherplace.x : Nat - some.otherplace.y : Nat - some.place.x : Nat - somewhere.y : Nat - somewhere.z : Nat -``` - -`names` searches relative to the current path. - -``` ucm --- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. -scratch/main> names 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 -scratch/main> names #gjmq673r1v - - Term - Hash: #gjmq673r1v - Names: some.otherplace.y some.place.x somewhere.z --- Works with absolute names too -scratch/main> names .some.place.x - - Term - Hash: #gjmq673r1v - Names: some.otherplace.y some.place.x somewhere.z -``` - -`debug.names.global` searches from the root, and absolutely qualifies results - -``` ucm --- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively. -scratch/other> debug.names.global x - - Found results in scratch/main - - 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 -scratch/other> debug.names.global #gjmq673r1v - - Found results in scratch/main - - Term - Hash: #gjmq673r1v - Names: some.otherplace.y some.place.x somewhere.z --- We can search using an absolute name -scratch/other> debug.names.global .some.place.x - - Found results in scratch/main - - Term - Hash: #gjmq673r1v - Names: some.otherplace.y some.place.x somewhere.z -``` diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md deleted file mode 100644 index fa3adfbe0b..0000000000 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ /dev/null @@ -1,26 +0,0 @@ -# Namespace deletion regression test - -See https://github.com/unisonweb/unison/issues/1552 - -If branch operations aren't performed in the correct order it's possible to end up with unexpected results. - -Previously the following sequence delete the current namespace -unexpectedly 😬. - -``` ucm -scratch/main> alias.term ##Nat.+ Nat.+ - - Done. -scratch/main> ls Nat - - 1. + (##Nat -> ##Nat -> ##Nat) -scratch/main> move.namespace Nat Nat.operators - - Done. -scratch/main> ls Nat - - 1. operators/ (1 term) -scratch/main> ls Nat.operators - - 1. + (##Nat -> ##Nat -> ##Nat) -``` diff --git a/unison-src/transcripts/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md deleted file mode 100644 index c803a2009a..0000000000 --- a/unison-src/transcripts/namespace-dependencies.output.md +++ /dev/null @@ -1,31 +0,0 @@ -# namespace.dependencies command - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -``` - -``` unison :hide -const a b = a -external.mynat = 1 -mynamespace.dependsOnText = const external.mynat 10 -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - const : a -> b -> a - external.mynat : Nat - mynamespace.dependsOnText : Nat -scratch/main> namespace.dependencies mynamespace - - External dependency Dependents in scratch/main:.mynamespace - lib.builtins.Nat 1. dependsOnText - - const 1. dependsOnText - - external.mynat 1. dependsOnText -``` diff --git a/unison-src/transcripts/namespace-directive.output.md b/unison-src/transcripts/namespace-directive.output.md deleted file mode 100644 index fa3c5f67b7..0000000000 --- a/unison-src/transcripts/namespace-directive.output.md +++ /dev/null @@ -1,200 +0,0 @@ -A `namespace foo` directive is optional, and may only appear at the top of a file. - -It affects the contents of the file as follows: - -1. All bindings like `x.y.z` are prefixed with the namespace; note that when this file is saved, the feedback mentions - the full bindings' names. - -``` ucm -scratch/main> builtins.mergeio lib.builtins - - Done. -``` - -``` unison -namespace foo - -baz : Nat -baz = 17 -``` - -``` ucm :added-by-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.baz : Nat -``` - -2. Free variables whose names exactly match bindings in the file are rewritten to refer to the prefixed binder instead. - That is, a term like `factorial = ... factorial ...` is rewritten to `foo.factorial = ... foo.factorial ...`. - -``` unison -namespace foo - -factorial : Int -> Int -factorial = cases - +0 -> +1 - n -> n * factorial (n - +1) - -longer.evil.factorial : Int -> Int -longer.evil.factorial n = n -``` - -``` ucm :added-by-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.factorial : Int -> Int - foo.longer.evil.factorial : Int -> Int -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo.factorial : Int -> Int - foo.longer.evil.factorial : Int -> Int -scratch/main> view factorial - - foo.factorial : Int -> Int - foo.factorial = cases - +0 -> +1 - n -> n Int.* foo.factorial (n Int.- +1) - - foo.longer.evil.factorial : Int -> Int - foo.longer.evil.factorial n = n -``` - -Note that in the above example, we do not want the existence of a `namespace foo` directive to determine whether the -reference to the name `factorial` within the body of `factorial` is a recursive reference (good, behavior without -namespace directive, exact-name-match-wins semantics) or an ambiguous reference (bad, as would be the case if the -bindings were expanded to `foo.factorial` and `foo.longer.evil.factorial`, but the variables left alone). - -Here are a few more examples demonstrating that type names, constructor names, generated record accessor names, and -type links are all properly handled. - -``` unison -type longer.foo.Foo = Bar -type longer.foo.Baz = { qux : Nat } -``` - -``` ucm :added-by-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 longer.foo.Baz - type longer.foo.Foo - longer.foo.Baz.qux : Baz -> Nat - longer.foo.Baz.qux.modify : (Nat ->{g} Nat) - -> Baz - ->{g} Baz - longer.foo.Baz.qux.set : Nat -> Baz -> Baz -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type longer.foo.Baz - type longer.foo.Foo - longer.foo.Baz.qux : Baz -> Nat - longer.foo.Baz.qux.modify : (Nat ->{g} Nat) -> Baz ->{g} Baz - longer.foo.Baz.qux.set : Nat -> Baz -> Baz -``` - -``` unison -namespace foo - -type Foo = Bar -type Baz = { qux : Nat } - -type RefersToFoo = RefersToFoo Foo - -refersToBar = cases - Foo.Bar -> 17 - -refersToQux baz = - Baz.qux baz + Baz.qux baz - -hasTypeLink = - {{ {type Foo} }} -``` - -``` ucm :added-by-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.Baz - type foo.Foo - type foo.RefersToFoo - foo.Baz.qux : foo.Baz -> Nat - foo.Baz.qux.modify : (Nat ->{g} Nat) - -> foo.Baz - ->{g} foo.Baz - foo.Baz.qux.set : Nat -> foo.Baz -> foo.Baz - foo.hasTypeLink : Doc2 - foo.refersToBar : foo.Foo -> Nat - foo.refersToQux : foo.Baz -> Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type foo.Baz - type foo.Foo - type foo.RefersToFoo - foo.Baz.qux : foo.Baz -> Nat - foo.Baz.qux.modify : (Nat ->{g} Nat) - -> foo.Baz - ->{g} foo.Baz - foo.Baz.qux.set : Nat -> foo.Baz -> foo.Baz - foo.hasTypeLink : Doc2 - foo.refersToBar : foo.Foo -> Nat - foo.refersToQux : foo.Baz -> Nat -scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink - - type foo.RefersToFoo = RefersToFoo foo.Foo - - foo.hasTypeLink : Doc2 - foo.hasTypeLink = {{ {type foo.Foo} }} - - foo.refersToBar : foo.Foo -> Nat - foo.refersToBar = cases foo.Foo.Bar -> 17 - - foo.refersToQux : foo.Baz -> Nat - foo.refersToQux baz = - use Nat + - use foo.Baz qux - qux baz + qux baz -scratch/main> todo - - You have no pending todo items. Good work! ✅ -``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md deleted file mode 100644 index 27f26ebfa2..0000000000 --- a/unison-src/transcripts/numbered-args.output.md +++ /dev/null @@ -1,161 +0,0 @@ -# Using numbered arguments in UCM - -``` ucm :hide -scratch/main> alias.type ##Text Text -``` - -First lets add some contents to our codebase. - -``` unison -foo = "foo" -bar = "bar" -baz = "baz" -qux = "qux" -quux = "quux" -corge = "corge" -``` - -``` ucm :added-by-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`: - - bar : Text - baz : Text - corge : Text - foo : Text - quux : Text - qux : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Text - baz : Text - corge : Text - foo : Text - quux : Text - qux : Text -``` - -We can get the list of things in the namespace, and UCM will give us a numbered -list: - -``` ucm -scratch/main> find - - 1. bar : Text - 2. baz : Text - 3. corge : Text - 4. foo : Text - 5. quux : Text - 6. qux : Text - 7. builtin type Text -``` - -We can ask to `view` the second element of this list: - -``` ucm -scratch/main> find - - 1. bar : Text - 2. baz : Text - 3. corge : Text - 4. foo : Text - 5. quux : Text - 6. qux : Text - 7. builtin type Text -scratch/main> view 2 - - baz : Text - baz = "baz" -``` - -And we can `view` multiple elements by separating with spaces: - -``` ucm -scratch/main> find - - 1. bar : Text - 2. baz : Text - 3. corge : Text - 4. foo : Text - 5. quux : Text - 6. qux : Text - 7. builtin type Text -scratch/main> view 2 3 5 - - baz : Text - baz = "baz" - - corge : Text - corge = "corge" - - quux : Text - quux = "quux" -``` - -We can also ask for a range: - -``` ucm -scratch/main> find - - 1. bar : Text - 2. baz : Text - 3. corge : Text - 4. foo : Text - 5. quux : Text - 6. qux : Text - 7. builtin type Text -scratch/main> view 2-4 - - baz : Text - baz = "baz" - - corge : Text - corge = "corge" - - foo : Text - foo = "foo" -``` - -And we can ask for multiple ranges and use mix of ranges and numbers: - -``` ucm -scratch/main> find - - 1. bar : Text - 2. baz : Text - 3. corge : Text - 4. foo : Text - 5. quux : Text - 6. qux : Text - 7. builtin type Text -scratch/main> view 1-3 4 5-6 - - bar : Text - bar = "bar" - - baz : Text - baz = "baz" - - corge : Text - corge = "corge" - - foo : Text - foo = "foo" - - quux : Text - quux = "quux" - - qux : Text - qux = "qux" -``` diff --git a/unison-src/transcripts/old-fold-right.output.md b/unison-src/transcripts/old-fold-right.output.md deleted file mode 100644 index a73bcebd0e..0000000000 --- a/unison-src/transcripts/old-fold-right.output.md +++ /dev/null @@ -1,30 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -oldRight: (b ->{e} a ->{e} b) -> [a] ->{e} [b] -oldRight f la = bug "out" - -pecan: '{} [Text] -pecan = 'let - la = [1, 2, 3] - f: Text -> Nat -> Text - f = bug "out" - - oldRight f la -``` - -``` ucm :added-by-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`: - - oldRight : (b ->{e} a ->{e} b) -> [a] ->{e} [b] - pecan : '[Text] -``` diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md deleted file mode 100644 index 75c628b11e..0000000000 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ /dev/null @@ -1,1343 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -# Basics - -## non-exhaustive patterns - -``` unison :error -unique type T = A | B | C - -test : T -> () -test = cases - A -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 4 | test = cases - 5 | A -> () - - - Patterns not matched: - - * B - * C -``` - -``` unison :error -unique type T = A | B - -test : (T, Optional T) -> () -test = cases - (A, Some _) -> () - (A, None) -> () - (B, Some A) -> () - (B, None) -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 4 | test = cases - 5 | (A, Some _) -> () - 6 | (A, None) -> () - 7 | (B, Some A) -> () - 8 | (B, None) -> () - - - Patterns not matched: - * (B, Some B) -``` - -## redundant patterns - -``` unison :error -unique type T = A | B | C - -test : T -> () -test = cases - A -> () - B -> () - C -> () - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 8 | _ -> () - -``` - -``` unison :error -unique type T = A | B - -test : (T, Optional T) -> () -test = cases - (A, Some _) -> () - (A, None) -> () - (B, Some _) -> () - (B, None) -> () - (A, Some A) -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 9 | (A, Some A) -> () - -``` - -# Uninhabited patterns - -match is complete without covering uninhabited patterns - -``` unison -unique type V = - -test : Optional (Optional V) -> () -test = cases - None -> () - Some None -> () -``` - -``` ucm :added-by-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 V - test : Optional (Optional V) -> () -``` - -uninhabited patterns are reported as redundant - -``` unison :error -unique type V = - -test0 : V -> () -test0 = cases - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 5 | _ -> () - -``` - -``` unison :error -unique type V = - -test : Optional (Optional V) -> () -test = cases - None -> () - Some None -> () - Some _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 7 | Some _ -> () - -``` - -# Guards - -## Incomplete patterns due to guards should be reported - -``` unison :error -test : () -> () -test = cases - () | false -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | () | false -> () - - - Patterns not matched: - * () -``` - -``` unison :error -test : Optional Nat -> Nat -test = cases - None -> 0 - Some x - | isEven x -> x -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | None -> 0 - 4 | Some x - 5 | | isEven x -> x - - - Patterns not matched: - * Some _ -``` - -## Complete patterns with guards should be accepted - -``` unison :error -test : Optional Nat -> Nat -test = cases - None -> 0 - Some x - | isEven x -> x - | otherwise -> 0 -``` - -``` ucm :added-by-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`: - - test : Optional Nat -> Nat -``` - -# Pattern instantiation depth - -Uncovered patterns are only instantiated as deeply as necessary to -distinguish them from existing patterns. - -``` unison :error -unique type T = A | B | C - -test : Optional (Optional T) -> () -test = cases - None -> () - Some None -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 4 | test = cases - 5 | None -> () - 6 | Some None -> () - - - Patterns not matched: - * Some (Some _) -``` - -``` unison :error -unique type T = A | B | C - -test : Optional (Optional T) -> () -test = cases - None -> () - Some None -> () - Some (Some A) -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 4 | test = cases - 5 | None -> () - 6 | Some None -> () - 7 | Some (Some A) -> () - - - Patterns not matched: - - * Some (Some B) - * Some (Some C) -``` - -# Literals - -## Non-exhaustive - -Nat - -``` unison :error -test : Nat -> () -test = cases - 0 -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | 0 -> () - - - Patterns not matched: - * _ -``` - -Boolean - -``` unison :error -test : Boolean -> () -test = cases - true -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | true -> () - - - Patterns not matched: - * false -``` - -## Exhaustive - -Nat - -``` unison -test : Nat -> () -test = cases - 0 -> () - _ -> () -``` - -``` ucm :added-by-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`: - - test : Nat -> () -``` - -Boolean - -``` unison -test : Boolean -> () -test = cases - true -> () - false -> () -``` - -``` ucm :added-by-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`: - - test : Boolean -> () -``` - -# Redundant - -Nat - -``` unison :error -test : Nat -> () -test = cases - 0 -> () - 0 -> () - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 4 | 0 -> () - -``` - -Boolean - -``` unison :error -test : Boolean -> () -test = cases - true -> () - false -> () - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 5 | _ -> () - -``` - -# Sequences - -## Exhaustive - -``` unison -test : [()] -> () -test = cases - [] -> () - x +: xs -> () -``` - -``` ucm :added-by-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`: - - test : [()] -> () -``` - -## Non-exhaustive - -``` unison :error -test : [()] -> () -test = cases - [] -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | [] -> () - - - Patterns not matched: - * (() +: _) -``` - -``` unison :error -test : [()] -> () -test = cases - x +: xs -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | x +: xs -> () - - - Patterns not matched: - * [] -``` - -``` unison :error -test : [()] -> () -test = cases - xs :+ x -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | xs :+ x -> () - - - Patterns not matched: - * [] -``` - -``` unison :error -test : [()] -> () -test = cases - x0 +: (x1 +: xs) -> () - [] -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | x0 +: (x1 +: xs) -> () - 4 | [] -> () - - - Patterns not matched: - * (() +: []) -``` - -``` unison :error -test : [()] -> () -test = cases - [] -> () - x0 +: [] -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 2 | test = cases - 3 | [] -> () - 4 | x0 +: [] -> () - - - Patterns not matched: - * (() +: (() +: _)) -``` - -## Uninhabited - -`Cons` is not expected since `V` is uninhabited - -``` unison -unique type V = - -test : [V] -> () -test = cases - [] -> () -``` - -``` ucm :added-by-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 V - test : [V] -> () -``` - -## Length restrictions can equate cons and nil patterns - -Here the first pattern matches lists of length two or greater, the -second pattern matches lists of length 0. The third case matches when the -final element is `false`, while the fourth pattern matches when the -first element is `true`. However, the only possible list length at -the third or fourth clause is 1, so the first and final element must -be equal. Thus, the pattern match is exhaustive. - -``` unison -test : [Boolean] -> () -test = cases - [a, b] ++ xs -> () - [] -> () - xs :+ false -> () - true +: xs -> () -``` - -``` ucm :added-by-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`: - - test : [Boolean] -> () -``` - -This is the same idea as above but shows that fourth match is redundant. - -``` unison :error -test : [Boolean] -> () -test = cases - [a, b] ++ xs -> () - [] -> () - xs :+ true -> () - true +: xs -> () - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 6 | true +: xs -> () - -``` - -This is another similar example. The first pattern matches lists of -length 5 or greater. The second matches lists of length 4 or greater where the -first and third element are true. The third matches lists of length 4 -or greater where the final 4 elements are `true, false, true, false`. -The list must be exactly of length 4 to arrive at the second or third -clause, so the third pattern is redundant. - -``` unison :error -test : [Boolean] -> () -test = cases - [a, b, c, d, f] ++ xs -> () - [true, _, true, _] ++ _ -> () - _ ++ [true, false, true, false] -> () - _ -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 5 | _ ++ [true, false, true, false] -> () - -``` - -# bugfix: Sufficient data decl map - -``` unison -unique type T = A - -unit2t : Unit -> T -unit2t = cases - () -> A -``` - -``` ucm :added-by-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 T - unit2t : 'T -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type T - unit2t : 'T -``` - -Pattern coverage checking needs the data decl map to contain all -transitive type dependencies of the scrutinee type. We do this -before typechecking begins in a roundabout way: fetching all -transitive type dependencies of references that appear in the expression. - -This test ensures that we have fetched the `T` type although there is -no data decl reference to `T` in `witht`. - -``` unison -witht : Unit -witht = match unit2t () with - x -> () -``` - -``` ucm :added-by-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`: - - witht : () -``` - -``` unison -unique type V = - -evil : Unit -> V -evil = bug "" -``` - -``` ucm :added-by-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 V - evil : 'V -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type V - evil : 'V -``` - -``` unison :error -withV : Unit -withV = match evil () with - x -> () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 3 | x -> () - -``` - -``` unison -unique type SomeType = A -``` - -``` ucm :added-by-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 SomeType -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type SomeType -``` - -``` unison -unique type R = R SomeType - -get x = match x with - R y -> y -``` - -``` ucm :added-by-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 R - get : R -> SomeType -``` - -``` unison -unique type R = { someType : SomeType } -``` - -``` ucm :added-by-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 R - R.someType : R -> SomeType - R.someType.modify : (SomeType ->{g} SomeType) -> R ->{g} R - R.someType.set : SomeType -> R -> R -``` - -# Ability handlers - -## Exhaustive ability handlers are accepted - -``` unison -structural ability Abort where - abort : {Abort} a - - -result : '{e, Abort} a -> {e} a -result f = handle !f with cases - { x } -> x - { abort -> _ } -> bug "aborted" -``` - -``` ucm :added-by-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 ability Abort - result : '{e, Abort} a ->{e} a -``` - -``` unison -structural ability Abort where - abort : {Abort} a - -unique type T = A | B - -result : '{e, Abort} T -> {e} () -result f = handle !f with cases - { T.A } -> () - { B } -> () - { abort -> _ } -> bug "aborted" -``` - -``` ucm :added-by-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 ability Abort - result : '{e, Abort} T ->{e} () - - ⍟ These names already exist. You can `update` them to your - new definition: - - type T -``` - -``` unison -structural ability Abort where - abort : {Abort} a - -result : '{e, Abort} V -> {e} V -result f = - impl : Request {Abort} V -> V - impl = cases - { abort -> _ } -> bug "aborted" - handle !f with impl -``` - -``` ucm :added-by-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 ability Abort - result : '{e, Abort} V ->{e} V -``` - -``` unison -structural ability Abort where - abort : {Abort} a - -structural ability Stream a where - emit : a -> {Stream a} Unit - -handleMulti : '{Stream a, Abort} r -> (Optional r, [a]) -handleMulti c = - impl xs = cases - { r } -> (Some r, xs) - { emit x -> resume } -> handle !resume with impl (xs :+ x) - { abort -> _ } -> (None, xs) - handle !c with impl [] -``` - -``` ucm :added-by-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 ability Abort - structural ability Stream a - handleMulti : '{Abort, Stream a} r -> (Optional r, [a]) -``` - -## Non-exhaustive ability handlers are rejected - -``` unison :error -structural ability Abort where - abort : {Abort} a - abortWithMessage : Text -> {Abort} a - - -result : '{e, Abort} a -> {e} a -result f = handle !f with cases - { abort -> _ } -> bug "aborted" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 7 | result f = handle !f with cases - 8 | { abort -> _ } -> bug "aborted" - - - Patterns not matched: - - * { _ } - * { abortWithMessage _ -> _ } -``` - -``` unison :error -structural ability Abort where - abort : {Abort} a - -unique type T = A | B - -result : '{e, Abort} T -> {e} () -result f = handle !f with cases - { T.A } -> () - { abort -> _ } -> bug "aborted" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 7 | result f = handle !f with cases - 8 | { T.A } -> () - 9 | { abort -> _ } -> bug "aborted" - - - Patterns not matched: - * { B } -``` - -``` unison :error -unique ability Give a where - give : a -> {Give a} Unit - -unique type T = A | B - -result : '{e, Give T} r -> {e} r -result f = handle !f with cases - { x } -> x - { give T.A -> resume } -> result resume -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 7 | result f = handle !f with cases - 8 | { x } -> x - 9 | { give T.A -> resume } -> result resume - - - Patterns not matched: - * { give B -> _ } -``` - -``` unison :error -structural ability Abort where - abort : {Abort} a - -structural ability Stream a where - emit : a -> {Stream a} Unit - -handleMulti : '{Stream a, Abort} r -> (Optional r, [a]) -handleMulti c = - impl : [a] -> Request {Stream a, Abort} r -> (Optional r, [a]) - impl xs = cases - { r } -> (Some r, xs) - { emit x -> resume } -> handle !resume with impl (xs :+ x) - handle !c with impl [] -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 10 | impl xs = cases - 11 | { r } -> (Some r, xs) - 12 | { emit x -> resume } -> handle !resume with impl (xs :+ x) - - - Patterns not matched: - * { abort -> _ } -``` - -## Redundant handler cases are rejected - -``` unison :error -unique ability Give a where - give : a -> {Give a} Unit - -unique type T = A | B - -result : '{e, Give T} r -> {e} r -result f = handle !f with cases - { x } -> x - { give _ -> resume } -> result resume - { give T.A -> resume } -> result resume -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 10 | { give T.A -> resume } -> result resume - -``` - -## Exhaustive ability reinterpretations are accepted - -``` unison -structural ability Abort where - abort : {Abort} a - abortWithMessage : Text -> {Abort} a - - -result : '{e, Abort} a -> {e, Abort} a -result f = handle !f with cases - { x } -> x - { abort -> _ } -> abort - { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) -``` - -``` ucm :added-by-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 ability Abort - result : '{e, Abort} a ->{e, Abort} a -``` - -``` unison -structural ability Abort a where - abort : {Abort a} r - abortWithMessage : a -> {Abort a} r - -result : '{e, Abort V} a -> {e, Abort V} a -result f = - impl : Request {Abort V} r -> {Abort V} r - impl = cases - { x } -> x - { abort -> _ } -> abort - handle !f with impl -``` - -``` ucm :added-by-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 ability Abort a - result : '{e, Abort V} a ->{e, Abort V} a -``` - -## Non-exhaustive ability reinterpretations are rejected - -``` unison :error -structural ability Abort where - abort : {Abort} a - abortWithMessage : Text -> {Abort} a - - -result : '{e, Abort} a -> {e, Abort} a -result f = handle !f with cases - { x } -> x - { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 7 | result f = handle !f with cases - 8 | { x } -> x - 9 | { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) - - - Patterns not matched: - * { abort -> _ } -``` - -## Hacky workaround for uninhabited abilities - -Although all of the constructors of an ability might be uninhabited, -the typechecker requires at least one be specified so that it can -determine that the ability should be discharged. So, the default -pattern match coverage checking behavior of prohibiting covering any -of the cases is problematic. Instead, the pattern match coverage -checker will require that at least one constructor be given, even if -they are all uninhabited. - -The messages here aren't the best, but I don't think uninhabited -abilities will come up and get handlers written for them often. - -``` unison :error -unique ability Give a where - give : a -> {Give a} Unit - give2 : a -> {Give a} Unit - -result : '{e, Give V} r -> {e} r -result f = - impl : Request {Give V} r -> {} r - impl = cases - { x } -> x - handle !f with impl -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - Pattern match doesn't cover all possible cases: - 8 | impl = cases - 9 | { x } -> x - - - Patterns not matched: - - * { give _ -> _ } - * { give2 _ -> _ } -``` - -``` unison -unique ability Give a where - give : a -> {Give a} Unit - give2 : a -> {Give a} Unit - -result : '{e, Give V} r -> {e} r -result f = - impl : Request {Give V} r -> {} r - impl = cases - { x } -> x - { give _ -> resume } -> bug "impossible" - handle !f with impl -``` - -``` ucm :added-by-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`: - - ability Give a - result : '{e, Give V} r ->{e} r -``` - -``` unison -unique ability Give a where - give : a -> {Give a} Unit - give2 : a -> {Give a} Unit - -result : '{e, Give V} r -> {e} r -result f = - impl : Request {Give V} r -> {} r - impl = cases - { x } -> x - { give2 _ -> resume } -> bug "impossible" - handle !f with impl -``` - -``` ucm :added-by-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`: - - ability Give a - result : '{e, Give V} r ->{e} r -``` - -``` unison :error -unique ability Give a where - give : a -> {Give a} Unit - give2 : a -> {Give a} Unit - -result : '{e, Give V} r -> {e} r -result f = - impl : Request {Give V} r -> {} r - impl = cases - { x } -> x - { give _ -> resume } -> bug "impossible" - { give2 _ -> resume } -> bug "impossible" - handle !f with impl -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 11 | { give2 _ -> resume } -> bug "impossible" - -``` - -``` unison :error -unique ability GiveA a where - giveA : a -> {GiveA a} Unit - giveA2 : a -> {GiveA a} Unit - -unique ability GiveB a where - giveB : a -> {GiveB a} Unit - giveB2 : a -> {GiveB a} Unit - -result : '{e, GiveA V, GiveB V} r -> {e} r -result f = - impl : Request {GiveA V, GiveB V} r -> {} r - impl = cases - { x } -> x - { giveA _ -> _ } -> bug "impossible" - { giveA2 _ -> _ } -> bug "impossible" - { giveB _ -> _ } -> bug "impossible" - { giveB2 _ -> _ } -> bug "impossible" - handle !f with impl -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - This case would be ignored because it's already covered by the preceding case(s): - 15 | { giveA2 _ -> _ } -> bug "impossible" - -``` - -``` unison -unique ability GiveA a where - giveA : a -> {GiveA a} Unit - giveA2 : a -> {GiveA a} Unit - -unique ability GiveB a where - giveB : a -> {GiveB a} Unit - giveB2 : a -> {GiveB a} Unit - -result : '{e, GiveA V, GiveB V} r -> {e} r -result f = - impl : Request {GiveA V, GiveB V} r -> {} r - impl = cases - { x } -> x - { giveA2 _ -> _ } -> bug "impossible" - { giveB _ -> _ } -> bug "impossible" - handle !f with impl -``` - -``` ucm :added-by-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`: - - ability GiveA a - ability GiveB a - result : '{e, GiveA V, GiveB V} r ->{e} r -``` diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md deleted file mode 100644 index c09675c9c1..0000000000 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ /dev/null @@ -1,193 +0,0 @@ -Regression test for https://github.com/unisonweb/unison/pull/2377 - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -structural ability Ab where - a: Nat -> () - -dopey = cases - ?0 -> () - _ -> () - -grumpy = cases - d -> () - -happy = cases - true -> () - false -> () - -sneezy = cases - +1 -> () - _ -> () - -bashful = cases - Some a -> () - _ -> () - -mouthy = cases - [] -> () - _ -> () - -pokey = cases - h +: t -> () - _ -> () - -sleepy = cases - i :+ l -> () - _ -> () - -demure = cases - [0] -> () - _ -> () - -angry = cases - a ++ [] -> () - -tremulous = cases - (0,1) -> () - _ -> () - -throaty = cases - { Ab.a a -> k } -> () - { _ } -> () - -agitated = cases - a | a == 2 -> () - _ -> () - -doc = cases - y@4 -> () - _ -> () -``` - -``` ucm :added-by-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 ability Ab - agitated : Nat -> () - angry : [t] -> () - bashful : Optional a -> () - demure : [Nat] -> () - doc : Nat -> () - dopey : Char -> () - grumpy : ff284oqf651 -> () - happy : Boolean -> () - mouthy : [t] -> () - pokey : [t] -> () - sleepy : [t] -> () - sneezy : Int -> () - throaty : Request {g, Ab} x -> () - tremulous : (Nat, Nat) -> () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural ability Ab - agitated : Nat -> () - angry : [t] -> () - bashful : Optional a -> () - demure : [Nat] -> () - doc : Nat -> () - dopey : Char -> () - grumpy : ff284oqf651 -> () - happy : Boolean -> () - mouthy : [t] -> () - pokey : [t] -> () - sleepy : [t] -> () - sneezy : Int -> () - throaty : Request {g, Ab} x -> () - tremulous : (Nat, Nat) -> () -scratch/main> view dopey - - dopey : Char -> () - dopey = cases - ?0 -> () - _ -> () -scratch/main> view grumpy - - grumpy : ff284oqf651 -> () - grumpy = cases d -> () -scratch/main> view happy - - happy : Boolean -> () - happy = cases - true -> () - false -> () -scratch/main> view sneezy - - sneezy : Int -> () - sneezy = cases - +1 -> () - _ -> () -scratch/main> view bashful - - bashful : Optional a -> () - bashful = cases - Some a -> () - _ -> () -scratch/main> view mouthy - - mouthy : [t] -> () - mouthy = cases - [] -> () - _ -> () -scratch/main> view pokey - - pokey : [t] -> () - pokey = cases - h +: t -> () - _ -> () -scratch/main> view sleepy - - sleepy : [t] -> () - sleepy = cases - i :+ l -> () - _ -> () -scratch/main> view demure - - demure : [Nat] -> () - demure = cases - [0] -> () - _ -> () -scratch/main> view angry - - angry : [t] -> () - angry = cases a ++ [] -> () -scratch/main> view tremulous - - tremulous : (Nat, Nat) -> () - tremulous = cases - (0, 1) -> () - _ -> () -scratch/main> view throaty - - throaty : Request {g, Ab} x -> () - throaty = cases - { Ab.a a -> k } -> () - { _ } -> () -scratch/main> view agitated - - agitated : Nat -> () - agitated = cases - a | a == 2 -> () - _ -> () -scratch/main> view doc - - doc : Nat -> () - doc = cases - y@4 -> () - _ -> () -``` diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md deleted file mode 100644 index 88b34574b2..0000000000 --- a/unison-src/transcripts/patternMatchTls.output.md +++ /dev/null @@ -1,51 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -We had bugs in the calling conventions for both send and terminate which would -cause pattern matching on the resulting (Right ()) would cause a runtime error. - -``` unison -use builtin.io2.Tls newClient send handshake terminate - -frank: '{IO} () -frank = do - socket = assertRight (clientSocket.impl "example.com" "443") - config = ClientConfig.default "example.com" 0xs - tls = assertRight (newClient.impl config socket) - () = assertRight (handshake.impl tls) - () = assertRight (send.impl tls 0xs) - () = assertRight (terminate.impl tls) - () - -assertRight : Either a b -> b -assertRight = cases - Right x -> x - Left _ -> bug "expected a right but got a left" -``` - -``` ucm :added-by-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`: - - assertRight : Either a b -> b - frank : '{IO} () -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - assertRight : Either a b -> b - frank : '{IO} () -scratch/main> run frank - - () -``` diff --git a/unison-src/transcripts/patterns.output.md b/unison-src/transcripts/patterns.output.md deleted file mode 100644 index 56b0474376..0000000000 --- a/unison-src/transcripts/patterns.output.md +++ /dev/null @@ -1,36 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Some tests of pattern behavior. - -``` unison -p1 = join [literal "blue", literal "frog"] - -> Pattern.run (many p1) "bluefrogbluegoat" -> Pattern.run (many.corrected p1) "bluefrogbluegoat" -``` - -``` ucm :added-by-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`: - - p1 : Pattern Text - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 3 | > Pattern.run (many p1) "bluefrogbluegoat" - ⧩ - Some ([], "goat") - - 4 | > Pattern.run (many.corrected p1) "bluefrogbluegoat" - ⧩ - Some ([], "bluegoat") -``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md deleted file mode 100644 index dd5838bedf..0000000000 --- a/unison-src/transcripts/propagate.output.md +++ /dev/null @@ -1,176 +0,0 @@ -# Propagating type edits - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -We introduce a type `Foo` with a function dependent `fooToInt`. - -``` unison -unique type Foo = Foo - -fooToInt : Foo -> Int -fooToInt _ = +42 -``` - -``` ucm :added-by-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 - fooToInt : Foo -> Int -``` - -And then we add it. - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - fooToInt : Foo -> Int -scratch/main> find.verbose - - 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo - type Foo - - 2. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo#0 - Foo.Foo : Foo - - 3. -- #j6hbm1gc2ak4f46b6705q90ld4bmhoi8etq2q45j081i9jgn95fvk3p6tjg67e7sm0021035i8qikmk4p6k845l5d00u26cos5731to - fooToInt : Foo -> Int - -scratch/main> view fooToInt - - fooToInt : Foo -> Int - fooToInt _ = +42 -``` - -Then if we change the type `Foo`... - -``` unison -unique type Foo = Foo | Bar -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -and update the codebase to use the new type `Foo`... - -``` ucm -scratch/main> update.old - - ⍟ I've updated these names to your new definition: - - type Foo -``` - -... it should automatically propagate the type to `fooToInt`. - -``` ucm -scratch/main> view fooToInt - - fooToInt : Foo -> Int - fooToInt _ = +42 -``` - -### Preserving user type variables - -We make a term that has a dependency on another term and also a non-redundant -user-provided type signature. - -``` unison -preserve.someTerm : Optional foo -> Optional foo -preserve.someTerm x = x - -preserve.otherTerm : Optional baz -> Optional baz -preserve.otherTerm y = someTerm y -``` - -``` ucm :added-by-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`: - - preserve.otherTerm : Optional baz -> Optional baz - preserve.someTerm : Optional foo -> Optional foo -``` - -Add that to the codebase: - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - preserve.otherTerm : Optional baz -> Optional baz - preserve.someTerm : Optional foo -> Optional foo -``` - -Let's now edit the dependency: - -``` unison -preserve.someTerm : Optional x -> Optional x -preserve.someTerm _ = None -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - preserve.someTerm : Optional x -> Optional x -``` - -Update... - -``` ucm -scratch/main> update.old - - ⍟ I've updated these names to your new definition: - - preserve.someTerm : Optional x -> Optional x -``` - -Now the type of `someTerm` should be `Optional x -> Optional x` and the -type of `otherTerm` should remain the same. - -``` ucm -scratch/main> view preserve.someTerm - - preserve.someTerm : Optional x -> Optional x - preserve.someTerm _ = None -scratch/main> view preserve.otherTerm - - preserve.otherTerm : Optional baz -> Optional baz - preserve.otherTerm y = someTerm y -``` diff --git a/unison-src/transcripts/pull-errors.output.md b/unison-src/transcripts/pull-errors.output.md deleted file mode 100644 index 9a1b0e4cdf..0000000000 --- a/unison-src/transcripts/pull-errors.output.md +++ /dev/null @@ -1,39 +0,0 @@ -``` ucm :error -test/main> pull @aryairani/test-almost-empty/main lib.base_latest - - The use of `pull` to install libraries is now deprecated. - Going forward, you can use - `lib.install @aryairani/test-almost-empty/main`. - - Downloaded 2 entities. - - I installed @aryairani/test-almost-empty/main as - aryairani_test_almost_empty_main. -test/main> pull @aryairani/test-almost-empty/main a.b - - ⚠️ - - Sorry, I wasn’t sure how to process your request: - - I think you want to merge @aryairani/test-almost-empty/main - into the a.b namespace, but the `pull` command only supports - merging into the top level of a local project branch. - - You can run `help pull` for more information on using `pull`. -test/main> pull @aryairani/test-almost-empty/main a - - I think you want to merge @aryairani/test-almost-empty/main - into the a branch, but it doesn't exist. If you want, you can - create it with `branch.empty a`, and then `pull` again. -test/main> pull @aryairani/test-almost-empty/main .a - - ⚠️ - - Sorry, I wasn’t sure how to process your request: - - I think you want to merge @aryairani/test-almost-empty/main - into the .a namespace, but the `pull` command only supports - merging into the top level of a local project branch. - - You can run `help pull` for more information on using `pull`. -``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md deleted file mode 100644 index 26548ab236..0000000000 --- a/unison-src/transcripts/records.output.md +++ /dev/null @@ -1,205 +0,0 @@ -Ensure that Records keep their syntax after being added to the codebase - -``` ucm :hide -scratch/main> builtins.merge -scratch/main> load unison-src/transcripts-using-base/base.u -``` - -## Record with 1 field - -``` unison :hide -unique type Record1 = { a : Text } -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view Record1 - - type Record1 = { a : Text } -``` - -## Record with 2 fields - -``` unison :hide -unique type Record2 = { a : Text, b : Int } -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view Record2 - - type Record2 = { a : Text, b : Int } -``` - -## Record with 3 fields - -``` unison :hide -unique type Record3 = { a : Text, b : Int, c : Nat } -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view Record3 - - type Record3 = { a : Text, b : Int, c : Nat } -``` - -## Record with many fields - -``` unison :hide -unique type Record4 = - { a : Text - , b : Int - , c : Nat - , d : Bytes - , e : Text - , f : Nat - , g : [Nat] - } -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view Record4 - - type Record4 - = { a : Text, - b : Int, - c : Nat, - d : Bytes, - e : Text, - f : Nat, - g : [Nat] } -``` - -## Record with many many fields - -``` unison :hide -unique type Record5 = { - zero : Nat, - one : [Nat], - two : [[Nat]], - three: [[[Nat]]], - four: [[[[Nat]]]], - five: [[[[[Nat]]]]], - six: [[[[[[Nat]]]]]], - seven: [[[[[[[Nat]]]]]]], - eight: [[[[[[[[Nat]]]]]]]], - nine: [[[[[[[[[Nat]]]]]]]]], - ten: [[[[[[[[[[Nat]]]]]]]]]], - eleven: [[[[[[[[[[[Nat]]]]]]]]]]], - twelve: [[[[[[[[[[[[Nat]]]]]]]]]]]], - thirteen: [[[[[[[[[[[[[Nat]]]]]]]]]]]]], - fourteen: [[[[[[[[[[[[[[Nat]]]]]]]]]]]]]], - fifteen: [[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]], - sixteen: [[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]], - seventeen: [[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]], - eighteen: [[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]], - nineteen: [[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]], - twenty: [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] -} -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> view Record5 - - type Record5 - = { zero : Nat, - one : [Nat], - two : [[Nat]], - three : [[[Nat]]], - four : [[[[Nat]]]], - five : [[[[[Nat]]]]], - six : [[[[[[Nat]]]]]], - seven : [[[[[[[Nat]]]]]]], - eight : [[[[[[[[Nat]]]]]]]], - nine : [[[[[[[[[Nat]]]]]]]]], - ten : [[[[[[[[[[Nat]]]]]]]]]], - eleven : [[[[[[[[[[[Nat]]]]]]]]]]], - twelve : [[[[[[[[[[[[Nat]]]]]]]]]]]], - thirteen : [[[[[[[[[[[[[Nat]]]]]]]]]]]]], - fourteen : [[[[[[[[[[[[[[Nat]]]]]]]]]]]]]], - fifteen : [[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]], - sixteen : [[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]], - seventeen : [[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]], - eighteen : [[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]], - nineteen : [[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]], - twenty : [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] } -``` - -## Record with user-defined type fields - -This record type has two fields whose types are user-defined (`Record4` and `UserType`). - -``` unison :hide -unique type UserType = UserType Nat - -unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } -``` - -``` ucm :hide -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 -scratch/main> view RecordWithUserType - - type RecordWithUserType - = { a : Text, b : Record4, c : UserType } -``` - -## Syntax - -Trailing commas are allowed. - -``` unison -unique type Record5 = - { a : Text, - b : Int, - } -``` - -``` ucm :added-by-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`: - - Record5.a : Record5 -> Text - Record5.a.modify : (Text ->{g} Text) - -> Record5 - ->{g} Record5 - Record5.a.set : Text -> Record5 -> Record5 - Record5.b : Record5 -> Int - Record5.b.modify : (Int ->{g} Int) - -> Record5 - ->{g} Record5 - Record5.b.set : Int -> Record5 -> Record5 - - ⍟ These names already exist. You can `update` them to your - new definition: - - type Record5 -``` diff --git a/unison-src/transcripts/redundant.output.md b/unison-src/transcripts/redundant.output.md deleted file mode 100644 index 94f13f90b7..0000000000 --- a/unison-src/transcripts/redundant.output.md +++ /dev/null @@ -1,45 +0,0 @@ -The same kind of thing happens with `map`. Are we saying this is incorrect behaviour? - -``` unison -map : (a -> b) -> [a] -> [b] -map f = cases - x +: xs -> f x +: map f xs - [] -> [] -``` - -``` ucm - - 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`: - - map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - -``` -``` ucm -.> add - - ⍟ I've added these definitions: - - map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b] - -.> view map - - map : (a -> b) -> [a] -> [b] - map f = cases - x +: xs -> - use builtin.List +: - f x +: map f xs - [] -> [] - -.> find map - - 1. map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b] - - -``` diff --git a/unison-src/transcripts/reflog.output.md b/unison-src/transcripts/reflog.output.md deleted file mode 100644 index 75a5c5d7b5..0000000000 --- a/unison-src/transcripts/reflog.output.md +++ /dev/null @@ -1,134 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -First we make some changes to the codebase so there's data in the reflog. - -``` unison -x = 1 -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - x : Nat -``` - -``` unison -y = 2 -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - y : Nat -scratch/main> branch /other - - Done. I've created the other branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /other`. -scratch/other> alias.term y z - - Done. -newproject/main> builtins.merge lib.builtins - - Done. -newproject/main> alias.type lib.builtins.Nat MyNat - - Done. -``` - -Should see reflog entries from the current branch - -``` ucm -scratch/main> reflog - - Below is a record of recent changes, you can use - `reset #abcdef` to reset the current branch to a previous - state. - - Tip: Use `diff.namespace 1 7` to compare between points in - history. - - Branch Hash Description - 1. scratch/main #6mdl5gruh5 add - 2. scratch/main #3rqf1hbev7 add - 3. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins - 4. scratch/main #sg60bvjo91 Project Created -``` - -Should see reflog entries from the current project - -``` ucm -scratch/main> project.reflog - - Below is a record of recent changes, you can use - `reset #abcdef` to reset the current branch to a previous - state. - - Tip: Use `diff.namespace 1 7` to compare between points in - history. - - Branch Hash Description - 1. scratch/other #148flqs4b1 alias.term scratch/other:.y scratch/other:z - 2. scratch/other #6mdl5gruh5 Branch created from scratch/main - 3. scratch/main #6mdl5gruh5 add - 4. scratch/main #3rqf1hbev7 add - 5. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins - 6. scratch/main #sg60bvjo91 Project Created -``` - -Should see reflog entries from all projects - -``` ucm -scratch/main> reflog.global - - Below is a record of recent changes, you can use - `reset #abcdef` to reset the current branch to a previous - state. - - Tip: Use `diff.namespace 1 7` to compare between points in - history. - - Branch Hash Description - 1. newproject/main #2rjhs2vq43 alias.term newproject/main:lib.builtins.Nat newproject/main:... - 2. newproject/main #ms9lggs2rg builtins.merge newproject/main:lib.builtins - 3. newproject/main #sg60bvjo91 Branch Created - 4. scratch/other #148flqs4b1 alias.term scratch/other:.y scratch/other:z - 5. scratch/other #6mdl5gruh5 Branch created from scratch/main - 6. scratch/main #6mdl5gruh5 add - 7. scratch/main #3rqf1hbev7 add - 8. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins - 9. scratch/main #sg60bvjo91 Project Created -``` diff --git a/unison-src/transcripts/release-draft-command.output.md b/unison-src/transcripts/release-draft-command.output.md deleted file mode 100644 index a1136ec464..0000000000 --- a/unison-src/transcripts/release-draft-command.output.md +++ /dev/null @@ -1,63 +0,0 @@ -The `release.draft` command drafts a release from the current branch. - -``` ucm :hide -foo/main> builtins.merge -``` - -Some setup: - -``` unison -someterm = 18 -``` - -``` ucm :added-by-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`: - - someterm : Nat -``` - -``` ucm -foo/main> add - - ⍟ I've added these definitions: - - someterm : Nat -``` - -Now, the `release.draft` demo: - -`release.draft` accepts a single semver argument. - -``` ucm -foo/main> release.draft 1.2.3 - - 😎 Great! I've created a draft release for you at - /releases/drafts/1.2.3. - - You can create a `ReleaseNotes : Doc` in this branch to give - an overview of the release. It'll automatically show up on - Unison Share when you publish. - - When ready to release 1.2.3 to the world, `push` the release - to Unison Share, navigate to the release, and click "Publish". - - Tip: if you get pulled away from drafting your release, you - can always get back to it with - `switch /releases/drafts/1.2.3`. -``` - -It's an error to try to create a `releases/drafts/x.y.z` branch that already exists. - -``` ucm :error -foo/main> release.draft 1.2.3 - - foo/releases/drafts/1.2.3 already exists. You can switch to it - with `switch foo/releases/drafts/1.2.3`. -``` diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md deleted file mode 100644 index 54e23fb64c..0000000000 --- a/unison-src/transcripts/reset.output.md +++ /dev/null @@ -1,193 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -def = "first value" -``` - -``` ucm :added-by-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`: - - def : Text -``` - -``` ucm :hide -scratch/main> update -``` - -``` unison :hide -def = "second value" -``` - -Can reset to a value from history by number. - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #5vq851j3hg - - + Adds / updates: - - def - - ⊙ 2. #ujvq6e87kp - - + Adds / updates: - - def - - □ 3. #4bigcpnl7t (start of history) -scratch/main> reset 2 - - Done. -scratch/main> view def - - def : Text - def = "first value" -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #ujvq6e87kp - - + Adds / updates: - - def - - □ 2. #4bigcpnl7t (start of history) -``` - -Can reset to a value from reflog by number. - -``` ucm -scratch/main> reflog - - Below is a record of recent changes, you can use - `reset #abcdef` to reset the current branch to a previous - state. - - Tip: Use `diff.namespace 1 7` to compare between points in - history. - - Branch Hash Description - 1. scratch/main #ujvq6e87kp reset ujvq6e87kp4288eq3al9v5luctic0ocd7ug1fu0go5bicrr2vfnrb0... - 2. scratch/main #5vq851j3hg update - 3. scratch/main #ujvq6e87kp update - 4. scratch/main #4bigcpnl7t builtins.merge - 5. scratch/main #sg60bvjo91 Project Created --- Reset the current branch to the first history element -scratch/main> reset 2 - - Done. -scratch/main> view def - - def : Text - def = "second value" -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #5vq851j3hg - - + Adds / updates: - - def - - ⊙ 2. #ujvq6e87kp - - + Adds / updates: - - def - - □ 3. #4bigcpnl7t (start of history) -``` - -# reset branch - -``` ucm -foo/main> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #sg60bvjo91 (start of history) -``` - -``` unison :hide -a = 5 -``` - -``` ucm -foo/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -foo/empty> reset /main: - - Done. -foo/empty> view a - - a : ##Nat - a = 5 -foo/empty> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #5l94rduvel (start of history) -``` - -## second argument is always interpreted as a branch - -``` unison :hide -main.a = 3 -``` - -``` ucm -foo/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -foo/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #0i64kpfccl - - + Adds / updates: - - main.a - - □ 2. #5l94rduvel (start of history) -foo/main> reset 2 main - - Done. -``` diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md deleted file mode 100644 index 863ce848b2..0000000000 --- a/unison-src/transcripts/resolution-failures.output.md +++ /dev/null @@ -1,124 +0,0 @@ -# Resolution Errors - -This transcript tests the errors printed to the user when a name cannot be resolved. - -## Codebase Setup - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -``` - -First we define differing types with the same name in different namespaces: - -``` unison -unique type one.AmbiguousType = one.AmbiguousType -unique type two.AmbiguousType = two.AmbiguousType - -one.ambiguousTerm = "term one" -two.ambiguousTerm = "term two" -``` - -``` ucm :added-by-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 one.AmbiguousType - type two.AmbiguousType - one.ambiguousTerm : Text - two.ambiguousTerm : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type one.AmbiguousType - type two.AmbiguousType - one.ambiguousTerm : Text - two.ambiguousTerm : Text -``` - -## Tests - -Now we introduce code which isn't sufficiently qualified. -It is ambiguous which type from which namespace we mean. - -We expect the output to: - -1. Print all ambiguous usage sites separately -2. Print possible disambiguation suggestions for each unique ambiguity - -``` unison :error --- We intentionally avoid using a constructor to ensure the constructor doesn't --- affect type resolution. -useAmbiguousType : AmbiguousType -> () -useAmbiguousType _ = () - -useUnknownType : UnknownType -> () -useUnknownType _ = () - --- Despite being a duplicate disambiguation, this should still be included in the annotations printout -separateAmbiguousTypeUsage : AmbiguousType -> () -separateAmbiguousTypeUsage _ = () -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - - ❓ - - I couldn't resolve any of these symbols: - - 3 | useAmbiguousType : AmbiguousType -> () - 4 | useAmbiguousType _ = () - 5 | - 6 | useUnknownType : UnknownType -> () - 7 | useUnknownType _ = () - 8 | - 9 | -- Despite being a duplicate disambiguation, this should still be included in the annotations printout - 10 | separateAmbiguousTypeUsage : AmbiguousType -> () - - - Symbol Suggestions - - AmbiguousType one.AmbiguousType - two.AmbiguousType - - UnknownType No matches -``` - -Currently, ambiguous terms are caught and handled by type directed name resolution, -but expect it to eventually be handled by the above machinery. - -``` unison :error -useAmbiguousTerm = ambiguousTerm -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what ambiguousTerm refers to here: - - 1 | useAmbiguousTerm = ambiguousTerm - - The name ambiguousTerm is ambiguous. I couldn't narrow it down - by type, as any type would work here. - - I found some terms in scope that have matching names and - types. Maybe you meant one of these: - - one.ambiguousTerm : Text - two.ambiguousTerm : Text -``` diff --git a/unison-src/transcripts/rsa.output.md b/unison-src/transcripts/rsa.output.md deleted file mode 100644 index cd07c425a3..0000000000 --- a/unison-src/transcripts/rsa.output.md +++ /dev/null @@ -1,73 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison - -up = 0xs0123456789abcdef -down = 0xsfedcba9876543210 - --- | Generated with: --- openssl genrsa -out private_key.pem 1024 --- openssl rsa -in private_key.pem -outform DER | xxd -p -secret = 0xs30820276020100300d06092a864886f70d0101010500048202603082025c02010002818100a7104b2f20725896076e629ccedbcd6907b16694c6e3d8768b5e0e685670b49616e796c588e5aafb92ef986c1a42c021fed0bdc99212c969cdab98087a0ee4c2f4acd4b6049a87a96afc45668329a3cf21a86fb13b488bbe9fefa1cd5a459014f0d0101378e9661e11b73acf54c8a91141ac90309e7fb6ed69b4e63230ab291502030100010281807cdc23a4fc3619d93f8293b728af848d0c0fdd603269d5bd7b99f760a9c22065d08693dbdcddf1f5863306133d694819e04d789aef4e95343b601507b8d9eac4492e6d7031b035c5d84eceaa9686b292712632d33b3303af84314d7920bc3d45f90d7818fc2587b129196d378ee4ed3e6b8d9010d504bb6470ff53e7c5fb17a1024100d67cbcf113d24325fcef12a778dc47c7060055290b68287649ef092558daccb61c4e7bc290740b75a29d4356dcbd66d18b0860dbff394cc8ff3d94d57617adbd024100c765d8261dd3d8e0d3caf11ab7b212eed181354215687ca6387283e4f0be16e79c8f298be0a70c7734dea78ea65128517d693cabfa4c0ff5328f2abb85d2023902403ca41dc347285e65c22251b2d9bfe5e7463217e1b7e0e5f7b3a58a7f6da4c6d60220ca6ad2ee8c42e10bf77afa83ee2af6551315800e52404db1ba7fb398b43d02410084877d85c0177933ddb12a554eb8edfa8b872c85d2c2d2ee8be019280696e19469ab81bab5c371f69d4e4be1f54b45d7fbda017870f1333e0eafb78051ee8689024061f694c12e934c44b7734f62d1b2a3d3624a4980e1b8e066d78dbabd2436654fbb9d9701425900daaafa1e031310e8a580520bb9e1c1288c669fce252bad1e65 - --- | Generated with: --- openssl rsa -in private_key.pem -outform DER -pubout | xxd -p -publicKey = 0xs30819f300d06092a864886f70d010101050003818d0030818902818100a7104b2f20725896076e629ccedbcd6907b16694c6e3d8768b5e0e685670b49616e796c588e5aafb92ef986c1a42c021fed0bdc99212c969cdab98087a0ee4c2f4acd4b6049a87a96afc45668329a3cf21a86fb13b488bbe9fefa1cd5a459014f0d0101378e9661e11b73acf54c8a91141ac90309e7fb6ed69b4e63230ab29150203010001 - -incorrectPublicKey = 0xs30819f300d06092a864886f70d010101050003818d0030818902818100a7104b2f20725896076e629ccedbcd6907b16694c6e3d8768b5e0e685670b49616e796c588e5aafb92ef986c1a42c021fed0bdc99212c969cdab98087a0ee4c2f4acd4b6049a87a96afc45668329a3cf21a86fb13b488bbe9fefa1cd5a459014f0d0101378e9661e11b73acf54c8a91141ac90309e7fb6ed69b4e63230ab29150203010002 - -message = up ++ down ++ up ++ down ++ down ++ up ++ down ++ up - -signature = crypto.Rsa.sign.impl secret message - -sigOkay = match signature with - Left err -> Left err - Right sg -> crypto.Rsa.verify.impl publicKey message sg - -sigKo = match signature with - Left err -> Left err - Right sg -> crypto.Rsa.verify.impl incorrectPublicKey message sg - -> signature -> sigOkay -> sigKo -``` - -``` ucm :added-by-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`: - - down : Bytes - incorrectPublicKey : Bytes - message : Bytes - publicKey : Bytes - secret : Bytes - sigKo : Either Failure Boolean - sigOkay : Either Failure Boolean - signature : Either Failure Bytes - up : Bytes - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 28 | > signature - ⧩ - Right - 0xs84b02b6bb0e1196b65378cb12b727f7b4b38e5979f0632e8a51cfab088827f6d3da4221788029f75a0a5f4d740372cfa590462888a1189bbd9de9b084f26116640e611af5a1a17229beec7fb2570887181bbdced8f0ebfec6cad6bdd318a616ba4f01c90e1436efe44b18417d18ce712a0763be834f8c76e0c39b2119b061373 - - 29 | > sigOkay - ⧩ - Right true - - 30 | > sigKo - ⧩ - Right false -``` diff --git a/unison-src/transcripts/scope-ref.output.md b/unison-src/transcripts/scope-ref.output.md deleted file mode 100644 index ac1972098d..0000000000 --- a/unison-src/transcripts/scope-ref.output.md +++ /dev/null @@ -1,38 +0,0 @@ -A short script to test mutable references with local scope. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -test = Scope.run 'let - r = Scope.ref 0 - Ref.write r 1 - i = Ref.read r - Ref.write r 2 - j = Ref.read r - Ref.write r 5 - (i, j, Ref.read r) - -> test -``` - -``` ucm :added-by-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`: - - test : (Nat, Nat, Nat) - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 10 | > test - ⧩ - (1, 2, 5) -``` diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md deleted file mode 100644 index ad8d1d3e69..0000000000 --- a/unison-src/transcripts/suffixes.output.md +++ /dev/null @@ -1,166 +0,0 @@ -# Suffix-based resolution of names - -``` ucm :hide -scratch/main> builtins.merge -``` - -Any unique name suffix can be used to refer to a definition. For instance: - -``` unison :hide --- No imports needed even though FQN is `builtin.{Int,Nat}` -foo.bar.a : Int -foo.bar.a = +99 - --- No imports needed even though FQN is `builtin.Optional.{None,Some}` -optional.isNone = cases - None -> true - Some _ -> false -``` - -This also affects commands like find. Notice lack of qualified names in output: - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo.bar.a : Int - optional.isNone : Optional a -> Boolean -scratch/main> find take - - 1. builtin.Bytes.take : Nat -> Bytes -> Bytes - 2. builtin.List.take : Nat -> [a] -> [a] - 3. builtin.Text.take : Nat -> Text -> Text - 4. builtin.io2.MVar.take.impl : MVar a ->{IO} Either Failure a - 5. builtin.io2.MVar.tryTake : MVar a ->{IO} Optional a -``` - -The `view` and `display` commands also benefit from this: - -``` ucm -scratch/main> view List.drop - - builtin builtin.List.drop : builtin.Nat -> [a] -> [a] -scratch/main> display bar.a - - +99 -``` - -In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. - -Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: - -``` ucm -scratch/main> find : Nat -> [a] -> [a] - - 1. builtin.List.drop : Nat -> [a] -> [a] - 2. builtin.List.take : Nat -> [a] -> [a] -``` - -## Preferring names not in `lib.*.lib.*` - -Suffix-based resolution prefers names that are not in an indirect dependency. - -``` unison -cool.abra.cadabra = "my project" -lib.distributed.abra.cadabra = "direct dependency 1" -lib.distributed.baz.qux = "direct dependency 2" -lib.distributed.lib.baz.qux = "indirect dependency" -``` - -``` ucm :added-by-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`: - - cool.abra.cadabra : Text - lib.distributed.abra.cadabra : Text - lib.distributed.baz.qux : Text - lib.distributed.lib.baz.qux : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - cool.abra.cadabra : Text - lib.distributed.abra.cadabra : Text - lib.distributed.baz.qux : Text - lib.distributed.lib.baz.qux : Text -``` - -``` unison :error -> abra.cadabra -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I couldn't figure out what abra.cadabra refers to here: - - 1 | > abra.cadabra - - The name abra.cadabra is ambiguous. I couldn't narrow it down - by type, as any type would work here. - - I found some terms in scope that have matching names and - types. Maybe you meant one of these: - - cool.abra.cadabra : Text - distributed.abra.cadabra : Text -``` - -``` unison -> baz.qux -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > baz.qux - ⧩ - "direct dependency 2" -``` - -``` ucm -scratch/main> view abra.cadabra - - cool.abra.cadabra : Text - cool.abra.cadabra = "my project" - - lib.distributed.abra.cadabra : Text - lib.distributed.abra.cadabra = "direct dependency 1" -scratch/main> view baz.qux - - lib.distributed.baz.qux : Text - lib.distributed.baz.qux = "direct dependency 2" -``` - -Note that we can always still view indirect dependencies by using more name segments: - -``` ucm -scratch/main> view distributed.abra.cadabra - - lib.distributed.abra.cadabra : Text - lib.distributed.abra.cadabra = "direct dependency 1" -scratch/main> names distributed.lib.baz.qux - - Term - Hash: #nhup096n2s - Names: lib.distributed.lib.baz.qux -``` diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md deleted file mode 100644 index ec032c8949..0000000000 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ /dev/null @@ -1,85 +0,0 @@ -# Regression test for updates which conflict with an existing data constructor - -https://github.com/unisonweb/unison/issues/2786 - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -First we add a sum-type to the codebase. - -``` unison -structural type X = x -``` - -``` ucm :added-by-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 X - (also named lib.builtins.Unit) -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type X - (also named lib.builtins.Unit) -``` - -Now we update the type, changing the name of the constructors, *but*, we simultaneously -add a new top-level term with the same name as the old constructor. - -``` unison -structural type X = y | z - -X.x : Text -X.x = "some text that's not in the codebase" - -dependsOnX = Text.size X.x -``` - -``` ucm :added-by-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.x : Text - dependsOnX : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - structural type X - (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 -scratch/main> update.old - - ⍟ I've added these definitions: - - X.x : Text - dependsOnX : Nat - - ⍟ I've updated these names to your new definition: - - structural type X - (The old definition was also named lib.builtins.Unit.) -``` diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md deleted file mode 100644 index 4c8b6e1377..0000000000 --- a/unison-src/transcripts/switch-command.output.md +++ /dev/null @@ -1,93 +0,0 @@ -The `switch` command switches to an existing project or branch. - -``` ucm :hide -foo/main> builtins.merge -bar/main> builtins.merge -``` - -Setup stuff. - -``` unison -someterm = 18 -``` - -``` ucm :added-by-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`: - - someterm : Nat -``` - -``` ucm -foo/main> add - - ⍟ I've added these definitions: - - someterm : Nat -foo/main> branch bar - - Done. I've created the bar branch based off of main. - - Tip: To merge your work back into the main branch, first - `switch /main` then `merge /bar`. -foo/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`. -``` - -Now, the demo. When unambiguous, `switch` switches to either a project or a branch in the current project. A branch in -the current project can be preceded by a forward slash (which makes it unambiguous). A project can be followed by a -forward slash (which makes it unambiguous). - -``` ucm -scratch/main> switch foo -scratch/main> switch foo/topic -foo/main> switch topic -foo/main> switch /topic -foo/main> switch bar/ -``` - -It's an error to try to switch to something ambiguous. - -``` ucm :error -foo/main> switch bar - - I'm not sure if you wanted to switch to the branch foo/bar or - the project bar. Could you be more specific? - - 1. /bar (the branch bar in the current project) - 2. bar/ (the project bar, with the branch left unspecified) - - Tip: use `switch 1` or `switch 2` to pick one of these. -``` - -It's an error to try to switch to something that doesn't exist, of course. - -``` ucm :error -scratch/main> switch foo/no-such-branch - - foo/no-such-branch does not exist. -``` - -``` ucm :error -scratch/main> switch no-such-project - - Neither project no-such-project nor branch /no-such-project - exists. -``` - -``` ucm :error -foo/main> switch no-such-project-or-branch - - Neither project no-such-project-or-branch nor branch - /no-such-project-or-branch exists. -``` diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md deleted file mode 100644 index 0a6336d99a..0000000000 --- a/unison-src/transcripts/tab-completion.output.md +++ /dev/null @@ -1,219 +0,0 @@ -# Tab Completion - -Test that tab completion works as expected. - -## Tab Complete Command Names - -``` ucm -scratch/main> debug.tab-complete vi - - view - view.global -scratch/main> debug.tab-complete delete. - - delete.branch - delete.namespace - delete.namespace.force - delete.project - delete.term - delete.term.verbose - delete.type - delete.type.verbose - delete.verbose -``` - -## Tab complete terms & types - -``` unison -subnamespace.someName = 1 -subnamespace.someOtherName = 2 -subnamespace2.thing = 3 -othernamespace.someName = 4 - -unique type subnamespace.AType = A | B -``` - -``` ucm :added-by-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 subnamespace.AType - othernamespace.someName : ##Nat - subnamespace.someName : ##Nat - subnamespace.someOtherName : ##Nat - subnamespace2.thing : ##Nat -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm --- Should tab complete namespaces since they may contain terms/types -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 -scratch/main> debug.tab-complete view subnamespace - - subnamespace. - subnamespace2. --- Should complete things from child namespaces of the current query if it's dot-suffixed -scratch/main> debug.tab-complete view subnamespace. - - * subnamespace.AType - subnamespace.AType. - * subnamespace.someName - * subnamespace.someOtherName --- Should complete things from child namespaces of the current query if there are no more completions at this level. -scratch/main> debug.tab-complete view subnamespace2 - - subnamespace2. - * subnamespace2.thing --- Should prefix-filter by query suffix -scratch/main> debug.tab-complete view subnamespace.some - - * subnamespace.someName - * subnamespace.someOtherName -scratch/main> debug.tab-complete view subnamespace.someOther - - * subnamespace.someOtherName -``` - -``` unison :hide -absolute.term = "absolute" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - absolute.term : ##Text --- Should tab complete absolute names -scratch/main> debug.tab-complete view .absolute.te - - * .absolute.term -``` - -## Tab complete namespaces - -``` ucm --- Should tab complete namespaces -scratch/main> debug.tab-complete find-in sub - - subnamespace - subnamespace2 -scratch/main> debug.tab-complete find-in subnamespace - - subnamespace - subnamespace2 -scratch/main> debug.tab-complete find-in subnamespace. - - subnamespace.AType -scratch/main> debug.tab-complete io.test sub - - subnamespace. - subnamespace2. -scratch/main> debug.tab-complete io.test subnamespace - - subnamespace. - subnamespace2. -scratch/main> debug.tab-complete io.test subnamespace. - - subnamespace.AType. - * subnamespace.someName - * subnamespace.someOtherName -``` - -Tab Complete Delete Subcommands - -``` unison -unique type Foo = A | B -add : a -> a -add b = b -``` - -``` ucm :added-by-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 - add : a -> a -``` - -``` ucm -scratch/main> update.old - - ⍟ I've added these definitions: - - type Foo - add : a -> a -scratch/main> debug.tab-complete delete.type Foo - - * Foo - Foo. -scratch/main> debug.tab-complete delete.term add - - * add -``` - -## Tab complete projects and branches - -``` ucm -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`. -myproject/main> debug.tab-complete branch.delete /mybr - - /mybranch -myproject/main> debug.tab-complete project.rename my - - myproject -``` - -Commands which complete namespaces OR branches should list both - -``` unison -mybranchsubnamespace.term = 1 -``` - -``` ucm :added-by-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`: - - mybranchsubnamespace.term : ##Nat -``` - -``` ucm -myproject/main> add - - ⍟ I've added these definitions: - - mybranchsubnamespace.term : ##Nat -myproject/main> debug.tab-complete merge mybr - - /mybranch -``` diff --git a/unison-src/transcripts/tdnr.output.md b/unison-src/transcripts/tdnr.output.md deleted file mode 100644 index cbb138389b..0000000000 --- a/unison-src/transcripts/tdnr.output.md +++ /dev/null @@ -1,1175 +0,0 @@ -TDNR selects local term (in file) that typechecks over local term (in file) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -bad.foo = "bar" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - bad.foo : Text - good.foo : Nat - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in file) that typechecks over local term (in namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text -``` - -``` unison -good.foo = 17 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - good.foo : Nat - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in file) that typechecks over local term (shadowing namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text -``` - -``` unison -good.foo = 17 -bad.foo = "baz" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - good.foo : Nat - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - bad.foo : Text -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in namespace) that typechecks over local term (in file) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -``` - -``` ucm :added-by-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`: - - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat -``` - -``` unison -bad.foo = "bar" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - bad.foo : Text - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in namespace) that typechecks over local term (in namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - good.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in namespace) that typechecks over local term (shadowing namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - good.foo : Nat -``` - -``` unison -bad.foo = "baz" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - bad.foo : Text -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (shadowing namespace) that typechecks over local term (in file) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -``` - -``` ucm :added-by-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`: - - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat -``` - -``` unison -good.foo = 18 -bad.foo = "bar" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - bad.foo : Text - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - good.foo : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (shadowing namespace) that typechecks over local term (in namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - good.foo : Nat -``` - -``` unison -good.foo = 18 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - good.foo : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (shadowing namespace) that typechecks over local term (shadowing namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - good.foo : Nat -``` - -``` unison -good.foo = 18 -bad.foo = "baz" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - bad.foo : Text - good.foo : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -\=== start local over direct dep - -TDNR selects local term (in file) that typechecks over direct dependency that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - lib.bad.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.bad.foo : Text -``` - -``` unison -good.foo = 17 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - good.foo : Nat - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (in namespace) that typechecks over direct dependency that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -lib.bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - good.foo : Nat - lib.bad.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat - lib.bad.foo : Text -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects local term (shadowing namespace) that typechecks over direct dependency that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -lib.bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - good.foo : Nat - lib.bad.foo : Text -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat - lib.bad.foo : Text -``` - -``` unison -good.foo = 18 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - good.foo : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR not used to select local term (in file) that typechecks over indirect dependency that also typechecks. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.dep.lib.dep.foo = 217 -``` - -``` ucm :added-by-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`: - - lib.dep.lib.dep.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.dep.lib.dep.foo : Nat -``` - -``` unison -good.foo = 17 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - good.foo : Nat - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR not used to select local term (in namespace) that typechecks over indirect dependency that also typechecks. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -lib.dep.lib.dep.foo = 217 -``` - -``` ucm :added-by-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`: - - good.foo : Nat - lib.dep.lib.dep.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat - lib.dep.lib.dep.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR not used to select local term (shadowing namespace) that typechecks over indirect dependency that also typechecks. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -good.foo = 17 -lib.dep.lib.dep.foo = 217 -``` - -``` ucm :added-by-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`: - - good.foo : Nat - lib.dep.lib.dep.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - good.foo : Nat - lib.dep.lib.dep.foo : Nat -``` - -``` unison -good.foo = 18 -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - good.foo : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects direct dependency that typechecks over local term (in file) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.good.foo = 17 -``` - -``` ucm :added-by-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`: - - lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.good.foo : Nat -``` - -``` unison -bad.foo = "bar" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - bad.foo : Text - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects direct dependency that typechecks over local term (in namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - lib.good.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects direct dependency that typechecks over local term (shadowing namespace) that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.good.foo = 17 -bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - bad.foo : Text - lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bad.foo : Text - lib.good.foo : Nat -``` - -``` unison -bad.foo = "baz" -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat - - ⍟ These names already exist. You can `update` them to your - new definition: - - bad.foo : Text -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects direct dependency that typechecks over direct dependency that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.good.foo = 17 -lib.bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - lib.bad.foo : Text - lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.bad.foo : Text - lib.good.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR not used to select direct dependency that typechecks over indirect dependency that also typechecks. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.good.foo = 17 -lib.dep.lib.dep.foo = 217 -``` - -``` ucm :added-by-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`: - - lib.dep.lib.dep.foo : Nat - lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.dep.lib.dep.foo : Nat - lib.good.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -TDNR selects indirect dependency that typechecks over indirect dependency that doesn't. - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -lib.dep.lib.good.foo = 17 -lib.dep.lib.bad.foo = "bar" -``` - -``` ucm :added-by-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`: - - lib.dep.lib.bad.foo : Text - lib.dep.lib.good.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.dep.lib.bad.foo : Text - lib.dep.lib.good.foo : Nat -``` - -``` unison -thing = foo Nat.+ foo -``` - -``` ucm :added-by-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`: - - thing : Nat -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md deleted file mode 100644 index 202c8b4525..0000000000 --- a/unison-src/transcripts/test-command.output.md +++ /dev/null @@ -1,153 +0,0 @@ -Merge builtins so we get enough names for the testing stuff. - -``` ucm :hide -scratch/main> builtins.merge -``` - -The `test` command should run all of the tests in the current directory. - -``` unison -test1 : [Result] -test1 = [Ok "test1"] - -foo.test2 : [Result] -foo.test2 = [Ok "test2"] -``` - -``` ucm :added-by-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.test2 : [Result] - test1 : [Result] -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> test - - ✅ - - - - - - New test results: - - 1. foo.test2 ◉ test2 - 2. test1 ◉ test1 - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -Tests should be cached if unchanged. - -``` ucm -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. foo.test2 ◉ test2 - 2. test1 ◉ test1 - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -`test` won't descend into the `lib` namespace, but `test.all` will. - -``` unison -lib.dep.testInLib : [Result] -lib.dep.testInLib = [Ok "testInLib"] -``` - -``` ucm :added-by-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`: - - lib.dep.testInLib : [Result] -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. foo.test2 ◉ test2 - 2. test1 ◉ test1 - - ✅ 2 test(s) passing - - Tip: Use view 1 to view the source of a test. -scratch/main> test.all - - - Cached test results (`help testcache` to learn more) - - 1. foo.test2 ◉ test2 - 2. test1 ◉ test1 - - ✅ 2 test(s) passing - - ✅ - - - - New test results: - - 1. lib.dep.testInLib ◉ testInLib - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -`test` WILL run tests within `lib` if specified explicitly. - -``` ucm -scratch/main> test lib.dep - - Cached test results (`help testcache` to learn more) - - 1. lib.dep.testInLib ◉ testInLib - - ✅ 1 test(s) passing - - Tip: Use view 1 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. - -``` ucm -scratch/main> test foo - - Cached test results (`help testcache` to learn more) - - 1. foo.test2 ◉ test2 - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md deleted file mode 100644 index 1ecc7b517a..0000000000 --- a/unison-src/transcripts/text-literals.output.md +++ /dev/null @@ -1,127 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -This transcript shows some syntax for raw text literals. - -``` unison -lit1 = """ -This is a raw text literal. -It can start with 3 or more ", -and is terminated by the same number of quotes. -Nothing is escaped. \n - -The initial newline, if it exists, is ignored. -The last line, if it's just whitespace up to the closing quotes, -is ignored. - -Use an extra blank line if you'd like a trailing newline. Like so: - -""" - -> lit1 -> Some lit1 - -lit2 = """" - This is a raw text literal, indented. - It can start with 3 or more ", - and is terminated by the same number of quotes. - Nothing is escaped. \n - - This doesn't terminate the literal - """ - """" - -> lit2 -> Some lit2 -``` - -``` ucm :added-by-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`: - - lit1 : Text - lit2 : Text - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 15 | > lit1 - ⧩ - """ - This is a raw text literal. - It can start with 3 or more ", - and is terminated by the same number of quotes. - Nothing is escaped. \n - - The initial newline, if it exists, is ignored. - The last line, if it's just whitespace up to the closing quotes, - is ignored. - - Use an extra blank line if you'd like a trailing newline. Like so: - - """ - - 16 | > Some lit1 - ⧩ - Some - "This is a raw text literal.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThe initial newline, if it exists, is ignored.\nThe last line, if it's just whitespace up to the closing quotes,\nis ignored.\n\nUse an extra blank line if you'd like a trailing newline. Like so:\n" - - 27 | > lit2 - ⧩ - """" - This is a raw text literal, indented. - It can start with 3 or more ", - and is terminated by the same number of quotes. - Nothing is escaped. \n - - This doesn't terminate the literal - """ - """" - - 28 | > Some lit2 - ⧩ - Some - "This is a raw text literal, indented.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThis doesn't terminate the literal - \"\"\"" -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lit1 : Text - lit2 : Text -scratch/main> view lit1 lit2 - - lit1 : Text - lit1 = - """ - This is a raw text literal. - It can start with 3 or more ", - and is terminated by the same number of quotes. - Nothing is escaped. \n - - The initial newline, if it exists, is ignored. - The last line, if it's just whitespace up to the closing quotes, - is ignored. - - Use an extra blank line if you'd like a trailing newline. Like so: - - """ - - lit2 : Text - lit2 = - """" - This is a raw text literal, indented. - It can start with 3 or more ", - and is terminated by the same number of quotes. - Nothing is escaped. \n - - This doesn't terminate the literal - """ - """" -``` diff --git a/unison-src/transcripts/textfind.output.md b/unison-src/transcripts/textfind.output.md deleted file mode 100644 index 41c0d8ac54..0000000000 --- a/unison-src/transcripts/textfind.output.md +++ /dev/null @@ -1,204 +0,0 @@ -# The `text.find` command - -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -The `text.find` (or `grep`) command can be used to search for text or numeric literals appearing anywhere in your project. Just supply one or more tokens to search for. Unlike regular grep over the text of your code, this ignores local variables and function names that happen to match your search tokens (use `dependents` or `find` for that purpose). It's only searching for text or numeric literals that match. - -``` ucm -scratch/main> help grep - - text.find (or grep) - `text.find token1 "99" token2` finds terms with literals (text - or numeric) containing `token1`, `99`, and `token2`. - - Numeric literals must be quoted (ex: "42") but single words - need not be quoted. - - Use `text.find.all` to include search of `lib`. -``` - -``` ucm -scratch/main> help text.find.all - - text.find.all (or grep.all) - `text.find.all token1 "99" token2` finds terms with literals - (text or numeric) containing `token1`, `99`, and `token2`. - - Numeric literals must be quoted (ex: "42") but single words - need not be quoted. - - Use `text.find` to exclude `lib` from search. -``` - -Here's an example: - -``` unison -foo = - _ = "an interesting constant" - 1 -bar = match "well hi there" with - "ooga" -> 99 - "booga" -> 23 - _ -> 0 -baz = ["an", "quaffle", "tres"] -qux = - quaffle = 99 - quaffle + 1 - -lib.foo = [Any 46, Any "hi", Any "zoink"] -lib.bar = 3 -``` - -``` ucm :added-by-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`: - - bar : Nat - baz : [Text] - foo : Nat - lib.bar : Nat - lib.foo : [Any] - qux : Nat -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm -scratch/main> grep hi - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> view 1 - - bar : Nat - bar = match "well hi there" with - "ooga" -> 99 - "booga" -> 23 - _ -> 0 -scratch/main> grep "hi" - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> text.find.all hi - - 🔎 - - These definitions from the current namespace have matches: - - 1. bar - 2. lib.foo - - Tip: Try `edit 1` or `edit 1-2` to bring these into your - scratch file. -scratch/main> view 1-5 - - bar : Nat - bar = match "well hi there" with - "ooga" -> 99 - "booga" -> 23 - _ -> 0 - - lib.foo : [Any] - lib.foo = [Any 46, Any "hi", Any "zoink"] -scratch/main> grep oog - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> view 1 - - bar : Nat - bar = match "well hi there" with - "ooga" -> 99 - "booga" -> 23 - _ -> 0 -``` - -``` ucm -scratch/main> grep quaffle - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. baz - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> view 1-5 - - baz : [Text] - baz = ["an", "quaffle", "tres"] -scratch/main> text.find "interesting const" - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. foo - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> view 1-5 - - foo : Nat - foo = - _ = "an interesting constant" - 1 -scratch/main> text.find "99" "23" - - 🔎 - - These definitions from the current namespace (excluding `lib`) have matches: - - 1. bar - - Tip: Try `edit 1` to bring this into your scratch file. -scratch/main> view 1 - - bar : Nat - bar = match "well hi there" with - "ooga" -> 99 - "booga" -> 23 - _ -> 0 -``` - -Now some failed searches: - -``` ucm :error -scratch/main> grep lsdkfjlskdjfsd - - 😶 I couldn't find any matches. - - Tip: `text.find.all` will search `lib` as well. -``` - -Notice it gives the tip about `text.find.all`. But not here: - -``` ucm :error -scratch/main> grep.all lsdkfjlskdjfsd - - 😶 I couldn't find any matches. -``` diff --git a/unison-src/transcripts/todo-bug-builtins.output.md b/unison-src/transcripts/todo-bug-builtins.output.md deleted file mode 100644 index b1db33c768..0000000000 --- a/unison-src/transcripts/todo-bug-builtins.output.md +++ /dev/null @@ -1,105 +0,0 @@ -# The `todo` and `bug` builtin - -``` ucm :hide -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. - -``` unison :error -> todo "implement me later" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 💔💥 - - I've encountered a call to builtin.todo with the following - value: - - "implement me later" - - Stack trace: - todo - #qe5e1lcfn8 -``` - -``` unison :error -> bug "there's a bug in my code" -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 💔💥 - - I've encountered a call to builtin.bug with the following - value: - - "there's a bug in my code" - - Stack trace: - bug - #m67hcdcoda -``` - -## Todo - -`todo` is useful if you want to come back to a piece of code later but you want your project to compile. - -``` unison -complicatedMathStuff x = todo "Come back and to something with x here" -``` - -``` ucm :added-by-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`: - - complicatedMathStuff : x -> r -``` - -## Bug - -`bug` is used to indicate that a particular branch is not expected to execute. - -``` unison -test = match true with - true -> "Yay" - false -> bug "Wow, that's unexpected" -``` - -``` ucm :added-by-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`: - - test : Text -``` diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md deleted file mode 100644 index a985d1177b..0000000000 --- a/unison-src/transcripts/todo.output.md +++ /dev/null @@ -1,403 +0,0 @@ -# Nothing to do - -When there's nothing to do, `todo` says this: - -``` ucm -scratch/main> todo - - You have no pending todo items. Good work! ✅ -``` - -# Dependents of `todo` - -The `todo` command shows local (outside `lib`) terms that directly call `todo`. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -foo : Nat -foo = todo "implement foo" - -bar : Nat -bar = foo + foo -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -scratch/main> todo - - These terms call `todo`: - - 1. foo -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Direct dependencies without names - -The `todo` command shows hashes of direct dependencies of local (outside `lib`) definitions that don't have names in -the current namespace. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -foo.bar = 15 -baz = foo.bar + foo.bar -``` - -``` ucm :added-by-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`: - - baz : Nat - foo.bar : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - baz : Nat - foo.bar : Nat -scratch/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 -scratch/main> todo - - These terms do not have any names in the current namespace: - - 1. #1jujb8oelv -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Conflicted names - -The `todo` command shows conflicted names. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -foo = 16 -bar = 17 -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -scratch/main> debug.alias.term.force foo bar - - Done. -scratch/main> todo - - ❓ - - The term bar has conflicting definitions: - - 1. bar#14ibahkll6 - 2. bar#cq22mm4sca - - Tip: Use `move.term` or `delete.term` to resolve the - conflicts. -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Definitions in lib - -The `todo` command complains about terms and types directly in `lib`. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -lib.foo = 16 -``` - -``` ucm :added-by-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`: - - lib.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - lib.foo : Nat -scratch/main> todo - - There's a type or term at the top level of the `lib` - namespace, where I only expect to find subnamespaces - representing library dependencies. Please move or remove it. -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Constructor aliases - -The `todo` command complains about constructor aliases. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -type Foo = One -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> alias.term Foo.One Foo.Two - - Done. -scratch/main> todo - - The type Foo has a constructor with multiple names. - - 1. Foo.One - 2. Foo.Two - - Please delete all but one name for each constructor. -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Missing constructor names - -The `todo` command complains about missing constructor names. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -type Foo = Bar -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> delete.term Foo.Bar - - Done. -scratch/main> todo - - These types have some constructors with missing names. - - 1. Foo - - You can use `view 1` and - `alias.term .` to give names - to each unnamed constructor. -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Nested decl aliases - -The `todo` command complains about nested decl aliases. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -structural type Foo a = One a | Two a a -structural type Foo.inner.Bar a = Uno a | Dos a a -``` - -``` ucm :added-by-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 Foo a - structural type Foo.inner.Bar a -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type Foo a - structural type Foo.inner.Bar a -scratch/main> todo - - These types are aliases, but one is nested under the other. - Please separate them or delete one copy. - - 1. Foo - 2. Foo.inner.Bar -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` - -# Stray constructors - -The `todo` command complains about stray constructors. - -``` ucm :hide -scratch/main> builtins.mergeio lib.builtins -``` - -``` unison -type Foo = Bar -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> alias.term Foo.Bar Baz - - Done. -scratch/main> todo - - These constructors are not nested beneath their corresponding - type names: - - 1. Baz - - For each one, please either use `move` to move if, or if it's - an extra copy, you can simply `delete` it. -``` - -``` ucm :hide -scratch/main> delete.project scratch -``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md deleted file mode 100644 index 9e7b49520d..0000000000 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ /dev/null @@ -1,104 +0,0 @@ -A simple transcript to test the use of exceptions that bubble to the top level. - -``` ucm :hide -scratch/main> builtins.merge -``` - -FYI, here are the `Exception` and `Failure` types: - -``` ucm -scratch/main> view Exception Failure - - structural ability builtin.Exception where - raise : Failure ->{builtin.Exception} x - - type builtin.io2.Failure - = Failure Type Text Any -``` - -Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: - -``` unison -use builtin IO Exception Test.Result - -main : '{IO, Exception} () -main _ = () - -mytest : '{IO, Exception} [Test.Result] -mytest _ = [Ok "Great"] -``` - -``` ucm :added-by-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`: - - main : '{IO, Exception} () - mytest : '{IO, Exception} [Result] -``` - -``` ucm -scratch/main> run main - - () -scratch/main> add - - ⍟ I've added these definitions: - - main : '{IO, Exception} () - mytest : '{IO, Exception} [Result] -scratch/main> io.test mytest - - New test results: - - 1. mytest ◉ Great - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -Now a test to show the handling of uncaught exceptions: - -``` unison -main2 = '(error "oh noes!" ()) - -error : Text -> a ->{Exception} x -error msg a = - builtin.Exception.raise (Failure (typeLink RuntimeError) msg (Any a)) - -unique type RuntimeError = -``` - -``` ucm :added-by-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 RuntimeError - error : Text -> a ->{Exception} x - main2 : '{Exception} r -``` - -``` ucm :error -scratch/main> run main2 - - 💔💥 - - The program halted with an unhandled exception: - - Failure (typeLink RuntimeError) "oh noes!" (Any ()) - - Stack trace: - ##raise -``` diff --git a/unison-src/transcripts/transcript-parser-commands.output.md b/unison-src/transcripts/transcript-parser-commands.output.md deleted file mode 100644 index 147db1caf7..0000000000 --- a/unison-src/transcripts/transcript-parser-commands.output.md +++ /dev/null @@ -1,68 +0,0 @@ -### Transcript parser operations - -``` ucm :hide -scratch/main> builtins.merge -``` - -The transcript parser is meant to parse `ucm` and `unison` blocks. - -``` unison -x = 1 -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - x : Nat -``` - -``` unison :hide:error :scratch.u -z -``` - -``` ucm :error -scratch/main> delete foo - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - foo -``` - -``` ucm :error -scratch/main> delete lineToken.call - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - lineToken.call -``` - -However handling of blocks of other languages should be supported. - -``` python -some python code -``` - -``` c_cpp -some C++ code -``` - -``` c9search -some cloud9 code -``` diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md deleted file mode 100644 index f30039d736..0000000000 --- a/unison-src/transcripts/type-deps.output.md +++ /dev/null @@ -1,64 +0,0 @@ -# Ensure type dependencies are properly considered in slurping - -https://github.com/unisonweb/unison/pull/2821 - -``` ucm :hide -scratch/main> builtins.merge -``` - -Define a type. - -``` unison :hide -structural type Y = Y -``` - -``` ucm :hide -scratch/main> add -``` - -Now, we update `Y`, and add a new type `Z` which depends on it. - -``` unison -structural type Z = Z Y -structural type Y = Y Nat -``` - -``` ucm :added-by-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 Z - - ⍟ These names already exist. You can `update` them to your - new definition: - - structural type Y - (The old definition is also named builtin.Unit.) -``` - -Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. - -``` ucm :error -scratch/main> add - - x These definitions failed: - - Reason - needs update structural type Y - blocked structural type Z - - Tip: Use `help filestatus` to learn more. --- This shouldn't exist, because it should've been blocked. -scratch/main> view Z - - ⚠️ - - The following names were not found in the codebase. Check your spelling. - Z -``` diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md deleted file mode 100644 index 4d2459a147..0000000000 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ /dev/null @@ -1,36 +0,0 @@ -# Type modifiers are optional, `unique` is the default. - -``` ucm :hide -scratch/main> builtins.merge -``` - -Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. - -``` unison -type Abc = Abc -unique type Def = Def -structural type Ghi = Ghi - -ability MyAbility where const : a -unique ability MyAbilityU where const : a -structural ability MyAbilityS where const : a -``` - -``` ucm :added-by-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 Abc - type Def - structural type Ghi - (also named builtin.Unit) - ability MyAbility - structural ability MyAbilityS - ability MyAbilityU -``` diff --git a/unison-src/transcripts/undo.output.md b/unison-src/transcripts/undo.output.md deleted file mode 100644 index 42d5854e74..0000000000 --- a/unison-src/transcripts/undo.output.md +++ /dev/null @@ -1,179 +0,0 @@ -# Undo - -Undo should pop a node off of the history of the current branch. - -``` unison :hide -x = 1 -``` - -``` ucm -scratch/main> builtins.merge lib.builtins - - Done. -scratch/main> add - - ⍟ I've added these definitions: - - x : Nat -scratch/main> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/main> alias.term x y - - Done. -scratch/main> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) - 3. y (Nat) -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #nmem6r6no1 - - + Adds / updates: - - y - - = Copies: - - Original name New name(s) - x y - - ⊙ 2. #3rqf1hbev7 - - + Adds / updates: - - x - - □ 3. #ms9lggs2rg (start of history) -scratch/main> undo - - Here are the changes I undid - - Name changes: - - Original Changes - 1. x 2. y (added) -scratch/main> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/main> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #3rqf1hbev7 - - + Adds / updates: - - x - - □ 2. #ms9lggs2rg (start of history) -``` - ------ - -It should not be affected by changes on other branches. - -``` unison :hide -x = 1 -``` - -``` ucm -scratch/branch1> builtins.merge lib.builtins - - Done. -scratch/branch1> add - - ⍟ I've added these definitions: - - x : Nat -scratch/branch1> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/branch1> alias.term x y - - Done. -scratch/branch1> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) - 3. y (Nat) -scratch/branch1> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #nmem6r6no1 - - + Adds / updates: - - y - - = Copies: - - Original name New name(s) - x y - - ⊙ 2. #3rqf1hbev7 - - + Adds / updates: - - x - - □ 3. #ms9lggs2rg (start of history) --- Make some changes on an unrelated branch -scratch/branch2> builtins.merge lib.builtins - - Done. -scratch/branch2> delete.namespace lib - - Done. -scratch/branch1> undo - - Here are the changes I undid - - Name changes: - - Original Changes - 1. x 2. y (added) -scratch/branch1> ls - - 1. lib/ (469 terms, 74 types) - 2. x (Nat) -scratch/branch1> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #3rqf1hbev7 - - + Adds / updates: - - x - - □ 2. #ms9lggs2rg (start of history) -``` - ------ - -Undo should be a no-op on a newly created branch - -``` ucm :error -scratch/main> branch.create-empty new - - Done. I've created an empty branch scratch/new. - - Tip: Use `merge /somebranch` to initialize this branch. -scratch/new> undo - - ⚠️ - - Nothing more to undo. -``` diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md deleted file mode 100644 index c1014c5546..0000000000 --- a/unison-src/transcripts/unique-type-churn.output.md +++ /dev/null @@ -1,137 +0,0 @@ -This transcript demonstrates that unique types no longer always get a fresh GUID: they share GUIDs with already-saved -unique types of the same name. - -``` unison -unique type A = A - -unique type B = B C -unique type C = C B -``` - -``` ucm :added-by-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 A - type B - type C -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type A - type B - type C -``` - -``` unison -unique type A = A - -unique type B = B C -unique type C = C B -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. -``` - -If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. - -``` ucm -scratch/main> names A - - Type - Hash: #uj8oalgadr - Names: A - - Term - Hash: #uj8oalgadr#0 - Names: A.A -``` - -``` unison -unique type A = A () -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type A -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> names A - - Type - Hash: #ufo5tuc7ho - Names: A - - Term - Hash: #ufo5tuc7ho#0 - Names: A.A -``` - -``` unison -unique type A = A -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type A -``` - -Note that `A` is back to its original hash. - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> names A - - Type - Hash: #uj8oalgadr - Names: A - - Term - Hash: #uj8oalgadr#0 - Names: A.A -``` diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md deleted file mode 100644 index 287736fb2a..0000000000 --- a/unison-src/transcripts/unitnamespace.output.md +++ /dev/null @@ -1,33 +0,0 @@ -``` unison -`()`.foo = "bar" -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - `()`.foo : ##Text -scratch/main> find - - 1. `()`.foo : ##Text -scratch/main> find-in `()` - - 1. foo : ##Text -scratch/main> delete.namespace `()` - - Done. -``` diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md deleted file mode 100644 index 23c1c618bc..0000000000 --- a/unison-src/transcripts/universal-cmp.output.md +++ /dev/null @@ -1,76 +0,0 @@ -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 -scratch/main> builtins.merge -``` - -``` unison -unique type A = A - -threadEyeDeez _ = - t1 = forkComp '() - t2 = forkComp '() - (t1 == t2, t1 < t2) -``` - -``` ucm :added-by-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 A - threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type A - threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) -scratch/main> run threadEyeDeez - - (false, true) -``` - -``` unison -> typeLink A == typeLink A -> typeLink Text == typeLink Text -> typeLink Text == typeLink A -> termLink threadEyeDeez == termLink threadEyeDeez -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > typeLink A == typeLink A - ⧩ - true - - 2 | > typeLink Text == typeLink Text - ⧩ - true - - 3 | > typeLink Text == typeLink A - ⧩ - false - - 4 | > termLink threadEyeDeez == termLink threadEyeDeez - ⧩ - true -``` diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md deleted file mode 100644 index db2aaa7460..0000000000 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ /dev/null @@ -1,53 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -f : '{} Nat -f _ = 5 - -fc : '{IO, Exception} Nat -fc = unsafe.coerceAbilities f - -main : '{IO, Exception} [Result] -main _ = - n = !fc - if n == 5 then [Ok ""] else [Fail ""] -``` - -``` ucm :added-by-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`: - - f : 'Nat - fc : '{IO, Exception} Nat - main : '{IO, Exception} [Result] -``` - -``` ucm -scratch/main> find unsafe.coerceAbilities - - 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b -scratch/main> add - - ⍟ I've added these definitions: - - f : 'Nat - fc : '{IO, Exception} Nat - main : '{IO, Exception} [Result] -scratch/main> io.test main - - New test results: - - 1. main ◉ - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md deleted file mode 100644 index 31032b48c7..0000000000 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ /dev/null @@ -1,68 +0,0 @@ -`update` / `patch` (anything that a patch) ignores the namespace named "lib" at the location it's applied. This follows -the project organization convention that dependencies are put in "lib"; it's much easier to apply a patch to all of -one's own code if the "lib" namespace is simply ignored. - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison -foo = 100 -lib.foo = 100 -``` - -``` ucm :added-by-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 : Nat - lib.foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : Nat - lib.foo : Nat -``` - -``` unison -foo = 200 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Nat - (The old definition is also named lib.foo.) -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> names foo - - Term - Hash: #9ntnotdp87 - Names: foo -``` diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md deleted file mode 100644 index 078f2cfdda..0000000000 --- a/unison-src/transcripts/update-on-conflict.output.md +++ /dev/null @@ -1,67 +0,0 @@ -# Update on conflict - -Conflicted definitions prevent `update` from succeeding. - -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -``` unison -x = 1 -temp = 2 -``` - -``` ucm :added-by-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`: - - temp : Nat - x : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - temp : Nat - x : Nat -scratch/main> debug.alias.term.force temp x - - Done. -scratch/main> delete.term temp - - Done. -``` - -``` unison -x = 3 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - x : Nat -``` - -``` ucm :error -scratch/main> update - - This branch has more than one term with the name `x`. Please - delete or rename all but one of them, then try the update - again. -``` diff --git a/unison-src/transcripts/update-suffixifies-properly.output.md b/unison-src/transcripts/update-suffixifies-properly.output.md deleted file mode 100644 index 8edef4df26..0000000000 --- a/unison-src/transcripts/update-suffixifies-properly.output.md +++ /dev/null @@ -1,97 +0,0 @@ -``` ucm :hide -myproject/main> builtins.merge lib.builtin -``` - -``` unison -a.x.x.x.x = 100 -b.x.x.x.x = 100 -foo = 25 -c.y.y.y.y = foo + 10 -d.y.y.y.y = foo + 10 -bar = a.x.x.x.x + c.y.y.y.y -``` - -``` ucm :added-by-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.x.x.x.x : Nat - b.x.x.x.x : Nat - bar : Nat - c.y.y.y.y : Nat - d.y.y.y.y : Nat - foo : Nat -``` - -``` ucm -myproject/main> add - - ⍟ I've added these definitions: - - a.x.x.x.x : Nat - b.x.x.x.x : Nat - bar : Nat - c.y.y.y.y : Nat - d.y.y.y.y : Nat - foo : Nat -``` - -``` unison -foo = +30 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Int -``` - -``` ucm :error -myproject/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -foo = +30 - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -bar : Nat -bar = - use Nat + - x + c.y.y.y.y - -c.y.y.y.y : Nat -c.y.y.y.y = - use Nat + - foo + 10 - -d.y.y.y.y : Nat -d.y.y.y.y = - use Nat + - foo + 10 - -``` 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 deleted file mode 100644 index e8b3d4ef9f..0000000000 --- a/unison-src/transcripts/update-term-aliases-in-different-ways.output.md +++ /dev/null @@ -1,77 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 - -bar : Nat -bar = 5 -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -``` - -``` unison -foo : Nat -foo = 6 - -bar : Nat -bar = 7 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - bar : Nat - (The old definition is also named foo.) - foo : Nat - (The old definition is also named bar.) -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view foo bar - - bar : Nat - bar = 7 - - foo : Nat - foo = 6 -``` diff --git a/unison-src/transcripts/update-term-to-different-type.output.md b/unison-src/transcripts/update-term-to-different-type.output.md deleted file mode 100644 index ee2d0d88af..0000000000 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ /dev/null @@ -1,63 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 -``` - -``` ucm :added-by-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 : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : Nat -``` - -``` unison -foo : Int -foo = +5 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Int -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view foo - - foo : Int - foo = +5 -``` diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md deleted file mode 100644 index a13bfd8150..0000000000 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ /dev/null @@ -1,72 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 - -bar : Nat -bar = 5 -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -``` - -``` unison -foo : Nat -foo = 6 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Nat - (The old definition is also named bar.) -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view foo bar - - bar : Nat - bar = 5 - - foo : Nat - foo = 6 -``` 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 deleted file mode 100644 index e590bc1b04..0000000000 --- a/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md +++ /dev/null @@ -1,82 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 - -bar : Nat -bar = foo + 10 -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -``` - -``` unison -foo : Int -foo = +5 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Int -``` - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -foo : Int -foo = +5 - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -bar : Nat -bar = - use Nat + - foo + 10 - -``` diff --git a/unison-src/transcripts/update-term-with-dependent.output.md b/unison-src/transcripts/update-term-with-dependent.output.md deleted file mode 100644 index aba7ad6b70..0000000000 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ /dev/null @@ -1,74 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 - -bar : Nat -bar = foo + 10 -``` - -``` ucm :added-by-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`: - - bar : Nat - foo : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - bar : Nat - foo : Nat -``` - -``` unison -foo : Nat -foo = 6 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view bar - - bar : Nat - bar = - use Nat + - foo + 10 -``` diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md deleted file mode 100644 index 753eab2cf0..0000000000 --- a/unison-src/transcripts/update-term.output.md +++ /dev/null @@ -1,63 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -foo : Nat -foo = 5 -``` - -``` ucm :added-by-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 : Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : Nat -``` - -``` unison -foo : Nat -foo = 6 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Nat -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view foo - - foo : Nat - foo = 6 -``` diff --git a/unison-src/transcripts/update-test-to-non-test.output.md b/unison-src/transcripts/update-test-to-non-test.output.md deleted file mode 100644 index 21965f8a19..0000000000 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ /dev/null @@ -1,75 +0,0 @@ -``` ucm -scratch/main> builtins.merge - - Done. -``` - -``` unison -test> foo = [] -``` - -``` ucm :added-by-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 : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | test> foo = [] - -``` - -After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : [Result] -scratch/main> view foo - - foo : [Result] - foo = [] -``` - -``` unison -foo = 1 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : Nat -``` - -After updating `foo` to not be a test, we expect `view` to not render it like a test. - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view foo - - foo : Nat - foo = 1 -``` diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md deleted file mode 100644 index 0c3cac7aaa..0000000000 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ /dev/null @@ -1,67 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge -``` - -Given a test that depends on another definition, - -``` unison :hide -foo n = n + 1 - -test> mynamespace.foo.test = - n = 2 - if (foo n) == 2 then [ Ok "passed" ] else [ Fail "wat" ] -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - foo : Nat -> Nat - mynamespace.foo.test : [Result] -``` - -if we change the type of the dependency, the test should show in the scratch file as a test watch. - -``` unison -foo n = "hello, world!" -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - foo : n -> Text -``` - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -foo n = "hello, world!" - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -test> mynamespace.foo.test = - n = 2 - if foo n == 2 then [Ok "passed"] else [Fail "wat"] - -``` diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md deleted file mode 100644 index 6ca215cd51..0000000000 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ /dev/null @@ -1,72 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo - = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -``` - -``` unison -unique type Foo - = Bar Nat - | Baz Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = Bar Nat | Baz Nat Nat -scratch/main> find.verbose - - 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog - type Foo - - 2. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#0 - Foo.Bar : Nat -> Foo - - 3. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#1 - Foo.Baz : Nat -> Nat -> Foo - -``` diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md deleted file mode 100644 index 6cfe366468..0000000000 --- a/unison-src/transcripts/update-type-add-field.output.md +++ /dev/null @@ -1,66 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = Bar Nat Nat -scratch/main> find.verbose - - 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - type Foo - - 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 - Foo.Bar : Nat -> Nat -> 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 deleted file mode 100644 index 4527bc19bb..0000000000 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ /dev/null @@ -1,35 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtins -``` - -``` unison -unique type Foo = { bar : Nat } -``` - -``` ucm :added-by-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 - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = { bar : Nat } -``` diff --git a/unison-src/transcripts/update-type-add-record-field.output.md b/unison-src/transcripts/update-type-add-record-field.output.md deleted file mode 100644 index bef52e1367..0000000000 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ /dev/null @@ -1,99 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = { bar : Nat } -``` - -``` ucm :added-by-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 - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -``` unison -unique type Foo = { bar : Nat, baz : Int } -``` - -``` ucm :added-by-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.baz : Foo -> Int - Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo - Foo.baz.set : Int -> Foo -> Foo - - ⍟ These names already exist. You can `update` them to your - new definition: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = { bar : Nat, baz : Int } -scratch/main> find.verbose - - 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 - type Foo - - 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 - Foo.bar : Foo -> Nat - - 3. -- #7m1n2178r5u12jdnb6crcmanu2gm961kdvbjul5m6hta1s57avibsvk6p5g9efut8sennpgstbb8kf97eujbbuiplsoloa4cael7t90 - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - - 4. -- #ghuqoel4pao6v8e7un238i3e86vv7a7pnvgaq8m9s32edm1upgv35gri2iu32ipn9r4poli56r5kr3vtjfrltem696grfl75al4jkgg - Foo.bar.set : Nat -> Foo -> Foo - - 5. -- #p8emkm2s09n3nsd8ne5f6fro0vsldk8pn7n6rcf417anuvvun43qrk1ioofs6pdq4537eosao17c7ibvktktr3lfqglmj26gmbulmj0 - Foo.baz : Foo -> Int - - 6. -- #0il9pl29jpe3fh6vp3qeqai73915k3qffhf4bgttrgsj000b9fgs3bqoj8ugjop6kdr04acc34m1bj7lf417tslfeva7dmmoqdu5hug - Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo - - 7. -- #87rjeqltvvd4adffsheqae62eefoge8p78pvnjdkc9q1stq20lhubvtpos0io4v3vhnol8nn2uollup97l4orq1fh2h12b0imeuuc58 - Foo.baz.set : Int -> Foo -> Foo - - 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 - Foo.Foo : Nat -> Int -> Foo - -``` diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md deleted file mode 100644 index 564977360d..0000000000 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ /dev/null @@ -1,64 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> alias.term Foo.Bar Foo.BarAlias - - Done. -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> update - - Sorry, I wasn't able to perform the update: - - The type Foo has a constructor with multiple names, and I - can't perform an update in this situation: - - * Foo.Bar - * Foo.BarAlias - - Please delete all but one name for each constructor, and then - try updating again. -``` 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 deleted file mode 100644 index d267239d61..0000000000 --- a/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md +++ /dev/null @@ -1,82 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo - = Bar Nat - | Baz Nat Nat - -foo : Foo -> Nat -foo = cases - Bar n -> n - Baz n m -> n + m -``` - -``` ucm :added-by-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 - foo : Foo -> Nat -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - foo : Foo -> Nat -``` - -``` unison -unique type Foo - = Bar Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -type Foo = Bar Nat - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -foo : Foo -> Nat -foo = cases - Bar n -> n - Baz n m -> n Nat.+ m - -``` diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md deleted file mode 100644 index 1d3f8ab182..0000000000 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ /dev/null @@ -1,69 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo - = Bar Nat - | Baz Nat Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -``` - -``` unison -unique type Foo - = Bar Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = Bar Nat -scratch/main> find.verbose - - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - type Foo - - 2. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 - Foo.Bar : Nat -> Foo - -``` diff --git a/unison-src/transcripts/update-type-delete-record-field.output.md b/unison-src/transcripts/update-type-delete-record-field.output.md deleted file mode 100644 index 418d886e24..0000000000 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ /dev/null @@ -1,122 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = { bar : Nat, baz : Int } -``` - -``` ucm :added-by-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 - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo - Foo.baz : Foo -> Int - Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo - Foo.baz.set : Int -> Foo -> Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo - Foo.baz : Foo -> Int - Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo - Foo.baz.set : Int -> Foo -> Foo -``` - -``` unison -unique type Foo = { bar : Nat } -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -We want the field accessors to go away; but for now they are here, causing the update to fail. - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -scratch/main> view Foo - - type Foo = { bar : Nat, baz : Int } -scratch/main> find.verbose - - 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 - type Foo - - 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 - Foo.bar : Foo -> Nat - - 3. -- #7m1n2178r5u12jdnb6crcmanu2gm961kdvbjul5m6hta1s57avibsvk6p5g9efut8sennpgstbb8kf97eujbbuiplsoloa4cael7t90 - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - - 4. -- #ghuqoel4pao6v8e7un238i3e86vv7a7pnvgaq8m9s32edm1upgv35gri2iu32ipn9r4poli56r5kr3vtjfrltem696grfl75al4jkgg - Foo.bar.set : Nat -> Foo -> Foo - - 5. -- #p8emkm2s09n3nsd8ne5f6fro0vsldk8pn7n6rcf417anuvvun43qrk1ioofs6pdq4537eosao17c7ibvktktr3lfqglmj26gmbulmj0 - Foo.baz : Foo -> Int - - 6. -- #0il9pl29jpe3fh6vp3qeqai73915k3qffhf4bgttrgsj000b9fgs3bqoj8ugjop6kdr04acc34m1bj7lf417tslfeva7dmmoqdu5hug - Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo - - 7. -- #87rjeqltvvd4adffsheqae62eefoge8p78pvnjdkc9q1stq20lhubvtpos0io4v3vhnol8nn2uollup97l4orq1fh2h12b0imeuuc58 - Foo.baz.set : Int -> Foo -> Foo - - 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 - Foo.Foo : Nat -> Int -> Foo - -``` - -``` unison :added-by-ucm scratch.u -type Foo = { bar : Nat } - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -Foo.baz : Foo -> Int -Foo.baz = cases Foo _ baz -> baz - -Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo -Foo.baz.modify f = cases Foo bar baz -> Foo bar (f baz) - -Foo.baz.set : Int -> Foo -> Foo -Foo.baz.set baz1 = cases Foo bar _ -> Foo bar baz1 - -``` diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md deleted file mode 100644 index 20f9b77371..0000000000 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ /dev/null @@ -1,67 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> delete.term Foo.Bar - - Done. -``` - -Now we've set up a situation where the original constructor missing. - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> view Foo - - type Foo = #b509v3eg4k#0 Nat -scratch/main> update - - Sorry, I wasn't able to perform the update: - - The type Foo has some constructors with missing names, and I - can't perform an update in this situation. - - You can use `view Foo` and - `alias.term Foo.` to give names to - each unnamed constructor, and then try the update again. -``` diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.output.md b/unison-src/transcripts/update-type-nested-decl-aliases.output.md deleted file mode 100644 index b6cdaacd02..0000000000 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ /dev/null @@ -1,62 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat - -structural type A.B = OneAlias Foo -structural type A = B.TheOtherAlias Foo -``` - -``` ucm :added-by-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 A - structural type A.B - type Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - structural type A - structural type A.B - type Foo -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> update - - The type A.B is an alias of A. I'm not able to perform an - update when a type exists nested under an alias of itself. - Please separate them or delete one copy, and then try updating - again. -``` diff --git a/unison-src/transcripts/update-type-no-op-record.output.md b/unison-src/transcripts/update-type-no-op-record.output.md deleted file mode 100644 index c810b32965..0000000000 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ /dev/null @@ -1,45 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = { bar : Nat } -``` - -``` ucm :added-by-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 - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - Foo.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo -``` - -Bug: this no-op update should (of course) succeed. - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.output.md b/unison-src/transcripts/update-type-stray-constructor-alias.output.md deleted file mode 100644 index dc9e4bf2f8..0000000000 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ /dev/null @@ -1,62 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> alias.term Foo.Bar Stray.BarAlias - - Done. -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> update - - Sorry, I wasn't able to perform the update, because I need all - constructor names to be nested somewhere beneath the - corresponding type name. - - The constructor Stray.BarAlias is not nested beneath the - corresponding type name. Please either use `move` to move it, - or if it's an extra copy, you can simply `delete` it. Then try - the update again. -``` diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md deleted file mode 100644 index 9af0c8065d..0000000000 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ /dev/null @@ -1,69 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -scratch/main> move.term Foo.Bar Stray.Bar - - Done. -``` - -Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -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 -scratch/main> view Foo - - type Foo = Stray.Bar Nat -scratch/main> update - - Sorry, I wasn't able to perform the update: - - The type Foo has some constructors with missing names, and I - can't perform an update in this situation. - - You can use `view Foo` and - `alias.term Foo.` to give names to - each unnamed constructor, and then try the update again. -``` 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 deleted file mode 100644 index 0808ba0660..0000000000 --- a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md +++ /dev/null @@ -1,85 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat - -makeFoo : Nat -> Foo -makeFoo n = Bar (n+10) -``` - -``` ucm :added-by-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 - makeFoo : Nat -> Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - makeFoo : Nat -> Foo -``` - -``` unison -unique type Foo = internal.Bar Nat - -Foo.Bar : Nat -> Foo -Foo.Bar n = internal.Bar n -``` - -``` ucm :added-by-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: - - ⊡ Previously added definitions will be ignored: Foo - - ⍟ These new definitions are ok to `add`: - - Foo.Bar : Nat -> Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view Foo - - type Foo = internal.Bar Nat -scratch/main> find.verbose - - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - type Foo - - 2. -- #36rn6jqt1k5jccb3c7vagp3jam74dngr92kgcntqhs6dbkua54verfert2i6hsku6uitt9s2jvt1msric0tgemal52d5apav6akn25o - Foo.Bar : Nat -> Foo - - 3. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 - Foo.internal.Bar : Nat -> Foo - - 4. -- #204frdcl0iid1ujkkfbkc6b3v7cgqp56h1q3duc46i5md6qb4m6am1fqbceb335u87l05gkdnaa7fjn4alj1diukgme63e41lh072l8 - makeFoo : Nat -> Foo - -``` 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 deleted file mode 100644 index 7c4574a088..0000000000 --- a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md +++ /dev/null @@ -1,81 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Nat -``` - -``` ucm :added-by-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 -scratch/main> add - - ⍟ I've added these definitions: - - type Foo -``` - -``` unison -unique type Foo = { bar : Nat } -``` - -``` ucm :added-by-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.bar : Foo -> Nat - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - Foo.bar.set : Nat -> Foo -> Foo - - ⍟ These names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -scratch/main> view Foo - - type Foo = { bar : Nat } -scratch/main> find.verbose - - 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - type Foo - - 2. -- #ovhevqfin94qhq5fu0mujfi20mbpvg5mh4vsfklrohp84cch4lhvrn5p29cnbsqfm92l7bt8c1vpjooh72a0psbddvvten4gq2sipag - Foo.bar : Foo -> Nat - - 3. -- #as72md2u70e0u9s2ig2ug7jvlbrk1mubo8qlfokpuvgusg35svh05r7nsj27sqo5edeghjnk8g8259fi4ismse736v4n5ojrb3o2le8 - Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo - - 4. -- #5cbctoor75nbtn4ppp10qm1i25gqt2lgth3itqa0lloib32je4ijfj2n3qcdfhmdcnbgum2jg46opntlohv7ladun3dmefl1ucgobeg - Foo.bar.set : Nat -> Foo -> Foo - - 5. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 - Foo.Foo : Nat -> Foo - -``` diff --git a/unison-src/transcripts/update-type-with-dependent-term.output.md b/unison-src/transcripts/update-type-with-dependent-term.output.md deleted file mode 100644 index c56e884d6c..0000000000 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ /dev/null @@ -1,75 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat - -incrFoo : Foo -> Foo -incrFoo = cases Bar n -> Bar (n+1) -``` - -``` ucm :added-by-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 - incrFoo : Foo -> Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Foo - incrFoo : Foo -> Foo -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -type Foo = Bar Nat Nat - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -incrFoo : Foo -> Foo -incrFoo = cases Bar n -> Bar (n Nat.+ 1) - -``` 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 deleted file mode 100644 index c8d569aa01..0000000000 --- a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md +++ /dev/null @@ -1,72 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -unique type Baz = Qux Foo -``` - -``` ucm :added-by-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 Baz - type Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Baz - type Foo -``` - -``` unison -unique type Foo a = Bar Nat a -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo a -``` - -``` ucm :error -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Typechecking failed. I've updated your scratch file with the - definitions that need fixing. Once the file is compiling, try - `update` again. -``` - -``` unison :added-by-ucm scratch.u -type Foo a = Bar Nat a - --- The definitions below no longer typecheck with the changes above. --- Please fix the errors and try `update` again. - -type Baz = Qux Foo - -``` diff --git a/unison-src/transcripts/update-type-with-dependent-type.output.md b/unison-src/transcripts/update-type-with-dependent-type.output.md deleted file mode 100644 index 9fe59c9183..0000000000 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ /dev/null @@ -1,82 +0,0 @@ -``` ucm :hide -scratch/main> builtins.merge lib.builtin -``` - -``` unison -unique type Foo = Bar Nat -unique type Baz = Qux Foo -``` - -``` ucm :added-by-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 Baz - type Foo -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - type Baz - type Foo -``` - -``` unison -unique type Foo = Bar Nat Nat -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - type Foo -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - That's done. Now I'm making sure everything typechecks... - - Everything typechecks, so I'm saving the results... - - Done. -scratch/main> view Foo - - type Foo = Bar Nat Nat -scratch/main> view Baz - - type Baz = Qux Foo -scratch/main> find.verbose - - 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 - type Baz - - 2. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08#0 - Baz.Qux : Foo -> Baz - - 3. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - type Foo - - 4. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 - Foo.Bar : Nat -> Nat -> Foo - -``` diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md deleted file mode 100644 index 9024cc741a..0000000000 --- a/unison-src/transcripts/update-watch.output.md +++ /dev/null @@ -1,28 +0,0 @@ -``` unison -> 1 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > 1 - ⧩ - 1 -``` - -``` ucm -scratch/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -``` diff --git a/unison-src/transcripts/upgrade-happy-path.output.md b/unison-src/transcripts/upgrade-happy-path.output.md deleted file mode 100644 index 7d92085582..0000000000 --- a/unison-src/transcripts/upgrade-happy-path.output.md +++ /dev/null @@ -1,70 +0,0 @@ -``` ucm :hide -proj/main> builtins.merge lib.builtin -``` - -``` unison -lib.old.foo = 17 -lib.new.foo = 18 -thingy = lib.old.foo + 10 -``` - -``` ucm :added-by-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`: - - lib.new.foo : Nat - lib.old.foo : Nat - thingy : Nat -``` - -``` ucm -proj/main> add - - ⍟ I've added these definitions: - - lib.new.foo : Nat - lib.old.foo : Nat - thingy : Nat -``` - -Test tab completion and fzf options of upgrade command. - -``` ucm -proj/main> debug.tab-complete upgrade ol - - old -proj/main> debug.fuzzy-options upgrade _ - - Select a dependency to upgrade: - * builtin - * new - * old -proj/main> debug.fuzzy-options upgrade old _ - - Select a dependency to upgrade to: - * builtin - * new - * old -``` - -``` ucm -proj/main> upgrade old new - - I upgraded old to new, and removed old. -proj/main> ls lib - - 1. builtin/ (469 terms, 74 types) - 2. new/ (1 term) -proj/main> view thingy - - thingy : Nat - thingy = - use Nat + - foo + 10 -``` diff --git a/unison-src/transcripts/upgrade-sad-path.output.md b/unison-src/transcripts/upgrade-sad-path.output.md deleted file mode 100644 index 128079cdb4..0000000000 --- a/unison-src/transcripts/upgrade-sad-path.output.md +++ /dev/null @@ -1,107 +0,0 @@ -``` ucm :hide -proj/main> builtins.merge lib.builtin -``` - -``` unison -lib.old.foo = 17 -lib.new.foo = +18 -thingy = lib.old.foo + 10 -``` - -``` ucm :added-by-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`: - - lib.new.foo : Int - lib.old.foo : Nat - thingy : Nat -``` - -``` ucm -proj/main> add - - ⍟ I've added these definitions: - - lib.new.foo : Int - lib.old.foo : Nat - thingy : Nat -``` - -``` ucm :error -proj/main> upgrade old new - - I couldn't automatically upgrade old to new. However, I've - added the definitions that need attention to the top of - scratch.u. - - When you're done, you can run - - upgrade.commit - - to merge your changes back into main and delete the temporary - branch. Or, if you decide to cancel the upgrade instead, you - can run - - delete.branch /upgrade-old-to-new - - to delete the temporary branch and switch back to main. -``` - -``` unison :added-by-ucm scratch.u -thingy : Nat -thingy = - use Nat + - foo + 10 -``` - -Resolve the error and commit the upgrade. - -``` unison -thingy = foo + +10 -``` - -``` ucm :added-by-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 names already exist. You can `update` them to your - new definition: - - thingy : Int -``` - -``` ucm -proj/upgrade-old-to-new> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -proj/upgrade-old-to-new> upgrade.commit - - I fast-forward merged proj/upgrade-old-to-new into proj/main. -proj/main> view thingy - - thingy : Int - thingy = - use Int + - foo + +10 -proj/main> ls lib - - 1. builtin/ (469 terms, 74 types) - 2. new/ (1 term) -proj/main> branches - - Branch Remote branch - 1. main -``` diff --git a/unison-src/transcripts/upgrade-suffixifies-properly.output.md b/unison-src/transcripts/upgrade-suffixifies-properly.output.md deleted file mode 100644 index 17272a8510..0000000000 --- a/unison-src/transcripts/upgrade-suffixifies-properly.output.md +++ /dev/null @@ -1,83 +0,0 @@ -``` ucm :hide -myproject/main> builtins.merge lib.builtin -``` - -``` unison -lib.old.foo = 25 -lib.new.foo = +30 -a.x.x.x.x = 100 -b.x.x.x.x = 100 -c.y.y.y.y = lib.old.foo + 10 -d.y.y.y.y = lib.old.foo + 10 -bar = a.x.x.x.x + c.y.y.y.y -``` - -``` ucm :added-by-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.x.x.x.x : Nat - b.x.x.x.x : Nat - bar : Nat - c.y.y.y.y : Nat - d.y.y.y.y : Nat - lib.new.foo : Int - lib.old.foo : Nat -``` - -``` ucm -myproject/main> add - - ⍟ I've added these definitions: - - a.x.x.x.x : Nat - b.x.x.x.x : Nat - bar : Nat - c.y.y.y.y : Nat - d.y.y.y.y : Nat - lib.new.foo : Int - lib.old.foo : Nat -``` - -``` ucm :error -myproject/main> upgrade old new - - I couldn't automatically upgrade old to new. However, I've - added the definitions that need attention to the top of - scratch.u. - - When you're done, you can run - - upgrade.commit - - to merge your changes back into main and delete the temporary - branch. Or, if you decide to cancel the upgrade instead, you - can run - - delete.branch /upgrade-old-to-new - - to delete the temporary branch and switch back to main. -``` - -``` unison :added-by-ucm scratch.u -bar : Nat -bar = - use Nat + - x + c.y.y.y.y - -c.y.y.y.y : Nat -c.y.y.y.y = - use Nat + - foo + 10 - -d.y.y.y.y : Nat -d.y.y.y.y = - use Nat + - foo + 10 -``` diff --git a/unison-src/transcripts/upgrade-with-old-alias.output.md b/unison-src/transcripts/upgrade-with-old-alias.output.md deleted file mode 100644 index d635a912f0..0000000000 --- a/unison-src/transcripts/upgrade-with-old-alias.output.md +++ /dev/null @@ -1,48 +0,0 @@ -``` ucm :hide -myproject/main> builtins.merge lib.builtin -``` - -``` unison -lib.old.foo = 141 -lib.new.foo = 142 -bar = 141 -mything = lib.old.foo + 100 -``` - -``` ucm :added-by-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`: - - bar : Nat - lib.new.foo : Nat - lib.old.foo : Nat - mything : Nat -``` - -``` ucm -myproject/main> update - - Okay, I'm searching the branch for code that needs to be - updated... - - Done. -myproject/main> upgrade old new - - I upgraded old to new, and removed old. -myproject/main> view mything - - mything : Nat - mything = - use Nat + - foo + 100 -myproject/main> view bar - - bar : Nat - bar = 141 -``` diff --git a/unison-src/transcripts/view.output.md b/unison-src/transcripts/view.output.md deleted file mode 100644 index b84c8c9427..0000000000 --- a/unison-src/transcripts/view.output.md +++ /dev/null @@ -1,39 +0,0 @@ -# View commands - -``` ucm :hide -scratch/main> builtins.merge -``` - -``` unison :hide -a.thing = "a" -b.thing = "b" -``` - -``` ucm :hide -scratch/main> add -``` - -``` ucm --- Should suffix-search and find values in sub-namespaces -scratch/main> view thing - - a.thing : Text - a.thing = "a" - - b.thing : Text - b.thing = "b" --- Should support absolute paths -scratch/main> view .b.thing - - .b.thing : Text - .b.thing = "b" -``` - -TODO: swap this back to a 'ucm' block when view.global is re-implemented - -``` --- view.global should search globally and be absolutely qualified -scratch/other> view.global thing --- Should support branch relative paths -scratch/other> view /main:a.thing -``` diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md deleted file mode 100644 index b1f9869ccf..0000000000 --- a/unison-src/transcripts/watch-expressions.output.md +++ /dev/null @@ -1,96 +0,0 @@ -``` ucm -scratch/main> builtins.mergeio - - Done. -``` - -``` unison -test> pass = [Ok "Passed"] -``` - -``` ucm :added-by-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`: - - pass : [Result] - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | test> pass = [Ok "Passed"] - - ✅ Passed Passed -``` - -``` ucm -scratch/main> add - - ⍟ I've added these definitions: - - pass : [Result] -``` - -``` unison -test> pass = [Ok "Passed"] -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - I found and typechecked the definitions in scratch.u. This - file has been previously added to the codebase. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | test> pass = [Ok "Passed"] - - ✅ Passed Passed (cached) -``` - -``` ucm -scratch/main> add - - ⊡ Ignored previously added definitions: pass -scratch/main> test - - Cached test results (`help testcache` to learn more) - - 1. pass ◉ Passed - - ✅ 1 test(s) passing - - Tip: Use view 1 to view the source of a test. -``` - -``` unison -> ImmutableArray.fromList [?a, ?b, ?c] -> ImmutableByteArray.fromBytes 0xs123456 -``` - -``` ucm :added-by-ucm - - Loading changes detected in scratch.u. - - ✅ - - scratch.u changed. - - Now evaluating any watch expressions (lines starting with - `>`)... Ctrl+C cancels. - - 1 | > ImmutableArray.fromList [?a, ?b, ?c] - ⧩ - ImmutableArray.fromList [?a, ?b, ?c] - - 2 | > ImmutableByteArray.fromBytes 0xs123456 - ⧩ - fromBytes 0xs123456 -``` From 041d0f4c72a969037ffc9b6104a422e233e7b433 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 13:27:02 -0600 Subject: [PATCH 08/15] Inline scratch files in transcripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These were previously separated because transcripts previously couldn’t contain code blocks with triple backticks, but that is fixed now. --- unison-src/transcripts/idempotent/fix2238.md | 11 +++++++++-- unison-src/transcripts/idempotent/fix2238.u | 9 --------- unison-src/transcripts/idempotent/fix2244.md | 13 +++++++++++-- unison-src/transcripts/idempotent/fix2244.u | 11 ----------- unison-src/transcripts/idempotent/fix2795.md | 19 ++++++++++++++++++- .../transcripts/idempotent/fix2795/docs.u | 12 ------------ 6 files changed, 38 insertions(+), 37 deletions(-) delete mode 100644 unison-src/transcripts/idempotent/fix2238.u delete mode 100644 unison-src/transcripts/idempotent/fix2244.u delete mode 100644 unison-src/transcripts/idempotent/fix2795/docs.u diff --git a/unison-src/transcripts/idempotent/fix2238.md b/unison-src/transcripts/idempotent/fix2238.md index 1c24229cc8..c5be084dbf 100644 --- a/unison-src/transcripts/idempotent/fix2238.md +++ b/unison-src/transcripts/idempotent/fix2238.md @@ -12,6 +12,13 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. -``` ucm :error -scratch/main> load unison-src/transcripts/fix2238.u +```` unison :error +structural ability Abort where abort : x + +ex = {{ + +``` +abort + 1 ``` +}} +```` diff --git a/unison-src/transcripts/idempotent/fix2238.u b/unison-src/transcripts/idempotent/fix2238.u deleted file mode 100644 index 19e81357ee..0000000000 --- a/unison-src/transcripts/idempotent/fix2238.u +++ /dev/null @@ -1,9 +0,0 @@ - -structural ability Abort where abort : x - -ex = {{ - -``` -abort + 1 -``` -}} diff --git a/unison-src/transcripts/idempotent/fix2244.md b/unison-src/transcripts/idempotent/fix2244.md index b5affbf9e1..eb60e81046 100644 --- a/unison-src/transcripts/idempotent/fix2244.md +++ b/unison-src/transcripts/idempotent/fix2244.md @@ -4,10 +4,19 @@ scratch/main> builtins.mergeio Ensure closing token is emitted by closing brace in doc eval block. -``` ucm -scratch/main> load ./unison-src/transcripts/fix2244.u +````unison +x = {{ + +``` +let + x = 1 + y = 2 + x + y ``` +}} +```` + ``` ucm :hide scratch/main> add ``` diff --git a/unison-src/transcripts/idempotent/fix2244.u b/unison-src/transcripts/idempotent/fix2244.u deleted file mode 100644 index 2d947ceb19..0000000000 --- a/unison-src/transcripts/idempotent/fix2244.u +++ /dev/null @@ -1,11 +0,0 @@ -x = {{ - -``` -let - x = 1 - y = 2 - x + y -``` - -}} - diff --git a/unison-src/transcripts/idempotent/fix2795.md b/unison-src/transcripts/idempotent/fix2795.md index f63e266769..bee964c5ae 100644 --- a/unison-src/transcripts/idempotent/fix2795.md +++ b/unison-src/transcripts/idempotent/fix2795.md @@ -1,5 +1,22 @@ ``` ucm scratch/main> builtins.mergeio -scratch/main> load unison-src/transcripts/fix2795/docs.u +``` + +```` unison +test = {{ + ``` + t : Text + t = "hi" + + t + ``` + @source{t1} + +}} + +t1 = "hi" +```` + +``` ucm scratch/main> display test ``` diff --git a/unison-src/transcripts/idempotent/fix2795/docs.u b/unison-src/transcripts/idempotent/fix2795/docs.u deleted file mode 100644 index c5bb69aa6e..0000000000 --- a/unison-src/transcripts/idempotent/fix2795/docs.u +++ /dev/null @@ -1,12 +0,0 @@ -test = {{ - ``` - t : Text - t = "hi" - - t - ``` - @source{t1} - -}} - -t1 = "hi" From 73b2a9c8574aa1b4007093c471bb746ba36b31c6 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 13:36:46 -0600 Subject: [PATCH 09/15] Run idempotent transcript tests This produces the first output files, which should remain unchanged on subsequent runs. --- .../transcripts/idempotent/abilities.md | 19 + .../ability-order-doesnt-affect-hash.md | 27 + .../ability-term-conflicts-on-update.md | 146 +- unison-src/transcripts/idempotent/add-run.md | 180 +- .../idempotent/add-test-watch-roundtrip.md | 10 +- .../idempotent/addupdatemessages.md | 94 + .../transcripts/idempotent/alias-term.md | 18 + .../transcripts/idempotent/alias-type.md | 18 + .../transcripts/idempotent/anf-tests.md | 30 +- .../transcripts/idempotent/any-extract.md | 24 + .../idempotent/api-doc-rendering.md | 857 ++++ unison-src/transcripts/idempotent/api-find.md | 235 +- .../idempotent/api-getDefinition.md | 480 +- .../idempotent/api-list-projects-branches.md | 47 +- .../idempotent/api-namespace-details.md | 62 + .../idempotent/api-namespace-list.md | 118 +- .../transcripts/idempotent/api-summaries.md | 784 ++- .../idempotent/block-on-required-update.md | 43 + unison-src/transcripts/idempotent/blocks.md | 196 +- .../boolean-op-pretty-print-2819.md | 22 + .../transcripts/idempotent/branch-command.md | 103 + .../idempotent/branch-relative-path.md | 61 + .../transcripts/idempotent/bug-fix-4354.md | 13 + .../idempotent/bug-strange-closure.md | 4497 ++++++++++++++++- .../transcripts/idempotent/builtins-merge.md | 83 + unison-src/transcripts/idempotent/builtins.md | 154 + .../transcripts/idempotent/bytesFromList.md | 16 + unison-src/transcripts/idempotent/check763.md | 21 + unison-src/transcripts/idempotent/check873.md | 30 + .../idempotent/constructor-applied-to-unit.md | 49 + .../transcripts/idempotent/contrabilities.md | 13 + .../transcripts/idempotent/create-author.md | 12 + .../transcripts/idempotent/cycle-update-1.md | 52 + .../transcripts/idempotent/cycle-update-2.md | 50 + .../transcripts/idempotent/cycle-update-3.md | 45 + .../transcripts/idempotent/cycle-update-4.md | 61 + .../idempotent/debug-definitions.md | 122 + .../idempotent/debug-name-diffs.md | 85 + .../transcripts/idempotent/deep-names.md | 47 + .../idempotent/definition-diff-api.md | 3521 ++++++++++++- .../delete-namespace-dependents-check.md | 42 +- .../idempotent/delete-namespace.md | 64 + .../idempotent/delete-project-branch.md | 23 + .../transcripts/idempotent/delete-project.md | 39 + .../transcripts/idempotent/delete-silent.md | 16 + unison-src/transcripts/idempotent/delete.md | 231 + .../dependents-dependencies-debugfile.md | 79 +- .../idempotent/destructuring-binds.md | 98 + .../transcripts/idempotent/diff-namespace.md | 411 +- .../transcripts/idempotent/doc-formatting.md | 337 ++ .../idempotent/doc-type-link-keywords.md | 8 + unison-src/transcripts/idempotent/doc1.md | 88 +- unison-src/transcripts/idempotent/doc2.md | 102 + .../transcripts/idempotent/doc2markdown.md | 96 +- .../dont-upgrade-refs-that-exist-in-old.md | 32 +- .../transcripts/idempotent/duplicate-names.md | 87 + .../idempotent/duplicate-term-detection.md | 65 +- unison-src/transcripts/idempotent/ed25519.md | 31 + .../transcripts/idempotent/edit-command.md | 56 +- .../transcripts/idempotent/edit-namespace.md | 112 + .../idempotent/empty-namespaces.md | 72 + .../transcripts/idempotent/emptyCodebase.md | 15 +- .../transcripts/idempotent/error-messages.md | 267 + .../idempotent/escape-sequences.md | 24 + .../transcripts/idempotent/find-by-type.md | 24 + .../transcripts/idempotent/find-command.md | 48 + .../idempotent/fix-1381-excess-propagate.md | 27 + unison-src/transcripts/idempotent/fix-5267.md | 49 + unison-src/transcripts/idempotent/fix-5301.md | 37 + unison-src/transcripts/idempotent/fix-5312.md | 48 + unison-src/transcripts/idempotent/fix-5320.md | 19 + unison-src/transcripts/idempotent/fix-5323.md | 29 + unison-src/transcripts/idempotent/fix-5326.md | 128 +- unison-src/transcripts/idempotent/fix-5340.md | 53 + unison-src/transcripts/idempotent/fix-5357.md | 61 + unison-src/transcripts/idempotent/fix-5369.md | 39 + unison-src/transcripts/idempotent/fix-5374.md | 44 + unison-src/transcripts/idempotent/fix-5380.md | 30 + .../idempotent/fix-big-list-crash.md | 14 + unison-src/transcripts/idempotent/fix-ls.md | 26 + unison-src/transcripts/idempotent/fix1063.md | 24 + unison-src/transcripts/idempotent/fix1327.md | 32 + unison-src/transcripts/idempotent/fix1334.md | 6 +- unison-src/transcripts/idempotent/fix1390.md | 39 + unison-src/transcripts/idempotent/fix1421.md | 35 +- unison-src/transcripts/idempotent/fix1532.md | 47 + unison-src/transcripts/idempotent/fix1696.md | 9 + unison-src/transcripts/idempotent/fix1709.md | 35 + unison-src/transcripts/idempotent/fix1731.md | 13 + unison-src/transcripts/idempotent/fix1800.md | 49 +- unison-src/transcripts/idempotent/fix1844.md | 23 + unison-src/transcripts/idempotent/fix1926.md | 42 + unison-src/transcripts/idempotent/fix2026.md | 30 + unison-src/transcripts/idempotent/fix2027.md | 44 + unison-src/transcripts/idempotent/fix2049.md | 66 + unison-src/transcripts/idempotent/fix2053.md | 8 + unison-src/transcripts/idempotent/fix2156.md | 20 + unison-src/transcripts/idempotent/fix2167.md | 15 + unison-src/transcripts/idempotent/fix2187.md | 13 + unison-src/transcripts/idempotent/fix2231.md | 23 + unison-src/transcripts/idempotent/fix2238.md | 18 + unison-src/transcripts/idempotent/fix2244.md | 15 +- unison-src/transcripts/idempotent/fix2254.md | 132 +- unison-src/transcripts/idempotent/fix2268.md | 15 + unison-src/transcripts/idempotent/fix2334.md | 32 + unison-src/transcripts/idempotent/fix2344.md | 14 + unison-src/transcripts/idempotent/fix2350.md | 22 +- unison-src/transcripts/idempotent/fix2353.md | 15 + unison-src/transcripts/idempotent/fix2354.md | 17 + unison-src/transcripts/idempotent/fix2355.md | 19 + unison-src/transcripts/idempotent/fix2378.md | 20 + unison-src/transcripts/idempotent/fix2423.md | 20 + unison-src/transcripts/idempotent/fix2474.md | 39 +- unison-src/transcripts/idempotent/fix2628.md | 12 + unison-src/transcripts/idempotent/fix2663.md | 25 +- unison-src/transcripts/idempotent/fix2693.md | 4051 +++++++++++++++ unison-src/transcripts/idempotent/fix2712.md | 32 + unison-src/transcripts/idempotent/fix2795.md | 25 + unison-src/transcripts/idempotent/fix2822.md | 93 +- unison-src/transcripts/idempotent/fix2826.md | 41 + unison-src/transcripts/idempotent/fix2970.md | 17 +- unison-src/transcripts/idempotent/fix3037.md | 33 + unison-src/transcripts/idempotent/fix3171.md | 24 + unison-src/transcripts/idempotent/fix3196.md | 26 + unison-src/transcripts/idempotent/fix3215.md | 14 + unison-src/transcripts/idempotent/fix3244.md | 20 + unison-src/transcripts/idempotent/fix3265.md | 62 +- unison-src/transcripts/idempotent/fix3424.md | 23 +- unison-src/transcripts/idempotent/fix3634.md | 26 +- unison-src/transcripts/idempotent/fix3678.md | 20 + unison-src/transcripts/idempotent/fix3752.md | 14 + unison-src/transcripts/idempotent/fix3773.md | 20 + unison-src/transcripts/idempotent/fix3977.md | 28 + unison-src/transcripts/idempotent/fix4172.md | 68 + unison-src/transcripts/idempotent/fix4280.md | 14 + unison-src/transcripts/idempotent/fix4397.md | 11 + unison-src/transcripts/idempotent/fix4415.md | 14 + unison-src/transcripts/idempotent/fix4424.md | 15 + unison-src/transcripts/idempotent/fix4482.md | 49 + unison-src/transcripts/idempotent/fix4498.md | 28 + unison-src/transcripts/idempotent/fix4515.md | 46 + unison-src/transcripts/idempotent/fix4528.md | 21 + unison-src/transcripts/idempotent/fix4556.md | 46 + unison-src/transcripts/idempotent/fix4592.md | 13 + unison-src/transcripts/idempotent/fix4618.md | 42 + unison-src/transcripts/idempotent/fix4711.md | 39 + unison-src/transcripts/idempotent/fix4722.md | 25 +- unison-src/transcripts/idempotent/fix4731.md | 64 + unison-src/transcripts/idempotent/fix4780.md | 16 + unison-src/transcripts/idempotent/fix4898.md | 32 + unison-src/transcripts/idempotent/fix5055.md | 29 + unison-src/transcripts/idempotent/fix5076.md | 13 + unison-src/transcripts/idempotent/fix5080.md | 50 + unison-src/transcripts/idempotent/fix5168.md | 16 +- unison-src/transcripts/idempotent/fix5349.md | 67 +- unison-src/transcripts/idempotent/fix614.md | 73 + unison-src/transcripts/idempotent/fix689.md | 14 + unison-src/transcripts/idempotent/fix693.md | 80 + unison-src/transcripts/idempotent/fix845.md | 98 + unison-src/transcripts/idempotent/fix849.md | 20 + unison-src/transcripts/idempotent/fix942.md | 91 +- unison-src/transcripts/idempotent/fix987.md | 36 + .../transcripts/idempotent/formatter.md | 106 + .../transcripts/idempotent/fuzzy-options.md | 37 +- .../idempotent/generic-parse-errors.md | 119 + unison-src/transcripts/idempotent/help.md | 994 ++++ .../transcripts/idempotent/higher-rank.md | 76 + .../idempotent/input-parse-errors.md | 44 +- .../transcripts/idempotent/io-test-command.md | 37 + unison-src/transcripts/idempotent/io.md | 328 +- .../idempotent/keyword-identifiers.md | 46 +- .../transcripts/idempotent/kind-inference.md | 228 + .../transcripts/idempotent/lambdacase.md | 127 + .../transcripts/idempotent/lsp-fold-ranges.md | 24 + .../idempotent/lsp-name-completion.md | 11 + unison-src/transcripts/idempotent/move-all.md | 127 + .../transcripts/idempotent/move-namespace.md | 229 +- .../transcripts/idempotent/name-resolution.md | 257 + .../idempotent/name-segment-escape.md | 20 + .../transcripts/idempotent/name-selection.md | 116 +- unison-src/transcripts/idempotent/names.md | 64 +- .../namespace-deletion-regression.md | 10 + .../idempotent/namespace-dependencies.md | 15 + .../idempotent/namespace-directive.md | 130 +- .../transcripts/idempotent/numbered-args.md | 106 + .../transcripts/idempotent/old-fold-right.md | 14 + .../idempotent/pattern-match-coverage.md | 722 +++ .../idempotent/pattern-pretty-print-2345.md | 111 +- .../transcripts/idempotent/patternMatchTls.md | 21 +- unison-src/transcripts/idempotent/patterns.md | 24 + .../transcripts/idempotent/propagate.md | 96 + .../transcripts/idempotent/pull-errors.md | 33 + unison-src/transcripts/idempotent/records.md | 71 +- unison-src/transcripts/idempotent/reflog.md | 95 +- .../idempotent/release-draft-command.md | 34 + unison-src/transcripts/idempotent/reset.md | 130 + .../idempotent/resolution-failures.md | 74 +- unison-src/transcripts/idempotent/rsa.md | 37 + .../transcripts/idempotent/scope-ref.md | 20 + unison-src/transcripts/idempotent/suffixes.md | 91 + .../idempotent/sum-type-update-conflicts.md | 51 +- .../transcripts/idempotent/switch-command.md | 43 + .../transcripts/idempotent/tab-completion.md | 124 + unison-src/transcripts/idempotent/tdnr.md | 691 ++- .../transcripts/idempotent/test-command.md | 96 + .../transcripts/idempotent/text-literals.md | 86 + unison-src/transcripts/idempotent/textfind.md | 135 + .../idempotent/todo-bug-builtins.md | 78 + unison-src/transcripts/idempotent/todo.md | 215 + .../idempotent/top-level-exceptions.md | 59 + .../idempotent/transcript-parser-commands.md | 35 +- .../transcripts/idempotent/type-deps.md | 34 +- .../idempotent/type-modifier-are-optional.md | 19 + unison-src/transcripts/idempotent/undo.md | 132 +- .../idempotent/unique-type-churn.md | 91 + .../transcripts/idempotent/unitnamespace.md | 23 + .../transcripts/idempotent/universal-cmp.md | 49 + .../transcripts/idempotent/unsafe-coerce.md | 31 + .../update-ignores-lib-namespace.md | 43 + .../idempotent/update-on-conflict.md | 41 + .../idempotent/update-suffixifies-properly.md | 73 + .../update-term-aliases-in-different-ways.md | 49 + .../update-term-to-different-type.md | 41 + .../idempotent/update-term-with-alias.md | 47 + ...e-term-with-dependent-to-different-type.md | 58 + .../idempotent/update-term-with-dependent.md | 49 + .../transcripts/idempotent/update-term.md | 41 + .../idempotent/update-test-to-non-test.md | 50 + .../idempotent/update-test-watch-roundtrip.md | 40 + .../idempotent/update-type-add-constructor.md | 48 + .../idempotent/update-type-add-field.md | 45 + .../idempotent/update-type-add-new-record.md | 23 + .../update-type-add-record-field.md | 78 + .../update-type-constructor-alias.md | 44 + ...-type-delete-constructor-with-dependent.md | 55 + .../update-type-delete-constructor.md | 45 + .../update-type-delete-record-field.md | 99 + .../update-type-missing-constructor.md | 44 + .../update-type-nested-decl-aliases.md | 40 + .../idempotent/update-type-no-op-record.md | 28 + .../update-type-stray-constructor-alias.md | 42 + .../update-type-stray-constructor.md | 44 + ...turn-constructor-into-smart-constructor.md | 58 + ...update-type-turn-non-record-into-record.md | 60 + .../update-type-with-dependent-term.md | 53 + ...e-with-dependent-type-to-different-kind.md | 52 + .../update-type-with-dependent-type.md | 59 + .../transcripts/idempotent/update-watch.md | 21 + .../idempotent/upgrade-happy-path.md | 42 + .../idempotent/upgrade-sad-path.md | 76 + .../upgrade-suffixifies-properly.md | 62 + .../idempotent/upgrade-with-old-alias.md | 31 + unison-src/transcripts/idempotent/view.md | 12 +- .../idempotent/watch-expressions.md | 71 + 254 files changed, 30553 insertions(+), 230 deletions(-) diff --git a/unison-src/transcripts/idempotent/abilities.md b/unison-src/transcripts/idempotent/abilities.md index eeac5fc672..32c7116d98 100644 --- a/unison-src/transcripts/idempotent/abilities.md +++ b/unison-src/transcripts/idempotent/abilities.md @@ -21,6 +21,25 @@ ha = cases { four i -> c } -> handle c (j k l -> i+j+k+l) with ha ``` +``` ucm :added-by-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`: + + ability A + ha : Request {A} r -> r +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ability A + ha : Request {A} r -> r ``` diff --git a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md index d4fc3ff480..9e34873a6e 100644 --- a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md +++ b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md @@ -14,7 +14,34 @@ term2 : () ->{Bar, Foo} () term2 _ = () ``` +``` ucm :added-by-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`: + + ability Bar + ability Foo + term1 : '{Bar, Foo} () + term2 : '{Bar, Foo} () +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ability Bar + ability Foo + term1 : '{Bar, Foo} () + term2 : '{Bar, Foo} () scratch/main> names term1 + + Term + Hash: #8hum58rlih + Names: term1 term2 ``` diff --git a/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md b/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md index 83b4fbae61..0945af447a 100644 --- a/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md +++ b/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md @@ -14,11 +14,28 @@ unique ability Channels where send : a -> {Channels} () ``` +``` ucm :added-by-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`: + + ability Channels +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ability Channels ``` -Now we update the ability, changing the name of the constructor, _but_, we simultaneously +Now we update the ability, changing the name of the constructor, *but*, we simultaneously add a new top-level term with the same name as the constructor which is being removed from Channels. @@ -33,14 +50,49 @@ thing : '{Channels} () thing _ = send 1 ``` +``` ucm :added-by-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`: + + Channels.send : a -> () + thing : '{Channels} () + + ⍟ These names already exist. You can `update` them to your + new definition: + + ability Channels +``` + These should fail with a term/ctor conflict since we exclude the ability from the update. ``` ucm :error scratch/main> update.old patch Channels.send + + x These definitions failed: + + Reason + term/ctor collision Channels.send : a -> () + + Tip: Use `help filestatus` to learn more. scratch/main> update.old patch thing + + ⍟ I've added these definitions: + + Channels.send : a -> () + thing : '{Channels} () + + ⍟ I've updated these names to your new definition: + + ability Channels ``` -If however, `Channels.send` and `thing` _depend_ on `Channels`, updating them should succeed since it pulls in the ability as a dependency. +If however, `Channels.send` and `thing` *depend* on `Channels`, updating them should succeed since it pulls in the ability as a dependency. ``` unison unique ability Channels where @@ -53,17 +105,64 @@ thing : '{Channels} () thing _ = send 1 ``` +``` ucm :added-by-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: + + ⊡ Previously added definitions will be ignored: Channels + + ⍟ These names already exist. You can `update` them to your + new definition: + + Channels.send : a ->{Channels} () + thing : '{Channels} () +``` + These updates should succeed since `Channels` is a dependency. ``` ucm scratch/main> update.old.preview patch Channels.send + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⊡ Previously added definitions will be ignored: Channels + + ⍟ These names already exist. You can `update` them to your + new definition: + + Channels.send : a ->{Channels} () scratch/main> update.old.preview patch thing + + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: + + ⊡ Previously added definitions will be ignored: Channels + + ⍟ These names already exist. You can `update` them to your + new definition: + + Channels.send : a ->{Channels} () + thing : '{Channels} () ``` We should also be able to successfully update the whole thing. ``` ucm scratch/main> update.old + + ⊡ Ignored previously added definitions: Channels + + ⍟ I've updated these names to your new definition: + + Channels.send : a ->{Channels} () + thing : '{Channels} () ``` # Constructor-term conflict @@ -72,13 +171,29 @@ scratch/main> update.old scratch/main2> builtins.merge lib.builtins ``` - ``` unison X.x = 1 ``` +``` ucm :added-by-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.x : Nat +``` + ``` ucm scratch/main2> add + + ⍟ I've added these definitions: + + X.x : Nat ``` ``` unison @@ -86,8 +201,33 @@ structural ability X where x : () ``` +``` ucm :added-by-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: + + x These definitions would fail on `add` or `update`: + + Reason + blocked structural ability X + ctor/term collision X.x + + Tip: Use `help filestatus` to learn more. +``` + This should fail with a ctor/term conflict. ``` ucm :error scratch/main2> add + + x These definitions failed: + + Reason + blocked structural ability X + ctor/term collision X.x + + Tip: Use `help filestatus` to learn more. ``` diff --git a/unison-src/transcripts/idempotent/add-run.md b/unison-src/transcripts/idempotent/add-run.md index cac73163ad..77b9559294 100644 --- a/unison-src/transcripts/idempotent/add-run.md +++ b/unison-src/transcripts/idempotent/add-run.md @@ -17,29 +17,65 @@ is2even : 'Boolean is2even = '(even 2) ``` +``` ucm :added-by-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`: + + even : Nat -> Boolean + is2even : 'Boolean + odd : Nat -> Boolean +``` + it errors if there isn't a previous run ``` ucm :error scratch/main> add.run foo + + ⚠️ + + There is no previous evaluation to save. Use `run` to evaluate + something before attempting to save it. ``` ``` ucm scratch/main> run is2even + + true ``` it errors if the desired result name conflicts with a name in the unison file + ``` ucm :error scratch/main> add.run is2even + + ⚠️ + + Cannot save the last run result into `is2even` because that + name conflicts with a name in the scratch file. ``` otherwise, the result is successfully persisted + ``` ucm scratch/main> add.run foo.bar.baz + + ⍟ I've added these definitions: + + foo.bar.baz : Boolean ``` ``` ucm scratch/main> view foo.bar.baz + + foo.bar.baz : Boolean + foo.bar.baz = true ``` ## It resolves references within the unison file @@ -55,9 +91,31 @@ main : '{IO, Exception} (Nat -> Nat -> Nat) main _ = y ``` +``` ucm :added-by-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`: + + main : '{IO, Exception} (Nat -> Nat -> Nat) + y : Nat -> Nat -> Nat + z : Nat -> Nat +``` + ``` ucm scratch/main> run main + + a b -> a Nat.+ b Nat.+ z 10 scratch/main> add.run result + + ⍟ I've added these definitions: + + result : Nat -> Nat -> Nat + z : Nat -> Nat ``` ## It resolves references within the codebase @@ -67,8 +125,25 @@ inc : Nat -> Nat inc x = x + 1 ``` +``` ucm :added-by-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`: + + inc : Nat -> Nat +``` + ``` ucm scratch/main> add inc + + ⍟ I've added these definitions: + + inc : Nat -> Nat ``` ``` unison @@ -76,10 +151,32 @@ main : '(Nat -> Nat) main _ x = inc x ``` +``` ucm :added-by-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`: + + main : '(Nat -> Nat) +``` + ``` ucm scratch/main> run main + + inc scratch/main> add.run natfoo + + ⍟ I've added these definitions: + + natfoo : Nat -> Nat scratch/main> view natfoo + + natfoo : Nat -> Nat + natfoo = inc ``` ## It captures scratch file dependencies at run time @@ -90,19 +187,56 @@ y = x + x main = 'y ``` +``` ucm :added-by-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`: + + main : 'Nat + x : Nat + y : Nat +``` + ``` ucm scratch/main> run main -``` + 2 +``` ``` unison x = 50 ``` +``` ucm :added-by-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 +``` + this saves 2 to xres, rather than 100 + ``` ucm scratch/main> add.run xres + + ⍟ I've added these definitions: + + xres : Nat scratch/main> view xres + + xres : Nat + xres = 2 ``` ## It fails with a message if add cannot complete cleanly @@ -111,9 +245,31 @@ scratch/main> view xres main = '5 ``` +``` ucm :added-by-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`: + + main : 'Nat +``` + ``` ucm :error scratch/main> run main + + 5 scratch/main> add.run xres + + x These definitions failed: + + Reason + needs update xres : Nat + + Tip: Use `help filestatus` to learn more. ``` ## It works with absolute names @@ -122,8 +278,30 @@ scratch/main> add.run xres main = '5 ``` +``` ucm :added-by-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`: + + main : 'Nat +``` + ``` ucm scratch/main> run main + + 5 scratch/main> add.run .an.absolute.name + + ⍟ I've added these definitions: + + .an.absolute.name : Nat scratch/main> view .an.absolute.name + + .an.absolute.name : Nat + .an.absolute.name = 5 ``` diff --git a/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md index dae3e8f6ee..c2ce7b7fb3 100644 --- a/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md +++ b/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md @@ -7,9 +7,17 @@ test> foo : [Test.Result] 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! +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 scratch/main> add + + ⍟ I've added these definitions: + + foo : [Result] scratch/main> view foo + + foo : [Result] + foo : [Result] + foo = [] ``` diff --git a/unison-src/transcripts/idempotent/addupdatemessages.md b/unison-src/transcripts/idempotent/addupdatemessages.md index 81f85b0f2c..3cf4b245f2 100644 --- a/unison-src/transcripts/idempotent/addupdatemessages.md +++ b/unison-src/transcripts/idempotent/addupdatemessages.md @@ -14,10 +14,33 @@ structural type X = One Nat structural type Y = Two Nat Nat ``` +``` ucm :added-by-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 X + structural type Y + x : Nat + y : Nat +``` + Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type X + structural type Y + x : Nat + y : Nat ``` Let's add an alias for `1` and `One`: @@ -28,11 +51,34 @@ z = 1 structural type Z = One Nat ``` +``` ucm :added-by-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 Z + (also named X) + z : Nat + (also named x) +``` + Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Z + (also named X) + z : Nat + (also named x) ``` Let's update something that has an alias (to a value that doesn't have a name already): @@ -42,10 +88,36 @@ x = 3 structural type X = Three Nat Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + structural type X + (The old definition is also named Z.) + x : Nat + (The old definition is also named z.) +``` + 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 scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` Update it to something that already exists with a different name: @@ -55,8 +127,30 @@ x = 2 structural type X = Two Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + structural type X + (also named Y) + x : Nat + (also named y) +``` + 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 scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/alias-term.md b/unison-src/transcripts/idempotent/alias-term.md index 58bec4bc87..5fde538677 100644 --- a/unison-src/transcripts/idempotent/alias-term.md +++ b/unison-src/transcripts/idempotent/alias-term.md @@ -6,22 +6,40 @@ project/main> builtins.mergeio lib.builtins ``` ucm project/main> alias.term lib.builtins.bug foo + + Done. project/main> ls + + 1. foo (a -> b) + 2. lib/ (643 terms, 92 types) ``` It won't create a conflicted name, though. ``` ucm :error project/main> alias.term lib.builtins.todo foo + + ⚠️ + + A term by that name already exists. ``` ``` ucm project/main> ls + + 1. foo (a -> b) + 2. lib/ (643 terms, 92 types) ``` You can use `debug.alias.term.force` for that. ``` ucm project/main> debug.alias.term.force lib.builtins.todo foo + + Done. project/main> ls + + 1. foo (a -> b) + 2. foo (a -> b) + 3. lib/ (643 terms, 92 types) ``` diff --git a/unison-src/transcripts/idempotent/alias-type.md b/unison-src/transcripts/idempotent/alias-type.md index 2def8c77b0..2740753e46 100644 --- a/unison-src/transcripts/idempotent/alias-type.md +++ b/unison-src/transcripts/idempotent/alias-type.md @@ -6,22 +6,40 @@ project/main> builtins.mergeio lib.builtins ``` ucm project/main> alias.type lib.builtins.Nat Foo + + Done. project/main> ls + + 1. Foo (builtin type) + 2. lib/ (643 terms, 92 types) ``` It won't create a conflicted name, though. ``` ucm :error project/main> alias.type lib.builtins.Int Foo + + ⚠️ + + A type by that name already exists. ``` ``` ucm project/main> ls + + 1. Foo (builtin type) + 2. lib/ (643 terms, 92 types) ``` You can use `debug.alias.type.force` for that. ``` ucm project/main> debug.alias.type.force lib.builtins.Int Foo + + Done. project/main> ls + + 1. Foo (builtin type) + 2. Foo (builtin type) + 3. lib/ (643 terms, 92 types) ``` diff --git a/unison-src/transcripts/idempotent/anf-tests.md b/unison-src/transcripts/idempotent/anf-tests.md index f467a850fd..9bd5080fe3 100644 --- a/unison-src/transcripts/idempotent/anf-tests.md +++ b/unison-src/transcripts/idempotent/anf-tests.md @@ -6,9 +6,11 @@ This tests a variable related bug in the ANF compiler. The nested let would get flattened out, resulting in: - bar = result +``` +bar = result +``` -which would be handled by renaming. However, the _context_ portion of +which would be handled by renaming. However, the *context* portion of the rest of the code was not being renamed correctly, so `bar` would remain in the definition of `baz`. @@ -27,6 +29,30 @@ foo _ = > !foo ``` +``` ucm :added-by-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 : ∀ _. _ -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 12 | > !foo + ⧩ + 5 +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : ∀ _. _ -> Nat ``` diff --git a/unison-src/transcripts/idempotent/any-extract.md b/unison-src/transcripts/idempotent/any-extract.md index b474a8ef58..b17ca9b6f1 100644 --- a/unison-src/transcripts/idempotent/any-extract.md +++ b/unison-src/transcripts/idempotent/any-extract.md @@ -18,6 +18,30 @@ test> Any.unsafeExtract.works = ] ``` +``` ucm :added-by-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`: + + Any.unsafeExtract.works : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 4 | checks [1 == Any.unsafeExtract (Any 1), + + ✅ Passed Passed +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + Any.unsafeExtract.works : [Result] ``` diff --git a/unison-src/transcripts/idempotent/api-doc-rendering.md b/unison-src/transcripts/idempotent/api-doc-rendering.md index 2eaeca1430..a4ed862c42 100644 --- a/unison-src/transcripts/idempotent/api-doc-rendering.md +++ b/unison-src/transcripts/idempotent/api-doc-rendering.md @@ -87,8 +87,865 @@ scratch/main> add ``` ucm scratch/main> display term.doc + + # Heading + + # Heading 2 + + Term Link: otherTerm + + Type Link: Maybe + + Term source: + + term : Nat + term = 42 + + Term signature: + + term : Nat + + * List item + + 1. Numbered list item + + > Block quote + + Code block + + Inline code: + + `1 Nat.+ 2` + + `"doesn't typecheck" + 1` + + Link + + ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) + + Bold + + Italic + + ~~Strikethrough~~ + + Horizontal rule + + --- + + Table + + | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | + Cell 2 | | Cell 3 | Cell 4 | + + Video + + + {{ embed {{ + Video + [MediaSource "test.mp4" Nothing] + [("poster", "test.png")] }} }} + + + Transclusion/evaluation: + + This doc should be embedded. + + message ``` ``` api GET /api/projects/scratch/branches/main/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" + ] + } + }, + "typeDefinitions": {} + } ``` diff --git a/unison-src/transcripts/idempotent/api-find.md b/unison-src/transcripts/idempotent/api-find.md index 2033a55b9a..d08334aa0a 100644 --- a/unison-src/transcripts/idempotent/api-find.md +++ b/unison-src/transcripts/idempotent/api-find.md @@ -7,20 +7,249 @@ joey.httpServer.z = 44 joey.yaml.zz = 45 ``` +``` ucm :added-by-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`: + + joey.httpServer.z : ##Nat + joey.yaml.zz : ##Nat + rachel.filesystem.x : ##Nat + ross.httpClient.y : ##Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + joey.httpServer.z : ##Nat + joey.yaml.zz : ##Nat + rachel.filesystem.x : ##Nat + ross.httpClient.y : ##Nat ``` ``` api -- Namespace segment prefix search GET /api/projects/scratch/branches/main/find?query=http - + [ + [ + { + "result": { + "segments": [ + { + "contents": "ross.", + "tag": "Gap" + }, + { + "contents": "http", + "tag": "Match" + }, + { + "contents": "Client.y", + "tag": "Gap" + } + ] + }, + "score": 156 + }, + { + "contents": { + "bestFoundTermName": "y", + "namedTerm": { + "termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8", + "termName": "ross.httpClient.y", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ], + [ + { + "result": { + "segments": [ + { + "contents": "joey.", + "tag": "Gap" + }, + { + "contents": "http", + "tag": "Match" + }, + { + "contents": "Server.z", + "tag": "Gap" + } + ] + }, + "score": 156 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] -- Namespace segment suffix search GET /api/projects/scratch/branches/main/find?query=Server - + [ + [ + { + "result": { + "segments": [ + { + "contents": "joey.http", + "tag": "Gap" + }, + { + "contents": "Server", + "tag": "Match" + }, + { + "contents": ".z", + "tag": "Gap" + } + ] + }, + "score": 223 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] -- Substring search GET /api/projects/scratch/branches/main/find?query=lesys - + [ + [ + { + "result": { + "segments": [ + { + "contents": "rachel.fi", + "tag": "Gap" + }, + { + "contents": "lesys", + "tag": "Match" + }, + { + "contents": "tem.x", + "tag": "Gap" + } + ] + }, + "score": 175 + }, + { + "contents": { + "bestFoundTermName": "x", + "namedTerm": { + "termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "termName": "rachel.filesystem.x", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] -- Cross-segment search GET /api/projects/scratch/branches/main/find?query=joey.http + [ + [ + { + "result": { + "segments": [ + { + "contents": "joey.http", + "tag": "Match" + }, + { + "contents": "Server.z", + "tag": "Gap" + } + ] + }, + "score": 300 + }, + { + "contents": { + "bestFoundTermName": "z", + "namedTerm": { + "termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo", + "termName": "joey.httpServer.z", + "termTag": "Plain", + "termType": [ + { + "annotation": { + "contents": "##Nat", + "tag": "HashQualifier" + }, + "segment": "##Nat" + } + ] + } + }, + "tag": "FoundTermResult" + } + ] + ] ``` diff --git a/unison-src/transcripts/idempotent/api-getDefinition.md b/unison-src/transcripts/idempotent/api-getDefinition.md index 8606dee7ef..3093f55514 100644 --- a/unison-src/transcripts/idempotent/api-getDefinition.md +++ b/unison-src/transcripts/idempotent/api-getDefinition.md @@ -16,12 +16,203 @@ scratch/main> add ``` api -- Should NOT find names by suffix GET /api/projects/scratch/branches/main/getDefinition?names=x - + { + "missingDefinitions": [ + "x" + ], + "termDefinitions": {}, + "typeDefinitions": {} + } -- Term names should strip relativeTo prefix. GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested - + { + "missingDefinitions": [], + "termDefinitions": { + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { + "bestTermName": "x", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doc", + "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", + { + "contents": [ + { + "contents": "Documentation", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "nested.names.x" + ] + } + }, + "typeDefinitions": {} + } -- Should find definitions by hash, names should be relative GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested + { + "missingDefinitions": [], + "termDefinitions": { + "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": { + "bestTermName": "x", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "x", + "tag": "HashQualifier" + }, + "segment": "x" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "42" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doc", + "#ulr9f75rpcrv79d7sfo2ep2tvbntu3e360lfomird2bdpj4bnea230e8o5j0b9our8vggocpa7eck3pus14fcfajlttat1bg71t6rbg", + { + "contents": [ + { + "contents": "Documentation", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "nested.names.x" + ] + } + }, + "typeDefinitions": {} + } ``` ``` unison :hide @@ -41,10 +232,295 @@ Only docs for the term we request should be returned, even if there are other te ``` api GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest + { + "missingDefinitions": [], + "termDefinitions": { + "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { + "bestTermName": "doctest.thing", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "doctest.thing", + "tag": "HashQualifier" + }, + "segment": "doctest.thing" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "doctest.thing", + "tag": "HashQualifier" + }, + "segment": "doctest.thing" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"A thing\"" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doctest.thing.doc", + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", + { + "contents": [ + { + "contents": "The", + "tag": "Word" + }, + { + "contents": "correct", + "tag": "Word" + }, + { + "contents": "docs", + "tag": "Word" + }, + { + "contents": "for", + "tag": "Word" + }, + { + "contents": "the", + "tag": "Word" + }, + { + "contents": "thing", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "doctest.thing", + "doctest.thingalias" + ] + } + }, + "typeDefinitions": {} + } ``` 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/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest + { + "missingDefinitions": [], + "termDefinitions": { + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { + "bestTermName": "doctest.thing.doc", + "defnTermTag": "Doc", + "signature": [ + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "doctest.thing.doc", + "tag": "HashQualifier" + }, + "segment": "doctest.thing.doc" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "doctest.thing.doc", + "tag": "HashQualifier" + }, + "segment": "doctest.thing.doc" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DocDelimiter" + }, + "segment": "{{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "The" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "correct" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "docs" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "for" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "the" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "thing" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DocDelimiter" + }, + "segment": "}}" + } + ], + "tag": "UserObject" + }, + "termDocs": [ + [ + "doctest.thing.doc", + "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", + { + "contents": [ + { + "contents": "The", + "tag": "Word" + }, + { + "contents": "correct", + "tag": "Word" + }, + { + "contents": "docs", + "tag": "Word" + }, + { + "contents": "for", + "tag": "Word" + }, + { + "contents": "the", + "tag": "Word" + }, + { + "contents": "thing", + "tag": "Word" + } + ], + "tag": "Paragraph" + } + ] + ], + "termNames": [ + "doctest.thing.doc" + ] + } + }, + "typeDefinitions": {} + } ``` diff --git a/unison-src/transcripts/idempotent/api-list-projects-branches.md b/unison-src/transcripts/idempotent/api-list-projects-branches.md index 8275c44ce2..9d5952766b 100644 --- a/unison-src/transcripts/idempotent/api-list-projects-branches.md +++ b/unison-src/transcripts/idempotent/api-list-projects-branches.md @@ -12,13 +12,54 @@ project-one/main> branch branch-three ``` api -- Should list all projects GET /api/projects - + [ + { + "projectName": "project-one" + }, + { + "projectName": "project-three" + }, + { + "projectName": "project-two" + }, + { + "projectName": "scratch" + } + ] -- Should list projects starting with project-t GET /api/projects?prefix=project-t - + [ + { + "projectName": "project-three" + }, + { + "projectName": "project-two" + } + ] -- Should list all branches GET /api/projects/project-one/branches - + [ + { + "branchName": "branch-one" + }, + { + "branchName": "branch-three" + }, + { + "branchName": "branch-two" + }, + { + "branchName": "main" + } + ] -- Should list all branches beginning with branch-t GET /api/projects/project-one/branches?prefix=branch-t + [ + { + "branchName": "branch-three" + }, + { + "branchName": "branch-two" + } + ] ``` diff --git a/unison-src/transcripts/idempotent/api-namespace-details.md b/unison-src/transcripts/idempotent/api-namespace-details.md index 989873bf43..5e2db50a07 100644 --- a/unison-src/transcripts/idempotent/api-namespace-details.md +++ b/unison-src/transcripts/idempotent/api-namespace-details.md @@ -13,11 +13,73 @@ Here's a *README*! }} ``` +``` ucm :added-by-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`: + + nested.names.readme : Doc2 + nested.names.x : Nat + nested.names.x.doc : Doc2 +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + nested.names.readme : Doc2 + nested.names.x : Nat + nested.names.x.doc : Doc2 ``` ``` api -- Should find names by suffix GET /api/projects/scratch/branches/main/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" + } + } ``` diff --git a/unison-src/transcripts/idempotent/api-namespace-list.md b/unison-src/transcripts/idempotent/api-namespace-list.md index 4834b9f342..5139f87319 100644 --- a/unison-src/transcripts/idempotent/api-namespace-list.md +++ b/unison-src/transcripts/idempotent/api-namespace-list.md @@ -11,12 +11,128 @@ nested.names.x = 42 nested.names.readme = {{ I'm a readme! }} ``` +``` ucm :added-by-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`: + + nested.names.readme : Doc2 + nested.names.x : Nat + nested.names.x.doc : Doc2 +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + nested.names.readme : Doc2 + nested.names.x : Nat + nested.names.x.doc : Doc2 ``` ``` api GET /api/projects/scratch/branches/main/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" + } + ], + "namespaceListingFQN": "nested.names", + "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + } GET /api/projects/scratch/branches/main/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" + } + ], + "namespaceListingFQN": "nested.names", + "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" + } ``` diff --git a/unison-src/transcripts/idempotent/api-summaries.md b/unison-src/transcripts/idempotent/api-summaries.md index 7491a38752..039efb04b9 100644 --- a/unison-src/transcripts/idempotent/api-summaries.md +++ b/unison-src/transcripts/idempotent/api-summaries.md @@ -4,7 +4,6 @@ scratch/main> builtins.mergeio ``` - ``` unison :hide nat : Nat nat = 42 @@ -35,30 +34,649 @@ scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl ``` api -- term GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat - + { + "displayName": "nat", + "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } -- term without name uses hash GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary - + { + "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } -- doc GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc - + { + "displayName": "doc", + "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", + "summary": { + "contents": [ + { + "annotation": { + "contents": "#ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0", + "tag": "TypeReference" + }, + "segment": "Doc2" + } + ], + "tag": "UserObject" + }, + "tag": "Doc" + } -- test GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest - + { + "displayName": "mytest", + "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "[" + }, + { + "annotation": { + "contents": "#aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0", + "tag": "TypeReference" + }, + "segment": "Result" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "]" + } + ], + "tag": "UserObject" + }, + "tag": "Test" + } -- function GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func - + { + "displayName": "func", + "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } -- constructor GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This - + { + "displayName": "Thing.This", + "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", + "tag": "TypeReference" + }, + "segment": "Thing" + } + ], + "tag": "UserObject" + }, + "tag": "DataConstructor" + } -- Long type signature GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType - + { + "displayName": "funcWithLongType", + "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } -- Long type signature with render width GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType - + { + "displayName": "funcWithLongType", + "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "tag": "Plain" + } -- Builtin Term GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl + { + "displayName": "putBytesImpl", + "hash": "##IO.putBytes.impl.v3", + "summary": { + "contents": [ + { + "annotation": { + "contents": "##Handle", + "tag": "TypeReference" + }, + "segment": "Handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Bytes", + "tag": "TypeReference" + }, + "segment": "Bytes" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "contents": "##IO", + "tag": "TypeReference" + }, + "segment": "IO" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#0o7mf021foma9acqdaibmlh1jidlijq08uf7f5se9tssttqs546pfunjpk6s31mqoq8s2o1natede8hkk6he45l95fibglidikt44v8", + "tag": "TypeReference" + }, + "segment": "Either" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8", + "tag": "TypeReference" + }, + "segment": "Failure" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": "(" + }, + { + "annotation": null, + "segment": ")" + } + ], + "tag": "BuiltinObject" + }, + "tag": "Plain" + } ``` ## Type Summary APIs @@ -66,13 +684,155 @@ GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes. ``` api -- data GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing - + { + "displayName": "Thing", + "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Thing", + "tag": "HashQualifier" + }, + "segment": "Thing" + } + ], + "tag": "UserObject" + }, + "tag": "Data" + } -- data with type args GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe - + { + "displayName": "Maybe", + "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Maybe", + "tag": "HashQualifier" + }, + "segment": "Maybe" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + } + ], + "tag": "UserObject" + }, + "tag": "Data" + } -- ability GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream - + { + "displayName": "Stream", + "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", + "summary": { + "contents": [ + { + "annotation": { + "tag": "DataTypeModifier" + }, + "segment": "structural" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "ability" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Stream", + "tag": "HashQualifier" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "s" + } + ], + "tag": "UserObject" + }, + "tag": "Ability" + } -- builtin type GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat + { + "displayName": "Nat", + "hash": "##Nat", + "summary": { + "contents": [ + { + "annotation": null, + "segment": "Nat" + } + ], + "tag": "BuiltinObject" + }, + "tag": "Data" + } ``` diff --git a/unison-src/transcripts/idempotent/block-on-required-update.md b/unison-src/transcripts/idempotent/block-on-required-update.md index 374ddcc658..be0e05764d 100644 --- a/unison-src/transcripts/idempotent/block-on-required-update.md +++ b/unison-src/transcripts/idempotent/block-on-required-update.md @@ -10,8 +10,25 @@ scratch/main> builtins.merge x = 1 ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + x : Nat ``` Update `x`, and add a new `y` which depends on the update @@ -21,8 +38,34 @@ x = 10 y = x + 1 ``` +``` ucm :added-by-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 + + ⍟ These names already exist. You can `update` them to your + new definition: + + x : Nat +``` + 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 scratch/main> add y + + x These definitions failed: + + Reason + needs update x : Nat + blocked y : Nat + + Tip: Use `help filestatus` to learn more. ``` diff --git a/unison-src/transcripts/idempotent/blocks.md b/unison-src/transcripts/idempotent/blocks.md index 41894d1ba3..9645fffd9b 100644 --- a/unison-src/transcripts/idempotent/blocks.md +++ b/unison-src/transcripts/idempotent/blocks.md @@ -19,6 +19,26 @@ ex thing = > ex "hello" ``` +``` ucm :added-by-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`: + + ex : thing -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 8 | > ex "hello" + ⧩ + 43 +``` + ### Whether a block shadows outer names doesn't depend on the order of bindings in the block The `thing` reference in `bar` refers to the one declared locally in the block that `bar` is part of. This is true even if the declaration which shadows the outer name appears later in the block, for instance: @@ -32,6 +52,26 @@ ex thing = > ex "hello" ``` +``` ucm :added-by-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`: + + ex : thing -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 6 | > ex "hello" + ⧩ + 43 +``` + ### Blocks use lexical scoping and can only reference definitions in parent scopes or in the same block This is just the normal lexical scoping behavior. For example: @@ -47,7 +87,27 @@ ex thing = > ex (x -> x * 100) ``` -Here's another example, showing that bindings cannot reference bindings declared in blocks nested in the _body_ (the final expression) of a block: +``` ucm :added-by-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`: + + ex : (Nat ->{g} Nat) ->{g} Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 8 | > ex (x -> x * 100) + ⧩ + 4201 +``` + +Here's another example, showing that bindings cannot reference bindings declared in blocks nested in the *body* (the final expression) of a block: ``` unison ex thing = @@ -59,9 +119,29 @@ ex thing = > ex (x -> x * 100) ``` +``` ucm :added-by-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`: + + ex : (Nat ->{g} Nat) ->{g} Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 7 | > ex (x -> x * 100) + ⧩ + 4201 +``` + ### Blocks can define one or more functions which are recursive or mutually recursive -We call these groups of definitions that reference each other in a block _cycles_. For instance: +We call these groups of definitions that reference each other in a block *cycles*. For instance: ``` unison sumTo n = @@ -78,6 +158,20 @@ ex n = ping 42 ``` +``` ucm :added-by-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`: + + ex : n -> r + sumTo : Nat -> Nat +``` + The `go` function is a one-element cycle (it reference itself), and `ping` and `pong` form a two-element cycle. ### Cyclic references or forward reference must be guarded @@ -91,6 +185,19 @@ ex n = ping 0 ``` +``` ucm :added-by-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`: + + ex : n -> Nat +``` + Since the forward reference to `pong` appears inside `ping`. This, however, will not compile: @@ -102,6 +209,15 @@ ex n = pong ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 + 2 | pong = ping + 1 + 3 | ping = 42 +``` + This also won't compile; it's a cyclic reference that isn't guarded: ``` unison :error @@ -110,6 +226,14 @@ ex n = loop ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 + 2 | loop = loop +``` + This, however, will compile. This also shows that `'expr` is another way of guarding a definition. ``` unison @@ -118,7 +242,20 @@ ex n = !loop ``` -Just don't try to run it as it's an infinite loop! +``` ucm :added-by-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`: + + ex : n -> r +``` + +Just don't try to run it as it's an infinite loop\! ### Cyclic definitions in a block don't have access to any abilities @@ -134,7 +271,16 @@ ex n = zap1 ``` -### The _body_ of recursive functions can certainly access abilities +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. + + 5 | zap1 = launchMissiles "neptune" + zap2 +``` + +### The *body* of recursive functions can certainly access abilities For instance, this works fine: @@ -148,6 +294,20 @@ ex n = zap1 "pluto" ``` +``` ucm :added-by-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 ability SpaceAttack + ex : n ->{SpaceAttack} Nat +``` + ### Unrelated definitions not part of a cycle and are moved after the cycle For instance, `zap` here isn't considered part of the cycle (it doesn't reference `ping` or `pong`), so this typechecks fine: @@ -163,6 +323,20 @@ ex n = ping 42 ``` +``` ucm :added-by-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 ability SpaceAttack + ex : n ->{SpaceAttack} r +``` + This is actually parsed as if you moved `zap` after the cycle it find itself a part of: ``` unison @@ -175,3 +349,17 @@ ex n = zap = launchMissiles "neptune" ping 42 ``` + +``` ucm :added-by-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 ability SpaceAttack + ex : n ->{SpaceAttack} r +``` diff --git a/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md b/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md index 3f7f4e6214..4af3c7d061 100644 --- a/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md +++ b/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md @@ -11,7 +11,29 @@ hangExample = && ("a long piece of text to hang the line" == "") ``` +``` ucm :added-by-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`: + + hangExample : Boolean +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + hangExample : Boolean scratch/main> view hangExample + + hangExample : Boolean + hangExample = + "a long piece of text to hang the line" == "" + && "a long piece of text to hang the line" == "" ``` diff --git a/unison-src/transcripts/idempotent/branch-command.md b/unison-src/transcripts/idempotent/branch-command.md index bf9ff0c9e1..00ad35f4e5 100644 --- a/unison-src/transcripts/idempotent/branch-command.md +++ b/unison-src/transcripts/idempotent/branch-command.md @@ -13,7 +13,13 @@ someterm = 18 ``` ucm scratch/main> builtins.merge lib.builtins + + Done. scratch/main> add + + ⍟ I've added these definitions: + + someterm : Nat ``` Now, the `branch` demo: @@ -23,33 +29,121 @@ project. It can also create an empty branch. ``` ucm foo/main> branch topic1 + + Done. I've created the topic1 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic1`. foo/main> branch /topic2 + + Done. I've created the topic2 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic2`. foo/main> branch foo/topic3 + + Done. I've created the topic3 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic3`. foo/main> branch main topic4 + + Done. I've created the topic4 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic4`. foo/main> branch main /topic5 + + Done. I've created the topic5 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic5`. foo/main> branch main foo/topic6 + + Done. I've created the topic6 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic6`. foo/main> branch /main topic7 + + Done. I've created the topic7 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic7`. foo/main> branch /main /topic8 + + Done. I've created the topic8 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic8`. foo/main> branch /main foo/topic9 + + Done. I've created the topic9 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic9`. foo/main> branch foo/main topic10 + + Done. I've created the topic10 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic10`. foo/main> branch foo/main /topic11 + + Done. I've created the topic11 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic11`. scratch/main> branch foo/main foo/topic12 + Done. I've created the topic12 branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /topic12`. foo/main> branch bar/topic + + Done. I've created the bar/topic branch based off foo/main. bar/main> branch foo/main topic2 + + Done. I've created the bar/topic2 branch based off foo/main. bar/main> branch foo/main /topic3 + + Done. I've created the bar/topic3 branch based off foo/main. scratch/main> branch foo/main bar/topic4 + Done. I've created the bar/topic4 branch based off foo/main. foo/main> branch.empty empty1 + + Done. I've created an empty branch foo/empty1. + + Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty /empty2 + + Done. I've created an empty branch foo/empty2. + + Tip: Use `merge /somebranch` to initialize this branch. foo/main> branch.empty foo/empty3 + + Done. I've created an empty branch foo/empty3. + + Tip: Use `merge /somebranch` to initialize this branch. scratch/main> branch.empty foo/empty4 + + Done. I've created an empty branch foo/empty4. + + Tip: Use `merge /somebranch` to initialize this branch. ``` The `branch` command can create branches named `releases/drafts/*` (because why not). ``` ucm foo/main> branch releases/drafts/1.2.3 + + Done. I've created the releases/drafts/1.2.3 branch based off + of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /releases/drafts/1.2.3`. foo/main> switch /releases/drafts/1.2.3 ``` @@ -57,5 +151,14 @@ The `branch` command can't create branches named `releases/*` nor `releases/draf ``` ucm :error foo/main> branch releases/1.2.3 + + Branch names like releases/1.2.3 are reserved for releases. + + Tip: to download an existing release, try + `clone /releases/1.2.3`. + + Tip: to draft a new release, try `release.draft 1.2.3`. foo/main> switch /releases/1.2.3 + + foo/releases/1.2.3 does not exist. ``` diff --git a/unison-src/transcripts/idempotent/branch-relative-path.md b/unison-src/transcripts/idempotent/branch-relative-path.md index 2e0ac1901b..336d4c232b 100644 --- a/unison-src/transcripts/idempotent/branch-relative-path.md +++ b/unison-src/transcripts/idempotent/branch-relative-path.md @@ -3,8 +3,27 @@ foo = 5 foo.bar = 1 ``` +``` ucm :added-by-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 : ##Nat + foo.bar : ##Nat +``` + ``` ucm p0/main> add + + ⍟ I've added these definitions: + + foo : ##Nat + foo.bar : ##Nat ``` ``` unison @@ -12,14 +31,56 @@ bonk = 5 donk.bonk = 1 ``` +``` ucm :added-by-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 + (also named foo) + donk.bonk : ##Nat + (also named foo.bar) +``` + ``` ucm p1/main> add + + ⍟ I've added these definitions: + + bonk : ##Nat + donk.bonk : ##Nat p1/main> fork p0/main: zzz + + Done. p1/main> find zzz + + 1. zzz.foo : ##Nat + 2. zzz.foo.bar : ##Nat p1/main> fork p0/main:foo yyy + + Done. p1/main> find yyy + + 1. yyy.bar : ##Nat p0/main> fork p1/main: p0/main:p1 + + Done. p0/main> ls p1 + + 1. bonk (##Nat) + 2. donk/ (1 term) + 3. yyy/ (1 term) + 4. zzz/ (2 terms) p0/main> ls p1.zzz + + 1. foo (##Nat) + 2. foo/ (1 term) p0/main> ls p1.yyy + + 1. bar (##Nat) ``` diff --git a/unison-src/transcripts/idempotent/bug-fix-4354.md b/unison-src/transcripts/idempotent/bug-fix-4354.md index aafa40fa81..d662783099 100644 --- a/unison-src/transcripts/idempotent/bug-fix-4354.md +++ b/unison-src/transcripts/idempotent/bug-fix-4354.md @@ -11,3 +11,16 @@ bonk x = honk = x x ``` + +``` ucm :added-by-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 : a -> a +``` diff --git a/unison-src/transcripts/idempotent/bug-strange-closure.md b/unison-src/transcripts/idempotent/bug-strange-closure.md index e68236aec9..23a5fc90db 100644 --- a/unison-src/transcripts/idempotent/bug-strange-closure.md +++ b/unison-src/transcripts/idempotent/bug-strange-closure.md @@ -5,11 +5,414 @@ 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 +```` ucm scratch/main> display doc.guide + + # Unison computable documentation + + # Basic formatting + + Paragraphs are separated by one or more blanklines. + Sections have a title and 0 or more paragraphs or other + section elements. + + Text can be bold, *italicized*, ~~strikethrough~~, or + `monospaced` (or `monospaced`). + + You can link to Unison terms, types, and external URLs: + + * An external url + * Some is a term link; Optional is a type link + * A named type link and a named term link. Term links are + handy for linking to other documents! + + You can use `{{ .. }}` to escape out to regular Unison + syntax, for instance __not bold__. This is useful for + creating documents programmatically or just including + other documents. + + *Next up:* lists + + # Lists + + # Bulleted lists + + Bulleted lists can use `+`, `-`, or `*` for the bullets + (though the choice will be normalized away by the + pretty-printer). They can be nested, to any depth: + + * A + * B + * C + * C1 + * C2 + + # Numbered lists + + 1. A + 2. B + 3. C + + The first number of the list determines the starting + number in the rendered output. The other numbers are + ignored: + + 10. A + 11. B + 12. C + + Numbered lists can be nested as well, and combined with + bulleted lists: + + 1. Wake up. + * What am I doing here? + * In this nested list. + 2. Take shower. + 3. Get dressed. + + # Evaluation + + Expressions can be evaluated inline, for instance `2`. + + Blocks of code can be evaluated as well, for instance: + + id x = x + id (sqr 10) + ⧨ + 100 + + also: + + match 1 with + 1 -> "hi" + _ -> "goodbye" + ⧨ + "hi" + + To include a typechecked snippet of code without + evaluating it, you can do: + + use Nat * + cube : Nat -> Nat + cube x = x * x * x + + # Including Unison source code + + Unison definitions can be included in docs. For instance: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + Some rendering targets also support folded source: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + You can also include just a signature, inline, with + `sqr : Nat -> Nat`, or you can include one or more + signatures as a block: + + sqr : Nat -> Nat + + Nat.+ : Nat -> Nat -> Nat + + Or alternately: + + List.map : (a ->{e} b) -> [a] ->{e} [b] + + # Inline snippets + + You can include typechecked code snippets inline, for + instance: + + * `f x Nat.+ sqr 1` - the `2` says to ignore the first + two arguments when rendering. In richer renderers, the + `sqr` link will be clickable. + * If your snippet expression is just a single function + application, you can put it in double backticks, like + so: `sqr x`. This is equivalent to `sqr x`. + + # Non-Unison code blocks + + Use three or more single quotes to start a block with no + syntax highlighting: + + ``` raw + _____ _ + | | |___|_|___ ___ ___ + | | | | |_ -| . | | + |_____|_|_|_|___|___|_|_| + + ``` + + You can use three or more backticks plus a language name + for blocks with syntax highlighting: + + ``` Haskell + -- A fenced code block which isn't parsed by Unison + reverse = foldl (flip (:)) [] + ``` + + ``` Scala + // A fenced code block which isn't parsed by Unison + def reverse[A](xs: List[A]) = + xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) + ``` + + There are also asides, callouts, tables, tooltips, and more. + These don't currently have special syntax; just use the + `{{ }}` syntax to call these functions directly. + + docAside : Doc2 -> Doc2 + + docCallout : Optional Doc2 -> Doc2 -> Doc2 + + docBlockquote : Doc2 -> Doc2 + + docTooltip : Doc2 -> Doc2 -> Doc2 + + docTable : [[Doc2]] -> Doc2 + + This is an aside. ( + Some extra detail that doesn't belong in main text. ) + + | This is an important callout, with no icon. + + | 🌻 + | + | This is an important callout, with an icon. The text + | wraps onto multiple lines. + + > "And what is the use of a book," thought Alice, "without + > pictures or conversation?" + > + > *Lewis Carroll, Alice's Adventures in Wonderland* + + Hover over me + + a b A longer paragraph that will split + onto multiple lines, such that this + row occupies multiple lines in the + rendered table. + Some text More text Zounds! scratch/main> add + + ⍟ I've added these definitions: + + basicFormatting : Doc2 + doc.guide : Doc2 + evaluation : Doc2 + includingSource : Doc2 + lists : Doc2 + nonUnisonCodeBlocks : Doc2 + otherElements : Doc2 + sqr : Nat -> Nat scratch/main> display doc.guide -``` + + # Unison computable documentation + + # Basic formatting + + Paragraphs are separated by one or more blanklines. + Sections have a title and 0 or more paragraphs or other + section elements. + + Text can be bold, *italicized*, ~~strikethrough~~, or + `monospaced` (or `monospaced`). + + You can link to Unison terms, types, and external URLs: + + * An external url + * Some is a term link; Optional is a type link + * A named type link and a named term link. Term links are + handy for linking to other documents! + + You can use `{{ .. }}` to escape out to regular Unison + syntax, for instance __not bold__. This is useful for + creating documents programmatically or just including + other documents. + + *Next up:* lists + + # Lists + + # Bulleted lists + + Bulleted lists can use `+`, `-`, or `*` for the bullets + (though the choice will be normalized away by the + pretty-printer). They can be nested, to any depth: + + * A + * B + * C + * C1 + * C2 + + # Numbered lists + + 1. A + 2. B + 3. C + + The first number of the list determines the starting + number in the rendered output. The other numbers are + ignored: + + 10. A + 11. B + 12. C + + Numbered lists can be nested as well, and combined with + bulleted lists: + + 1. Wake up. + * What am I doing here? + * In this nested list. + 2. Take shower. + 3. Get dressed. + + # Evaluation + + Expressions can be evaluated inline, for instance `2`. + + Blocks of code can be evaluated as well, for instance: + + id x = x + id (sqr 10) + ⧨ + 100 + + also: + + match 1 with + 1 -> "hi" + _ -> "goodbye" + ⧨ + "hi" + + To include a typechecked snippet of code without + evaluating it, you can do: + + use Nat * + cube : Nat -> Nat + cube x = x * x * x + + # Including Unison source code + + Unison definitions can be included in docs. For instance: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + Some rendering targets also support folded source: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + You can also include just a signature, inline, with + `sqr : Nat -> Nat`, or you can include one or more + signatures as a block: + + sqr : Nat -> Nat + + Nat.+ : Nat -> Nat -> Nat + + Or alternately: + + List.map : (a ->{e} b) -> [a] ->{e} [b] + + # Inline snippets + + You can include typechecked code snippets inline, for + instance: + + * `f x Nat.+ sqr 1` - the `2` says to ignore the first + two arguments when rendering. In richer renderers, the + `sqr` link will be clickable. + * If your snippet expression is just a single function + application, you can put it in double backticks, like + so: `sqr x`. This is equivalent to `sqr x`. + + # Non-Unison code blocks + + Use three or more single quotes to start a block with no + syntax highlighting: + + ``` raw + _____ _ + | | |___|_|___ ___ ___ + | | | | |_ -| . | | + |_____|_|_|_|___|___|_|_| + + ``` + + You can use three or more backticks plus a language name + for blocks with syntax highlighting: + + ``` Haskell + -- A fenced code block which isn't parsed by Unison + reverse = foldl (flip (:)) [] + ``` + + ``` Scala + // A fenced code block which isn't parsed by Unison + def reverse[A](xs: List[A]) = + xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) + ``` + + There are also asides, callouts, tables, tooltips, and more. + These don't currently have special syntax; just use the + `{{ }}` syntax to call these functions directly. + + docAside : Doc2 -> Doc2 + + docCallout : Optional Doc2 -> Doc2 -> Doc2 + + docBlockquote : Doc2 -> Doc2 + + docTooltip : Doc2 -> Doc2 -> Doc2 + + docTable : [[Doc2]] -> Doc2 + + This is an aside. ( + Some extra detail that doesn't belong in main text. ) + + | This is an important callout, with no icon. + + | 🌻 + | + | This is an important callout, with an icon. The text + | wraps onto multiple lines. + + > "And what is the use of a book," thought Alice, "without + > pictures or conversation?" + > + > *Lewis Carroll, Alice's Adventures in Wonderland* + + Hover over me + + a b A longer paragraph that will split + onto multiple lines, such that this + row occupies multiple lines in the + rendered table. + Some text More text Zounds! +```` But we can't display this due to a decompilation problem. @@ -17,12 +420,427 @@ But we can't display this due to a decompilation problem. rendered = Pretty.get (docFormatConsole doc.guide) ``` -``` ucm +``` ucm :added-by-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`: + + rendered : Annotated () (Either SpecialForm ConsoleText) +``` + +```` ucm scratch/main> display rendered + + # Unison computable documentation + + # Basic formatting + + Paragraphs are separated by one or more blanklines. + Sections have a title and 0 or more paragraphs or other + section elements. + + Text can be bold, *italicized*, ~~strikethrough~~, or + `monospaced` (or `monospaced`). + + You can link to Unison terms, types, and external URLs: + + * An external url + * Some is a term link; Optional is a type link + * A named type link and a named term link. Term links are + handy for linking to other documents! + + You can use `{{ .. }}` to escape out to regular Unison + syntax, for instance __not bold__. This is useful for + creating documents programmatically or just including + other documents. + + *Next up:* lists + + # Lists + + # Bulleted lists + + Bulleted lists can use `+`, `-`, or `*` for the bullets + (though the choice will be normalized away by the + pretty-printer). They can be nested, to any depth: + + * A + * B + * C + * C1 + * C2 + + # Numbered lists + + 1. A + 2. B + 3. C + + The first number of the list determines the starting + number in the rendered output. The other numbers are + ignored: + + 10. A + 11. B + 12. C + + Numbered lists can be nested as well, and combined with + bulleted lists: + + 1. Wake up. + * What am I doing here? + * In this nested list. + 2. Take shower. + 3. Get dressed. + + # Evaluation + + Expressions can be evaluated inline, for instance `2`. + + Blocks of code can be evaluated as well, for instance: + + id x = x + id (sqr 10) + ⧨ + 100 + + also: + + match 1 with + 1 -> "hi" + _ -> "goodbye" + ⧨ + "hi" + + To include a typechecked snippet of code without + evaluating it, you can do: + + use Nat * + cube : Nat -> Nat + cube x = x * x * x + + # Including Unison source code + + Unison definitions can be included in docs. For instance: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + Some rendering targets also support folded source: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + You can also include just a signature, inline, with + `sqr : Nat -> Nat`, or you can include one or more + signatures as a block: + + sqr : Nat -> Nat + + Nat.+ : Nat -> Nat -> Nat + + Or alternately: + + List.map : (a ->{e} b) -> [a] ->{e} [b] + + # Inline snippets + + You can include typechecked code snippets inline, for + instance: + + * `f x Nat.+ sqr 1` - the `2` says to ignore the first + two arguments when rendering. In richer renderers, the + `sqr` link will be clickable. + * If your snippet expression is just a single function + application, you can put it in double backticks, like + so: `sqr x`. This is equivalent to `sqr x`. + + # Non-Unison code blocks + + Use three or more single quotes to start a block with no + syntax highlighting: + + ``` raw + _____ _ + | | |___|_|___ ___ ___ + | | | | |_ -| . | | + |_____|_|_|_|___|___|_|_| + + ``` + + You can use three or more backticks plus a language name + for blocks with syntax highlighting: + + ``` Haskell + -- A fenced code block which isn't parsed by Unison + reverse = foldl (flip (:)) [] + ``` + + ``` Scala + // A fenced code block which isn't parsed by Unison + def reverse[A](xs: List[A]) = + xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) + ``` + + There are also asides, callouts, tables, tooltips, and more. + These don't currently have special syntax; just use the + `{{ }}` syntax to call these functions directly. + + docAside : Doc2 -> Doc2 + + docCallout : Optional Doc2 -> Doc2 -> Doc2 + + docBlockquote : Doc2 -> Doc2 + + docTooltip : Doc2 -> Doc2 -> Doc2 + + docTable : [[Doc2]] -> Doc2 + + This is an aside. ( + Some extra detail that doesn't belong in main text. ) + + | This is an important callout, with no icon. + + | 🌻 + | + | This is an important callout, with an icon. The text + | wraps onto multiple lines. + + > "And what is the use of a book," thought Alice, "without + > pictures or conversation?" + > + > *Lewis Carroll, Alice's Adventures in Wonderland* + + Hover over me + + a b A longer paragraph that will split + onto multiple lines, such that this + row occupies multiple lines in the + rendered table. + Some text More text Zounds! scratch/main> add + + ⍟ I've added these definitions: + + rendered : Annotated () (Either SpecialForm ConsoleText) scratch/main> display rendered + + # Unison computable documentation + + # Basic formatting + + Paragraphs are separated by one or more blanklines. + Sections have a title and 0 or more paragraphs or other + section elements. + + Text can be bold, *italicized*, ~~strikethrough~~, or + `monospaced` (or `monospaced`). + + You can link to Unison terms, types, and external URLs: + + * An external url + * Some is a term link; Optional is a type link + * A named type link and a named term link. Term links are + handy for linking to other documents! + + You can use `{{ .. }}` to escape out to regular Unison + syntax, for instance __not bold__. This is useful for + creating documents programmatically or just including + other documents. + + *Next up:* lists + + # Lists + + # Bulleted lists + + Bulleted lists can use `+`, `-`, or `*` for the bullets + (though the choice will be normalized away by the + pretty-printer). They can be nested, to any depth: + + * A + * B + * C + * C1 + * C2 + + # Numbered lists + + 1. A + 2. B + 3. C + + The first number of the list determines the starting + number in the rendered output. The other numbers are + ignored: + + 10. A + 11. B + 12. C + + Numbered lists can be nested as well, and combined with + bulleted lists: + + 1. Wake up. + * What am I doing here? + * In this nested list. + 2. Take shower. + 3. Get dressed. + + # Evaluation + + Expressions can be evaluated inline, for instance `2`. + + Blocks of code can be evaluated as well, for instance: + + id x = x + id (sqr 10) + ⧨ + 100 + + also: + + match 1 with + 1 -> "hi" + _ -> "goodbye" + ⧨ + "hi" + + To include a typechecked snippet of code without + evaluating it, you can do: + + use Nat * + cube : Nat -> Nat + cube x = x * x * x + + # Including Unison source code + + Unison definitions can be included in docs. For instance: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + Some rendering targets also support folded source: + + structural type Optional a = Some a | None + + sqr : Nat -> Nat + sqr x = + use Nat * + x * x + + You can also include just a signature, inline, with + `sqr : Nat -> Nat`, or you can include one or more + signatures as a block: + + sqr : Nat -> Nat + + Nat.+ : Nat -> Nat -> Nat + + Or alternately: + + List.map : (a ->{e} b) -> [a] ->{e} [b] + + # Inline snippets + + You can include typechecked code snippets inline, for + instance: + + * `f x Nat.+ sqr 1` - the `2` says to ignore the first + two arguments when rendering. In richer renderers, the + `sqr` link will be clickable. + * If your snippet expression is just a single function + application, you can put it in double backticks, like + so: `sqr x`. This is equivalent to `sqr x`. + + # Non-Unison code blocks + + Use three or more single quotes to start a block with no + syntax highlighting: + + ``` raw + _____ _ + | | |___|_|___ ___ ___ + | | | | |_ -| . | | + |_____|_|_|_|___|___|_|_| + + ``` + + You can use three or more backticks plus a language name + for blocks with syntax highlighting: + + ``` Haskell + -- A fenced code block which isn't parsed by Unison + reverse = foldl (flip (:)) [] + ``` + + ``` Scala + // A fenced code block which isn't parsed by Unison + def reverse[A](xs: List[A]) = + xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) + ``` + + There are also asides, callouts, tables, tooltips, and more. + These don't currently have special syntax; just use the + `{{ }}` syntax to call these functions directly. + + docAside : Doc2 -> Doc2 + + docCallout : Optional Doc2 -> Doc2 -> Doc2 + + docBlockquote : Doc2 -> Doc2 + + docTooltip : Doc2 -> Doc2 -> Doc2 + + docTable : [[Doc2]] -> Doc2 + + This is an aside. ( + Some extra detail that doesn't belong in main text. ) + + | This is an important callout, with no icon. + + | 🌻 + | + | This is an important callout, with an icon. The text + | wraps onto multiple lines. + + > "And what is the use of a book," thought Alice, "without + > pictures or conversation?" + > + > *Lewis Carroll, Alice's Adventures in Wonderland* + + Hover over me + + a b A longer paragraph that will split + onto multiple lines, such that this + row occupies multiple lines in the + rendered table. + Some text More text Zounds! scratch/main> undo -``` + + Here are the changes I undid + + Added definitions: + + 1. rendered : Annotated () (Either SpecialForm ConsoleText) +```` And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic. @@ -31,3 +849,3674 @@ rendered = Pretty.get (docFormatConsole doc.guide) > rendered ``` + +```` ucm :added-by-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`: + + rendered : Annotated () (Either SpecialForm ConsoleText) + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 3 | > rendered + ⧩ + Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold (Plain "Unison"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "computable"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "documentation"))) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain "Basic"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "formatting"))) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "Paragraphs")) + , Lit + () (Right (Plain "are")) + , Lit + () + (Right + (Plain "separated")) + , Lit + () (Right (Plain "by")) + , Lit + () (Right (Plain "one")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "more")) + , Lit + () + (Right + (Plain "blanklines.")) + , Lit + () + (Right + (Plain "Sections")) + , Lit + () + (Right (Plain "have")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right (Plain "title")) + , Lit + () (Right (Plain "and")) + , Lit () (Right (Plain "0")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "more")) + , Lit + () + (Right + (Plain "paragraphs")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "other")) + , Lit + () + (Right (Plain "section")) + , Lit + () + (Right + (Plain "elements.")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "Text")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "be")) + , Annotated.Group + () + (Annotated.Append + () + [ Wrap + () + (Lit + () + (Right + (ConsoleText.Bold + (Plain + "bold")))) + , Lit + () + (Right (Plain ",")) + ]) + , Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "*")) + , Wrap + () + (Lit + () + (Right + (Plain + "italicized"))) + , Lit + () + (Right + (Plain "*")) + ]) + , Lit + () + (Right (Plain ",")) + ]) + , Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "~~")) + , Wrap + () + (Lit + () + (Right + (Plain + "strikethrough"))) + , Lit + () + (Right + (Plain + "~~")) + ]) + , Lit + () + (Right (Plain ",")) + ]) + , Lit + () (Right (Plain "or")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "`")) + , Lit + () + (Right + (Plain + "monospaced")) + , Lit + () + (Right (Plain "`")) + ]) + , Lit + () (Right (Plain "(or")) + , Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "`")) + , Lit + () + (Right + (Plain + "monospaced")) + , Lit + () + (Right + (Plain "`")) + ]) + , Lit + () + (Right + (Plain ").")) + ]) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "You")) + , Lit + () (Right (Plain "can")) + , Lit + () + (Right (Plain "link")) + , Lit + () (Right (Plain "to")) + , Lit + () + (Right (Plain "Unison")) + , Lit + () + (Right (Plain "terms,")) + , Lit + () + (Right (Plain "types,")) + , Lit + () (Right (Plain "and")) + , Lit + () + (Right + (Plain "external")) + , Lit + () + (Right (Plain "URLs:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right (Plain "* "))) + (Lit + () + (Right (Plain " "))) + (Wrap + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Underline + (Plain + "An"))) + , Lit + () + (Right + (Underline + (Plain + "external"))) + , Lit + () + (Right + (Underline + (Plain + "url"))) + ]))) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain "* "))) + (Lit + () + (Right (Plain " "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Left + (SpecialForm.Link + (Right + (Term.Term + (Any + (do + Some)))))) + , Lit + () + (Right + (Plain "is")) + , Lit + () + (Right + (Plain "a")) + , Lit + () + (Right + (Plain "term")) + , Lit + () + (Right + (Plain "link;")) + , Lit + () + (Left + (SpecialForm.Link + (Left + (typeLink Optional)))) + , Lit + () + (Right + (Plain "is")) + , Lit + () + (Right + (Plain "a")) + , Lit + () + (Right + (Plain "type")) + , Lit + () + (Right + (Plain "link")) + ])) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain "* "))) + (Lit + () + (Right (Plain " "))) + (Wrap + () + (Annotated.Append + () + [ Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Underline + (Plain + "A"))) + , Lit + () + (Right + (Underline + (Plain + "named"))) + , Lit + () + (Right + (Underline + (Plain + "type"))) + , Lit + () + (Right + (Underline + (Plain + "link"))) + ]) + , Lit + () + (Right + (Plain "and")) + , Annotated.Group + () + (Annotated.Append + () + [ Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Underline + (Plain + "a"))) + , Lit + () + (Right + (Underline + (Plain + "named"))) + , Lit + () + (Right + (Underline + (Plain + "term"))) + , Lit + () + (Right + (Underline + (Plain + "link"))) + ]) + , Lit + () + (Right + (Plain + ".")) + ]) + , Lit + () + (Right + (Plain "Term")) + , Lit + () + (Right + (Plain "links")) + , Lit + () + (Right + (Plain "are")) + , Lit + () + (Right + (Plain "handy")) + , Lit + () + (Right + (Plain "for")) + , Lit + () + (Right + (Plain + "linking")) + , Lit + () + (Right + (Plain "to")) + , Lit + () + (Right + (Plain "other")) + , Lit + () + (Right + (Plain + "documents!")) + ])) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "You")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "use")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "`")) + , Lit + () + (Right + (Plain + "{{ .. }}")) + , Lit + () + (Right (Plain "`")) + ]) + , Lit + () (Right (Plain "to")) + , Lit + () + (Right (Plain "escape")) + , Lit + () (Right (Plain "out")) + , Lit + () (Right (Plain "to")) + , Lit + () + (Right (Plain "regular")) + , Lit + () + (Right (Plain "Unison")) + , Lit + () + (Right (Plain "syntax,")) + , Lit + () (Right (Plain "for")) + , Lit + () + (Right + (Plain "instance")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "__not bold__")) + , Lit + () + (Right (Plain ".")) + ]) + , Lit + () + (Right (Plain "This")) + , Lit + () (Right (Plain "is")) + , Lit + () + (Right (Plain "useful")) + , Lit + () (Right (Plain "for")) + , Lit + () + (Right + (Plain "creating")) + , Lit + () + (Right + (Plain "documents")) + , Lit + () + (Right + (Plain + "programmatically")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "just")) + , Lit + () + (Right + (Plain "including")) + , Lit + () + (Right (Plain "other")) + , Lit + () + (Right + (Plain "documents.")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "*")) + , Lit + () + (Right + (Plain "Next")) + ]) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "up:")) + , Lit + () + (Right (Plain "*")) + ]) + , Lit + () + (Left + (SpecialForm.Link + (Right + (Term.Term + (Any (do lists)))))) + ]))) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Right + (ConsoleText.Bold + (Plain "Lists")))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right (Plain "# "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain + "Bulleted"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain + "lists"))) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Bulleted")) + , Lit + () + (Right + (Plain + "lists")) + , Lit + () + (Right + (Plain "can")) + , Lit + () + (Right + (Plain "use")) + , Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "`")) + , Lit + () + (Right + (Plain + "+")) + , Lit + () + (Right + (Plain + "`")) + ]) + , Lit + () + (Right + (Plain + ",")) + ]) + , Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "`")) + , Lit + () + (Right + (Plain + "-")) + , Lit + () + (Right + (Plain + "`")) + ]) + , Lit + () + (Right + (Plain + ",")) + ]) + , Lit + () + (Right + (Plain "or")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "`")) + , Lit + () + (Right + (Plain + "*")) + , Lit + () + (Right + (Plain + "`")) + ]) + , Lit + () + (Right + (Plain "for")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "bullets")) + , Lit + () + (Right + (Plain + "(though")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "choice")) + , Lit + () + (Right + (Plain + "will")) + , Lit + () + (Right + (Plain "be")) + , Lit + () + (Right + (Plain + "normalized")) + , Lit + () + (Right + (Plain + "away")) + , Lit + () + (Right + (Plain "by")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "pretty-printer).")) + , Lit + () + (Right + (Plain + "They")) + , Lit + () + (Right + (Plain "can")) + , Lit + () + (Right + (Plain "be")) + , Lit + () + (Right + (Plain + "nested,")) + , Lit + () + (Right + (Plain "to")) + , Lit + () + (Right + (Plain "any")) + , Lit + () + (Right + (Plain + "depth:")) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right + (Plain + "* "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "A")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "* "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "B")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "* "))) + (Lit + () + (Right + (Plain + " "))) + (Annotated.Append + () + [ Wrap + () + (Lit + () + (Right + (Plain + "C"))) + , Lit + () + (Right + (Plain + "\n")) + , Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + ( + ) + (Right + (Plain + "* "))) + (Lit + ( + ) + (Right + (Plain + " "))) + (Wrap + ( + ) + (Lit + ( + ) + (Right + (Plain + "C1")))) + , Lit + () + (Right + (Plain + "\n")) + , Indent + () + (Lit + ( + ) + (Right + (Plain + "* "))) + (Lit + ( + ) + (Right + (Plain + " "))) + (Wrap + ( + ) + (Lit + ( + ) + (Right + (Plain + "C2")))) + ]) + ]) + ]))) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right (Plain "# "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain + "Numbered"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain + "lists"))) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right + (Plain + "1. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "A")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "2. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "B")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "3. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "C")))) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "The")) + , Lit + () + (Right + (Plain + "first")) + , Lit + () + (Right + (Plain + "number")) + , Lit + () + (Right + (Plain "of")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "list")) + , Lit + () + (Right + (Plain + "determines")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "starting")) + , Lit + () + (Right + (Plain + "number")) + , Lit + () + (Right + (Plain "in")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "rendered")) + , Lit + () + (Right + (Plain + "output.")) + , Lit + () + (Right + (Plain "The")) + , Lit + () + (Right + (Plain + "other")) + , Lit + () + (Right + (Plain + "numbers")) + , Lit + () + (Right + (Plain "are")) + , Lit + () + (Right + (Plain + "ignored:")) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right + (Plain + "10. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "A")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "11. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "B")))) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "12. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Lit + () + (Right + (Plain + "C")))) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Numbered")) + , Lit + () + (Right + (Plain + "lists")) + , Lit + () + (Right + (Plain "can")) + , Lit + () + (Right + (Plain "be")) + , Lit + () + (Right + (Plain + "nested")) + , Lit + () + (Right + (Plain "as")) + , Lit + () + (Right + (Plain + "well,")) + , Lit + () + (Right + (Plain "and")) + , Lit + () + (Right + (Plain + "combined")) + , Lit + () + (Right + (Plain + "with")) + , Lit + () + (Right + (Plain + "bulleted")) + , Lit + () + (Right + (Plain + "lists:")) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right + (Plain + "1. "))) + (Lit + () + (Right + (Plain + " "))) + (Annotated.Append + () + [ Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Wake")) + , Lit + () + (Right + (Plain + "up.")) + ]) + , Lit + () + (Right + (Plain + "\n")) + , Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + ( + ) + (Right + (Plain + "* "))) + (Lit + ( + ) + (Right + (Plain + " "))) + (Wrap + ( + ) + (Annotated.Append + ( + ) + [ Lit + ( + ) + (Right + (Plain + "What")) + , Lit + ( + ) + (Right + (Plain + "am")) + , Lit + ( + ) + (Right + (Plain + "I")) + , Lit + ( + ) + (Right + (Plain + "doing")) + , Lit + ( + ) + (Right + (Plain + "here?")) + ])) + , Lit + () + (Right + (Plain + "\n")) + , Indent + () + (Lit + ( + ) + (Right + (Plain + "* "))) + (Lit + ( + ) + (Right + (Plain + " "))) + (Wrap + ( + ) + (Annotated.Append + ( + ) + [ Lit + ( + ) + (Right + (Plain + "In")) + , Lit + ( + ) + (Right + (Plain + "this")) + , Lit + ( + ) + (Right + (Plain + "nested")) + , Lit + ( + ) + (Right + (Plain + "list.")) + ])) + ]) + ]) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "2. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Take")) + , Lit + () + (Right + (Plain + "shower.")) + ])) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "3. "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Get")) + , Lit + () + (Right + (Plain + "dressed.")) + ])) + ]))) + ]))) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Right + (ConsoleText.Bold + (Plain "Evaluation")))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "Expressions")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "be")) + , Lit + () + (Right + (Plain "evaluated")) + , Lit + () + (Right (Plain "inline,")) + , Lit + () (Right (Plain "for")) + , Lit + () + (Right + (Plain "instance")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Left + (EvalInline + (Term.Term + (Any + (do + 1 + Nat.+ 1))))) + , Lit + () + (Right (Plain ".")) + ]) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "Blocks")) + , Lit + () (Right (Plain "of")) + , Lit + () + (Right (Plain "code")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "be")) + , Lit + () + (Right + (Plain "evaluated")) + , Lit + () (Right (Plain "as")) + , Lit + () + (Right (Plain "well,")) + , Lit + () (Right (Plain "for")) + , Lit + () + (Right + (Plain "instance:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () (Lit + () (Left + (Eval + (Term.Term + (Any + (do + id x = x + id (sqr 10)))))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () (Right (Plain "also:"))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () (Lit + () (Left + (Eval + (Term.Term + (Any + (do match 1 with + 1 -> "hi" + _ -> "goodbye"))))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "To")) + , Lit + () + (Right (Plain "include")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right + (Plain "typechecked")) + , Lit + () + (Right (Plain "snippet")) + , Lit + () (Right (Plain "of")) + , Lit + () + (Right (Plain "code")) + , Lit + () + (Right (Plain "without")) + , Lit + () + (Right + (Plain "evaluating")) + , Lit + () (Right (Plain "it,")) + , Lit + () (Right (Plain "you")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "do:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () (Lit + () (Left + (ExampleBlock + 0 (Term.Term + (Any + (do + use Nat * + cube : Nat -> Nat + cube x = x * x * x + ()))))))) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain "Including"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "Unison"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "source"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "code"))) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "Unison")) + , Lit + () + (Right + (Plain "definitions")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "be")) + , Lit + () + (Right + (Plain "included")) + , Lit + () (Right (Plain "in")) + , Lit + () + (Right (Plain "docs.")) + , Lit + () (Right (Plain "For")) + , Lit + () + (Right + (Plain "instance:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Left + (SpecialForm.Source + [ ( Left + (typeLink Optional) + , [] + ) + , ( Right + (Term.Term + (Any (do sqr))) + , [] + ) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "Some")) + , Lit + () + (Right + (Plain "rendering")) + , Lit + () + (Right (Plain "targets")) + , Lit + () + (Right (Plain "also")) + , Lit + () + (Right (Plain "support")) + , Lit + () + (Right (Plain "folded")) + , Lit + () + (Right (Plain "source:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Left + (FoldedSource + [ ( Left + (typeLink Optional) + , [] + ) + , ( Right + (Term.Term + (Any (do sqr))) + , [] + ) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "You")) + , Lit + () (Right (Plain "can")) + , Lit + () + (Right (Plain "also")) + , Lit + () + (Right (Plain "include")) + , Lit + () + (Right (Plain "just")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right + (Plain "signature,")) + , Lit + () + (Right (Plain "inline,")) + , Lit + () + (Right (Plain "with")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Left + (SignatureInline + (Term.Term + (Any + (do sqr))))) + , Lit + () + (Right (Plain ",")) + ]) + , Lit + () (Right (Plain "or")) + , Lit + () (Right (Plain "you")) + , Lit + () (Right (Plain "can")) + , Lit + () + (Right (Plain "include")) + , Lit + () (Right (Plain "one")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "more")) + , Lit + () + (Right + (Plain "signatures")) + , Lit + () (Right (Plain "as")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right (Plain "block:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Left + (SpecialForm.Signature + [ Term.Term + (Any (do sqr)) + , Term.Term + (Any (do (Nat.+))) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "Or")) + , Lit + () + (Right + (Plain "alternately:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Lit + () + (Left + (SpecialForm.Signature + [ Term.Term + (Any (do List.map)) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right (Plain "# "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain + "Inline"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain + "snippets"))) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "You")) + , Lit + () + (Right + (Plain "can")) + , Lit + () + (Right + (Plain + "include")) + , Lit + () + (Right + (Plain + "typechecked")) + , Lit + () + (Right + (Plain + "code")) + , Lit + () + (Right + (Plain + "snippets")) + , Lit + () + (Right + (Plain + "inline,")) + , Lit + () + (Right + (Plain "for")) + , Lit + () + (Right + (Plain + "instance:")) + ]))) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "\n")) + , Indent + () + (Lit + () + (Right (Plain " "))) + (Lit + () + (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit + () + (Right + (Plain + "* "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Left + (Example + 2 + (Term.Term + (Any + (do + f + x -> + f + x + Nat.+ sqr + 1))))) + , Lit + () + (Right + (Plain + "-")) + , Lit + () + (Right + (Plain + "the")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + ( + ) + (Right + (Plain + "`")) + , Lit + ( + ) + (Right + (Plain + "2")) + , Lit + ( + ) + (Right + (Plain + "`")) + ]) + , Lit + () + (Right + (Plain + "says")) + , Lit + () + (Right + (Plain + "to")) + , Lit + () + (Right + (Plain + "ignore")) + , Lit + () + (Right + (Plain + "the")) + , Lit + () + (Right + (Plain + "first")) + , Lit + () + (Right + (Plain + "two")) + , Lit + () + (Right + (Plain + "arguments")) + , Lit + () + (Right + (Plain + "when")) + , Lit + () + (Right + (Plain + "rendering.")) + , Lit + () + (Right + (Plain + "In")) + , Lit + () + (Right + (Plain + "richer")) + , Lit + () + (Right + (Plain + "renderers,")) + , Lit + () + (Right + (Plain + "the")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + ( + ) + (Right + (Plain + "`")) + , Lit + ( + ) + (Right + (Plain + "sqr")) + , Lit + ( + ) + (Right + (Plain + "`")) + ]) + , Lit + () + (Right + (Plain + "link")) + , Lit + () + (Right + (Plain + "will")) + , Lit + () + (Right + (Plain + "be")) + , Lit + () + (Right + (Plain + "clickable.")) + ])) + , Lit + () + (Right + (Plain "\n")) + , Indent + () + (Lit + () + (Right + (Plain + "* "))) + (Lit + () + (Right + (Plain + " "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "If")) + , Lit + () + (Right + (Plain + "your")) + , Lit + () + (Right + (Plain + "snippet")) + , Lit + () + (Right + (Plain + "expression")) + , Lit + () + (Right + (Plain + "is")) + , Lit + () + (Right + (Plain + "just")) + , Lit + () + (Right + (Plain + "a")) + , Lit + () + (Right + (Plain + "single")) + , Lit + () + (Right + (Plain + "function")) + , Lit + () + (Right + (Plain + "application,")) + , Lit + () + (Right + (Plain + "you")) + , Lit + () + (Right + (Plain + "can")) + , Lit + () + (Right + (Plain + "put")) + , Lit + () + (Right + (Plain + "it")) + , Lit + () + (Right + (Plain + "in")) + , Lit + () + (Right + (Plain + "double")) + , Lit + () + (Right + (Plain + "backticks,")) + , Lit + () + (Right + (Plain + "like")) + , Lit + () + (Right + (Plain + "so:")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + ( + ) + (Left + (Example + 1 + (Term.Term + (Any + (do + x -> + sqr + x))))) + , Lit + ( + ) + (Right + (Plain + ".")) + ]) + , Lit + () + (Right + (Plain + "This")) + , Lit + () + (Right + (Plain + "is")) + , Lit + () + (Right + (Plain + "equivalent")) + , Lit + () + (Right + (Plain + "to")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + ( + ) + (Left + (Example + 1 + (Term.Term + (Any + (do + x -> + sqr + x))))) + , Lit + ( + ) + (Right + (Plain + ".")) + ]) + ])) + ]))) + ]))) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Indent + () + (Lit () (Right (Plain "# "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (ConsoleText.Bold + (Plain "Non-Unison"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "code"))) + , Lit + () + (Right + (ConsoleText.Bold + (Plain "blocks"))) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "Use")) + , Lit + () + (Right (Plain "three")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "more")) + , Lit + () + (Right (Plain "single")) + , Lit + () + (Right (Plain "quotes")) + , Lit + () (Right (Plain "to")) + , Lit + () + (Right (Plain "start")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right (Plain "block")) + , Lit + () + (Right (Plain "with")) + , Lit + () (Right (Plain "no")) + , Lit + () + (Right (Plain "syntax")) + , Lit + () + (Right + (Plain "highlighting:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "``` ")) + , Annotated.Group + () + (Lit + () + (Right (Plain "raw"))) + , Lit + () + (Right (Plain "\n")) + , Lit + () + (Right + (Plain + " _____ _ \n | | |___|_|___ ___ ___ \n | | | | |_ -| . | |\n |_____|_|_|_|___|___|_|_|\n ")) + , Lit + () + (Right (Plain "\n")) + , Lit + () + (Right (Plain "```")) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "You")) + , Lit + () (Right (Plain "can")) + , Lit + () (Right (Plain "use")) + , Lit + () + (Right (Plain "three")) + , Lit + () (Right (Plain "or")) + , Lit + () + (Right (Plain "more")) + , Lit + () + (Right + (Plain "backticks")) + , Lit + () + (Right (Plain "plus")) + , Lit () (Right (Plain "a")) + , Lit + () + (Right + (Plain "language")) + , Lit + () + (Right (Plain "name")) + , Lit + () (Right (Plain "for")) + , Lit + () + (Right (Plain "blocks")) + , Lit + () + (Right (Plain "with")) + , Lit + () + (Right (Plain "syntax")) + , Lit + () + (Right + (Plain "highlighting:")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "``` ")) + , Annotated.Group + () + (Lit + () + (Right + (Plain "Haskell"))) + , Lit + () (Right (Plain "\n")) + , Lit + () + (Right + (Plain + "-- A fenced code block which isn't parsed by Unison\nreverse = foldl (flip (:)) []")) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "```")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "``` ")) + , Annotated.Group + () + (Lit + () + (Right (Plain "Scala"))) + , Lit + () (Right (Plain "\n")) + , Lit + () + (Right + (Plain + "// A fenced code block which isn't parsed by Unison\ndef reverse[A](xs: List[A]) = \n xs.foldLeft(Nil : List[A])((acc,a) => a +: acc)")) + , Lit + () (Right (Plain "\n")) + , Lit + () (Right (Plain "```")) + ]))) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Indent + () + (Lit () (Right (Plain " "))) + (Lit () (Right (Plain " "))) + (Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "There")) + , Lit () (Right (Plain "are")) + , Lit + () (Right (Plain "also")) + , Lit + () + (Right (Plain "asides,")) + , Lit + () + (Right (Plain "callouts,")) + , Lit + () + (Right (Plain "tables,")) + , Lit + () + (Right (Plain "tooltips,")) + , Lit () (Right (Plain "and")) + , Lit + () (Right (Plain "more.")) + , Lit + () (Right (Plain "These")) + , Lit + () (Right (Plain "don't")) + , Lit + () + (Right (Plain "currently")) + , Lit + () (Right (Plain "have")) + , Lit + () + (Right (Plain "special")) + , Lit + () + (Right (Plain "syntax;")) + , Lit + () (Right (Plain "just")) + , Lit () (Right (Plain "use")) + , Lit () (Right (Plain "the")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "`")) + , Lit + () + (Right + (Plain "{{ }}")) + , Lit + () + (Right (Plain "`")) + ]) + , Lit + () + (Right (Plain "syntax")) + , Lit () (Right (Plain "to")) + , Lit + () (Right (Plain "call")) + , Lit + () (Right (Plain "these")) + , Lit + () + (Right (Plain "functions")) + , Lit + () + (Right (Plain "directly.")) + ])) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Lit + () + (Left + (SpecialForm.Signature + [ Term.Term + (Any (do docAside)) + , Term.Term + (Any (do docCallout)) + , Term.Term + (Any + (do docBlockquote)) + , Term.Term + (Any (do docTooltip)) + , Term.Term + (Any (do docTable)) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () (Right (Plain "This")) + , Lit () (Right (Plain "is")) + , Lit () (Right (Plain "an")) + , Lit + () + (Right (Plain "aside.")) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "("))) + , Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Foreground + BrightBlack + (Plain "Some"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "extra"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "detail"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "that"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "doesn't"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "belong"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "in"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "main"))) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain "text."))) + ]) + , Lit + () + (Right + (Foreground + BrightBlack + (Plain ")"))) + ])) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Indent + () + (Lit + () (Right (Plain " | "))) + (Lit + () (Right (Plain " | "))) + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "This")) + , Lit + () + (Right (Plain "is")) + , Lit + () + (Right (Plain "an")) + , Lit + () + (Right + (Plain "important")) + , Lit + () + (Right + (Plain "callout,")) + , Lit + () + (Right + (Plain "with")) + , Lit + () + (Right (Plain "no")) + , Lit + () + (Right + (Plain "icon.")) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Indent + () + (Lit + () (Right (Plain " | "))) + (Lit + () (Right (Plain " | "))) + (Annotated.Append + () + [ Wrap + () + (Lit + () + (Right + (ConsoleText.Bold + (Plain "🌻")))) + , Lit + () + (Right (Plain "\n")) + , Lit + () (Right (Plain "")) + , Lit + () + (Right (Plain "\n")) + , Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "This")) + , Lit + () + (Right + (Plain "is")) + , Lit + () + (Right + (Plain "an")) + , Lit + () + (Right + (Plain + "important")) + , Lit + () + (Right + (Plain + "callout,")) + , Lit + () + (Right + (Plain "with")) + , Lit + () + (Right + (Plain "an")) + , Lit + () + (Right + (Plain "icon.")) + , Lit + () + (Right + (Plain "The")) + , Lit + () + (Right + (Plain "text")) + , Lit + () + (Right + (Plain "wraps")) + , Lit + () + (Right + (Plain "onto")) + , Lit + () + (Right + (Plain + "multiple")) + , Lit + () + (Right + (Plain + "lines.")) + ]) + ])))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Group + () + (Indent + () + (Lit () (Right (Plain "> "))) + (Lit () (Right (Plain "> "))) + (Annotated.Group + () + (Annotated.Append + () + [ Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "\"And")) + , Lit + () + (Right + (Plain + "what")) + , Lit + () + (Right + (Plain + "is")) + , Lit + () + (Right + (Plain + "the")) + , Lit + () + (Right + (Plain + "use")) + , Lit + () + (Right + (Plain + "of")) + , Lit + () + (Right + (Plain "a")) + , Lit + () + (Right + (Plain + "book,\"")) + , Lit + () + (Right + (Plain + "thought")) + , Lit + () + (Right + (Plain + "Alice,")) + , Lit + () + (Right + (Plain + "\"without")) + , Lit + () + (Right + (Plain + "pictures")) + , Lit + () + (Right + (Plain + "or")) + , Lit + () + (Right + (Plain + "conversation?\"")) + ])) + , Lit + () + (Right (Plain "\n")) + , Lit + () + (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Append + () + [ Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "*")) + , Lit + () + (Right + (Plain + "Lewis")) + ]) + , Lit + () + (Right + (Plain + "Carroll,")) + , Lit + () + (Right + (Plain + "Alice's")) + , Lit + () + (Right + (Plain + "Adventures")) + , Lit + () + (Right + (Plain + "in")) + , Annotated.Group + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain + "Wonderland")) + , Lit + () + (Right + (Plain + "*")) + ]) + ])) + ]))))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "Hover")) + , Lit + () + (Right (Plain "over")) + , Lit + () (Right (Plain "me")) + ]))) + , Lit () (Right (Plain "\n")) + , Lit () (Right (Plain "\n")) + , Annotated.Group + () + (Wrap + () + (Annotated.Table + () + [ [ Wrap + () + (Lit + () (Right (Plain "a"))) + , Wrap + () + (Lit + () (Right (Plain "b"))) + , Wrap + () + (Annotated.Append + () + [ Lit + () + (Right (Plain "A")) + , Lit + () + (Right + (Plain "longer")) + , Lit + () + (Right + (Plain + "paragraph")) + , Lit + () + (Right + (Plain "that")) + , Lit + () + (Right + (Plain "will")) + , Lit + () + (Right + (Plain "split")) + , Lit + () + (Right + (Plain "onto")) + , Lit + () + (Right + (Plain + "multiple")) + , Lit + () + (Right + (Plain "lines,")) + , Lit + () + (Right + (Plain "such")) + , Lit + () + (Right + (Plain "that")) + , Lit + () + (Right + (Plain "this")) + , Lit + () + (Right + (Plain "row")) + , Lit + () + (Right + (Plain + "occupies")) + , Lit + () + (Right + (Plain + "multiple")) + , Lit + () + (Right + (Plain "lines")) + , Lit + () + (Right + (Plain "in")) + , Lit + () + (Right + (Plain "the")) + , Lit + () + (Right + (Plain + "rendered")) + , Lit + () + (Right + (Plain "table.")) + ]) + ] + , [ Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "Some")) + , Lit + () + (Right + (Plain "text")) + ]) + , Wrap + () + (Annotated.Append + () + [ Lit + () + (Right + (Plain "More")) + , Lit + () + (Right + (Plain "text")) + ]) + , Wrap + () + (Lit + () + (Right + (Plain "Zounds!"))) + ] + ])) + ])))) + ]) +```` diff --git a/unison-src/transcripts/idempotent/builtins-merge.md b/unison-src/transcripts/idempotent/builtins-merge.md index f768b97b83..0c709fe1d3 100644 --- a/unison-src/transcripts/idempotent/builtins-merge.md +++ b/unison-src/transcripts/idempotent/builtins-merge.md @@ -2,5 +2,88 @@ The `builtins.merge` command adds the known builtins to the specified subnamespa ``` ucm scratch/main> builtins.merge builtins + + Done. scratch/main> ls builtins + + 1. Any (builtin type) + 2. Any/ (2 terms) + 3. Boolean (builtin type) + 4. Boolean/ (1 term) + 5. Bytes (builtin type) + 6. Bytes/ (34 terms) + 7. Char (builtin type) + 8. Char/ (22 terms, 1 type) + 9. ClientSockAddr (builtin type) + 10. Code (builtin type) + 11. Code/ (9 terms) + 12. Debug/ (3 terms) + 13. Doc (type) + 14. Doc/ (6 terms) + 15. Either (type) + 16. Either/ (2 terms) + 17. Exception (type) + 18. Exception/ (1 term) + 19. Float (builtin type) + 20. Float/ (38 terms) + 21. Handle/ (1 term) + 22. ImmutableArray (builtin type) + 23. ImmutableArray/ (3 terms) + 24. ImmutableByteArray (builtin type) + 25. ImmutableByteArray/ (8 terms) + 26. Int (builtin type) + 27. Int/ (31 terms) + 28. IsPropagated (type) + 29. IsPropagated/ (1 term) + 30. IsTest (type) + 31. IsTest/ (1 term) + 32. Link (type) + 33. Link/ (3 terms, 2 types) + 34. List (builtin type) + 35. List/ (10 terms) + 36. ListenSocket (builtin type) + 37. MutableArray (builtin type) + 38. MutableArray/ (6 terms) + 39. MutableByteArray (builtin type) + 40. MutableByteArray/ (14 terms) + 41. Nat (builtin type) + 42. Nat/ (28 terms) + 43. Optional (type) + 44. Optional/ (2 terms) + 45. Pattern (builtin type) + 46. Pattern/ (9 terms) + 47. Ref (builtin type) + 48. Ref/ (2 terms) + 49. Request (builtin type) + 50. RewriteCase (type) + 51. RewriteCase/ (1 term) + 52. RewriteSignature (type) + 53. RewriteSignature/ (1 term) + 54. RewriteTerm (type) + 55. RewriteTerm/ (1 term) + 56. Rewrites (type) + 57. Rewrites/ (1 term) + 58. Scope (builtin type) + 59. Scope/ (6 terms) + 60. SeqView (type) + 61. SeqView/ (2 terms) + 62. Socket/ (1 term) + 63. Test/ (2 terms, 1 type) + 64. Text (builtin type) + 65. Text/ (34 terms) + 66. ThreadId/ (1 term) + 67. Tuple (type) + 68. Tuple/ (1 term) + 69. UDPSocket (builtin type) + 70. Unit (type) + 71. Unit/ (1 term) + 72. Universal/ (7 terms) + 73. Value (builtin type) + 74. Value/ (5 terms) + 75. bug (a -> b) + 76. crypto/ (17 terms, 2 types) + 77. io2/ (146 terms, 32 types) + 78. metadata/ (2 terms) + 79. todo (a -> b) + 80. unsafe/ (1 term) ``` diff --git a/unison-src/transcripts/idempotent/builtins.md b/unison-src/transcripts/idempotent/builtins.md index 69001de9da..298ac7816e 100644 --- a/unison-src/transcripts/idempotent/builtins.md +++ b/unison-src/transcripts/idempotent/builtins.md @@ -167,6 +167,7 @@ scratch/main> add ``` ## `Boolean` functions + ``` unison :hide test> Boolean.tests.orTable = checks [ @@ -375,6 +376,7 @@ scratch/main> add ``` Other list functions + ``` unison :hide test> checks [ List.take bigN [1,2,3] == [1,2,3], @@ -391,6 +393,35 @@ test> Any.test1 = checks [(Any "hi" == Any "hi")] test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` +``` ucm :added-by-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`: + + Any.test1 : [Result] + Any.test2 : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > [Any "hi", Any (41 + 1)] + ⧩ + [Any "hi", Any 42] + + 3 | test> Any.test1 = checks [(Any "hi" == Any "hi")] + + ✅ Passed Passed + + 4 | test> Any.test2 = checks [(not (Any "hi" == Any 42))] + + ✅ Passed Passed +``` + ``` ucm :hide scratch/main> add ``` @@ -418,6 +449,46 @@ test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] openFile] ``` +``` ucm :added-by-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`: + + Sandbox.test1 : [Result] + Sandbox.test2 : [Result] + Sandbox.test3 : [Result] + openFile1 : Text + -> FileMode + ->{IO, Exception} Handle + openFile2 : Text + -> FileMode + ->{IO, Exception} Handle + openFiles : [Boolean] + validateSandboxedSimpl : [Link.Term] + -> Value + ->{IO} Boolean + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 15 | test> Sandbox.test1 = checks [validateSandboxed [] "hello"] + + ✅ Passed Passed + + 16 | test> Sandbox.test2 = checks openFiles + + ✅ Passed Passed + + 17 | test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl] + + ✅ Passed Passed +``` + ``` ucm :hide scratch/main> add ``` @@ -435,9 +506,34 @@ openFilesIO = do ] ``` +``` ucm :added-by-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`: + + openFilesIO : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + openFilesIO : '{IO} [Result] scratch/main> io.test openFilesIO + + New test results: + + 1. openFilesIO ◉ Passed + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ## Universal hash functions @@ -449,6 +545,30 @@ Just exercises the function test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] ``` +``` ucm :added-by-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`: + + Universal.murmurHash.tests : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > Universal.murmurHash 1 + ⧩ + 1208954131003843843 + + 2 | test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]] + + ✅ Passed Passed +``` + ``` ucm :hide scratch/main> add ``` @@ -459,4 +579,38 @@ Now that all the tests have been added to the codebase, let's view the test repo ``` ucm scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. Any.test1 ◉ Passed + 2. Any.test2 ◉ Passed + 3. Boolean.tests.andTable ◉ Passed + 4. Boolean.tests.notTable ◉ Passed + 5. Boolean.tests.orTable ◉ Passed + 6. Bytes.tests.at ◉ Passed + 7. Bytes.tests.compression ◉ Passed + 8. Bytes.tests.fromBase64UrlUnpadded ◉ Passed + 9. Bytes.tests.indexOf ◉ Passed + 10. Int.tests.arithmetic ◉ Passed + 11. Int.tests.bitTwiddling ◉ Passed + 12. Int.tests.conversions ◉ Passed + 13. Nat.tests.arithmetic ◉ Passed + 14. Nat.tests.bitTwiddling ◉ Passed + 15. Nat.tests.conversions ◉ Passed + 16. Sandbox.test1 ◉ Passed + 17. Sandbox.test2 ◉ Passed + 18. Sandbox.test3 ◉ Passed + 19. test.rtjqan7bcs ◉ Passed + 20. Text.tests.alignment ◉ Passed + 21. Text.tests.indexOf ◉ Passed + 22. Text.tests.indexOfEmoji ◉ Passed + 23. Text.tests.literalsEq ◉ Passed + 24. Text.tests.patterns ◉ Passed + 25. Text.tests.repeat ◉ Passed + 26. Text.tests.takeDropAppend ◉ Passed + 27. Universal.murmurHash.tests ◉ Passed + + ✅ 27 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/bytesFromList.md b/unison-src/transcripts/idempotent/bytesFromList.md index 5b35d2617e..664c9dff1b 100644 --- a/unison-src/transcripts/idempotent/bytesFromList.md +++ b/unison-src/transcripts/idempotent/bytesFromList.md @@ -7,3 +7,19 @@ This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2 ``` unison > Bytes.fromList [1,2,3,4] ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > Bytes.fromList [1,2,3,4] + ⧩ + 0xs01020304 +``` diff --git a/unison-src/transcripts/idempotent/check763.md b/unison-src/transcripts/idempotent/check763.md index 26a78a65eb..e7943b6b20 100644 --- a/unison-src/transcripts/idempotent/check763.md +++ b/unison-src/transcripts/idempotent/check763.md @@ -9,8 +9,29 @@ scratch/main> builtins.merge (+-+) x y = x * y ``` +``` ucm :added-by-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`: + + +-+ : Nat -> Nat -> Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + +-+ : Nat -> Nat -> Nat scratch/main> move.term +-+ boppitybeep + + Done. scratch/main> move.term boppitybeep +-+ + + Done. ``` diff --git a/unison-src/transcripts/idempotent/check873.md b/unison-src/transcripts/idempotent/check873.md index 14359bf1b8..64b5b383be 100644 --- a/unison-src/transcripts/idempotent/check873.md +++ b/unison-src/transcripts/idempotent/check873.md @@ -8,10 +8,40 @@ scratch/main> builtins.merge (-) = builtin.Nat.sub ``` +``` ucm :added-by-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`: + + - : Nat -> Nat -> Int +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + - : Nat -> Nat -> Int ``` ``` unison baz x = x - 1 ``` + +``` ucm :added-by-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`: + + baz : Nat -> Int +``` diff --git a/unison-src/transcripts/idempotent/constructor-applied-to-unit.md b/unison-src/transcripts/idempotent/constructor-applied-to-unit.md index 80dc83aa82..875b92c07f 100644 --- a/unison-src/transcripts/idempotent/constructor-applied-to-unit.md +++ b/unison-src/transcripts/idempotent/constructor-applied-to-unit.md @@ -9,3 +9,52 @@ structural type Zoink a b c = Zoink a b c > Any () > [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] ``` + +``` ucm :added-by-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 Zoink a b c + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 3 | > Any () + ⧩ + Any () + + 4 | > [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ] + ⧩ + [ Zoink + [0, 1, 2, 3, 4, 5] + [ 6 + , 3 + , 3 + , 3 + , 3 + , 3 + , 3 + , 3 + , 3 + , 3 + , 3 + , 4 + , 4 + , 4 + , 4 + , 4 + , 4 + , 4 + , 4 + , 4 + , 3 + ] + () + ] +``` diff --git a/unison-src/transcripts/idempotent/contrabilities.md b/unison-src/transcripts/idempotent/contrabilities.md index 91bbe5e4a0..0694f0e14a 100644 --- a/unison-src/transcripts/idempotent/contrabilities.md +++ b/unison-src/transcripts/idempotent/contrabilities.md @@ -6,3 +6,16 @@ scratch/main> builtins.merge f : (() -> a) -> Nat f x = 42 ``` + +``` ucm :added-by-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`: + + f : '{g} a -> Nat +``` diff --git a/unison-src/transcripts/idempotent/create-author.md b/unison-src/transcripts/idempotent/create-author.md index 8ff2f77393..c440dad44a 100644 --- a/unison-src/transcripts/idempotent/create-author.md +++ b/unison-src/transcripts/idempotent/create-author.md @@ -6,5 +6,17 @@ Demonstrating `create.author`: ``` ucm scratch/main> create.author alicecoder "Alice McGee" + + Added definitions: + + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID + + Tip: Add License values for alicecoder under metadata. scratch/main> find alicecoder + + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID ``` diff --git a/unison-src/transcripts/idempotent/cycle-update-1.md b/unison-src/transcripts/idempotent/cycle-update-1.md index 90a3091247..84ecc32e3d 100644 --- a/unison-src/transcripts/idempotent/cycle-update-1.md +++ b/unison-src/transcripts/idempotent/cycle-update-1.md @@ -12,8 +12,27 @@ pong : 'Nat pong _ = !ping + 2 ``` +``` ucm :added-by-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`: + + ping : 'Nat + pong : 'Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ping : 'Nat + pong : 'Nat ``` ``` unison @@ -21,7 +40,40 @@ ping : 'Nat ping _ = !pong + 3 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + ping : 'Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view ping pong + + ping : 'Nat + ping _ = + use Nat + + pong() + 3 + + pong : 'Nat + pong _ = + use Nat + + ping() + 2 ``` diff --git a/unison-src/transcripts/idempotent/cycle-update-2.md b/unison-src/transcripts/idempotent/cycle-update-2.md index 3f3c8ea3a2..9e35071030 100644 --- a/unison-src/transcripts/idempotent/cycle-update-2.md +++ b/unison-src/transcripts/idempotent/cycle-update-2.md @@ -12,8 +12,27 @@ pong : 'Nat pong _ = !ping + 2 ``` +``` ucm :added-by-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`: + + ping : 'Nat + pong : 'Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ping : 'Nat + pong : 'Nat ``` ``` unison @@ -21,7 +40,38 @@ ping : 'Nat ping _ = 3 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + ping : 'Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view ping pong + + ping : 'Nat + ping _ = 3 + + pong : 'Nat + pong _ = + use Nat + + ping() + 2 ``` diff --git a/unison-src/transcripts/idempotent/cycle-update-3.md b/unison-src/transcripts/idempotent/cycle-update-3.md index 509661633b..3047e61a1e 100644 --- a/unison-src/transcripts/idempotent/cycle-update-3.md +++ b/unison-src/transcripts/idempotent/cycle-update-3.md @@ -12,8 +12,27 @@ pong : 'Nat pong _ = !ping + 2 ``` +``` ucm :added-by-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`: + + ping : 'Nat + pong : 'Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ping : 'Nat + pong : 'Nat ``` ``` unison @@ -21,7 +40,33 @@ ping : Nat ping = 3 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + ping : Nat +``` + ``` ucm scratch/main> update.old + + ⍟ I've updated these names to your new definition: + + ping : Nat scratch/main> view ping pong + + ping : Nat + ping = 3 + + pong : 'Nat + pong _ = + use Nat + + #4t465jk908.1() + 2 ``` diff --git a/unison-src/transcripts/idempotent/cycle-update-4.md b/unison-src/transcripts/idempotent/cycle-update-4.md index f1b7aaafd3..77b977c934 100644 --- a/unison-src/transcripts/idempotent/cycle-update-4.md +++ b/unison-src/transcripts/idempotent/cycle-update-4.md @@ -12,8 +12,27 @@ pong : 'Nat pong _ = !ping + 2 ``` +``` ucm :added-by-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`: + + ping : 'Nat + pong : 'Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ping : 'Nat + pong : 'Nat ``` ``` unison @@ -24,7 +43,49 @@ clang : 'Nat clang _ = !pong + 3 ``` +``` ucm :added-by-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`: + + clang : 'Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + ping : 'Nat +``` + ``` ucm scratch/main> update.old ping + + ⍟ I've added these definitions: + + clang : 'Nat + + ⍟ I've updated these names to your new definition: + + ping : 'Nat + pong : 'Nat scratch/main> view ping pong clang + + clang : 'Nat + clang _ = + use Nat + + pong() + 3 + + ping : 'Nat + ping _ = + use Nat + + clang() + 1 + + pong : 'Nat + pong _ = + use Nat + + ping() + 2 ``` diff --git a/unison-src/transcripts/idempotent/debug-definitions.md b/unison-src/transcripts/idempotent/debug-definitions.md index fa6819d683..f6aa5a0228 100644 --- a/unison-src/transcripts/idempotent/debug-definitions.md +++ b/unison-src/transcripts/idempotent/debug-definitions.md @@ -18,11 +18,133 @@ ability Ask a where ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ability Ask a + structural type Optional a + (also named builtin.Optional) + x : Nat + y : Nat scratch/main> debug.term.abt Nat.+ + + Builtin term: ##Nat.+ 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" scratch/main> debug.term.abt Some + + Constructor #0 of the following type: + DataDeclaration + { modifier = Structural + , annotation = External + , bound = + [ User "a" ] + , constructors' = + [ + ( External + , User "Constructor0" + , + ( User "a". Var User "a" -> ReferenceDerived + ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) + ( Var User "a" ) + ) + ) + , + ( External + , User "Constructor1" + , + ( User "a". ReferenceDerived + ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) + ( Var User "a" ) + ) + ) + ] + } scratch/main> debug.term.abt ask + + Constructor #0 of the following type: + EffectDeclaration + { toDataDecl = DataDeclaration + { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" + , annotation = External + , bound = + [ User "a" ] + , constructors' = + [ + ( External + , User "Constructor0" + , + ( User "a". + ( + { + [ ReferenceDerived + ( Id "d8m1kmiscgfrl5n9ruvq1432lntfntl7nnao45qlk2uqhparm0uq2im0kbspu6u6kv65hd0i5oljq9m4b78peh5ekpma7gkihtsmfh0" 0 ) + ( Var User "a" ) + ] + } Var User "a" + ) + ) + ) + ] + } + } scratch/main> debug.type.abt Nat + + Builtin type: ##Nat scratch/main> debug.type.abt Optional + + DataDeclaration + { modifier = Structural + , annotation = External + , bound = + [ User "a" ] + , constructors' = + [ + ( External + , User "Constructor0" + , + ( User "a". Var User "a" -> ReferenceDerived + ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) + ( Var User "a" ) + ) + ) + , + ( External + , User "Constructor1" + , + ( User "a". ReferenceDerived + ( Id "nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg" 0 ) + ( Var User "a" ) + ) + ) + ] + } scratch/main> debug.type.abt Ask + + EffectDeclaration + { toDataDecl = DataDeclaration + { modifier = Unique "a1ns7cunv2dvjmum0q8jbc54g6811cbh" + , annotation = External + , bound = + [ User "a" ] + , constructors' = + [ + ( External + , User "Constructor0" + , + ( User "a". + ( + { + [ ReferenceDerived + ( Id "d8m1kmiscgfrl5n9ruvq1432lntfntl7nnao45qlk2uqhparm0uq2im0kbspu6u6kv65hd0i5oljq9m4b78peh5ekpma7gkihtsmfh0" 0 ) + ( Var User "a" ) + ] + } Var User "a" + ) + ) + ) + ] + } + } ``` diff --git a/unison-src/transcripts/idempotent/debug-name-diffs.md b/unison-src/transcripts/idempotent/debug-name-diffs.md index 92580871c3..6a452995f4 100644 --- a/unison-src/transcripts/idempotent/debug-name-diffs.md +++ b/unison-src/transcripts/idempotent/debug-name-diffs.md @@ -9,11 +9,96 @@ structural type a.x.Foo = Foo | Bar structural type a.b.Baz = Boo ``` +``` ucm :added-by-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 a.b.Baz + structural type a.x.Foo + a.b.one : ##Nat + a.two : ##Nat + a.x.four : ##Nat + a.x.three : ##Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type a.b.Baz + structural type a.x.Foo + a.b.one : ##Nat + a.two : ##Nat + a.x.four : ##Nat + a.x.three : ##Nat scratch/main> delete.term.verbose a.b.one + + Removed definitions: + + 1. a.b.one : ##Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> alias.term a.two a.newtwo + + Done. scratch/main> move.namespace a.x a.y + + Done. scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #tteooc9j2d + + > Moves: + + Original name New name + a.x.Foo a.y.Foo + a.x.Foo.Bar a.y.Foo.Bar + a.x.Foo.Foo a.y.Foo.Foo + a.x.four a.y.four + a.x.three a.y.three + + ⊙ 2. #bicrtgqj12 + + + Adds / updates: + + a.newtwo + + = Copies: + + Original name New name(s) + a.two a.newtwo + + ⊙ 3. #bofp4huk1j + + - Deletes: + + a.b.one + + □ 4. #gss5s88mo3 (start of history) scratch/main> debug.name-diff 4 1 + + Kind Name Change Ref + Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg + Term a.y.four Added #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 + Term a.y.three Added #f3lgjvjqoocpt8v6kdgd2bgthh11a7md3qdp9rf5datccmo580btjd5bt5dro3irqs0is7vm7s1dphddjbtufch620te7ef7canmjj8 + Term a.y.Foo.Bar Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d1 + Term a.y.Foo.Foo Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d0 + Term a.b.one Removed #gjmq673r1vrurfotlnirv7vutdhm6sa3s02em5g22kk606mv6duvv8be402dv79312i4a0onepq5bo7citsodvq2g720nttj0ee9p0g + Term a.x.four Removed #vcfbbslncd2qloc03kalgsmufl3j5es6cehcrbmlj6t78d4uk5j9gpa3hhf2opln1u2kiepg5n2cn49ianf2oig0mi4c2ldn1r9lf40 + Term a.x.three Removed #f3lgjvjqoocpt8v6kdgd2bgthh11a7md3qdp9rf5datccmo580btjd5bt5dro3irqs0is7vm7s1dphddjbtufch620te7ef7canmjj8 + Term a.x.Foo.Bar Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d1 + Term a.x.Foo.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0#d0 + Type a.y.Foo Added #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 + Type a.x.Foo Removed #6kbe32g06nqg93cqub6ohqc4ql4o49ntgnunifds0t75qre6lacnbsr3evn8bkivj68ecbvmhkbak4dbg4fqertcpgb396rmo34tnh0 ``` diff --git a/unison-src/transcripts/idempotent/deep-names.md b/unison-src/transcripts/idempotent/deep-names.md index 52c995aee5..e40dda1c04 100644 --- a/unison-src/transcripts/idempotent/deep-names.md +++ b/unison-src/transcripts/idempotent/deep-names.md @@ -1,6 +1,7 @@ First we'll set up two libraries, and then we'll use them in some projects and show what `names` are deep-loaded for them. Our two "libraries": + ``` unison :hide text.a = 1 text.b = 2 @@ -18,36 +19,82 @@ scratch/main> branch /app2 ``` Our `app1` project includes the text library twice and the http library twice as direct dependencies. + ``` ucm scratch/app1> fork text lib.text_v1 + + Done. 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 scratch/app1> names a + + Term + Hash: #gjmq673r1v + Names: lib.text_v1.a lib.text_v2.a scratch/app1> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v3.x lib.http_v4.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 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 + + 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 scratch/app2> names x + + Term + Hash: #nsmc4p1ra4 + Names: lib.http_v1.x lib.http_v2.x ``` diff --git a/unison-src/transcripts/idempotent/definition-diff-api.md b/unison-src/transcripts/idempotent/definition-diff-api.md index 945b088501..d8ecc6fb35 100644 --- a/unison-src/transcripts/idempotent/definition-diff-api.md +++ b/unison-src/transcripts/idempotent/definition-diff-api.md @@ -1,7 +1,13 @@ ``` ucm diffs/main> builtins.mergeio lib.builtins + + Done. diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> + + Done. diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- + + Done. ``` ``` unison @@ -26,9 +32,37 @@ take n s = handle s() with h n ``` +``` ucm :added-by-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`: + + ability Stream a + type Type + take : Nat -> '{g} t ->{g, Stream a} Optional t + term : Nat +``` + ``` ucm diffs/main> add + + ⍟ I've added these definitions: + + ability Stream a + type Type + take : Nat -> '{g} t ->{g, Stream a} Optional t + term : Nat diffs/main> branch.create new + + Done. I've created the new branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /new`. ``` ``` unison @@ -55,25 +89,3510 @@ take n s = else None ``` +``` ucm :added-by-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: + + ⊡ Previously added definitions will be ignored: Stream + + ⍟ These names already exist. You can `update` them to your + new definition: + + type Type a + take : Nat -> '{g} t ->{g, Stream a} Optional t + term : Nat +``` + ``` ucm diffs/new> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` Diff terms ``` api GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=term&newTerm=term + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "diffTag": "segmentChange", + "fromSegment": "\"Here's some text\"", + "toSegment": "\"Here's some different text\"" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "diffTag": "segmentChange", + "fromSegment": "1", + "toSegment": "2" + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newTerm": { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"Here's some different text\"" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "2" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "term" + ] + }, + "oldBranchRef": "main", + "oldTerm": { + "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": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "_", + "tag": "HashQualifier" + }, + "segment": "_" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TextLiteral" + }, + "segment": "\"Here's some text\"" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.+", + "tag": "TermReference" + }, + "segment": "+" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "term" + ] + }, + "project": "diffs" + } ``` More complex diff ``` api GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=take&newTerm=take + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": "\n" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "Var" + }, + "diffTag": "segmentChange", + "fromSegment": "a", + "toSegment": "n" + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": " " + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": " ", + "toSegment": " " + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + } + ] + }, + { + "annotation": null, + "diffTag": "segmentChange", + "fromSegment": "\n", + "toSegment": " " + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "diffTag": "segmentChange", + "fromSegment": "handle", + "toSegment": "if" + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "annotation": { + "tag": "Var" + }, + "diffTag": "segmentChange", + "fromSegment": "s", + "toSegment": "n" + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + } + ] + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newTerm": { + "bestTermName": "take", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "take" + ] + }, + "oldBranchRef": "main", + "oldTerm": { + "bestTermName": "take", + "defnTermTag": "Plain", + "signature": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + } + ], + "termDefinition": { + "contents": [ + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": { + "tag": "TypeAscriptionColon" + }, + "segment": " :" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelayForceChar" + }, + "segment": "'" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "TypeOperator" + }, + "segment": "->" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "{" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "g" + }, + { + "annotation": null, + "segment": "," + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro", + "tag": "TypeReference" + }, + "segment": "Stream" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "AbilityBraces" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", + "tag": "TypeReference" + }, + "segment": "Optional" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "t" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": { + "contents": "take", + "tag": "HashQualifier" + }, + "segment": "take" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseKeyword" + }, + "segment": "use " + }, + { + "annotation": { + "tag": "UsePrefix" + }, + "segment": "Nat" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": "-" + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": " " + }, + { + "annotation": { + "tag": "UseSuffix" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "h", + "tag": "HashQualifier" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": { + "tag": "BindingEquals" + }, + "segment": " =" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "cases" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "if " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.>", + "tag": "TermReference" + }, + "segment": ">" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "0" + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": " then" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#b035k0tpdv9jbs80ig29hujmv9kpkubda6or4320o5g7aj7edsudislnp2uovntgu5b0e6a18p0p7j8r2hcpr20blls7am8nll6t2ro#a0", + "tag": "TermReference" + }, + "segment": "emit" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "k" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": "(" + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat.drop", + "tag": "TermReference" + }, + "segment": "-" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "NumericLiteral" + }, + "segment": "1" + }, + { + "annotation": { + "tag": "Parenthesis" + }, + "segment": ")" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "else" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d1", + "tag": "TermReference" + }, + "segment": "None" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "{" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": "}" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "->" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg#d0", + "tag": "TermReference" + }, + "segment": "Some" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "r" + }, + { + "annotation": null, + "segment": "\n" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "handle" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "s" + }, + { + "annotation": { + "tag": "Unit" + }, + "segment": "()" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "ControlKeyword" + }, + "segment": "with" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "h" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "n" + } + ], + "tag": "UserObject" + }, + "termDocs": [], + "termNames": [ + "take" + ] + }, + "project": "diffs" + } ``` - Diff types ``` api GET /api/projects/diffs/diff/types?oldBranchRef=main&newBranchRef=new&oldType=Type&newType=Type + { + "diff": { + "contents": [ + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + } + ] + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + } + ] + }, + { + "diffTag": "annotationChange", + "fromAnnotation": { + "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", + "tag": "TermReference" + }, + "segment": "Type", + "toAnnotation": { + "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", + "tag": "TermReference" + } + }, + { + "diffTag": "both", + "elements": [ + { + "annotation": null, + "segment": " " + } + ] + }, + { + "diffTag": "old", + "elements": [ + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ] + }, + { + "diffTag": "new", + "elements": [ + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ] + } + ], + "tag": "UserObject" + }, + "diffKind": "diff", + "newBranchRef": "new", + "newType": { + "bestTypeName": "Type", + "defnTypeTag": "Data", + "typeDefinition": { + "contents": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "DataTypeParams" + }, + "segment": "a" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + }, + { + "annotation": { + "contents": "#uik7pl3klg4u2obtf2fattdaeldui46ohmsi0knpp5hu8tn4d5o8vp570qgh7esgap0pmq9cfrh9dfg1r8qa7qh33g45a3tric24o20#d0", + "tag": "TermReference" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "tag": "Var" + }, + "segment": "a" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Text", + "tag": "TypeReference" + }, + "segment": "Text" + } + ], + "tag": "UserObject" + }, + "typeDocs": [], + "typeNames": [ + "Type" + ] + }, + "oldBranchRef": "main", + "oldType": { + "bestTypeName": "Type", + "defnTypeTag": "Data", + "typeDefinition": { + "contents": [ + { + "annotation": { + "tag": "DataTypeKeyword" + }, + "segment": "type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "Type", + "tag": "HashQualifier" + }, + "segment": "Type" + }, + { + "annotation": { + "tag": "DelimiterChar" + }, + "segment": " = " + }, + { + "annotation": { + "contents": "#m5hlrmkn9a3kuqabta2e9qs934em1qmkotpsh9tjvta2u86nuesbjbk2k2sprbdiljq7uqibp49vku4gfpg2u60ceiv8net1f0bu2n8#d0", + "tag": "TermReference" + }, + "segment": "Type" + }, + { + "annotation": null, + "segment": " " + }, + { + "annotation": { + "contents": "##Nat", + "tag": "TypeReference" + }, + "segment": "Nat" + } + ], + "tag": "UserObject" + }, + "typeDocs": [], + "typeNames": [ + "Type" + ] + }, + "project": "diffs" + } ``` diff --git a/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md b/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md index 1477978a2e..55bbbc526c 100644 --- a/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md +++ b/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md @@ -2,7 +2,7 @@ # Delete namespace dependents check -This is a regression test, previously `delete.namespace` allowed a delete as long as the deletions had a name _anywhere_ in your codebase, it should only check the current project branch. +This is a regression test, previously `delete.namespace` allowed a delete as long as the deletions had a name *anywhere* in your codebase, it should only check the current project branch. ``` ucm :hide myproject/main> builtins.merge @@ -14,9 +14,49 @@ sub.dependency = 123 dependent = dependency + 99 ``` +``` ucm :added-by-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`: + + dependent : Nat + sub.dependency : Nat +``` + ``` ucm :error myproject/main> add + + ⍟ I've added these definitions: + + dependent : Nat + sub.dependency : Nat myproject/main> branch /new + + Done. I've created the new branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /new`. myproject/new> delete.namespace sub + + ⚠️ + + I didn't delete the namespace because the following + definitions are still in use. + + Dependency Referenced In + dependency 1. dependent + + If you want to proceed anyways and leave those definitions + without names, use delete.namespace.force myproject/new> view dependent + + dependent : Nat + dependent = + use Nat + + dependency + 99 ``` diff --git a/unison-src/transcripts/idempotent/delete-namespace.md b/unison-src/transcripts/idempotent/delete-namespace.md index b23a294273..3360102d47 100644 --- a/unison-src/transcripts/idempotent/delete-namespace.md +++ b/unison-src/transcripts/idempotent/delete-namespace.md @@ -22,39 +22,103 @@ Deleting a namespace with no external dependencies should succeed. ``` ucm scratch/main> delete.namespace no_dependencies + + Done. ``` Deleting a namespace with external dependencies should fail and list all dependents. ``` ucm :error scratch/main> delete.namespace dependencies + + ⚠️ + + I didn't delete the namespace because the following + definitions are still in use. + + Dependency Referenced In + term2 1. dependents.usage1 + 2. dependents.usage2 + + term1 3. dependents.usage1 + 4. dependents.usage2 + + If you want to proceed anyways and leave those definitions + without names, use delete.namespace.force ``` Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ``` ucm scratch/main> delete.namespace.force dependencies + + Done. + + ⚠️ + + Of the things I deleted, the following are still used in the + following definitions. They now contain un-named references. + + Dependency Referenced In + term2 1. dependents.usage1 + 2. dependents.usage2 + + term1 3. dependents.usage1 + 4. dependents.usage2 ``` I should be able to view an affected dependency by number ``` ucm scratch/main> view 2 + + dependents.usage2 : Nat + dependents.usage2 = + use Nat * + #gjmq673r1v * #dcgdua2lj6 ``` Deleting the root namespace should require confirmation if not forced. ``` ucm 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, or delete the current branch with `delete.branch` 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 scratch/main> history . + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #sg60bvjo91 (start of history) ``` Deleting the root namespace shouldn't require confirmation if forced. ``` ucm 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 scratch/main> history . + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #sg60bvjo91 (start of history) ``` diff --git a/unison-src/transcripts/idempotent/delete-project-branch.md b/unison-src/transcripts/idempotent/delete-project-branch.md index ab78f07c19..9ed4a06a7e 100644 --- a/unison-src/transcripts/idempotent/delete-project-branch.md +++ b/unison-src/transcripts/idempotent/delete-project-branch.md @@ -3,6 +3,11 @@ your working directory with each command). ``` ucm foo/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`. foo/topic> delete.branch /topic ``` @@ -10,6 +15,11 @@ A branch need not be preceded by a forward slash. ``` ucm foo/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`. foo/topic> delete.branch topic ``` @@ -17,6 +27,11 @@ You can precede the branch name by a project name. ``` ucm foo/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`. scratch/main> delete.branch foo/topic ``` @@ -31,6 +46,10 @@ You can delete the last branch in the project, a new one will be created. ``` ucm scratch/main> delete.branch scratch/main scratch/main> branches + + Branch Remote branch + 1. main + 2. main2 ``` If the the last branch isn't /main, then /main will be created. @@ -39,4 +58,8 @@ If the the last branch isn't /main, then /main will be created. scratch/main2> delete.branch /main scratch/main2> delete.branch /main2 scratch/other> branches + + Branch Remote branch + 1. main + 2. other ``` diff --git a/unison-src/transcripts/idempotent/delete-project.md b/unison-src/transcripts/idempotent/delete-project.md index 4b941ac8cf..3830718958 100644 --- a/unison-src/transcripts/idempotent/delete-project.md +++ b/unison-src/transcripts/idempotent/delete-project.md @@ -2,18 +2,57 @@ ``` ucm scratch/main> project.create-empty foo + + 🎉 I've created the project foo. + + 🎨 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! scratch/main> 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! -- I can delete the project I'm currently on scratch/main> delete.project scratch foo/main> projects + + 1. bar + 2. foo -- I can delete a different project foo/main> delete.project bar foo/main> projects + + 1. foo -- I can delete the last project, a new scratch project will be created foo/main> delete.project foo project/main> projects + + 1. project + 2. scratch -- If the last project is scratch, a scratch2 project will be created. scratch/main> delete.project project scratch/main> delete.project scratch project/main> projects + + 1. project + 2. scratch2 ``` diff --git a/unison-src/transcripts/idempotent/delete-silent.md b/unison-src/transcripts/idempotent/delete-silent.md index e100570404..a12f718915 100644 --- a/unison-src/transcripts/idempotent/delete-silent.md +++ b/unison-src/transcripts/idempotent/delete-silent.md @@ -1,5 +1,10 @@ ``` ucm :error scratch/main> delete foo + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + foo ``` ``` unison :hide @@ -9,7 +14,18 @@ structural type Foo = Foo () ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo + foo : ##Nat scratch/main> delete foo + + Done. scratch/main> delete.type Foo + + Done. scratch/main> delete.term Foo.Foo + + Done. ``` diff --git a/unison-src/transcripts/idempotent/delete.md b/unison-src/transcripts/idempotent/delete.md index afc4872c22..89e8019007 100644 --- a/unison-src/transcripts/idempotent/delete.md +++ b/unison-src/transcripts/idempotent/delete.md @@ -11,6 +11,11 @@ exist. ``` ucm :error scratch/main> delete.verbose foo + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + foo ``` Now for some easy cases. Deleting an unambiguous term, then deleting an @@ -23,9 +28,35 @@ structural type Foo = Foo () ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo + foo : Nat scratch/main> delete.verbose foo + + Removed definitions: + + 1. foo : Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> delete.verbose Foo + + Removed definitions: + + 1. structural type Foo + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> delete.verbose Foo.Foo + + Removed definitions: + + 1. Foo.Foo : '#089vmor9c5 + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` How about an ambiguous term? @@ -37,14 +68,36 @@ a.bar = 2 ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a.bar : Nat + a.foo : Nat scratch/main> debug.alias.term.force a.bar a.foo + + Done. ``` A delete should remove both versions of the term. ``` ucm scratch/main> delete.verbose a.foo + + Removed definitions: + + 1. a.foo#gjmq673r1v : Nat + + Name changes: + + Original Changes + 2. a.bar ┐ 3. a.foo#dcgdua2lj6 (removed) + 4. a.foo#dcgdua2lj6 ┘ + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> ls a + + 1. bar (Nat) ``` Let's repeat all that on a type, for completeness. @@ -56,9 +109,38 @@ structural type a.Bar = Bar ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type a.Bar + (also named lib.builtins.Unit) + structural type a.Foo scratch/main> debug.alias.type.force a.Bar a.Foo + + Done. scratch/main> delete.verbose a.Foo + + Removed definitions: + + 1. structural type a.Foo#089vmor9c5 + + Name changes: + + Original Changes + 2. a.Bar ┐ 3. a.Foo#00nv2kob8f (removed) + 4. lib.builtins.Unit │ + 5. a.Foo#00nv2kob8f ┘ + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> delete.verbose a.Foo.Foo + + Removed definitions: + + 1. a.Foo.Foo : '#089vmor9c5 + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` Finally, let's try to delete a term and a type with the same name. @@ -70,7 +152,20 @@ structural type foo = Foo () ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type foo + foo : Nat scratch/main> delete.verbose foo + + Removed definitions: + + 1. structural type foo + 2. foo : Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` We want to be able to delete multiple terms at once @@ -83,7 +178,22 @@ c = "c" ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a : Text + b : Text + c : Text scratch/main> delete.verbose a b c + + Removed definitions: + + 1. a : Text + 2. b : Text + 3. c : Text + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` We can delete terms and types in the same invocation of delete @@ -97,8 +207,34 @@ c = "c" ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo + a : Text + b : Text + c : Text scratch/main> 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 use a hash from `reflog` to undo + this change. scratch/main> delete.verbose Foo.Foo + + Name changes: + + Original Changes + 1. Foo.Foo ┐ 2. Foo.Foo (removed) + 3. foo.Foo ┘ + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` We can delete a type and its constructors @@ -109,7 +245,24 @@ structural type Foo = Foo () ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo scratch/main> 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 use a hash from `reflog` to undo + this change. ``` You should not be able to delete terms which are referenced by other terms @@ -123,7 +276,25 @@ d = a + b + c ``` ucm :error scratch/main> add + + ⍟ I've added these definitions: + + a : Nat + b : Nat + (also named a.bar) + c : Nat + d : Nat scratch/main> delete.verbose a b c + + ⚠️ + + 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 @@ -137,7 +308,24 @@ h = e + f + g ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + e : Nat + f : Nat + g : Nat + h : Nat scratch/main> 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 use a hash from `reflog` to undo + this change. ``` You should be able to delete a type and all the functions that reference it in a single command @@ -152,7 +340,21 @@ incrementFoo = cases ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo + incrementFoo : Foo -> Nat scratch/main> delete.verbose Foo Foo.Foo incrementFoo + + Removed definitions: + + 1. structural type Foo + 2. Foo.Foo : Nat -> Foo + 3. incrementFoo : Foo -> Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` If you mess up on one of the names of your command, delete short circuits @@ -166,7 +368,19 @@ h = e + f + g ``` ucm :error scratch/main> add + + ⍟ I've added these definitions: + + e : Nat + f : Nat + g : Nat + h : Nat scratch/main> 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 @@ -178,6 +392,23 @@ pong _ = 4 Nat.+ !ping ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ping : 'Nat + pong : 'Nat scratch/main> delete.verbose ping + + Removed definitions: + + 1. ping : 'Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> view pong + + pong : 'Nat + pong _ = + use Nat + + 4 + #l9uq1dpl5v.1() ``` diff --git a/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md b/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md index 1d9455baeb..b41edea0f1 100644 --- a/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md +++ b/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md @@ -3,9 +3,11 @@ scratch/main> builtins.merge ``` ### `debug.file` + I can use `debug.file` to see the hashes of the last typechecked file. Given this .u file: + ``` unison :hide structural type outside.A = A Nat outside.B structural type outside.B = B Int @@ -17,22 +19,97 @@ inside.p = c inside.q x = x + p * p inside.r = d ``` + ``` ucm scratch/main> debug.file + + type inside.M#h37a56c5ep + type outside.A#6l6krl7n4l + type outside.B#eo6rj0lj1b + inside.p#htoo5rnb54 + inside.q#1mqcoh3tnk + inside.r#nkgohbke6n + outside.c#f3lgjvjqoo + outside.d#ukd7tu6kds ``` This will help me make progress in some situations when UCM is being deficient or broken. ### `dependents` / `dependencies` + But wait, there's more. I can check the dependencies and dependents of a definition: + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type inside.M + structural type outside.A + structural type outside.B + inside.p : Nat + inside.q : Nat -> Nat + inside.r : Boolean + outside.c : Nat + outside.d : Boolean scratch/main> dependents q + + q has no dependents. scratch/main> dependencies q + + Dependencies of: q + + Types: + + 1. Nat + + Terms: + + 2. Nat.* + 3. Nat.+ + 4. p + + Tip: Try `view 4` to see the source of any numbered item in + the above list. scratch/main> dependencies B + + Dependencies of: type B, B + + Types: + + 1. B + 2. Int + + Tip: Try `view 2` to see the source of any numbered item in + the above list. scratch/main> dependencies d + + Dependencies of: d + + Types: + + 1. Boolean + 2. Nat + + Terms: + + 3. < + 4. c + 5. Nat.+ + 6. p + + Tip: Try `view 6` to see the source of any numbered item in + the above list. scratch/main> dependents d -scratch/main> + + Dependents of: d + + Terms: + + 1. r + + Tip: Try `view 1` to see the source of any numbered item in + the above list. ``` 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/idempotent/destructuring-binds.md b/unison-src/transcripts/idempotent/destructuring-binds.md index a1b2a816fe..fcaa949d26 100644 --- a/unison-src/transcripts/idempotent/destructuring-binds.md +++ b/unison-src/transcripts/idempotent/destructuring-binds.md @@ -18,9 +18,37 @@ ex1 tup = c + d ``` +``` ucm :added-by-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`: + + ex0 : Nat -> Nat + ex1 : (a, b, (Nat, Nat)) -> Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ex0 : Nat -> Nat + ex1 : (a, b, (Nat, Nat)) -> Nat scratch/main> view ex0 ex1 + + ex0 : Nat -> Nat + ex0 n = + use Nat + + (a, _, (c, d)) = ("uno", "dos", (n, 7)) + c + d + + ex1 : (a, b, (Nat, Nat)) -> Nat + ex1 = cases (a, b, (c, d)) -> c Nat.+ d ``` 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`. @@ -33,6 +61,20 @@ ex2 tup = match tup with (a, b, (c,d)) -> c + d ``` +``` ucm :added-by-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`: + + ex2 : (a, b, (Nat, Nat)) -> Nat + (also named ex1) +``` + ## Corner cases Destructuring binds can't be recursive: the left-hand side bound variables aren't available on the right hand side. For instance, this doesn't typecheck: @@ -43,6 +85,26 @@ ex4 = "Doesn't typecheck" ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what a refers to here: + + 2 | (a,b) = (a Nat.+ b, 19) + + I think its type should be: + + Nat + + Some common causes of this error include: + * Your current namespace is too deep to contain the + definition in its subtree + * The definition is part of a library which hasn't been + added to this project + * You have a typo in the name +``` + Even though the parser accepts any pattern on the LHS of a bind, it looks pretty weird to see things like `12 = x`, so we avoid showing a destructuring bind when the LHS is a "literal" pattern (like `42` or "hi"). Again these examples wouldn't compile with coverage checking. ``` unison @@ -57,9 +119,38 @@ ex5a _ = match (99 + 1, "hi") with _ -> "impossible" ``` +``` ucm :added-by-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`: + + ex5 : 'Text + ex5a : 'Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ex5 : 'Text + ex5a : 'Text scratch/main> view ex5 ex5a + + ex5 : 'Text + ex5 _ = match 99 Nat.+ 1 with + 12 -> "Hi" + _ -> "Bye" + + ex5a : 'Text + ex5a _ = match (99 Nat.+ 1, "hi") with + (x, "hi") -> "Not printed as a destructuring bind." + _ -> "impossible" ``` Notice how it prints both an ordinary match. @@ -75,5 +166,12 @@ For clarity, the pretty-printer leaves this alone, even though in theory it coul ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ex6 : (Nat, Nat) -> Nat scratch/main> view ex6 + + ex6 : (Nat, Nat) -> Nat + ex6 = cases (x, y) -> x Nat.+ y ``` diff --git a/unison-src/transcripts/idempotent/diff-namespace.md b/unison-src/transcripts/idempotent/diff-namespace.md index cffc703b6a..08f325a6d6 100644 --- a/unison-src/transcripts/idempotent/diff-namespace.md +++ b/unison-src/transcripts/idempotent/diff-namespace.md @@ -13,6 +13,11 @@ fslkdjflskdjflksjdf = 663 ``` ucm scratch/b1> add + + ⍟ I've added these definitions: + + fslkdjflskdjflksjdf : Nat + x : Nat ``` ``` unison :hide @@ -23,22 +28,45 @@ abc = 23 ``` ucm scratch/b2> add + + ⍟ I've added these definitions: + + abc : Nat + fslkdjflskdjflksjdf : Nat + x : Nat scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf + + Done. ``` ``` ucm scratch/main> 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) ``` + 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 + - 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 :hide fromJust = 1 @@ -53,19 +81,44 @@ structural ability X a1 a2 where x : () ``` ucm scratch/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 scratch/ns1> alias.term fromJust fromJust' + + Done. scratch/ns1> alias.term helloWorld helloWorld2 + + Done. scratch/ns1> branch /ns2 + + Done. I've created the ns2 branch based off of ns1. + + Tip: To merge your work back into the ns1 branch, first + `switch /ns1` then `merge /ns2`. ``` Here's what we've done so far: ``` ucm :error scratch/main> diff.namespace .nothing /ns1: + + ⚠️ + + The namespace scratch/main:.nothing is empty. Was there a typo? ``` ``` ucm :error scratch/main> diff.namespace /ns1: /ns2: + + The namespaces are identical. ``` ``` unison :hide @@ -74,8 +127,16 @@ junk = "asldkfjasldkfj" ``` ucm scratch/ns1> add + + ⍟ I've added these definitions: + + junk : Text scratch/ns1> debug.alias.term.force junk fromJust + + Done. scratch/ns1> delete.term junk + + Done. ``` ``` unison :hide @@ -89,30 +150,168 @@ unique type Y a b = Y a b ``` ucm scratch/ns2> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> 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 : Nat + + 6. bdependent : Nat + ↓ + 7. bdependent : 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 + + Name changes: + + Original Changes + 13. fromJust' ┐ 14. fromJust#gjmq673r1v (removed) + 15. fromJust#gjmq673r1v ┘ scratch/ns2> alias.term d d' + + Done. scratch/ns2> alias.type A A' + + Done. scratch/ns2> alias.term A.A A'.A + + Done. scratch/ns2> alias.type X X' + + Done. scratch/ns2> alias.term X.x X'.x + + Done. scratch/main> 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 : Nat + + 6. bdependent : Nat + ↓ + 7. bdependent : 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 + + Name changes: + + Original Changes + 14. A 15. A' (added) + + 16. X 17. X' (added) + + 18. A.A 19. A'.A (added) + + 20. fromJust' ┐ 21. fromJust#gjmq673r1v (removed) + 22. fromJust#gjmq673r1v ┘ + + 23. X.x 24. X'.x (added) scratch/ns1> alias.type X X2 + + Done. scratch/ns1> alias.term X.x X2.x + + Done. scratch/ns2> alias.type A' A'' + + Done. scratch/ns2> alias.term A'.A A''.A + + Done. scratch/ns2> branch /ns3 + + Done. I've created the ns3 branch based off of ns2. + + Tip: To merge your work back into the ns2 branch, first + `switch /ns2` then `merge /ns3`. scratch/ns2> alias.term fromJust' yoohoo + + Done. scratch/ns2> delete.term.verbose fromJust' + + Name changes: + + Original Changes + 1. fromJust' ┐ 2. fromJust' (removed) + 3. yoohoo ┘ + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. scratch/main> diff.namespace /ns3: /ns2: + + Name changes: + + Original Changes + 1. fromJust' 2. yoohoo (added) + 3. fromJust' (removed) ``` + ``` unison :hide bdependent = "banana" ``` + ``` ucm scratch/ns3> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> diff.namespace /ns2: /ns3: -``` + Updates: + + 1. bdependent : Nat + ↓ + 2. bdependent : Text + + Name changes: + + Original Changes + 3. yoohoo 4. fromJust' (added) + 5. yoohoo (removed) +``` ## Two different auto-propagated changes creating a name conflict @@ -128,8 +327,24 @@ forconflicts = 777 ``` ucm scratch/nsx> add + + ⍟ I've added these definitions: + + a : Nat + b : Nat + forconflicts : Nat scratch/nsx> branch /nsy + + Done. I've created the nsy branch based off of nsx. + + Tip: To merge your work back into the nsx branch, first + `switch /nsx` then `merge /nsy`. scratch/nsx> branch /nsz + + Done. I've created the nsz branch based off of nsx. + + Tip: To merge your work back into the nsx branch, first + `switch /nsx` then `merge /nsz`. ``` ``` unison :hide @@ -138,6 +353,15 @@ a = 444 ``` ucm scratch/nsy> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` ``` unison :hide @@ -146,15 +370,65 @@ a = 555 ``` ucm scratch/nsz> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/nsy> branch /nsw + + Done. I've created the nsw branch based off of nsy. + + Tip: To merge your work back into the nsy branch, first + `switch /nsy` then `merge /nsw`. scratch/nsw> debug.alias.term.force .forconflicts .a + + Done. scratch/nsw> debug.alias.term.force .forconflicts .b + + Done. ``` ``` ucm scratch/main> diff.namespace /nsx: /nsw: + + New name conflicts: + + 1. a#uiiiv8a86s : Nat + ↓ + 2. ┌ a#mdl4vqtu00 : Nat + 3. └ a#r3msrbpp1v : Nat + + 4. b#lhigeb1let : Nat + ↓ + 5. ┌ b#r3msrbpp1v : Nat + 6. └ b#unkqhuu66p : Nat + + Name changes: + + Original Changes + 7. forconflicts 8. a#r3msrbpp1v (added) + 9. b#r3msrbpp1v (added) scratch/nsw> view a + + a#mdl4vqtu00 : Nat + a#mdl4vqtu00 = 444 + + a#r3msrbpp1v : Nat + a#r3msrbpp1v = 777 scratch/nsw> view b + + b#r3msrbpp1v : Nat + b#r3msrbpp1v = 777 + + b#unkqhuu66p : Nat + b#unkqhuu66p = + use Nat + + a#mdl4vqtu00 + 1 ``` ## Should be able to diff a namespace hash from history. @@ -163,63 +437,112 @@ scratch/nsw> view b x = 1 ``` +``` ucm :added-by-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 scratch/hashdiff> add + + ⍟ I've added these definitions: + + x : ##Nat ``` ``` unison y = 2 ``` +``` ucm :added-by-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 scratch/hashdiff> add + + ⍟ I've added these definitions: + + y : ##Nat scratch/hashdiff> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #ru1hnjofdj + + + Adds / updates: + + y + + □ 2. #i52j9fd57b (start of history) scratch/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 +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 +4. ┌ bar\#0ja1qfpej6 : Nat +5. └ bar\#jk19sm5bf8 : Nat + ↓ +6. bar\#jk19sm5bf8 : Nat ## Display issues to fixup -- [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? + - \[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/idempotent/doc-formatting.md b/unison-src/transcripts/idempotent/doc-formatting.md index 3e54da2d52..f6404dee11 100644 --- a/unison-src/transcripts/idempotent/doc-formatting.md +++ b/unison-src/transcripts/idempotent/doc-formatting.md @@ -13,11 +13,31 @@ foo n = n + 1 ``` +``` ucm :added-by-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 : Nat -> Nat +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view foo + + foo : Nat -> Nat + foo n = + use Nat + + _ = [: do the thing :] + n + 1 ``` Note that `@` and `:]` must be escaped within docs. @@ -26,11 +46,28 @@ Note that `@` and `:]` must be escaped within docs. escaping = [: Docs look [: like \@this \:] :] ``` +``` ucm :added-by-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`: + + escaping : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view escaping + + escaping : Doc + escaping = [: Docs look [: like \@this \:] :] ``` (Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) @@ -45,11 +82,32 @@ commented = [: :] ``` +``` ucm :added-by-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`: + + commented : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view commented + + commented : Doc + commented = + [: example: + + -- a comment f x = x + 1 + :] ``` ### Indenting, and paragraph reflow @@ -63,11 +121,28 @@ Handling of indenting in docs between the parser and pretty-printer is a bit fid doc1 = [: hi :] ``` +``` ucm :added-by-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 +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc1 + + doc1 : Doc + doc1 = [: hi :] ``` ``` unison @@ -82,11 +157,32 @@ doc2 = [: hello and the rest. :] ``` +``` ucm :added-by-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`: + + doc2 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc2 + + doc2 : Doc + doc2 = + [: hello + - foo + - bar + and the rest. :] ``` ``` unison @@ -104,11 +200,47 @@ Note that because of the special treatment of the first line mentioned above, wh :] ``` +``` ucm :added-by-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`: + + doc3 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc3 + + doc3 : Doc + doc3 = + [: When Unison identifies a paragraph, it removes any + newlines from it before storing it, and then reflows the + paragraph text to fit the display window on + display/view/edit. + + For these purposes, a paragraph is any sequence of non-empty + lines that have zero indent (after the unindenting mentioned + above.) + + - So this is not a paragraph, even + though you might want it to be. + + And this text | as a paragraph + is not treated | either. + + Note that because of the special treatment of the first line + mentioned above, where its leading space is removed, it is + always treated as a paragraph. + :] ``` ``` unison @@ -119,11 +251,33 @@ doc4 = [: Here's another example of some paragraphs. - Apart from this one. :] ``` +``` ucm :added-by-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`: + + doc4 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc4 + + doc4 : Doc + doc4 = + [: Here's another example of some paragraphs. + + All these lines have zero indent. + + - Apart from this one. :] ``` ``` unison @@ -136,11 +290,31 @@ doc5 = [: - foo and the rest. :] ``` +``` ucm :added-by-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`: + + doc5 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc5 + + doc5 : Doc + doc5 = + [: - foo + - bar + and the rest. :] ``` ``` unison @@ -152,11 +326,32 @@ doc6 = [: :] ``` +``` ucm :added-by-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`: + + doc6 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view doc6 + + doc6 : Doc + doc6 = + [: - foo + - bar + and the rest. + :] ``` ### More testing @@ -167,11 +362,30 @@ empty = [::] expr = foo 1 ``` + +``` ucm :added-by-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`: + + empty : Doc + expr : Nat +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view empty + + empty : Doc + empty = [: :] ``` ``` unison @@ -213,11 +427,85 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo :] ``` + +``` ucm :added-by-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`: + + test1 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view test1 + + test1 : Doc + test1 = + [: The internal logic starts to get hairy when you use the + \@ features, for example referencing a name like @List.take. + Internally, the text between each such usage is its own blob + (blob ends here --> @List.take), so paragraph reflow has to + be aware of multiple blobs to do paragraph reflow (or, more + accurately, to do the normalization step where newlines with + a paragraph are removed.) + + Para to reflow: lorem ipsum dolor lorem ipsum dolor lorem + ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum + dolor lorem ipsum dolor ending in ref @List.take + + @List.take starting para lorem ipsum dolor lorem ipsum dolor + lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem + ipsum dolor lorem ipsum dolor. + + Middle of para: lorem ipsum dolor lorem ipsum dolor lorem + ipsum dolor @List.take lorem ipsum dolor lorem ipsum dolor + lorem ipsum dolor lorem ipsum dolor. + + - non-para line (@List.take) with ref @List.take + Another non-para line + @List.take starting non-para line + + - non-para line with ref @List.take + before a para-line lorem ipsum dolor lorem ipsum dolor lorem + ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum + dolor lorem ipsum dolor lorem ipsum dolor. + + - non-para line followed by a para line starting with ref + @List.take lorem ipsum dolor lorem ipsum dolor lorem ipsum + dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor + lorem ipsum dolor lorem ipsum dolor. + + a para-line ending with ref lorem ipsum dolor lorem ipsum + dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor + lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor @List.take + - non-para line + + para line lorem ipsum dolor lorem ipsum dolor lorem ipsum + dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor + lorem ipsum dolor lorem ipsum dolor + @List.take followed by non-para line starting with ref. + + @[signature] List.take + + @[source] foo + + @[evaluate] expr + + @[include] doc1 + + -- note the leading space below + @[signature] List.take + + :] ``` ``` unison @@ -225,11 +513,29 @@ scratch/main> view test1 reg1363 = [: `@List.take foo` bar baz :] ``` + +``` ucm :added-by-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`: + + reg1363 : Doc +``` + ``` ucm :hide scratch/main> add ``` + ``` ucm scratch/main> view reg1363 + + reg1363 : Doc + reg1363 = [: `@List.take foo` bar baz :] ``` ``` unison @@ -241,14 +547,45 @@ test2 = [: @[source] foo ▶ bar :] ``` + +``` ucm :added-by-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`: + + test2 : Doc +``` + ``` ucm :hide scratch/main> add ``` + View is fine. + ``` ucm scratch/main> view test2 + + test2 : Doc + test2 = + [: Take a look at this: + @[source] foo ▶ bar + :] ``` + But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: + ``` ucm scratch/main> display test2 + + Take a look at this: + foo : Nat -> Nat + foo n = + use Nat + + _ = [: do the thing :] + n + 1 ▶ bar ``` diff --git a/unison-src/transcripts/idempotent/doc-type-link-keywords.md b/unison-src/transcripts/idempotent/doc-type-link-keywords.md index a825cca946..8e9fdb7c99 100644 --- a/unison-src/transcripts/idempotent/doc-type-link-keywords.md +++ b/unison-src/transcripts/idempotent/doc-type-link-keywords.md @@ -35,7 +35,15 @@ Now we check that each doc links to the object of the correct name: ``` ucm scratch/main> display docs.example1 + + A doc that links to the abilityPatterns term scratch/main> display docs.example2 + + A doc that links to the Patterns ability scratch/main> display docs.example3 + + A doc that links to the typeLabels term scratch/main> display docs.example4 + + A doc that links to the Labels type ``` diff --git a/unison-src/transcripts/idempotent/doc1.md b/unison-src/transcripts/idempotent/doc1.md index 97c8efcc29..1c95c14626 100644 --- a/unison-src/transcripts/idempotent/doc1.md +++ b/unison-src/transcripts/idempotent/doc1.md @@ -8,6 +8,14 @@ Unison documentation is written in Unison. Documentation is a value of the follo ``` ucm scratch/main> view lib.builtins.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: @@ -22,15 +30,28 @@ Can link to definitions like @List.drop or @List :] ``` +``` ucm :added-by-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). + - 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 @@ -41,8 +62,27 @@ List.take.ex1 = take 0 [1,2,3,4,5] List.take.ex2 = take 2 [1,2,3,4,5] ``` +``` ucm :added-by-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: + + List.take.ex1 : [Nat] + List.take.ex2 : [Nat] ``` And now let's write our docs and reference these examples: @@ -64,20 +104,58 @@ List.take.doc = [: :] ``` +``` ucm :added-by-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 scratch/main> 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. ``` 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] ``` diff --git a/unison-src/transcripts/idempotent/doc2.md b/unison-src/transcripts/idempotent/doc2.md index fd96eb047f..1e164c14ce 100644 --- a/unison-src/transcripts/idempotent/doc2.md +++ b/unison-src/transcripts/idempotent/doc2.md @@ -116,3 +116,105 @@ Format it to check that everything pretty-prints in a valid way. ``` ucm scratch/main> debug.format ``` + +``` unison :added-by-ucm scratch.u +otherDoc : a -> Doc2 +otherDoc _ = {{ yo }} + +otherTerm : Nat +otherTerm = 99 + +fulldoc : Doc2 +fulldoc = + use Nat + + {{ + Heres some text with a soft line break + + hard line break + + Here's a cool **BOLD** __italic__ ~~strikethrough~~ thing with an inline code + block `1 + 2` + + Should print with appropriate fences for the contents: + + `No fancy quotes` + + '' There are `backticks` in here '' + + ''' There are `backticks` and ''quotes'' in here ''' + + # Heading + + ## Heading 2 + + Term Link: {otherTerm} + + Type Link: {type Optional} + + Term source: + + @source{term} + + Term signature: + + @signature{term} + + * List item + + Inline code: + + `` 1 + 2 `` + + ` "doesn't typecheck" + 1 ` + + [Link](https://unison-lang.org) + + ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) + + Horizontal rule + + --- + + Video + + {{ + Special + (Embed + (Any (Video [MediaSource "test.mp4" None] [("poster", "test.png")]))) + }} + + Transclusion/evaluation: + + {{ otherDoc (a -> Word a) }} + + --- + + The following markdown features aren't supported by the Doc format yet, + but maybe will someday + + > Block quote + + Table + + | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | + + Indented Code block + + ''' + Exact whitespace should be preserved across multiple updates. Don't mess with the logo! + + _____ _ + | | |___|_|___ ___ ___ + | | | | |_ -| . | | + |_____|_|_|_|___|___|_|_| + + Line with no whitespace: + + Should have one full trailing newline below here: + + ''' + + Inline ` text literal with 1 space of padding ` in the middle of a + sentence. + }} +``` diff --git a/unison-src/transcripts/idempotent/doc2markdown.md b/unison-src/transcripts/idempotent/doc2markdown.md index 6d1da3f337..9f8a946c0f 100644 --- a/unison-src/transcripts/idempotent/doc2markdown.md +++ b/unison-src/transcripts/idempotent/doc2markdown.md @@ -89,9 +89,80 @@ Table scratch/main> add ``` -``` ucm +```` ucm scratch/main> debug.doc-to-markdown fulldoc -``` + + Heres some text with a soft line break + + hard line break + + Here's a cool **BOLD** _italic_ ~~strikethrough~~ thing with an inline code block `1 + 2` + + # Heading + + ## Heading 2 + + Term Link: `otherTerm` + + Type Link: `Optional` + + Term source: + + ```unison + term : '{g} a -> Doc2.Term + term a = Term.Term (Any a) + ``` + + + + Term signature: + + ```unison + term : '{g} a -> Doc2.Term + ``` + + + + - List item + + Inline code: + + `1 Nat.+ 2` + + ` "doesn't typecheck" + 1 ` + + [Link](https://unison-lang.org) + + ![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png) + + Horizontal rule + + --- + + Video + + ![](test.mp4) + + Transclusion/evaluation: + + yo + + + + --- + + The following markdown features aren't supported by the Doc format yet, but maybe will someday + + > Block quote + + Table + + | Header 1 | Header 2 | | -------- | -------- | | Cell 1 | Cell 2 | + + Indented Code block + + +```` You can add docs to a term or type with a top-level doc literal above the binding: @@ -109,3 +180,24 @@ unique type MyUniqueType = MyUniqueType {{ This is a structural type doc }} structural type MyStructuralType = MyStructuralType ``` + +``` ucm :added-by-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 MyStructuralType + (also named builtin.Unit) + type MyType + type MyUniqueType + MyStructuralType.doc : Doc2 + MyType.doc : Doc2 + MyUniqueType.doc : Doc2 + myTerm : Nat + myTerm.doc : Doc2 +``` diff --git a/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md b/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md index 5c87b30c7a..6672495a0b 100644 --- a/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md +++ b/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md @@ -1,5 +1,5 @@ If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrade old new` would rewrite references to -`#old` with references to `#new`. And it will... !!unless!! `#old` still exists in new. +`#old` with references to `#new`. And it will... \!\!unless\!\! `#old` still exists in new. ``` ucm :hide foo/main> builtins.merge lib.builtin @@ -12,8 +12,38 @@ lib.new.foo = 19 mything = lib.old.foo + lib.old.foo ``` +``` ucm :added-by-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`: + + lib.new.foo : Nat + lib.new.other : Nat + lib.old.foo : Nat + mything : Nat +``` + ``` ucm foo/main> add + + ⍟ I've added these definitions: + + lib.new.foo : Nat + lib.new.other : Nat + lib.old.foo : Nat + mything : Nat foo/main> upgrade old new + + I upgraded old to new, and removed old. foo/main> view mything + + mything : Nat + mything = + use Nat + + other + other ``` diff --git a/unison-src/transcripts/idempotent/duplicate-names.md b/unison-src/transcripts/idempotent/duplicate-names.md index 30d1c3c9bf..c1834160e3 100644 --- a/unison-src/transcripts/idempotent/duplicate-names.md +++ b/unison-src/transcripts/idempotent/duplicate-names.md @@ -14,6 +14,19 @@ Stream.send : a -> () Stream.send _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name Stream.send: + 2 | send : a -> () + 3 | + 4 | Stream.send : a -> () + 5 | Stream.send _ = () +``` + Term and type constructor collisions should cause a parse error. ``` unison :error @@ -23,6 +36,19 @@ X.x : a -> () X.x _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name X.x: + 1 | structural type X = x + 2 | + 3 | X.x : a -> () + 4 | X.x _ = () +``` + Ability and type constructor collisions should cause a parse error. ``` unison :error @@ -31,6 +57,17 @@ structural ability X where x : () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found two types called X: + + 1 | structural type X = x + 2 | structural ability X where + 3 | x : () +``` + Field accessors and terms with the same name should cause a parse error. ``` unison :error @@ -40,6 +77,30 @@ X.x.set = () X.x = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name X.x: + 1 | structural type X = {x : ()} + 2 | X.x.modify = () + 3 | X.x.set = () + 4 | X.x = () + + + I found multiple bindings with the name X.x.modify: + 1 | structural type X = {x : ()} + 2 | X.x.modify = () + + + I found multiple bindings with the name X.x.set: + 1 | structural type X = {x : ()} + 2 | X.x.modify = () + 3 | X.x.set = () +``` + Types and terms with the same name are allowed. ``` unison @@ -48,7 +109,33 @@ structural type X = Z X = () ``` +``` ucm :added-by-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 X + (also named builtin.Unit) + X : () +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type X + (also named builtin.Unit) + X : () scratch/main> view X + + structural type X = Z + + X : () + X = () ``` diff --git a/unison-src/transcripts/idempotent/duplicate-term-detection.md b/unison-src/transcripts/idempotent/duplicate-term-detection.md index 1113e87a5b..0e3eeebe0f 100644 --- a/unison-src/transcripts/idempotent/duplicate-term-detection.md +++ b/unison-src/transcripts/idempotent/duplicate-term-detection.md @@ -4,7 +4,6 @@ scratch/main> builtins.merge ``` - Trivial duplicate terms should be detected: ``` unison :error @@ -12,6 +11,17 @@ x = 1 x = 2 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name x: + 1 | x = 1 + 2 | x = 2 +``` + Equivalent duplicate terms should be detected: ``` unison :error @@ -19,6 +29,17 @@ x = 1 x = 1 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name x: + 1 | x = 1 + 2 | x = 1 +``` + Duplicates from record accessors/setters should be detected ``` unison :error @@ -28,6 +49,30 @@ Record.x.set = 2 Record.x.modify = 2 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name Record.x: + 1 | structural type Record = {x: Nat, y: Nat} + 2 | Record.x = 1 + + + I found multiple bindings with the name Record.x.modify: + 1 | structural type Record = {x: Nat, y: Nat} + 2 | Record.x = 1 + 3 | Record.x.set = 2 + 4 | Record.x.modify = 2 + + + I found multiple bindings with the name Record.x.set: + 1 | structural type Record = {x: Nat, y: Nat} + 2 | Record.x = 1 + 3 | Record.x.set = 2 +``` + Duplicate terms and constructors should be detected: ``` unison :error @@ -40,3 +85,21 @@ structural ability AnAbility where AnAbility.thing = 2 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ❗️ + + I found multiple bindings with the name AnAbility.thing: + 6 | thing : Nat -> () + 7 | + 8 | AnAbility.thing = 2 + + + I found multiple bindings with the name SumType.X: + 1 | structural type SumType = X + 2 | + 3 | SumType.X = 1 +``` diff --git a/unison-src/transcripts/idempotent/ed25519.md b/unison-src/transcripts/idempotent/ed25519.md index db397226ca..11bfafdd77 100644 --- a/unison-src/transcripts/idempotent/ed25519.md +++ b/unison-src/transcripts/idempotent/ed25519.md @@ -23,3 +23,34 @@ sigOkay = match signature with > signature > sigOkay ``` + +``` ucm :added-by-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`: + + down : Bytes + message : Bytes + public : Bytes + secret : Bytes + sigOkay : Either Failure Boolean + signature : Either Failure Bytes + up : Bytes + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 18 | > signature + ⧩ + Right + 0xs0b76988ce7e5147d36597d2a526ec7b8e178b3ae29083598c33c9fbcdf0f84b4ff2f8c5409123dd9a0c54447861c07e21296500a98540f5d5f15d927eaa6d30a + + 19 | > sigOkay + ⧩ + Right true +``` diff --git a/unison-src/transcripts/idempotent/edit-command.md b/unison-src/transcripts/idempotent/edit-command.md index 756805737f..70bcc562c9 100644 --- a/unison-src/transcripts/idempotent/edit-command.md +++ b/unison-src/transcripts/idempotent/edit-command.md @@ -1,8 +1,10 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` -``` unison /private/tmp/scratch.u +``` unison /private/tmp/scratch.u foo = 123 bar = 456 @@ -10,12 +12,64 @@ bar = 456 mytest = [Ok "ok"] ``` +``` ucm :added-by-ucm + + Loading changes detected in /private/tmp/scratch.u. + + I found and typechecked these definitions in + /private/tmp/scratch.u. If you do an `add` or `update`, here's + how your codebase would change: + + ⍟ These new definitions are ok to `add`: + + bar : Nat + foo : Nat + mytest : [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat + mytest : [Result] scratch/main> edit foo bar + + ☝️ + + I added 2 definitions to the top of /private/tmp/scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. scratch/main> edit mytest + + ☝️ + + I added 1 definitions to the top of /private/tmp/scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. +``` + +``` unison :added-by-ucm /private/tmp/scratch.u +bar : Nat +bar = 456 + +foo : Nat +foo = 123 +``` + +``` unison :added-by-ucm /private/tmp/scratch.u +test> mytest = [Ok "ok"] ``` ``` ucm :error scratch/main> edit missing + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + missing ``` diff --git a/unison-src/transcripts/idempotent/edit-namespace.md b/unison-src/transcripts/idempotent/edit-namespace.md index 0df25c5548..78e8f6aa2f 100644 --- a/unison-src/transcripts/idempotent/edit-namespace.md +++ b/unison-src/transcripts/idempotent/edit-namespace.md @@ -21,18 +21,130 @@ lib.project.ignoreMe = 30 unique type Foo = { bar : Nat, baz : Nat } ``` +``` ucm :added-by-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 + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo + Foo.baz : Foo -> Nat + Foo.baz.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.baz.set : Nat -> Foo -> Foo + lib.project.ignoreMe : Nat + nested.cycle.ping : Nat -> Nat + nested.cycle.ping.doc : Doc2 + nested.cycle.pong : Nat -> Nat + nested.cycle.pong.doc : Doc2 + simple.x : Nat + simple.y : Nat + toplevel : Text +``` + ``` ucm project/main> add + + ⍟ I've added these definitions: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo + Foo.baz : Foo -> Nat + Foo.baz.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.baz.set : Nat -> Foo -> Foo + lib.project.ignoreMe : Nat + nested.cycle.ping : Nat -> Nat + nested.cycle.ping.doc : Doc2 + nested.cycle.pong : Nat -> Nat + nested.cycle.pong.doc : Doc2 + simple.x : Nat + simple.y : Nat + toplevel : Text ``` `edit.namespace` edits the whole namespace (minus the top-level `lib`). ``` ucm project/main> edit.namespace + + ☝️ + + I added 8 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. +``` + +``` unison :added-by-ucm scratch.u +type Foo = { bar : Nat, baz : Nat } + +nested.cycle.ping : Nat -> Nat +nested.cycle.ping n = + use Nat + + n + nested.cycle.pong n + +nested.cycle.ping.doc : Doc2 +nested.cycle.ping.doc = {{ ping doc }} + +nested.cycle.pong : Nat -> Nat +nested.cycle.pong n = + use Nat + + n + nested.cycle.ping n + +nested.cycle.pong.doc : Doc2 +nested.cycle.pong.doc = {{ pong doc }} + +simple.x : Nat +simple.x = 10 + +simple.y : Nat +simple.y = 20 + +toplevel : Text +toplevel = "hi" ``` `edit.namespace` can also accept explicit paths ``` ucm project/main> edit.namespace nested simple + + ☝️ + + I added 6 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. +``` + +``` unison :added-by-ucm scratch.u +nested.cycle.ping : Nat -> Nat +nested.cycle.ping n = + use Nat + + n + nested.cycle.pong n + +nested.cycle.ping.doc : Doc2 +nested.cycle.ping.doc = {{ ping doc }} + +nested.cycle.pong : Nat -> Nat +nested.cycle.pong n = + use Nat + + n + nested.cycle.ping n + +nested.cycle.pong.doc : Doc2 +nested.cycle.pong.doc = {{ pong doc }} + +simple.x : Nat +simple.x = 10 + +simple.y : Nat +simple.y = 20 ``` diff --git a/unison-src/transcripts/idempotent/empty-namespaces.md b/unison-src/transcripts/idempotent/empty-namespaces.md index c979e89e72..51807308a4 100644 --- a/unison-src/transcripts/idempotent/empty-namespaces.md +++ b/unison-src/transcripts/idempotent/empty-namespaces.md @@ -10,14 +10,45 @@ scratch/main> delete.namespace mynamespace ``` The deleted namespace shouldn't appear in `ls` output. + ``` ucm :error scratch/main> ls + + nothing to show ``` + ``` ucm :error scratch/main> find.verbose + + ☝️ + + 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. + + `debug.find.global` can be used to search outside the current + namespace. ``` + ``` ucm :error scratch/main> find mynamespace + + ☝️ + + 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. + + `debug.find.global` can be used to search outside the current + namespace. ``` ## history @@ -26,6 +57,13 @@ The history of the namespace should be empty. ``` ucm scratch/main> history mynamespace + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #sg60bvjo91 (start of history) ``` Add and then delete a term to add some history to a deleted namespace. @@ -46,13 +84,29 @@ I should be allowed to fork over a deleted namespace ``` ucm scratch/main> fork stuff deleted + + Done. ``` The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ``` ucm scratch/main> history stuff + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #q2dq4tsno1 (start of history) scratch/main> history deleted + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #q2dq4tsno1 (start of history) ``` ## move.namespace @@ -71,7 +125,25 @@ The history should be that of the moved namespace. ``` ucm scratch/main> delete.namespace moveoverme + + Done. scratch/main> history moveme + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #c5uisu4kll (start of history) scratch/main> move.namespace moveme moveoverme + + Done. scratch/main> history moveoverme + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #c5uisu4kll (start of history) ``` diff --git a/unison-src/transcripts/idempotent/emptyCodebase.md b/unison-src/transcripts/idempotent/emptyCodebase.md index 822846f924..6492740f26 100644 --- a/unison-src/transcripts/idempotent/emptyCodebase.md +++ b/unison-src/transcripts/idempotent/emptyCodebase.md @@ -2,26 +2,37 @@ The Unison codebase, when first initialized, contains no definitions in its namespace. -Not even `Nat` or `+`! +Not even `Nat` or `+`\! -BEHOLD!!! +BEHOLD\!\!\! ``` ucm :error scratch/main> ls + + nothing to show ``` Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ``` ucm scratch/main> builtins.merge lib.builtins + + Done. scratch/main> ls lib + + 1. builtins/ (469 terms, 74 types) ``` And for a limited time, you can get even more builtin goodies: ``` ucm scratch/main> builtins.mergeio lib.builtinsio + + Done. scratch/main> ls lib + + 1. builtins/ (469 terms, 74 types) + 2. builtinsio/ (643 terms, 92 types) ``` More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/idempotent/error-messages.md b/unison-src/transcripts/idempotent/error-messages.md index 6a13333931..1496829a52 100644 --- a/unison-src/transcripts/idempotent/error-messages.md +++ b/unison-src/transcripts/idempotent/error-messages.md @@ -14,54 +14,189 @@ Some basic errors of literals. x = 1. -- missing some digits after the decimal ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 1. -- missing some digits after the decimal + + I was expecting some digits after the `.` , for example: `1.0` + or `1.1e37`. +``` + ``` unison :error x = 1e -- missing an exponent ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 1e -- missing an exponent + + I was expecting some digits for the exponent, for example: + `1e37`. +``` + ``` unison :error x = 1e- -- missing an exponent ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 1e- -- missing an exponent + + I was expecting some digits for the exponent, for example: + `1e-37`. +``` + ``` unison :error x = 1E+ -- missing an exponent ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 1E+ -- missing an exponent + + I was expecting some digits for the exponent, for example: + `1e+37`. +``` + ### Hex, octal, binary, and bytes literals ``` unison :error x = 0xoogabooga -- invalid hex chars ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 0xoogabooga -- invalid hex chars + + I was expecting only hexidecimal characters (one of + 0123456789abcdefABCDEF) after the 0x. +``` + ``` unison :error x = 0o987654321 -- 9 and 8 are not valid octal char ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 0o987654321 -- 9 and 8 are not valid octal char + + I was expecting only octal characters (one of 01234567) after + the 0o. +``` + ``` unison :error x = 0b3201 -- 3 and 2 are not valid binary chars ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This number isn't valid syntax: + + 1 | x = 0b3201 -- 3 and 2 are not valid binary chars + + I was expecting only binary characters (one of 01) after the + 0b. +``` + ``` unison :error x = 0xsf -- odd number of hex chars in a bytes literal ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This bytes literal isn't valid syntax: 0xsf + + 1 | x = 0xsf -- odd number of hex chars in a bytes literal + + I was expecting an even number of hexidecimal characters (one + of 0123456789abcdefABCDEF) after the 0xs. +``` + ``` unison :error x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This bytes literal isn't valid syntax: 0xsnotvalidhexchars + + 1 | x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal + + I was expecting an even number of hexidecimal characters (one + of 0123456789abcdefABCDEF) after the 0xs. +``` + ### Layout errors ``` unison :error foo = else -- not matching if ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a closing 'else' here without a matching 'then'. + + 1 | foo = else -- not matching if +``` + ``` unison :error foo = then -- unclosed ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a closing 'then' here without a matching 'if'. + + 1 | foo = then -- unclosed +``` + ``` unison :error foo = with -- unclosed ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a closing 'with' here without a matching 'handle' or 'match'. + + 1 | foo = with -- unclosed +``` + ### Matching ``` unison :error @@ -69,11 +204,39 @@ foo = with -- unclosed foo = match 1 with ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | foo = match 1 with + + + Patterns not matched: + * _ +``` + ``` unison :error foo = match 1 with 2 -- no right-hand-side ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 3 | + + I was surprised to find an end of section here. + I was expecting one of these instead: + + * "," + * case match + * pattern guard +``` + ``` unison :error -- Mismatched arities foo = cases @@ -81,6 +244,20 @@ foo = cases 3 -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + 😶 + + Not all the branches of this pattern matching have the same + number of arguments. I was assuming they'd all have 2 + arguments (based on the previous patterns) but this one has + 1 arguments: + 4 | 3 -> () + +``` + ``` unison :error -- Missing a '->' x = match Some a with @@ -90,6 +267,25 @@ x = match Some a with 2 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 7 | + + I was surprised to find an end of section here. + I was expecting one of these instead: + + * "," + * blank + * case match + * false + * pattern guard + * true +``` + ``` unison :error -- Missing patterns x = match Some a with @@ -98,6 +294,22 @@ x = match Some a with -> 3 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 4 | -> 2 + + + I was surprised to find a -> here. + I was expecting one of these instead: + + * end of input + * newline or semicolon +``` + ``` unison :error -- Guards following an unguarded case x = match Some a with @@ -105,6 +317,22 @@ x = match Some a with | true -> 2 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 4 | | true -> 2 + + + I was surprised to find a '|' here. + I was expecting one of these instead: + + * end of input + * newline or semicolon +``` + ### Watches ``` unison :error @@ -112,13 +340,52 @@ x = match Some a with > ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I expected a non-empty watch expression and not just ">" + + 2 | > +``` + ### Keywords ``` unison :error use.keyword.in.namespace = 1 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The identifier `namespace` used here is a reserved keyword: + + 1 | use.keyword.in.namespace = 1 + + You can avoid this problem either by renaming the identifier + or wrapping it in backticks (like `namespace` ). +``` + ``` unison :error -- reserved operator a ! b = 1 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This looks like the start of an expression here + + 2 | a ! b = 1 + + but at the file top-level, I expect one of the following: + + - A binding, like a = 42 OR + a : Nat + a = 42 + - A watch expression, like > a + 1 + - An `ability` declaration, like unique ability Foo where ... + - A `type` declaration, like structural type Optional a = None | Some a +``` diff --git a/unison-src/transcripts/idempotent/escape-sequences.md b/unison-src/transcripts/idempotent/escape-sequences.md index b4b1e97b35..fdc05a5045 100644 --- a/unison-src/transcripts/idempotent/escape-sequences.md +++ b/unison-src/transcripts/idempotent/escape-sequences.md @@ -3,3 +3,27 @@ > "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" > "古池や蛙飛びこむ水の音" ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > "Rúnar" + ⧩ + "Rúnar" + + 2 | > "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" + ⧩ + "῎Ανδρα μοι ἔννεπε, Μοῦσα, πολύτροπον" + + 3 | > "古池や蛙飛びこむ水の音" + ⧩ + "古池や蛙飛びこむ水の音" +``` diff --git a/unison-src/transcripts/idempotent/find-by-type.md b/unison-src/transcripts/idempotent/find-by-type.md index 8906b80d0e..d4a8f1a26f 100644 --- a/unison-src/transcripts/idempotent/find-by-type.md +++ b/unison-src/transcripts/idempotent/find-by-type.md @@ -18,10 +18,34 @@ baz = cases ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type A + bar : Text -> A + baz : A -> Text + foo : A scratch/main> find : Text -> A + + 1. bar : Text -> A + 2. A.A : Text -> A scratch/main> find : A -> Text + + 1. baz : A -> Text scratch/main> find : A + + 1. foo : A ``` + ``` ucm :error scratch/main> find : Text + + ☝️ + + I couldn't find exact type matches, resorting to fuzzy + matching... + + 1. bar : Text -> A + 2. baz : A -> Text + 3. A.A : Text -> A ``` diff --git a/unison-src/transcripts/idempotent/find-command.md b/unison-src/transcripts/idempotent/find-command.md index f484be087e..ad1cb6727f 100644 --- a/unison-src/transcripts/idempotent/find-command.md +++ b/unison-src/transcripts/idempotent/find-command.md @@ -18,26 +18,74 @@ scratch/main> add ``` ucm scratch/main> find foo + + 1. cat.foo : Nat + 2. foo : Nat scratch/main> view 1 + + cat.foo : Nat + cat.foo = 4 scratch/main> find.all foo + + 1. cat.foo : Nat + 2. cat.lib.foo : Nat + 3. lib.foo : Nat + 4. foo : Nat scratch/main> view 1 + + cat.foo : Nat + cat.foo = 4 ``` ``` ucm scratch/main> find-in cat foo + + 1. foo : Nat scratch/main> view 1 + + cat.foo : Nat + cat.foo = 4 scratch/main> find-in.all cat foo + + 1. lib.foo : Nat + 2. foo : Nat scratch/main> view 1 + + cat.lib.foo : Nat + cat.lib.foo = 5 ``` Finding within a namespace ``` ucm scratch/main> find bar + + 1. somewhere.bar : Nat scratch/other> debug.find.global bar + + Found results in scratch/main + + 1. .cat.lib.bar : Nat + 2. .lib.bar : Nat + 3. .somewhere.bar : Nat scratch/main> find-in somewhere bar + + 1. bar : Nat ``` ``` ucm :error scratch/main> find baz + + ☝️ + + 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. + + `debug.find.global` can be used to search outside the current + namespace. ``` diff --git a/unison-src/transcripts/idempotent/fix-1381-excess-propagate.md b/unison-src/transcripts/idempotent/fix-1381-excess-propagate.md index 8f3f347a87..b724b01f05 100644 --- a/unison-src/transcripts/idempotent/fix-1381-excess-propagate.md +++ b/unison-src/transcripts/idempotent/fix-1381-excess-propagate.md @@ -1,6 +1,7 @@ We were seeing an issue where (it seemed) that every namespace that was visited during a propagate would get a new history node, even when it didn't contain any dependents. Example: + ``` unison :hide a = "a term" X.foo = "a namespace" @@ -8,21 +9,47 @@ X.foo = "a namespace" ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + X.foo : ##Text + a : ##Text ``` Here is an update which should not affect `X`: + ``` unison :hide a = "an update" ``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; + ``` ucm scratch/main> history X + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #das1se4g2i (start of history) ``` + however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: + ``` ucm :error scratch/main> history #7nl6ppokhg + + 😶 + + I don't know of a namespace with that hash. ``` diff --git a/unison-src/transcripts/idempotent/fix-5267.md b/unison-src/transcripts/idempotent/fix-5267.md index 16720ae8c8..475180d672 100644 --- a/unison-src/transcripts/idempotent/fix-5267.md +++ b/unison-src/transcripts/idempotent/fix-5267.md @@ -10,12 +10,38 @@ bar : Nat bar = direct.foo + direct.foo ``` +``` ucm :added-by-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`: + + bar : Nat + lib.direct.foo : Nat + lib.direct.lib.indirect.foo : Nat +``` + Here, `bar` renders as `foo + foo`, even though there are two names with suffix `foo` in scope, because one is an indirect dependency. It used to render as `direct.foo + direct.foo`. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + lib.direct.foo : Nat + lib.direct.lib.indirect.foo : Nat scratch/main> view bar + + bar : Nat + bar = + use Nat + + foo + foo ``` Same test, but for types. @@ -27,7 +53,30 @@ type lib.direct.lib.indirect.Foo = MkFoo type Bar = MkBar direct.Foo ``` +``` ucm :added-by-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 Bar + type lib.direct.Foo + type lib.direct.lib.indirect.Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Bar + type lib.direct.Foo + type lib.direct.lib.indirect.Foo scratch/main> view Bar + + type Bar = MkBar Foo ``` diff --git a/unison-src/transcripts/idempotent/fix-5301.md b/unison-src/transcripts/idempotent/fix-5301.md index 7af0e8f21b..be2a126470 100644 --- a/unison-src/transcripts/idempotent/fix-5301.md +++ b/unison-src/transcripts/idempotent/fix-5301.md @@ -3,6 +3,8 @@ letter) that is either not found or ambiguouus fails. Previously, it would be tr ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison :error @@ -13,6 +15,23 @@ foo = cases Bar X -> 5 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + + ❓ + + I couldn't resolve any of these symbols: + + 5 | Bar X -> 5 + + + Symbol Suggestions + + X No matches +``` + ``` unison :error type Foo = Bar A type A = X @@ -22,3 +41,21 @@ foo : Foo -> Nat foo = cases Bar X -> 5 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + + ❓ + + I couldn't resolve any of these symbols: + + 7 | Bar X -> 5 + + + Symbol Suggestions + + X A.X + B.X +``` diff --git a/unison-src/transcripts/idempotent/fix-5312.md b/unison-src/transcripts/idempotent/fix-5312.md index 8edb1375a8..710cf258c2 100644 --- a/unison-src/transcripts/idempotent/fix-5312.md +++ b/unison-src/transcripts/idempotent/fix-5312.md @@ -3,6 +3,8 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison @@ -14,14 +16,60 @@ b.y = x + 1 c = b.y + 1 ``` +``` ucm :added-by-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.y : Nat + b.y : Nat + c : Nat + x : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a.y : Nat + b.y : Nat + c : Nat + x : Nat ``` ``` unison x = 100 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix-5320.md b/unison-src/transcripts/idempotent/fix-5320.md index 03c4ca50c4..a4142f5c3a 100644 --- a/unison-src/transcripts/idempotent/fix-5320.md +++ b/unison-src/transcripts/idempotent/fix-5320.md @@ -1,8 +1,27 @@ ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison :error foo = cases bar.Baz -> 5 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + + ❓ + + I couldn't resolve any of these symbols: + + 2 | bar.Baz -> 5 + + + Symbol Suggestions + + bar.Baz No matches +``` diff --git a/unison-src/transcripts/idempotent/fix-5323.md b/unison-src/transcripts/idempotent/fix-5323.md index 68d808b5ba..873797fadc 100644 --- a/unison-src/transcripts/idempotent/fix-5323.md +++ b/unison-src/transcripts/idempotent/fix-5323.md @@ -3,6 +3,8 @@ render as `c = y + 1` (ambiguous). ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison @@ -15,10 +17,37 @@ b.y = lib.old.x + 1 c = b.y + 1 ``` +``` ucm :added-by-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.y : Nat + b.y : Nat + c : Nat + lib.new.x : Nat + lib.old.x : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a.y : Nat + b.y : Nat + c : Nat + lib.new.x : Nat + lib.old.x : Nat ``` ``` ucm scratch/main> upgrade old new + + I upgraded old to new, and removed old. ``` diff --git a/unison-src/transcripts/idempotent/fix-5326.md b/unison-src/transcripts/idempotent/fix-5326.md index 30ed96c391..71e7894ed9 100644 --- a/unison-src/transcripts/idempotent/fix-5326.md +++ b/unison-src/transcripts/idempotent/fix-5326.md @@ -1,18 +1,42 @@ ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison x = 1 ``` +``` ucm :added-by-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 scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> branch foo -scratch/main> -``` + Done. I've created the foo branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /foo`. ``` + +``` main, foo | A @@ -22,13 +46,36 @@ A x = 2 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> branch bar -scratch/main> -``` + Done. I've created the bar branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /bar`. ``` + +``` main, bar | | foo @@ -40,11 +87,30 @@ B - A x = 3 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm scratch/main> update -``` + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` + +``` main | | bar foo @@ -56,12 +122,30 @@ C - B - A x = 4 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm scratch/main> update -scratch/foo> -``` + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` + +``` main | | bar foo @@ -73,11 +157,29 @@ D - C - B - A y = 5 ``` +``` ucm :added-by-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 scratch/foo> update -``` + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` + +``` main | | bar @@ -91,9 +193,11 @@ D - C - B - A ``` ucm scratch/main> merge /foo -``` + I merged scratch/foo into scratch/main. ``` + +``` main | | bar @@ -107,12 +211,16 @@ F - D - C - B - A ``` ucm scratch/main> merge /bar + + 😶 + + scratch/main was already up-to-date with scratch/bar. ``` This should be a fast-forward, but we used to get this shape instead (which fails due to conflicts), because we incorrectly computed `LCA(main, bar)` as `A`, not `B`. -``` +``` main | | ------------ bar diff --git a/unison-src/transcripts/idempotent/fix-5340.md b/unison-src/transcripts/idempotent/fix-5340.md index 51c1962ab5..f4825dcdbc 100644 --- a/unison-src/transcripts/idempotent/fix-5340.md +++ b/unison-src/transcripts/idempotent/fix-5340.md @@ -10,8 +10,31 @@ my.foo = 17 lib.dep.lib.dep.foo = 18 ``` +``` ucm :added-by-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 lib.dep.lib.dep.Foo + type my.Foo + lib.dep.lib.dep.foo : Nat + my.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type lib.dep.lib.dep.Foo + type my.Foo + lib.dep.lib.dep.foo : Nat + my.foo : Nat ``` These references to type `Foo` and term `foo` are unambiguous (resolving to the `my.Foo` and `my.foo` in the @@ -22,7 +45,37 @@ type my.Foo = MkFoo type Bar = MkBar Foo ``` +``` ucm :added-by-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: + + ⊡ Previously added definitions will be ignored: my.Foo + + ⍟ These new definitions are ok to `add`: + + type Bar +``` + ``` unison my.foo = 17 bar = foo Nat.+ foo ``` + +``` ucm :added-by-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: + + ⊡ Previously added definitions will be ignored: my.foo + + ⍟ These new definitions are ok to `add`: + + bar : Nat +``` diff --git a/unison-src/transcripts/idempotent/fix-5357.md b/unison-src/transcripts/idempotent/fix-5357.md index 2018b51e60..ad9c45ca93 100644 --- a/unison-src/transcripts/idempotent/fix-5357.md +++ b/unison-src/transcripts/idempotent/fix-5357.md @@ -8,8 +8,27 @@ foo = ignore 4 ``` +``` ucm :added-by-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 : () + util.ignore : a -> () +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : () + util.ignore : a -> () ``` ``` unison @@ -17,8 +36,50 @@ lib.base.ignore : a -> () lib.base.ignore _ = () ``` +``` ucm :added-by-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`: + + lib.base.ignore : a -> () + (also named util.ignore) +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.base.ignore : a -> () + (also named util.ignore) scratch/main> edit.namespace + + ☝️ + + I added 2 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. scratch/main> load + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. +``` + +``` unison :added-by-ucm scratch.u +foo : () +foo = + use util ignore + ignore 3 + ignore 4 + +util.ignore : a -> () +util.ignore _ = () ``` diff --git a/unison-src/transcripts/idempotent/fix-5369.md b/unison-src/transcripts/idempotent/fix-5369.md index 2f5834060e..6559b94f26 100644 --- a/unison-src/transcripts/idempotent/fix-5369.md +++ b/unison-src/transcripts/idempotent/fix-5369.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,27 @@ two.foo : Text two.foo = "blah" ``` +``` ucm :added-by-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.foo : Nat + two.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + one.foo : Nat + two.foo : Text ``` ``` unison @@ -21,3 +42,21 @@ one.foo = 18 bar : Nat bar = foo + foo ``` + +``` ucm :added-by-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`: + + bar : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + one.foo : Nat +``` diff --git a/unison-src/transcripts/idempotent/fix-5374.md b/unison-src/transcripts/idempotent/fix-5374.md index 689b8834ff..a22dc8f370 100644 --- a/unison-src/transcripts/idempotent/fix-5374.md +++ b/unison-src/transcripts/idempotent/fix-5374.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison @@ -9,8 +11,50 @@ lib.direct.lib.indirect.foo = 18 thing = indirect.foo + indirect.foo ``` +``` ucm :added-by-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`: + + lib.direct.foo : Nat + lib.direct.lib.indirect.foo : Nat + thing : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.direct.foo : Nat + lib.direct.lib.indirect.foo : Nat + thing : Nat scratch/main> view thing + + thing : Nat + thing = + use Nat + + use indirect foo + foo + foo scratch/main> edit thing + + ☝️ + + I added 1 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. +``` + +``` unison :added-by-ucm scratch.u +thing : Nat +thing = + use Nat + + use indirect foo + foo + foo ``` diff --git a/unison-src/transcripts/idempotent/fix-5380.md b/unison-src/transcripts/idempotent/fix-5380.md index 539f634e65..f24dcaa513 100644 --- a/unison-src/transcripts/idempotent/fix-5380.md +++ b/unison-src/transcripts/idempotent/fix-5380.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge lib.builtin + + Done. ``` ``` unison @@ -13,8 +15,36 @@ bar = foo + qux ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat scratch/main> move.term foo qux + + Done. scratch/main> view bar + + bar : Nat + bar = + use Nat + + qux : Nat + qux = 18 + .qux + qux ``` diff --git a/unison-src/transcripts/idempotent/fix-big-list-crash.md b/unison-src/transcripts/idempotent/fix-big-list-crash.md index 7008d80142..1ab91c73a7 100644 --- a/unison-src/transcripts/idempotent/fix-big-list-crash.md +++ b/unison-src/transcripts/idempotent/fix-big-list-crash.md @@ -11,3 +11,17 @@ unique type Direction = U | D | L | R x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U,336),(L,697),(D,682),(L,180),(U,951),(L,189),(D,547),(R,697),(U,583),(L,172),(D,859),(L,370),(D,114),(L,519),(U,829),(R,389),(U,608),(R,66),(D,634),(L,320),(D,49),(L,931),(U,137),(L,349),(D,689),(L,351),(D,829),(R,819),(D,138),(L,118),(D,849),(R,230),(U,858),(L,509),(D,311),(R,815),(U,217),(R,359),(U,840),(R,77),(U,230),(R,361),(U,322),(R,300),(D,646),(R,348),(U,815),(R,793),(D,752),(R,967),(U,128),(R,948),(D,499),(R,359),(U,572),(L,566),(U,815),(R,630),(D,290),(L,829),(D,736),(R,358),(U,778),(R,891),(U,941),(R,544),(U,889),(L,920),(U,913),(L,447),(D,604),(R,538),(U,818),(L,215),(D,437),(R,447),(U,576),(R,452),(D,794),(R,864),(U,269),(L,325),(D,35),(L,268),(D,639),(L,101),(U,777),(L,776),(U,958),(R,105),(U,517),(R,667),(D,423),(R,603),(U,469),(L,125),(D,919),(R,879),(U,994),(R,665),(D,377),(R,456),(D,570),(L,685),(U,291),(R,261),(U,846),(R,840),(U,418),(L,974),(D,270),(L,312),(D,426),(R,621),(D,334),(L,855),(D,378),(R,694),(U,845),(R,481),(U,895),(L,362),(D,840),(L,712),(U,57),(R,276),(D,643),(R,566),(U,348),(R,361),(D,144),(L,287),(D,864),(L,556),(U,610),(L,927),(U,322),(R,271),(D,90),(L,741),(U,446),(R,181),(D,527),(R,56),(U,805),(L,907),(D,406),(L,286),(U,873),(L,79),(D,280),(L,153),(D,377),(R,253),(D,61),(R,475),(D,804),(R,788),(U,393),(L,660),(U,314),(R,489),(D,491),(L,234),(D,712),(L,253),(U,651),(L,777),(D,726),(R,146),(U,47),(R,630),(U,517),(R,226),(U,624),(L,834),(D,153),(L,513),(U,799),(R,287),(D,868),(R,982),(U,390),(L,296),(D,373),(R,9),(U,994),(R,105),(D,673),(L,657),(D,868),(R,738),(D,277),(R,374),(U,828),(R,860),(U,247),(R,484),(U,986),(L,723),(D,847),(L,578),(U,487),(L,51),(D,865),(L,328),(D,199),(R,812),(D,726),(R,355),(D,463),(R,761),(U,69),(R,508),(D,753),(L,81),(D,50),(L,345),(D,66),(L,764),(D,466),(L,975),(U,619),(R,59),(D,788),(L,737),(D,360),(R,14),(D,253),(L,512),(D,417),(R,828),(D,188),(L,394),(U,212),(R,658),(U,369),(R,920),(U,927),(L,339),(U,552),(R,856),(D,458),(R,407),(U,41),(L,930),(D,460),(R,809),(U,467),(L,410),(D,800),(L,135),(D,596),(R,678),(D,4),(L,771),(D,637),(L,876),(U,192),(L,406),(D,136),(R,666),(U,730),(R,711),(D,291),(L,586),(U,845),(R,606),(U,2),(L,228),(D,759),(R,244),(U,946),(R,948),(U,160),(R,397),(U,134),(R,188),(U,850),(R,623),(D,315),(L,219),(D,450),(R,489),(U,374),(R,299),(D,474),(L,767),(D,679),(L,160),(D,403),(L,708)] ``` + +``` ucm :added-by-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 Direction + x : [(Direction, Nat)] +``` diff --git a/unison-src/transcripts/idempotent/fix-ls.md b/unison-src/transcripts/idempotent/fix-ls.md index fcafe9a65d..a6b134972c 100644 --- a/unison-src/transcripts/idempotent/fix-ls.md +++ b/unison-src/transcripts/idempotent/fix-ls.md @@ -1,5 +1,7 @@ ``` ucm test-ls/main> builtins.merge + + Done. ``` ``` unison @@ -8,8 +10,32 @@ foo.bar.add x y = x Int.+ y foo.bar.subtract x y = x Int.- y ``` +``` ucm :added-by-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.bar.add : Int -> Int -> Int + foo.bar.subtract : Int -> Int -> Int +``` + ``` ucm test-ls/main> add + + ⍟ I've added these definitions: + + foo.bar.add : Int -> Int -> Int + foo.bar.subtract : Int -> Int -> Int test-ls/main> ls foo + + 1. bar/ (2 terms) test-ls/main> ls 1 + + 1. add (Int -> Int -> Int) + 2. subtract (Int -> Int -> Int) ``` diff --git a/unison-src/transcripts/idempotent/fix1063.md b/unison-src/transcripts/idempotent/fix1063.md index d7b310105b..03399ce4a0 100644 --- a/unison-src/transcripts/idempotent/fix1063.md +++ b/unison-src/transcripts/idempotent/fix1063.md @@ -12,7 +12,31 @@ use Boolean not noop = not `.` not ``` +``` ucm :added-by-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`: + + `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o + noop : Boolean -> Boolean +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o + noop : Boolean -> Boolean scratch/main> view noop + + noop : Boolean -> Boolean + noop = + use Boolean not + not `.` not ``` diff --git a/unison-src/transcripts/idempotent/fix1327.md b/unison-src/transcripts/idempotent/fix1327.md index 3336b806c5..f93ab84b4c 100644 --- a/unison-src/transcripts/idempotent/fix1327.md +++ b/unison-src/transcripts/idempotent/fix1327.md @@ -4,12 +4,44 @@ foo = 4 bar = 5 ``` +``` ucm :added-by-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`: + + bar : ##Nat + foo : ##Nat +``` + `alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones. Now `ls` returns a pair of the absolute search directory and the result relative to that search directory, so it can be used in both absolute and relative contexts. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : ##Nat + foo : ##Nat scratch/main> ls + + 1. bar (##Nat) + 2. foo (##Nat) scratch/main> alias.many 1-2 .ns1_nohistory + + Here's what changed in .ns1_nohistory : + + Added definitions: + + 1. bar : ##Nat + 2. foo : ##Nat + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. ``` diff --git a/unison-src/transcripts/idempotent/fix1334.md b/unison-src/transcripts/idempotent/fix1334.md index 5b537c38cf..f0475b4de6 100644 --- a/unison-src/transcripts/idempotent/fix1334.md +++ b/unison-src/transcripts/idempotent/fix1334.md @@ -1,4 +1,4 @@ -Previously, the `alias.term` and `alias.type` would fail if the source argument was hash-only, and there was no way to create an alias for a definition that didn't already have a name. Also, the `replace.term` and `replace.type` _only_ worked on hashes, and they had to be _full_ hashes. +Previously, the `alias.term` and `alias.type` would fail if the source argument was hash-only, and there was no way to create an alias for a definition that didn't already have a name. Also, the `replace.term` and `replace.type` *only* worked on hashes, and they had to be *full* hashes. With this PR, the source of an alias can be a short hash (even of a definition that doesn't currently have a name in the namespace) along with a name or hash-qualified name from the current namespace as usual. @@ -6,5 +6,9 @@ Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ``` ucm scratch/main> alias.type ##Nat Cat + + Done. scratch/main> alias.term ##Nat.+ please_fix_763.+ + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix1390.md b/unison-src/transcripts/idempotent/fix1390.md index cb9a318e6a..40ae203bca 100644 --- a/unison-src/transcripts/idempotent/fix1390.md +++ b/unison-src/transcripts/idempotent/fix1390.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -11,9 +13,33 @@ List.map f = go [] ``` +``` ucm :added-by-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.map : (i ->{g} o) -> [i] ->{g} [o] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + List.map : (i ->{g} o) -> [i] ->{g} [o] scratch/main> view List.map + + List.map : (i ->{g} o) -> [i] ->{g} [o] + List.map f = + go acc = cases + [] -> acc + h +: t -> go (acc :+ f h) t + go [] ``` ``` unison @@ -25,3 +51,16 @@ List.map2 f = h +: t -> go (acc :+ f h) t go [] ``` + +``` ucm :added-by-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.map2 : (g ->{h} g2) -> [g] ->{h} [g2] +``` diff --git a/unison-src/transcripts/idempotent/fix1421.md b/unison-src/transcripts/idempotent/fix1421.md index cc3cf3f3fe..d372af4910 100644 --- a/unison-src/transcripts/idempotent/fix1421.md +++ b/unison-src/transcripts/idempotent/fix1421.md @@ -1,8 +1,27 @@ - ``` ucm - scratch/main> alias.type ##Nat Nat - scratch/main> alias.term ##Nat.+ Nat.+ - ``` - ``` unison - unique type A = A Nat - unique type B = B Nat Nat - ``` +``` ucm +scratch/main> alias.type ##Nat Nat + + Done. +scratch/main> alias.term ##Nat.+ Nat.+ + + Done. +``` + +``` unison +unique type A = A Nat +unique type B = B Nat Nat +``` + +``` ucm :added-by-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 A + type B +``` diff --git a/unison-src/transcripts/idempotent/fix1532.md b/unison-src/transcripts/idempotent/fix1532.md index 44ab37140b..6d44d627e5 100644 --- a/unison-src/transcripts/idempotent/fix1532.md +++ b/unison-src/transcripts/idempotent/fix1532.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` First, lets create two namespaces. `foo` and `bar`, and add some definitions. @@ -10,31 +12,76 @@ foo.y = 100 bar.z = x + y ``` +``` ucm :added-by-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`: + + bar.z : Nat + foo.x : Nat + foo.y : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar.z : Nat + foo.x : Nat + foo.y : Nat ``` Let's see what we have created... ``` ucm scratch/main> ls + + 1. bar/ (1 term) + 2. builtin/ (469 terms, 74 types) + 3. foo/ (2 terms) ``` Now, if we try deleting the namespace `foo`, we get an error, as expected. ``` ucm :error scratch/main> delete.namespace foo + + ⚠️ + + I didn't delete the namespace because the following + definitions are still in use. + + Dependency Referenced In + x 1. bar.z + + y 2. bar.z + + If you want to proceed anyways and leave those definitions + without names, use delete.namespace.force ``` Any numbered arguments should refer to `bar.z`. ``` ucm scratch/main> debug.numberedArgs + + 1. bar.z + 2. bar.z ``` We can then delete the dependent term, and then delete `foo`. ``` ucm scratch/main> delete.term 1 + + Done. scratch/main> delete.namespace foo + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix1696.md b/unison-src/transcripts/idempotent/fix1696.md index 2f1a9995f8..4461c47c64 100644 --- a/unison-src/transcripts/idempotent/fix1696.md +++ b/unison-src/transcripts/idempotent/fix1696.md @@ -19,3 +19,12 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") > dialog ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. + + 13 | dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") +``` diff --git a/unison-src/transcripts/idempotent/fix1709.md b/unison-src/transcripts/idempotent/fix1709.md index 6a81587a16..5b73cc3a96 100644 --- a/unison-src/transcripts/idempotent/fix1709.md +++ b/unison-src/transcripts/idempotent/fix1709.md @@ -6,10 +6,45 @@ id2 x = id x ``` +``` ucm :added-by-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`: + + id : x -> x + id2 : x -> x +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + id : x -> x + id2 : x -> x ``` ``` unison > id2 "hi" ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > id2 "hi" + ⧩ + "hi" +``` diff --git a/unison-src/transcripts/idempotent/fix1731.md b/unison-src/transcripts/idempotent/fix1731.md index 01a0a4f0d3..45341bc675 100644 --- a/unison-src/transcripts/idempotent/fix1731.md +++ b/unison-src/transcripts/idempotent/fix1731.md @@ -19,3 +19,16 @@ repro : Text -> () repro = cases input -> () ``` + +``` ucm :added-by-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`: + + repro : Text -> () +``` diff --git a/unison-src/transcripts/idempotent/fix1800.md b/unison-src/transcripts/idempotent/fix1800.md index 5717967a48..ee969c0eed 100644 --- a/unison-src/transcripts/idempotent/fix1800.md +++ b/unison-src/transcripts/idempotent/fix1800.md @@ -21,25 +21,50 @@ main3 _ = printLine "🦄 ☁️ 🌈" Testing a few variations here: -* Should be able to run annotated and unannotated main functions in the current file. -* Should be able to run annotated and unannotated main functions from the codebase. + - Should be able to run annotated and unannotated main functions in the current file. + - Should be able to run annotated and unannotated main functions from the codebase. ``` ucm scratch/main> run main1 + + () scratch/main> run main2 + + () scratch/main> run main3 + + () scratch/main> add + + ⍟ I've added these definitions: + + main1 : '{IO} () + main2 : ∀ _. _ ->{IO} () + main3 : '{IO} () + printLine : Text ->{IO} () scratch/main> rename.term main1 code.main1 + + Done. scratch/main> rename.term main2 code.main2 + + Done. scratch/main> rename.term main3 code.main3 + + Done. ``` The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ``` ucm 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,8 +81,28 @@ This shouldn't work since `main4` and `main5` don't have the right type. ``` ucm :error scratch/main> run main4 + + 😶 + + I found this function: + + main4 : Nat ->{IO} Nat + + but in order for me to `run` it needs to be a subtype of: + + main4 : '{IO, Exception} result ``` ``` ucm :error scratch/main> run main5 + + 😶 + + I found this function: + + main5 : Nat ->{IO} () + + but in order for me to `run` it needs to be a subtype of: + + main5 : '{IO, Exception} result ``` diff --git a/unison-src/transcripts/idempotent/fix1844.md b/unison-src/transcripts/idempotent/fix1844.md index efa25fed25..60a97a6e2f 100644 --- a/unison-src/transcripts/idempotent/fix1844.md +++ b/unison-src/transcripts/idempotent/fix1844.md @@ -8,3 +8,26 @@ snoc k aN = match k with > snoc (One 1) 2 ``` + +``` ucm :added-by-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 One a + type Woot a b c + type Z + snoc : One a -> aN -> Woot (One a) (One aN) ##Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 8 | > snoc (One 1) 2 + ⧩ + Woot (One 1) (One 2) 99 +``` diff --git a/unison-src/transcripts/idempotent/fix1926.md b/unison-src/transcripts/idempotent/fix1926.md index 41ba336685..0363045c97 100644 --- a/unison-src/transcripts/idempotent/fix1926.md +++ b/unison-src/transcripts/idempotent/fix1926.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -8,8 +10,48 @@ scratch/main> builtins.merge sq = 2934892384 ``` +``` ucm :added-by-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`: + + sq : Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > 'sq + ⧩ + do sq +``` + ``` unison > 'sq sq = 2934892384 ``` + +``` ucm :added-by-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`: + + sq : Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > 'sq + ⧩ + do sq +``` diff --git a/unison-src/transcripts/idempotent/fix2026.md b/unison-src/transcripts/idempotent/fix2026.md index 62351bfb35..eb9ec090e5 100644 --- a/unison-src/transcripts/idempotent/fix2026.md +++ b/unison-src/transcripts/idempotent/fix2026.md @@ -39,6 +39,36 @@ Exception.unsafeRun! e _ = handle !e with h ``` +``` ucm :added-by-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 ability Exception + (also named builtin.Exception) + Exception.unsafeRun! : '{g, Exception} a -> '{g} a + compose2 : (c ->{𝕖1} d) + -> (a ->{𝕖2} b ->{𝕖3} c) + -> a + -> b + ->{𝕖1, 𝕖2, 𝕖3} d + ex : '{IO} () + printLine : Text ->{IO, Exception} () + putBytes : Handle + -> Bytes + ->{IO, Exception} () + putText : Handle -> Text ->{IO, Exception} () + stdOut : Handle + toException : Either Failure a ->{Exception} a +``` + ``` ucm scratch/main> run ex + + () ``` diff --git a/unison-src/transcripts/idempotent/fix2027.md b/unison-src/transcripts/idempotent/fix2027.md index 4e5fcda67b..fe4095adbf 100644 --- a/unison-src/transcripts/idempotent/fix2027.md +++ b/unison-src/transcripts/idempotent/fix2027.md @@ -48,6 +48,50 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` +``` ucm :added-by-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 Either a b + (also named builtin.Either) + structural ability Exception + (also named builtin.Exception) + Exception.unsafeRun! : '{g, Exception} a -> '{g} a + bugFail : Failure -> r + closeSocket : Socket ->{IO, Exception} () + hello : Text -> Text ->{IO, Exception} () + myServer : '{IO} () + putBytes : Handle + -> Bytes + ->{IO, Exception} () + putText : Handle -> Text ->{IO, Exception} () + reraise : Either Failure b ->{Exception} b + serverSocket : Optional Text + -> Text + ->{IO, Exception} Socket + socketSend : Socket + -> Bytes + ->{IO, Exception} () + toException : Either Failure a ->{Exception} a +``` + ``` ucm :error scratch/main> run myServer + + 💔💥 + + I've encountered a call to builtin.bug with the following + value: + + Failure (typeLink IOFailure) "problem" (Any ()) + + Stack trace: + bug + #8ppr1tt4q2 ``` diff --git a/unison-src/transcripts/idempotent/fix2049.md b/unison-src/transcripts/idempotent/fix2049.md index c780d76c09..21686574b7 100644 --- a/unison-src/transcripts/idempotent/fix2049.md +++ b/unison-src/transcripts/idempotent/fix2049.md @@ -52,6 +52,43 @@ Fold.Stream.fold = !res Universal.== false ``` +``` ucm :added-by-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 Fold g a b + type Fold' g a b x + structural ability Stream a + Fold.Stream.fold : Fold g a b + -> '{g, Stream a} r + -> '{g} b + Fold.fromFold' : Fold' g a b x -> Fold g a b + Fold.mkFold : (t ->{g} a ->{g} t) + -> t + -> (t ->{g} b) + -> Fold g a b + Stream.foldl : (x ->{g} a ->{g} x) + -> x + -> '{g, Stream a} r + -> '{g} x + Stream.range : Nat -> Nat -> '{Stream Nat} () + folds.all : (a ->{g} Boolean) -> Fold g a Boolean + id : x -> x + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 44 | pred = n -> (Nat.gt n 2) + ⧩ + true +``` + Tests some capabilities for catching runtime exceptions. ``` unison @@ -73,7 +110,36 @@ tests _ = ] ``` +``` ucm :added-by-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`: + + catcher : '{IO} () ->{IO} Result + tests : ∀ _. _ ->{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + catcher : '{IO} () ->{IO} Result + tests : ∀ _. _ ->{IO} [Result] scratch/main> io.test tests + + New test results: + + 1. tests ◉ caught + ◉ caught + ◉ got the right answer + + ✅ 3 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/fix2053.md b/unison-src/transcripts/idempotent/fix2053.md index 2a91680258..2d5f1ce62e 100644 --- a/unison-src/transcripts/idempotent/fix2053.md +++ b/unison-src/transcripts/idempotent/fix2053.md @@ -4,4 +4,12 @@ scratch/main> builtins.mergeio ``` ucm scratch/main> display List.map + + f a -> + let + use Nat + + go i as acc = match List.at i as with + None -> acc + Some a -> go (i + 1) as (acc :+ f a) + go 0 a [] ``` diff --git a/unison-src/transcripts/idempotent/fix2156.md b/unison-src/transcripts/idempotent/fix2156.md index 3807592445..e0823b9652 100644 --- a/unison-src/transcripts/idempotent/fix2156.md +++ b/unison-src/transcripts/idempotent/fix2156.md @@ -11,3 +11,23 @@ sqr n = n * n > sqr ``` + +``` ucm :added-by-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`: + + sqr : Nat -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 4 | > sqr + ⧩ + n -> n Nat.* n +``` diff --git a/unison-src/transcripts/idempotent/fix2167.md b/unison-src/transcripts/idempotent/fix2167.md index 5d328e99bb..58613b9685 100644 --- a/unison-src/transcripts/idempotent/fix2167.md +++ b/unison-src/transcripts/idempotent/fix2167.md @@ -19,6 +19,21 @@ R.near1 region loc = match R.near 42 with ls -> R.die () ``` +``` ucm :added-by-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 ability R t + R.near : Nat ->{R t} [Nat] + R.near1 : region -> loc ->{R t} Nat +``` + The issue was that abilities with parameters like this were sometimes causing failures like this because the variable in the parameter would escape to a scope where it no longer made sense. Then solving would diff --git a/unison-src/transcripts/idempotent/fix2187.md b/unison-src/transcripts/idempotent/fix2187.md index 6575b5e309..9357219032 100644 --- a/unison-src/transcripts/idempotent/fix2187.md +++ b/unison-src/transcripts/idempotent/fix2187.md @@ -17,3 +17,16 @@ lexicalScopeEx = inner1 ``` + +``` ucm :added-by-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`: + + lexicalScopeEx : [Text] +``` diff --git a/unison-src/transcripts/idempotent/fix2231.md b/unison-src/transcripts/idempotent/fix2231.md index a7844426f8..c6230bfa08 100644 --- a/unison-src/transcripts/idempotent/fix2231.md +++ b/unison-src/transcripts/idempotent/fix2231.md @@ -24,6 +24,29 @@ foldl f a = cases txt = foldl (Text.++) "" ["a", "b", "c"] ``` +``` ucm :added-by-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`: + + << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c + f : Float -> Float + foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b + txt : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + << : (b ->{e} c) -> (a ->{e} b) -> a ->{e} c + f : Float -> Float + foldl : (b ->{e} a ->{e} b) -> b -> [a] ->{e} b + txt : Text ``` diff --git a/unison-src/transcripts/idempotent/fix2238.md b/unison-src/transcripts/idempotent/fix2238.md index c5be084dbf..2e8c2f3a98 100644 --- a/unison-src/transcripts/idempotent/fix2238.md +++ b/unison-src/transcripts/idempotent/fix2238.md @@ -10,6 +10,15 @@ structural ability Abort where abort : x ex = {{ @eval{abort} }} ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The expression in red needs the {Abort} ability, but this location does not have access to any abilities. + + 3 | ex = {{ @eval{abort} }} +``` + This file should also not typecheck - it has a triple backticks block that uses abilities. ```` unison :error @@ -22,3 +31,12 @@ abort + 1 ``` }} ```` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The expression in red needs the {Abort} ability, but this location does not have access to any abilities. + + 6 | abort + 1 +``` diff --git a/unison-src/transcripts/idempotent/fix2244.md b/unison-src/transcripts/idempotent/fix2244.md index eb60e81046..6a223fb14e 100644 --- a/unison-src/transcripts/idempotent/fix2244.md +++ b/unison-src/transcripts/idempotent/fix2244.md @@ -4,7 +4,7 @@ scratch/main> builtins.mergeio Ensure closing token is emitted by closing brace in doc eval block. -````unison +```` unison x = {{ ``` @@ -17,6 +17,19 @@ let }} ```` +``` ucm :added-by-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 : Doc2 +``` + ``` ucm :hide scratch/main> add ``` diff --git a/unison-src/transcripts/idempotent/fix2254.md b/unison-src/transcripts/idempotent/fix2254.md index d8ba13e169..dcb8e9668d 100644 --- a/unison-src/transcripts/idempotent/fix2254.md +++ b/unison-src/transcripts/idempotent/fix2254.md @@ -38,8 +38,21 @@ We'll make our edits in a new branch. ``` ucm 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 + f2 : A Nat Nat Nat Nat -> Nat + f3 : NeedsA Nat Nat -> Nat + g : A Nat Nat Nat Nat -> Nat scratch/a> branch /a2 -scratch/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. @@ -57,8 +70,51 @@ Let's do the update now, and verify that the definitions all look good and there ``` ucm scratch/a2> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. 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 + + You have no pending todo items. Good work! ✅ ``` ## Record updates @@ -69,25 +125,97 @@ Here's a test of updating a record: scratch/r1> builtins.merge lib.builtins ``` - ``` unison structural type Rec = { uno : Nat, dos : Nat } combine r = uno r + dos r ``` +``` ucm :added-by-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 :added-by-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 +``` + And checking that after updating this record, there's nothing `todo`: ``` ucm scratch/r2> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/r2> todo + + You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/idempotent/fix2268.md b/unison-src/transcripts/idempotent/fix2268.md index 4a929ec8f4..b75a1ac3c4 100644 --- a/unison-src/transcripts/idempotent/fix2268.md +++ b/unison-src/transcripts/idempotent/fix2268.md @@ -18,3 +18,18 @@ test _ = x = a toNat x ``` + +``` ucm :added-by-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`: + + ability A + ability B + test : '{B} Nat +``` diff --git a/unison-src/transcripts/idempotent/fix2334.md b/unison-src/transcripts/idempotent/fix2334.md index 52d6634c3d..7235d10d6b 100644 --- a/unison-src/transcripts/idempotent/fix2334.md +++ b/unison-src/transcripts/idempotent/fix2334.md @@ -17,3 +17,35 @@ f = cases > f 0 1 > f 1 1 ``` + +``` ucm :added-by-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`: + + f : Nat -> Nat -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 7 | > f 0 0 + ⧩ + 0 + + 8 | > f 1 0 + ⧩ + 3 + + 9 | > f 0 1 + ⧩ + 2 + + 10 | > f 1 1 + ⧩ + 2 +``` diff --git a/unison-src/transcripts/idempotent/fix2344.md b/unison-src/transcripts/idempotent/fix2344.md index c72ea4252f..ebf6ec6399 100644 --- a/unison-src/transcripts/idempotent/fix2344.md +++ b/unison-src/transcripts/idempotent/fix2344.md @@ -19,3 +19,17 @@ sneezy dee _ = antiNate dee 1 ``` + +``` ucm :added-by-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`: + + ability Nate + sneezy : (Nat ->{d} a) -> '{d, Nate} a +``` diff --git a/unison-src/transcripts/idempotent/fix2350.md b/unison-src/transcripts/idempotent/fix2350.md index ec6c90cf4c..4eda0fee4f 100644 --- a/unison-src/transcripts/idempotent/fix2350.md +++ b/unison-src/transcripts/idempotent/fix2350.md @@ -2,7 +2,9 @@ This tests an issue where ability variables were being defaulted over eagerly. In general, we want to avoid collecting up variables from the use of definitions with types like: - T ->{e} U +``` +T ->{e} U +``` Since this type works for every `e`, it is, 'pure;' and we might as well have `e = {}`, since `{}` is a subrow of every other row. @@ -11,7 +13,9 @@ ongoing inference, it's undesirable to default it. Previously there was a check to see if `e` occurred in the context. However, the wanted abilities being collected aren't in the context, so types like: - T ->{S e} U ->{e} V +``` +T ->{S e} U ->{e} V +``` were a corner case. We would add `S e` to the wanted abilities, then not realize that `e` shouldn't be defaulted. @@ -23,3 +27,17 @@ unique ability Storage d g where save : a ->{Storage d g, g} (d a) save a = !(save.impl a) ``` + +``` ucm :added-by-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`: + + ability Storage d g + save : a ->{g, Storage d g} d a +``` diff --git a/unison-src/transcripts/idempotent/fix2353.md b/unison-src/transcripts/idempotent/fix2353.md index 7a45f1549b..5d404425c2 100644 --- a/unison-src/transcripts/idempotent/fix2353.md +++ b/unison-src/transcripts/idempotent/fix2353.md @@ -14,3 +14,18 @@ pure.run a0 a = -- make sure this builtin can still be referenced Scope.run a' ``` + +``` ucm :added-by-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`: + + ability Async t g + ability Exception + pure.run : a -> (∀ t. '{Async t g} a) ->{g, Exception} a +``` diff --git a/unison-src/transcripts/idempotent/fix2354.md b/unison-src/transcripts/idempotent/fix2354.md index 5ec5dfa17e..7a0eeea719 100644 --- a/unison-src/transcripts/idempotent/fix2354.md +++ b/unison-src/transcripts/idempotent/fix2354.md @@ -11,3 +11,20 @@ f id = id 0 x = 'f ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat + where I expected to find: (a -> 𝕣1) -> 𝕣 + + 1 | f : (forall a . a -> a) -> Nat + 2 | f id = id 0 + 3 | + 4 | x = 'f + + from right here: + + 1 | f : (forall a . a -> a) -> Nat +``` diff --git a/unison-src/transcripts/idempotent/fix2355.md b/unison-src/transcripts/idempotent/fix2355.md index dc04e189a1..e04b76fa87 100644 --- a/unison-src/transcripts/idempotent/fix2355.md +++ b/unison-src/transcripts/idempotent/fix2355.md @@ -22,3 +22,22 @@ example = 'let t2 = A.fork '(A.put 10 r) A.await r ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I tried to infer a cyclic ability. + + The expression in red was inferred to require the ability: + + {A t25 {𝕖36, 𝕖18}} + + where `𝕖18` is its overall abilities. + + I need a type signature to help figure this out. + + 10 | go u = + 11 | t = A.fork '(go (u + 1)) + 12 | A.await t +``` diff --git a/unison-src/transcripts/idempotent/fix2378.md b/unison-src/transcripts/idempotent/fix2378.md index ef70ac7ef4..e8003d95c4 100644 --- a/unison-src/transcripts/idempotent/fix2378.md +++ b/unison-src/transcripts/idempotent/fix2378.md @@ -41,3 +41,23 @@ ex _ = x : '{} (Either () Nat) x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ``` + +``` ucm :added-by-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`: + + ability A t g + ability C c + ability Ex + A.pure.run : (∀ t. '{g, A t g} a) ->{g, Ex} a + C.pure.run : (∀ c. '{g, C c} r) ->{g, Ex} r + Ex.catch : '{g, Ex} a ->{g} Either () a + ex : '{C c, A t {C c}} Nat + x : 'Either () Nat +``` diff --git a/unison-src/transcripts/idempotent/fix2423.md b/unison-src/transcripts/idempotent/fix2423.md index 7dfcbe6619..4d80a93472 100644 --- a/unison-src/transcripts/idempotent/fix2423.md +++ b/unison-src/transcripts/idempotent/fix2423.md @@ -29,3 +29,23 @@ Split.zipSame sa sb _ = handle !sa with go sb ``` + +``` ucm :added-by-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 ability Split + Split.append : '{g, Split} a + -> '{g, Split} a + -> '{g, Split} a + Split.zipSame : '{g, Split} a + -> '{g, Split} b + -> '{g, Split} (a, b) + force : '{g} o ->{g} o +``` diff --git a/unison-src/transcripts/idempotent/fix2474.md b/unison-src/transcripts/idempotent/fix2474.md index dc7fe37aeb..6ddb859310 100644 --- a/unison-src/transcripts/idempotent/fix2474.md +++ b/unison-src/transcripts/idempotent/fix2474.md @@ -2,22 +2,26 @@ Tests an issue with a lack of generality of handlers. In general, a set of cases: - { e ... -> k } +``` +{ e ... -> k } +``` should be typed in the following way: - 1. The scrutinee has type `Request {E, g} r -> s` where `E` is all - the abilities being handled. `g` is a slack variable, because all - abilities that are used in the handled expression pass through - the handler. Previously this was being inferred as merely - `Request {E} r -> s` - 2. The continuation variable `k` should have type `o ->{E, g} r`, - matching the above types (`o` is the result type of `e`). - Previously this was being checked as `o ->{E0} r`, where `E0` is - the ability that contains `e`. +1. The scrutinee has type `Request {E, g} r -> s` where `E` is all + the abilities being handled. `g` is a slack variable, because all + abilities that are used in the handled expression pass through + the handler. Previously this was being inferred as merely + `Request {E} r -> s` +2. The continuation variable `k` should have type `o ->{E, g} r`, + matching the above types (`o` is the result type of `e`). + Previously this was being checked as `o ->{E0} r`, where `E0` is + the ability that contains `e`. ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -32,3 +36,18 @@ Stream.uncons s = { Stream.emit a -> tl } -> Right (a, tl : '{Stream a,g} r) handle !s with go ``` + +``` ucm :added-by-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 ability Stream a + Stream.uncons : '{g, Stream a} r + ->{g} Either r (a, '{g, Stream a} r) +``` diff --git a/unison-src/transcripts/idempotent/fix2628.md b/unison-src/transcripts/idempotent/fix2628.md index 795021dfd8..02a9894f11 100644 --- a/unison-src/transcripts/idempotent/fix2628.md +++ b/unison-src/transcripts/idempotent/fix2628.md @@ -11,5 +11,17 @@ 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 scratch/main> find : Nat -> MyRecord + + 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord ``` diff --git a/unison-src/transcripts/idempotent/fix2663.md b/unison-src/transcripts/idempotent/fix2663.md index 24990f3201..59667660af 100644 --- a/unison-src/transcripts/idempotent/fix2663.md +++ b/unison-src/transcripts/idempotent/fix2663.md @@ -2,7 +2,9 @@ Tests a variable capture problem. After pattern compilation, the match would end up: - T p1 p3 p3 +``` +T p1 p3 p3 +``` and z would end up referring to the first p3 rather than the second. @@ -21,3 +23,24 @@ bad x = match Some (Some x) with > bad 2 ``` + +``` ucm :added-by-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 Trip + bad : Nat -> (Nat, Nat) + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 9 | > bad 2 + ⧩ + (2, 5) +``` diff --git a/unison-src/transcripts/idempotent/fix2693.md b/unison-src/transcripts/idempotent/fix2693.md index 562f9199a0..31ca467e57 100644 --- a/unison-src/transcripts/idempotent/fix2693.md +++ b/unison-src/transcripts/idempotent/fix2693.md @@ -12,16 +12,4067 @@ range : Nat -> List Nat range = loop [] ``` +``` ucm :added-by-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`: + + loop : [Nat] -> Nat -> [Nat] + range : Nat -> [Nat] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + loop : [Nat] -> Nat -> [Nat] + range : Nat -> [Nat] ``` ``` unison > range 2000 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > range 2000 + ⧩ + [ 1 + , 2 + , 3 + , 4 + , 5 + , 6 + , 7 + , 8 + , 9 + , 10 + , 11 + , 12 + , 13 + , 14 + , 15 + , 16 + , 17 + , 18 + , 19 + , 20 + , 21 + , 22 + , 23 + , 24 + , 25 + , 26 + , 27 + , 28 + , 29 + , 30 + , 31 + , 32 + , 33 + , 34 + , 35 + , 36 + , 37 + , 38 + , 39 + , 40 + , 41 + , 42 + , 43 + , 44 + , 45 + , 46 + , 47 + , 48 + , 49 + , 50 + , 51 + , 52 + , 53 + , 54 + , 55 + , 56 + , 57 + , 58 + , 59 + , 60 + , 61 + , 62 + , 63 + , 64 + , 65 + , 66 + , 67 + , 68 + , 69 + , 70 + , 71 + , 72 + , 73 + , 74 + , 75 + , 76 + , 77 + , 78 + , 79 + , 80 + , 81 + , 82 + , 83 + , 84 + , 85 + , 86 + , 87 + , 88 + , 89 + , 90 + , 91 + , 92 + , 93 + , 94 + , 95 + , 96 + , 97 + , 98 + , 99 + , 100 + , 101 + , 102 + , 103 + , 104 + , 105 + , 106 + , 107 + , 108 + , 109 + , 110 + , 111 + , 112 + , 113 + , 114 + , 115 + , 116 + , 117 + , 118 + , 119 + , 120 + , 121 + , 122 + , 123 + , 124 + , 125 + , 126 + , 127 + , 128 + , 129 + , 130 + , 131 + , 132 + , 133 + , 134 + , 135 + , 136 + , 137 + , 138 + , 139 + , 140 + , 141 + , 142 + , 143 + , 144 + , 145 + , 146 + , 147 + , 148 + , 149 + , 150 + , 151 + , 152 + , 153 + , 154 + , 155 + , 156 + , 157 + , 158 + , 159 + , 160 + , 161 + , 162 + , 163 + , 164 + , 165 + , 166 + , 167 + , 168 + , 169 + , 170 + , 171 + , 172 + , 173 + , 174 + , 175 + , 176 + , 177 + , 178 + , 179 + , 180 + , 181 + , 182 + , 183 + , 184 + , 185 + , 186 + , 187 + , 188 + , 189 + , 190 + , 191 + , 192 + , 193 + , 194 + , 195 + , 196 + , 197 + , 198 + , 199 + , 200 + , 201 + , 202 + , 203 + , 204 + , 205 + , 206 + , 207 + , 208 + , 209 + , 210 + , 211 + , 212 + , 213 + , 214 + , 215 + , 216 + , 217 + , 218 + , 219 + , 220 + , 221 + , 222 + , 223 + , 224 + , 225 + , 226 + , 227 + , 228 + , 229 + , 230 + , 231 + , 232 + , 233 + , 234 + , 235 + , 236 + , 237 + , 238 + , 239 + , 240 + , 241 + , 242 + , 243 + , 244 + , 245 + , 246 + , 247 + , 248 + , 249 + , 250 + , 251 + , 252 + , 253 + , 254 + , 255 + , 256 + , 257 + , 258 + , 259 + , 260 + , 261 + , 262 + , 263 + , 264 + , 265 + , 266 + , 267 + , 268 + , 269 + , 270 + , 271 + , 272 + , 273 + , 274 + , 275 + , 276 + , 277 + , 278 + , 279 + , 280 + , 281 + , 282 + , 283 + , 284 + , 285 + , 286 + , 287 + , 288 + , 289 + , 290 + , 291 + , 292 + , 293 + , 294 + , 295 + , 296 + , 297 + , 298 + , 299 + , 300 + , 301 + , 302 + , 303 + , 304 + , 305 + , 306 + , 307 + , 308 + , 309 + , 310 + , 311 + , 312 + , 313 + , 314 + , 315 + , 316 + , 317 + , 318 + , 319 + , 320 + , 321 + , 322 + , 323 + , 324 + , 325 + , 326 + , 327 + , 328 + , 329 + , 330 + , 331 + , 332 + , 333 + , 334 + , 335 + , 336 + , 337 + , 338 + , 339 + , 340 + , 341 + , 342 + , 343 + , 344 + , 345 + , 346 + , 347 + , 348 + , 349 + , 350 + , 351 + , 352 + , 353 + , 354 + , 355 + , 356 + , 357 + , 358 + , 359 + , 360 + , 361 + , 362 + , 363 + , 364 + , 365 + , 366 + , 367 + , 368 + , 369 + , 370 + , 371 + , 372 + , 373 + , 374 + , 375 + , 376 + , 377 + , 378 + , 379 + , 380 + , 381 + , 382 + , 383 + , 384 + , 385 + , 386 + , 387 + , 388 + , 389 + , 390 + , 391 + , 392 + , 393 + , 394 + , 395 + , 396 + , 397 + , 398 + , 399 + , 400 + , 401 + , 402 + , 403 + , 404 + , 405 + , 406 + , 407 + , 408 + , 409 + , 410 + , 411 + , 412 + , 413 + , 414 + , 415 + , 416 + , 417 + , 418 + , 419 + , 420 + , 421 + , 422 + , 423 + , 424 + , 425 + , 426 + , 427 + , 428 + , 429 + , 430 + , 431 + , 432 + , 433 + , 434 + , 435 + , 436 + , 437 + , 438 + , 439 + , 440 + , 441 + , 442 + , 443 + , 444 + , 445 + , 446 + , 447 + , 448 + , 449 + , 450 + , 451 + , 452 + , 453 + , 454 + , 455 + , 456 + , 457 + , 458 + , 459 + , 460 + , 461 + , 462 + , 463 + , 464 + , 465 + , 466 + , 467 + , 468 + , 469 + , 470 + , 471 + , 472 + , 473 + , 474 + , 475 + , 476 + , 477 + , 478 + , 479 + , 480 + , 481 + , 482 + , 483 + , 484 + , 485 + , 486 + , 487 + , 488 + , 489 + , 490 + , 491 + , 492 + , 493 + , 494 + , 495 + , 496 + , 497 + , 498 + , 499 + , 500 + , 501 + , 502 + , 503 + , 504 + , 505 + , 506 + , 507 + , 508 + , 509 + , 510 + , 511 + , 512 + , 513 + , 514 + , 515 + , 516 + , 517 + , 518 + , 519 + , 520 + , 521 + , 522 + , 523 + , 524 + , 525 + , 526 + , 527 + , 528 + , 529 + , 530 + , 531 + , 532 + , 533 + , 534 + , 535 + , 536 + , 537 + , 538 + , 539 + , 540 + , 541 + , 542 + , 543 + , 544 + , 545 + , 546 + , 547 + , 548 + , 549 + , 550 + , 551 + , 552 + , 553 + , 554 + , 555 + , 556 + , 557 + , 558 + , 559 + , 560 + , 561 + , 562 + , 563 + , 564 + , 565 + , 566 + , 567 + , 568 + , 569 + , 570 + , 571 + , 572 + , 573 + , 574 + , 575 + , 576 + , 577 + , 578 + , 579 + , 580 + , 581 + , 582 + , 583 + , 584 + , 585 + , 586 + , 587 + , 588 + , 589 + , 590 + , 591 + , 592 + , 593 + , 594 + , 595 + , 596 + , 597 + , 598 + , 599 + , 600 + , 601 + , 602 + , 603 + , 604 + , 605 + , 606 + , 607 + , 608 + , 609 + , 610 + , 611 + , 612 + , 613 + , 614 + , 615 + , 616 + , 617 + , 618 + , 619 + , 620 + , 621 + , 622 + , 623 + , 624 + , 625 + , 626 + , 627 + , 628 + , 629 + , 630 + , 631 + , 632 + , 633 + , 634 + , 635 + , 636 + , 637 + , 638 + , 639 + , 640 + , 641 + , 642 + , 643 + , 644 + , 645 + , 646 + , 647 + , 648 + , 649 + , 650 + , 651 + , 652 + , 653 + , 654 + , 655 + , 656 + , 657 + , 658 + , 659 + , 660 + , 661 + , 662 + , 663 + , 664 + , 665 + , 666 + , 667 + , 668 + , 669 + , 670 + , 671 + , 672 + , 673 + , 674 + , 675 + , 676 + , 677 + , 678 + , 679 + , 680 + , 681 + , 682 + , 683 + , 684 + , 685 + , 686 + , 687 + , 688 + , 689 + , 690 + , 691 + , 692 + , 693 + , 694 + , 695 + , 696 + , 697 + , 698 + , 699 + , 700 + , 701 + , 702 + , 703 + , 704 + , 705 + , 706 + , 707 + , 708 + , 709 + , 710 + , 711 + , 712 + , 713 + , 714 + , 715 + , 716 + , 717 + , 718 + , 719 + , 720 + , 721 + , 722 + , 723 + , 724 + , 725 + , 726 + , 727 + , 728 + , 729 + , 730 + , 731 + , 732 + , 733 + , 734 + , 735 + , 736 + , 737 + , 738 + , 739 + , 740 + , 741 + , 742 + , 743 + , 744 + , 745 + , 746 + , 747 + , 748 + , 749 + , 750 + , 751 + , 752 + , 753 + , 754 + , 755 + , 756 + , 757 + , 758 + , 759 + , 760 + , 761 + , 762 + , 763 + , 764 + , 765 + , 766 + , 767 + , 768 + , 769 + , 770 + , 771 + , 772 + , 773 + , 774 + , 775 + , 776 + , 777 + , 778 + , 779 + , 780 + , 781 + , 782 + , 783 + , 784 + , 785 + , 786 + , 787 + , 788 + , 789 + , 790 + , 791 + , 792 + , 793 + , 794 + , 795 + , 796 + , 797 + , 798 + , 799 + , 800 + , 801 + , 802 + , 803 + , 804 + , 805 + , 806 + , 807 + , 808 + , 809 + , 810 + , 811 + , 812 + , 813 + , 814 + , 815 + , 816 + , 817 + , 818 + , 819 + , 820 + , 821 + , 822 + , 823 + , 824 + , 825 + , 826 + , 827 + , 828 + , 829 + , 830 + , 831 + , 832 + , 833 + , 834 + , 835 + , 836 + , 837 + , 838 + , 839 + , 840 + , 841 + , 842 + , 843 + , 844 + , 845 + , 846 + , 847 + , 848 + , 849 + , 850 + , 851 + , 852 + , 853 + , 854 + , 855 + , 856 + , 857 + , 858 + , 859 + , 860 + , 861 + , 862 + , 863 + , 864 + , 865 + , 866 + , 867 + , 868 + , 869 + , 870 + , 871 + , 872 + , 873 + , 874 + , 875 + , 876 + , 877 + , 878 + , 879 + , 880 + , 881 + , 882 + , 883 + , 884 + , 885 + , 886 + , 887 + , 888 + , 889 + , 890 + , 891 + , 892 + , 893 + , 894 + , 895 + , 896 + , 897 + , 898 + , 899 + , 900 + , 901 + , 902 + , 903 + , 904 + , 905 + , 906 + , 907 + , 908 + , 909 + , 910 + , 911 + , 912 + , 913 + , 914 + , 915 + , 916 + , 917 + , 918 + , 919 + , 920 + , 921 + , 922 + , 923 + , 924 + , 925 + , 926 + , 927 + , 928 + , 929 + , 930 + , 931 + , 932 + , 933 + , 934 + , 935 + , 936 + , 937 + , 938 + , 939 + , 940 + , 941 + , 942 + , 943 + , 944 + , 945 + , 946 + , 947 + , 948 + , 949 + , 950 + , 951 + , 952 + , 953 + , 954 + , 955 + , 956 + , 957 + , 958 + , 959 + , 960 + , 961 + , 962 + , 963 + , 964 + , 965 + , 966 + , 967 + , 968 + , 969 + , 970 + , 971 + , 972 + , 973 + , 974 + , 975 + , 976 + , 977 + , 978 + , 979 + , 980 + , 981 + , 982 + , 983 + , 984 + , 985 + , 986 + , 987 + , 988 + , 989 + , 990 + , 991 + , 992 + , 993 + , 994 + , 995 + , 996 + , 997 + , 998 + , 999 + , 1000 + , 1001 + , 1002 + , 1003 + , 1004 + , 1005 + , 1006 + , 1007 + , 1008 + , 1009 + , 1010 + , 1011 + , 1012 + , 1013 + , 1014 + , 1015 + , 1016 + , 1017 + , 1018 + , 1019 + , 1020 + , 1021 + , 1022 + , 1023 + , 1024 + , 1025 + , 1026 + , 1027 + , 1028 + , 1029 + , 1030 + , 1031 + , 1032 + , 1033 + , 1034 + , 1035 + , 1036 + , 1037 + , 1038 + , 1039 + , 1040 + , 1041 + , 1042 + , 1043 + , 1044 + , 1045 + , 1046 + , 1047 + , 1048 + , 1049 + , 1050 + , 1051 + , 1052 + , 1053 + , 1054 + , 1055 + , 1056 + , 1057 + , 1058 + , 1059 + , 1060 + , 1061 + , 1062 + , 1063 + , 1064 + , 1065 + , 1066 + , 1067 + , 1068 + , 1069 + , 1070 + , 1071 + , 1072 + , 1073 + , 1074 + , 1075 + , 1076 + , 1077 + , 1078 + , 1079 + , 1080 + , 1081 + , 1082 + , 1083 + , 1084 + , 1085 + , 1086 + , 1087 + , 1088 + , 1089 + , 1090 + , 1091 + , 1092 + , 1093 + , 1094 + , 1095 + , 1096 + , 1097 + , 1098 + , 1099 + , 1100 + , 1101 + , 1102 + , 1103 + , 1104 + , 1105 + , 1106 + , 1107 + , 1108 + , 1109 + , 1110 + , 1111 + , 1112 + , 1113 + , 1114 + , 1115 + , 1116 + , 1117 + , 1118 + , 1119 + , 1120 + , 1121 + , 1122 + , 1123 + , 1124 + , 1125 + , 1126 + , 1127 + , 1128 + , 1129 + , 1130 + , 1131 + , 1132 + , 1133 + , 1134 + , 1135 + , 1136 + , 1137 + , 1138 + , 1139 + , 1140 + , 1141 + , 1142 + , 1143 + , 1144 + , 1145 + , 1146 + , 1147 + , 1148 + , 1149 + , 1150 + , 1151 + , 1152 + , 1153 + , 1154 + , 1155 + , 1156 + , 1157 + , 1158 + , 1159 + , 1160 + , 1161 + , 1162 + , 1163 + , 1164 + , 1165 + , 1166 + , 1167 + , 1168 + , 1169 + , 1170 + , 1171 + , 1172 + , 1173 + , 1174 + , 1175 + , 1176 + , 1177 + , 1178 + , 1179 + , 1180 + , 1181 + , 1182 + , 1183 + , 1184 + , 1185 + , 1186 + , 1187 + , 1188 + , 1189 + , 1190 + , 1191 + , 1192 + , 1193 + , 1194 + , 1195 + , 1196 + , 1197 + , 1198 + , 1199 + , 1200 + , 1201 + , 1202 + , 1203 + , 1204 + , 1205 + , 1206 + , 1207 + , 1208 + , 1209 + , 1210 + , 1211 + , 1212 + , 1213 + , 1214 + , 1215 + , 1216 + , 1217 + , 1218 + , 1219 + , 1220 + , 1221 + , 1222 + , 1223 + , 1224 + , 1225 + , 1226 + , 1227 + , 1228 + , 1229 + , 1230 + , 1231 + , 1232 + , 1233 + , 1234 + , 1235 + , 1236 + , 1237 + , 1238 + , 1239 + , 1240 + , 1241 + , 1242 + , 1243 + , 1244 + , 1245 + , 1246 + , 1247 + , 1248 + , 1249 + , 1250 + , 1251 + , 1252 + , 1253 + , 1254 + , 1255 + , 1256 + , 1257 + , 1258 + , 1259 + , 1260 + , 1261 + , 1262 + , 1263 + , 1264 + , 1265 + , 1266 + , 1267 + , 1268 + , 1269 + , 1270 + , 1271 + , 1272 + , 1273 + , 1274 + , 1275 + , 1276 + , 1277 + , 1278 + , 1279 + , 1280 + , 1281 + , 1282 + , 1283 + , 1284 + , 1285 + , 1286 + , 1287 + , 1288 + , 1289 + , 1290 + , 1291 + , 1292 + , 1293 + , 1294 + , 1295 + , 1296 + , 1297 + , 1298 + , 1299 + , 1300 + , 1301 + , 1302 + , 1303 + , 1304 + , 1305 + , 1306 + , 1307 + , 1308 + , 1309 + , 1310 + , 1311 + , 1312 + , 1313 + , 1314 + , 1315 + , 1316 + , 1317 + , 1318 + , 1319 + , 1320 + , 1321 + , 1322 + , 1323 + , 1324 + , 1325 + , 1326 + , 1327 + , 1328 + , 1329 + , 1330 + , 1331 + , 1332 + , 1333 + , 1334 + , 1335 + , 1336 + , 1337 + , 1338 + , 1339 + , 1340 + , 1341 + , 1342 + , 1343 + , 1344 + , 1345 + , 1346 + , 1347 + , 1348 + , 1349 + , 1350 + , 1351 + , 1352 + , 1353 + , 1354 + , 1355 + , 1356 + , 1357 + , 1358 + , 1359 + , 1360 + , 1361 + , 1362 + , 1363 + , 1364 + , 1365 + , 1366 + , 1367 + , 1368 + , 1369 + , 1370 + , 1371 + , 1372 + , 1373 + , 1374 + , 1375 + , 1376 + , 1377 + , 1378 + , 1379 + , 1380 + , 1381 + , 1382 + , 1383 + , 1384 + , 1385 + , 1386 + , 1387 + , 1388 + , 1389 + , 1390 + , 1391 + , 1392 + , 1393 + , 1394 + , 1395 + , 1396 + , 1397 + , 1398 + , 1399 + , 1400 + , 1401 + , 1402 + , 1403 + , 1404 + , 1405 + , 1406 + , 1407 + , 1408 + , 1409 + , 1410 + , 1411 + , 1412 + , 1413 + , 1414 + , 1415 + , 1416 + , 1417 + , 1418 + , 1419 + , 1420 + , 1421 + , 1422 + , 1423 + , 1424 + , 1425 + , 1426 + , 1427 + , 1428 + , 1429 + , 1430 + , 1431 + , 1432 + , 1433 + , 1434 + , 1435 + , 1436 + , 1437 + , 1438 + , 1439 + , 1440 + , 1441 + , 1442 + , 1443 + , 1444 + , 1445 + , 1446 + , 1447 + , 1448 + , 1449 + , 1450 + , 1451 + , 1452 + , 1453 + , 1454 + , 1455 + , 1456 + , 1457 + , 1458 + , 1459 + , 1460 + , 1461 + , 1462 + , 1463 + , 1464 + , 1465 + , 1466 + , 1467 + , 1468 + , 1469 + , 1470 + , 1471 + , 1472 + , 1473 + , 1474 + , 1475 + , 1476 + , 1477 + , 1478 + , 1479 + , 1480 + , 1481 + , 1482 + , 1483 + , 1484 + , 1485 + , 1486 + , 1487 + , 1488 + , 1489 + , 1490 + , 1491 + , 1492 + , 1493 + , 1494 + , 1495 + , 1496 + , 1497 + , 1498 + , 1499 + , 1500 + , 1501 + , 1502 + , 1503 + , 1504 + , 1505 + , 1506 + , 1507 + , 1508 + , 1509 + , 1510 + , 1511 + , 1512 + , 1513 + , 1514 + , 1515 + , 1516 + , 1517 + , 1518 + , 1519 + , 1520 + , 1521 + , 1522 + , 1523 + , 1524 + , 1525 + , 1526 + , 1527 + , 1528 + , 1529 + , 1530 + , 1531 + , 1532 + , 1533 + , 1534 + , 1535 + , 1536 + , 1537 + , 1538 + , 1539 + , 1540 + , 1541 + , 1542 + , 1543 + , 1544 + , 1545 + , 1546 + , 1547 + , 1548 + , 1549 + , 1550 + , 1551 + , 1552 + , 1553 + , 1554 + , 1555 + , 1556 + , 1557 + , 1558 + , 1559 + , 1560 + , 1561 + , 1562 + , 1563 + , 1564 + , 1565 + , 1566 + , 1567 + , 1568 + , 1569 + , 1570 + , 1571 + , 1572 + , 1573 + , 1574 + , 1575 + , 1576 + , 1577 + , 1578 + , 1579 + , 1580 + , 1581 + , 1582 + , 1583 + , 1584 + , 1585 + , 1586 + , 1587 + , 1588 + , 1589 + , 1590 + , 1591 + , 1592 + , 1593 + , 1594 + , 1595 + , 1596 + , 1597 + , 1598 + , 1599 + , 1600 + , 1601 + , 1602 + , 1603 + , 1604 + , 1605 + , 1606 + , 1607 + , 1608 + , 1609 + , 1610 + , 1611 + , 1612 + , 1613 + , 1614 + , 1615 + , 1616 + , 1617 + , 1618 + , 1619 + , 1620 + , 1621 + , 1622 + , 1623 + , 1624 + , 1625 + , 1626 + , 1627 + , 1628 + , 1629 + , 1630 + , 1631 + , 1632 + , 1633 + , 1634 + , 1635 + , 1636 + , 1637 + , 1638 + , 1639 + , 1640 + , 1641 + , 1642 + , 1643 + , 1644 + , 1645 + , 1646 + , 1647 + , 1648 + , 1649 + , 1650 + , 1651 + , 1652 + , 1653 + , 1654 + , 1655 + , 1656 + , 1657 + , 1658 + , 1659 + , 1660 + , 1661 + , 1662 + , 1663 + , 1664 + , 1665 + , 1666 + , 1667 + , 1668 + , 1669 + , 1670 + , 1671 + , 1672 + , 1673 + , 1674 + , 1675 + , 1676 + , 1677 + , 1678 + , 1679 + , 1680 + , 1681 + , 1682 + , 1683 + , 1684 + , 1685 + , 1686 + , 1687 + , 1688 + , 1689 + , 1690 + , 1691 + , 1692 + , 1693 + , 1694 + , 1695 + , 1696 + , 1697 + , 1698 + , 1699 + , 1700 + , 1701 + , 1702 + , 1703 + , 1704 + , 1705 + , 1706 + , 1707 + , 1708 + , 1709 + , 1710 + , 1711 + , 1712 + , 1713 + , 1714 + , 1715 + , 1716 + , 1717 + , 1718 + , 1719 + , 1720 + , 1721 + , 1722 + , 1723 + , 1724 + , 1725 + , 1726 + , 1727 + , 1728 + , 1729 + , 1730 + , 1731 + , 1732 + , 1733 + , 1734 + , 1735 + , 1736 + , 1737 + , 1738 + , 1739 + , 1740 + , 1741 + , 1742 + , 1743 + , 1744 + , 1745 + , 1746 + , 1747 + , 1748 + , 1749 + , 1750 + , 1751 + , 1752 + , 1753 + , 1754 + , 1755 + , 1756 + , 1757 + , 1758 + , 1759 + , 1760 + , 1761 + , 1762 + , 1763 + , 1764 + , 1765 + , 1766 + , 1767 + , 1768 + , 1769 + , 1770 + , 1771 + , 1772 + , 1773 + , 1774 + , 1775 + , 1776 + , 1777 + , 1778 + , 1779 + , 1780 + , 1781 + , 1782 + , 1783 + , 1784 + , 1785 + , 1786 + , 1787 + , 1788 + , 1789 + , 1790 + , 1791 + , 1792 + , 1793 + , 1794 + , 1795 + , 1796 + , 1797 + , 1798 + , 1799 + , 1800 + , 1801 + , 1802 + , 1803 + , 1804 + , 1805 + , 1806 + , 1807 + , 1808 + , 1809 + , 1810 + , 1811 + , 1812 + , 1813 + , 1814 + , 1815 + , 1816 + , 1817 + , 1818 + , 1819 + , 1820 + , 1821 + , 1822 + , 1823 + , 1824 + , 1825 + , 1826 + , 1827 + , 1828 + , 1829 + , 1830 + , 1831 + , 1832 + , 1833 + , 1834 + , 1835 + , 1836 + , 1837 + , 1838 + , 1839 + , 1840 + , 1841 + , 1842 + , 1843 + , 1844 + , 1845 + , 1846 + , 1847 + , 1848 + , 1849 + , 1850 + , 1851 + , 1852 + , 1853 + , 1854 + , 1855 + , 1856 + , 1857 + , 1858 + , 1859 + , 1860 + , 1861 + , 1862 + , 1863 + , 1864 + , 1865 + , 1866 + , 1867 + , 1868 + , 1869 + , 1870 + , 1871 + , 1872 + , 1873 + , 1874 + , 1875 + , 1876 + , 1877 + , 1878 + , 1879 + , 1880 + , 1881 + , 1882 + , 1883 + , 1884 + , 1885 + , 1886 + , 1887 + , 1888 + , 1889 + , 1890 + , 1891 + , 1892 + , 1893 + , 1894 + , 1895 + , 1896 + , 1897 + , 1898 + , 1899 + , 1900 + , 1901 + , 1902 + , 1903 + , 1904 + , 1905 + , 1906 + , 1907 + , 1908 + , 1909 + , 1910 + , 1911 + , 1912 + , 1913 + , 1914 + , 1915 + , 1916 + , 1917 + , 1918 + , 1919 + , 1920 + , 1921 + , 1922 + , 1923 + , 1924 + , 1925 + , 1926 + , 1927 + , 1928 + , 1929 + , 1930 + , 1931 + , 1932 + , 1933 + , 1934 + , 1935 + , 1936 + , 1937 + , 1938 + , 1939 + , 1940 + , 1941 + , 1942 + , 1943 + , 1944 + , 1945 + , 1946 + , 1947 + , 1948 + , 1949 + , 1950 + , 1951 + , 1952 + , 1953 + , 1954 + , 1955 + , 1956 + , 1957 + , 1958 + , 1959 + , 1960 + , 1961 + , 1962 + , 1963 + , 1964 + , 1965 + , 1966 + , 1967 + , 1968 + , 1969 + , 1970 + , 1971 + , 1972 + , 1973 + , 1974 + , 1975 + , 1976 + , 1977 + , 1978 + , 1979 + , 1980 + , 1981 + , 1982 + , 1983 + , 1984 + , 1985 + , 1986 + , 1987 + , 1988 + , 1989 + , 1990 + , 1991 + , 1992 + , 1993 + , 1994 + , 1995 + , 1996 + , 1997 + , 1998 + , 1999 + , 2000 + ] +``` + Should be cached: ``` unison > range 2000 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > range 2000 + ⧩ + [ 1 + , 2 + , 3 + , 4 + , 5 + , 6 + , 7 + , 8 + , 9 + , 10 + , 11 + , 12 + , 13 + , 14 + , 15 + , 16 + , 17 + , 18 + , 19 + , 20 + , 21 + , 22 + , 23 + , 24 + , 25 + , 26 + , 27 + , 28 + , 29 + , 30 + , 31 + , 32 + , 33 + , 34 + , 35 + , 36 + , 37 + , 38 + , 39 + , 40 + , 41 + , 42 + , 43 + , 44 + , 45 + , 46 + , 47 + , 48 + , 49 + , 50 + , 51 + , 52 + , 53 + , 54 + , 55 + , 56 + , 57 + , 58 + , 59 + , 60 + , 61 + , 62 + , 63 + , 64 + , 65 + , 66 + , 67 + , 68 + , 69 + , 70 + , 71 + , 72 + , 73 + , 74 + , 75 + , 76 + , 77 + , 78 + , 79 + , 80 + , 81 + , 82 + , 83 + , 84 + , 85 + , 86 + , 87 + , 88 + , 89 + , 90 + , 91 + , 92 + , 93 + , 94 + , 95 + , 96 + , 97 + , 98 + , 99 + , 100 + , 101 + , 102 + , 103 + , 104 + , 105 + , 106 + , 107 + , 108 + , 109 + , 110 + , 111 + , 112 + , 113 + , 114 + , 115 + , 116 + , 117 + , 118 + , 119 + , 120 + , 121 + , 122 + , 123 + , 124 + , 125 + , 126 + , 127 + , 128 + , 129 + , 130 + , 131 + , 132 + , 133 + , 134 + , 135 + , 136 + , 137 + , 138 + , 139 + , 140 + , 141 + , 142 + , 143 + , 144 + , 145 + , 146 + , 147 + , 148 + , 149 + , 150 + , 151 + , 152 + , 153 + , 154 + , 155 + , 156 + , 157 + , 158 + , 159 + , 160 + , 161 + , 162 + , 163 + , 164 + , 165 + , 166 + , 167 + , 168 + , 169 + , 170 + , 171 + , 172 + , 173 + , 174 + , 175 + , 176 + , 177 + , 178 + , 179 + , 180 + , 181 + , 182 + , 183 + , 184 + , 185 + , 186 + , 187 + , 188 + , 189 + , 190 + , 191 + , 192 + , 193 + , 194 + , 195 + , 196 + , 197 + , 198 + , 199 + , 200 + , 201 + , 202 + , 203 + , 204 + , 205 + , 206 + , 207 + , 208 + , 209 + , 210 + , 211 + , 212 + , 213 + , 214 + , 215 + , 216 + , 217 + , 218 + , 219 + , 220 + , 221 + , 222 + , 223 + , 224 + , 225 + , 226 + , 227 + , 228 + , 229 + , 230 + , 231 + , 232 + , 233 + , 234 + , 235 + , 236 + , 237 + , 238 + , 239 + , 240 + , 241 + , 242 + , 243 + , 244 + , 245 + , 246 + , 247 + , 248 + , 249 + , 250 + , 251 + , 252 + , 253 + , 254 + , 255 + , 256 + , 257 + , 258 + , 259 + , 260 + , 261 + , 262 + , 263 + , 264 + , 265 + , 266 + , 267 + , 268 + , 269 + , 270 + , 271 + , 272 + , 273 + , 274 + , 275 + , 276 + , 277 + , 278 + , 279 + , 280 + , 281 + , 282 + , 283 + , 284 + , 285 + , 286 + , 287 + , 288 + , 289 + , 290 + , 291 + , 292 + , 293 + , 294 + , 295 + , 296 + , 297 + , 298 + , 299 + , 300 + , 301 + , 302 + , 303 + , 304 + , 305 + , 306 + , 307 + , 308 + , 309 + , 310 + , 311 + , 312 + , 313 + , 314 + , 315 + , 316 + , 317 + , 318 + , 319 + , 320 + , 321 + , 322 + , 323 + , 324 + , 325 + , 326 + , 327 + , 328 + , 329 + , 330 + , 331 + , 332 + , 333 + , 334 + , 335 + , 336 + , 337 + , 338 + , 339 + , 340 + , 341 + , 342 + , 343 + , 344 + , 345 + , 346 + , 347 + , 348 + , 349 + , 350 + , 351 + , 352 + , 353 + , 354 + , 355 + , 356 + , 357 + , 358 + , 359 + , 360 + , 361 + , 362 + , 363 + , 364 + , 365 + , 366 + , 367 + , 368 + , 369 + , 370 + , 371 + , 372 + , 373 + , 374 + , 375 + , 376 + , 377 + , 378 + , 379 + , 380 + , 381 + , 382 + , 383 + , 384 + , 385 + , 386 + , 387 + , 388 + , 389 + , 390 + , 391 + , 392 + , 393 + , 394 + , 395 + , 396 + , 397 + , 398 + , 399 + , 400 + , 401 + , 402 + , 403 + , 404 + , 405 + , 406 + , 407 + , 408 + , 409 + , 410 + , 411 + , 412 + , 413 + , 414 + , 415 + , 416 + , 417 + , 418 + , 419 + , 420 + , 421 + , 422 + , 423 + , 424 + , 425 + , 426 + , 427 + , 428 + , 429 + , 430 + , 431 + , 432 + , 433 + , 434 + , 435 + , 436 + , 437 + , 438 + , 439 + , 440 + , 441 + , 442 + , 443 + , 444 + , 445 + , 446 + , 447 + , 448 + , 449 + , 450 + , 451 + , 452 + , 453 + , 454 + , 455 + , 456 + , 457 + , 458 + , 459 + , 460 + , 461 + , 462 + , 463 + , 464 + , 465 + , 466 + , 467 + , 468 + , 469 + , 470 + , 471 + , 472 + , 473 + , 474 + , 475 + , 476 + , 477 + , 478 + , 479 + , 480 + , 481 + , 482 + , 483 + , 484 + , 485 + , 486 + , 487 + , 488 + , 489 + , 490 + , 491 + , 492 + , 493 + , 494 + , 495 + , 496 + , 497 + , 498 + , 499 + , 500 + , 501 + , 502 + , 503 + , 504 + , 505 + , 506 + , 507 + , 508 + , 509 + , 510 + , 511 + , 512 + , 513 + , 514 + , 515 + , 516 + , 517 + , 518 + , 519 + , 520 + , 521 + , 522 + , 523 + , 524 + , 525 + , 526 + , 527 + , 528 + , 529 + , 530 + , 531 + , 532 + , 533 + , 534 + , 535 + , 536 + , 537 + , 538 + , 539 + , 540 + , 541 + , 542 + , 543 + , 544 + , 545 + , 546 + , 547 + , 548 + , 549 + , 550 + , 551 + , 552 + , 553 + , 554 + , 555 + , 556 + , 557 + , 558 + , 559 + , 560 + , 561 + , 562 + , 563 + , 564 + , 565 + , 566 + , 567 + , 568 + , 569 + , 570 + , 571 + , 572 + , 573 + , 574 + , 575 + , 576 + , 577 + , 578 + , 579 + , 580 + , 581 + , 582 + , 583 + , 584 + , 585 + , 586 + , 587 + , 588 + , 589 + , 590 + , 591 + , 592 + , 593 + , 594 + , 595 + , 596 + , 597 + , 598 + , 599 + , 600 + , 601 + , 602 + , 603 + , 604 + , 605 + , 606 + , 607 + , 608 + , 609 + , 610 + , 611 + , 612 + , 613 + , 614 + , 615 + , 616 + , 617 + , 618 + , 619 + , 620 + , 621 + , 622 + , 623 + , 624 + , 625 + , 626 + , 627 + , 628 + , 629 + , 630 + , 631 + , 632 + , 633 + , 634 + , 635 + , 636 + , 637 + , 638 + , 639 + , 640 + , 641 + , 642 + , 643 + , 644 + , 645 + , 646 + , 647 + , 648 + , 649 + , 650 + , 651 + , 652 + , 653 + , 654 + , 655 + , 656 + , 657 + , 658 + , 659 + , 660 + , 661 + , 662 + , 663 + , 664 + , 665 + , 666 + , 667 + , 668 + , 669 + , 670 + , 671 + , 672 + , 673 + , 674 + , 675 + , 676 + , 677 + , 678 + , 679 + , 680 + , 681 + , 682 + , 683 + , 684 + , 685 + , 686 + , 687 + , 688 + , 689 + , 690 + , 691 + , 692 + , 693 + , 694 + , 695 + , 696 + , 697 + , 698 + , 699 + , 700 + , 701 + , 702 + , 703 + , 704 + , 705 + , 706 + , 707 + , 708 + , 709 + , 710 + , 711 + , 712 + , 713 + , 714 + , 715 + , 716 + , 717 + , 718 + , 719 + , 720 + , 721 + , 722 + , 723 + , 724 + , 725 + , 726 + , 727 + , 728 + , 729 + , 730 + , 731 + , 732 + , 733 + , 734 + , 735 + , 736 + , 737 + , 738 + , 739 + , 740 + , 741 + , 742 + , 743 + , 744 + , 745 + , 746 + , 747 + , 748 + , 749 + , 750 + , 751 + , 752 + , 753 + , 754 + , 755 + , 756 + , 757 + , 758 + , 759 + , 760 + , 761 + , 762 + , 763 + , 764 + , 765 + , 766 + , 767 + , 768 + , 769 + , 770 + , 771 + , 772 + , 773 + , 774 + , 775 + , 776 + , 777 + , 778 + , 779 + , 780 + , 781 + , 782 + , 783 + , 784 + , 785 + , 786 + , 787 + , 788 + , 789 + , 790 + , 791 + , 792 + , 793 + , 794 + , 795 + , 796 + , 797 + , 798 + , 799 + , 800 + , 801 + , 802 + , 803 + , 804 + , 805 + , 806 + , 807 + , 808 + , 809 + , 810 + , 811 + , 812 + , 813 + , 814 + , 815 + , 816 + , 817 + , 818 + , 819 + , 820 + , 821 + , 822 + , 823 + , 824 + , 825 + , 826 + , 827 + , 828 + , 829 + , 830 + , 831 + , 832 + , 833 + , 834 + , 835 + , 836 + , 837 + , 838 + , 839 + , 840 + , 841 + , 842 + , 843 + , 844 + , 845 + , 846 + , 847 + , 848 + , 849 + , 850 + , 851 + , 852 + , 853 + , 854 + , 855 + , 856 + , 857 + , 858 + , 859 + , 860 + , 861 + , 862 + , 863 + , 864 + , 865 + , 866 + , 867 + , 868 + , 869 + , 870 + , 871 + , 872 + , 873 + , 874 + , 875 + , 876 + , 877 + , 878 + , 879 + , 880 + , 881 + , 882 + , 883 + , 884 + , 885 + , 886 + , 887 + , 888 + , 889 + , 890 + , 891 + , 892 + , 893 + , 894 + , 895 + , 896 + , 897 + , 898 + , 899 + , 900 + , 901 + , 902 + , 903 + , 904 + , 905 + , 906 + , 907 + , 908 + , 909 + , 910 + , 911 + , 912 + , 913 + , 914 + , 915 + , 916 + , 917 + , 918 + , 919 + , 920 + , 921 + , 922 + , 923 + , 924 + , 925 + , 926 + , 927 + , 928 + , 929 + , 930 + , 931 + , 932 + , 933 + , 934 + , 935 + , 936 + , 937 + , 938 + , 939 + , 940 + , 941 + , 942 + , 943 + , 944 + , 945 + , 946 + , 947 + , 948 + , 949 + , 950 + , 951 + , 952 + , 953 + , 954 + , 955 + , 956 + , 957 + , 958 + , 959 + , 960 + , 961 + , 962 + , 963 + , 964 + , 965 + , 966 + , 967 + , 968 + , 969 + , 970 + , 971 + , 972 + , 973 + , 974 + , 975 + , 976 + , 977 + , 978 + , 979 + , 980 + , 981 + , 982 + , 983 + , 984 + , 985 + , 986 + , 987 + , 988 + , 989 + , 990 + , 991 + , 992 + , 993 + , 994 + , 995 + , 996 + , 997 + , 998 + , 999 + , 1000 + , 1001 + , 1002 + , 1003 + , 1004 + , 1005 + , 1006 + , 1007 + , 1008 + , 1009 + , 1010 + , 1011 + , 1012 + , 1013 + , 1014 + , 1015 + , 1016 + , 1017 + , 1018 + , 1019 + , 1020 + , 1021 + , 1022 + , 1023 + , 1024 + , 1025 + , 1026 + , 1027 + , 1028 + , 1029 + , 1030 + , 1031 + , 1032 + , 1033 + , 1034 + , 1035 + , 1036 + , 1037 + , 1038 + , 1039 + , 1040 + , 1041 + , 1042 + , 1043 + , 1044 + , 1045 + , 1046 + , 1047 + , 1048 + , 1049 + , 1050 + , 1051 + , 1052 + , 1053 + , 1054 + , 1055 + , 1056 + , 1057 + , 1058 + , 1059 + , 1060 + , 1061 + , 1062 + , 1063 + , 1064 + , 1065 + , 1066 + , 1067 + , 1068 + , 1069 + , 1070 + , 1071 + , 1072 + , 1073 + , 1074 + , 1075 + , 1076 + , 1077 + , 1078 + , 1079 + , 1080 + , 1081 + , 1082 + , 1083 + , 1084 + , 1085 + , 1086 + , 1087 + , 1088 + , 1089 + , 1090 + , 1091 + , 1092 + , 1093 + , 1094 + , 1095 + , 1096 + , 1097 + , 1098 + , 1099 + , 1100 + , 1101 + , 1102 + , 1103 + , 1104 + , 1105 + , 1106 + , 1107 + , 1108 + , 1109 + , 1110 + , 1111 + , 1112 + , 1113 + , 1114 + , 1115 + , 1116 + , 1117 + , 1118 + , 1119 + , 1120 + , 1121 + , 1122 + , 1123 + , 1124 + , 1125 + , 1126 + , 1127 + , 1128 + , 1129 + , 1130 + , 1131 + , 1132 + , 1133 + , 1134 + , 1135 + , 1136 + , 1137 + , 1138 + , 1139 + , 1140 + , 1141 + , 1142 + , 1143 + , 1144 + , 1145 + , 1146 + , 1147 + , 1148 + , 1149 + , 1150 + , 1151 + , 1152 + , 1153 + , 1154 + , 1155 + , 1156 + , 1157 + , 1158 + , 1159 + , 1160 + , 1161 + , 1162 + , 1163 + , 1164 + , 1165 + , 1166 + , 1167 + , 1168 + , 1169 + , 1170 + , 1171 + , 1172 + , 1173 + , 1174 + , 1175 + , 1176 + , 1177 + , 1178 + , 1179 + , 1180 + , 1181 + , 1182 + , 1183 + , 1184 + , 1185 + , 1186 + , 1187 + , 1188 + , 1189 + , 1190 + , 1191 + , 1192 + , 1193 + , 1194 + , 1195 + , 1196 + , 1197 + , 1198 + , 1199 + , 1200 + , 1201 + , 1202 + , 1203 + , 1204 + , 1205 + , 1206 + , 1207 + , 1208 + , 1209 + , 1210 + , 1211 + , 1212 + , 1213 + , 1214 + , 1215 + , 1216 + , 1217 + , 1218 + , 1219 + , 1220 + , 1221 + , 1222 + , 1223 + , 1224 + , 1225 + , 1226 + , 1227 + , 1228 + , 1229 + , 1230 + , 1231 + , 1232 + , 1233 + , 1234 + , 1235 + , 1236 + , 1237 + , 1238 + , 1239 + , 1240 + , 1241 + , 1242 + , 1243 + , 1244 + , 1245 + , 1246 + , 1247 + , 1248 + , 1249 + , 1250 + , 1251 + , 1252 + , 1253 + , 1254 + , 1255 + , 1256 + , 1257 + , 1258 + , 1259 + , 1260 + , 1261 + , 1262 + , 1263 + , 1264 + , 1265 + , 1266 + , 1267 + , 1268 + , 1269 + , 1270 + , 1271 + , 1272 + , 1273 + , 1274 + , 1275 + , 1276 + , 1277 + , 1278 + , 1279 + , 1280 + , 1281 + , 1282 + , 1283 + , 1284 + , 1285 + , 1286 + , 1287 + , 1288 + , 1289 + , 1290 + , 1291 + , 1292 + , 1293 + , 1294 + , 1295 + , 1296 + , 1297 + , 1298 + , 1299 + , 1300 + , 1301 + , 1302 + , 1303 + , 1304 + , 1305 + , 1306 + , 1307 + , 1308 + , 1309 + , 1310 + , 1311 + , 1312 + , 1313 + , 1314 + , 1315 + , 1316 + , 1317 + , 1318 + , 1319 + , 1320 + , 1321 + , 1322 + , 1323 + , 1324 + , 1325 + , 1326 + , 1327 + , 1328 + , 1329 + , 1330 + , 1331 + , 1332 + , 1333 + , 1334 + , 1335 + , 1336 + , 1337 + , 1338 + , 1339 + , 1340 + , 1341 + , 1342 + , 1343 + , 1344 + , 1345 + , 1346 + , 1347 + , 1348 + , 1349 + , 1350 + , 1351 + , 1352 + , 1353 + , 1354 + , 1355 + , 1356 + , 1357 + , 1358 + , 1359 + , 1360 + , 1361 + , 1362 + , 1363 + , 1364 + , 1365 + , 1366 + , 1367 + , 1368 + , 1369 + , 1370 + , 1371 + , 1372 + , 1373 + , 1374 + , 1375 + , 1376 + , 1377 + , 1378 + , 1379 + , 1380 + , 1381 + , 1382 + , 1383 + , 1384 + , 1385 + , 1386 + , 1387 + , 1388 + , 1389 + , 1390 + , 1391 + , 1392 + , 1393 + , 1394 + , 1395 + , 1396 + , 1397 + , 1398 + , 1399 + , 1400 + , 1401 + , 1402 + , 1403 + , 1404 + , 1405 + , 1406 + , 1407 + , 1408 + , 1409 + , 1410 + , 1411 + , 1412 + , 1413 + , 1414 + , 1415 + , 1416 + , 1417 + , 1418 + , 1419 + , 1420 + , 1421 + , 1422 + , 1423 + , 1424 + , 1425 + , 1426 + , 1427 + , 1428 + , 1429 + , 1430 + , 1431 + , 1432 + , 1433 + , 1434 + , 1435 + , 1436 + , 1437 + , 1438 + , 1439 + , 1440 + , 1441 + , 1442 + , 1443 + , 1444 + , 1445 + , 1446 + , 1447 + , 1448 + , 1449 + , 1450 + , 1451 + , 1452 + , 1453 + , 1454 + , 1455 + , 1456 + , 1457 + , 1458 + , 1459 + , 1460 + , 1461 + , 1462 + , 1463 + , 1464 + , 1465 + , 1466 + , 1467 + , 1468 + , 1469 + , 1470 + , 1471 + , 1472 + , 1473 + , 1474 + , 1475 + , 1476 + , 1477 + , 1478 + , 1479 + , 1480 + , 1481 + , 1482 + , 1483 + , 1484 + , 1485 + , 1486 + , 1487 + , 1488 + , 1489 + , 1490 + , 1491 + , 1492 + , 1493 + , 1494 + , 1495 + , 1496 + , 1497 + , 1498 + , 1499 + , 1500 + , 1501 + , 1502 + , 1503 + , 1504 + , 1505 + , 1506 + , 1507 + , 1508 + , 1509 + , 1510 + , 1511 + , 1512 + , 1513 + , 1514 + , 1515 + , 1516 + , 1517 + , 1518 + , 1519 + , 1520 + , 1521 + , 1522 + , 1523 + , 1524 + , 1525 + , 1526 + , 1527 + , 1528 + , 1529 + , 1530 + , 1531 + , 1532 + , 1533 + , 1534 + , 1535 + , 1536 + , 1537 + , 1538 + , 1539 + , 1540 + , 1541 + , 1542 + , 1543 + , 1544 + , 1545 + , 1546 + , 1547 + , 1548 + , 1549 + , 1550 + , 1551 + , 1552 + , 1553 + , 1554 + , 1555 + , 1556 + , 1557 + , 1558 + , 1559 + , 1560 + , 1561 + , 1562 + , 1563 + , 1564 + , 1565 + , 1566 + , 1567 + , 1568 + , 1569 + , 1570 + , 1571 + , 1572 + , 1573 + , 1574 + , 1575 + , 1576 + , 1577 + , 1578 + , 1579 + , 1580 + , 1581 + , 1582 + , 1583 + , 1584 + , 1585 + , 1586 + , 1587 + , 1588 + , 1589 + , 1590 + , 1591 + , 1592 + , 1593 + , 1594 + , 1595 + , 1596 + , 1597 + , 1598 + , 1599 + , 1600 + , 1601 + , 1602 + , 1603 + , 1604 + , 1605 + , 1606 + , 1607 + , 1608 + , 1609 + , 1610 + , 1611 + , 1612 + , 1613 + , 1614 + , 1615 + , 1616 + , 1617 + , 1618 + , 1619 + , 1620 + , 1621 + , 1622 + , 1623 + , 1624 + , 1625 + , 1626 + , 1627 + , 1628 + , 1629 + , 1630 + , 1631 + , 1632 + , 1633 + , 1634 + , 1635 + , 1636 + , 1637 + , 1638 + , 1639 + , 1640 + , 1641 + , 1642 + , 1643 + , 1644 + , 1645 + , 1646 + , 1647 + , 1648 + , 1649 + , 1650 + , 1651 + , 1652 + , 1653 + , 1654 + , 1655 + , 1656 + , 1657 + , 1658 + , 1659 + , 1660 + , 1661 + , 1662 + , 1663 + , 1664 + , 1665 + , 1666 + , 1667 + , 1668 + , 1669 + , 1670 + , 1671 + , 1672 + , 1673 + , 1674 + , 1675 + , 1676 + , 1677 + , 1678 + , 1679 + , 1680 + , 1681 + , 1682 + , 1683 + , 1684 + , 1685 + , 1686 + , 1687 + , 1688 + , 1689 + , 1690 + , 1691 + , 1692 + , 1693 + , 1694 + , 1695 + , 1696 + , 1697 + , 1698 + , 1699 + , 1700 + , 1701 + , 1702 + , 1703 + , 1704 + , 1705 + , 1706 + , 1707 + , 1708 + , 1709 + , 1710 + , 1711 + , 1712 + , 1713 + , 1714 + , 1715 + , 1716 + , 1717 + , 1718 + , 1719 + , 1720 + , 1721 + , 1722 + , 1723 + , 1724 + , 1725 + , 1726 + , 1727 + , 1728 + , 1729 + , 1730 + , 1731 + , 1732 + , 1733 + , 1734 + , 1735 + , 1736 + , 1737 + , 1738 + , 1739 + , 1740 + , 1741 + , 1742 + , 1743 + , 1744 + , 1745 + , 1746 + , 1747 + , 1748 + , 1749 + , 1750 + , 1751 + , 1752 + , 1753 + , 1754 + , 1755 + , 1756 + , 1757 + , 1758 + , 1759 + , 1760 + , 1761 + , 1762 + , 1763 + , 1764 + , 1765 + , 1766 + , 1767 + , 1768 + , 1769 + , 1770 + , 1771 + , 1772 + , 1773 + , 1774 + , 1775 + , 1776 + , 1777 + , 1778 + , 1779 + , 1780 + , 1781 + , 1782 + , 1783 + , 1784 + , 1785 + , 1786 + , 1787 + , 1788 + , 1789 + , 1790 + , 1791 + , 1792 + , 1793 + , 1794 + , 1795 + , 1796 + , 1797 + , 1798 + , 1799 + , 1800 + , 1801 + , 1802 + , 1803 + , 1804 + , 1805 + , 1806 + , 1807 + , 1808 + , 1809 + , 1810 + , 1811 + , 1812 + , 1813 + , 1814 + , 1815 + , 1816 + , 1817 + , 1818 + , 1819 + , 1820 + , 1821 + , 1822 + , 1823 + , 1824 + , 1825 + , 1826 + , 1827 + , 1828 + , 1829 + , 1830 + , 1831 + , 1832 + , 1833 + , 1834 + , 1835 + , 1836 + , 1837 + , 1838 + , 1839 + , 1840 + , 1841 + , 1842 + , 1843 + , 1844 + , 1845 + , 1846 + , 1847 + , 1848 + , 1849 + , 1850 + , 1851 + , 1852 + , 1853 + , 1854 + , 1855 + , 1856 + , 1857 + , 1858 + , 1859 + , 1860 + , 1861 + , 1862 + , 1863 + , 1864 + , 1865 + , 1866 + , 1867 + , 1868 + , 1869 + , 1870 + , 1871 + , 1872 + , 1873 + , 1874 + , 1875 + , 1876 + , 1877 + , 1878 + , 1879 + , 1880 + , 1881 + , 1882 + , 1883 + , 1884 + , 1885 + , 1886 + , 1887 + , 1888 + , 1889 + , 1890 + , 1891 + , 1892 + , 1893 + , 1894 + , 1895 + , 1896 + , 1897 + , 1898 + , 1899 + , 1900 + , 1901 + , 1902 + , 1903 + , 1904 + , 1905 + , 1906 + , 1907 + , 1908 + , 1909 + , 1910 + , 1911 + , 1912 + , 1913 + , 1914 + , 1915 + , 1916 + , 1917 + , 1918 + , 1919 + , 1920 + , 1921 + , 1922 + , 1923 + , 1924 + , 1925 + , 1926 + , 1927 + , 1928 + , 1929 + , 1930 + , 1931 + , 1932 + , 1933 + , 1934 + , 1935 + , 1936 + , 1937 + , 1938 + , 1939 + , 1940 + , 1941 + , 1942 + , 1943 + , 1944 + , 1945 + , 1946 + , 1947 + , 1948 + , 1949 + , 1950 + , 1951 + , 1952 + , 1953 + , 1954 + , 1955 + , 1956 + , 1957 + , 1958 + , 1959 + , 1960 + , 1961 + , 1962 + , 1963 + , 1964 + , 1965 + , 1966 + , 1967 + , 1968 + , 1969 + , 1970 + , 1971 + , 1972 + , 1973 + , 1974 + , 1975 + , 1976 + , 1977 + , 1978 + , 1979 + , 1980 + , 1981 + , 1982 + , 1983 + , 1984 + , 1985 + , 1986 + , 1987 + , 1988 + , 1989 + , 1990 + , 1991 + , 1992 + , 1993 + , 1994 + , 1995 + , 1996 + , 1997 + , 1998 + , 1999 + , 2000 + ] +``` diff --git a/unison-src/transcripts/idempotent/fix2712.md b/unison-src/transcripts/idempotent/fix2712.md index 97c3a9dc78..2787499d1a 100644 --- a/unison-src/transcripts/idempotent/fix2712.md +++ b/unison-src/transcripts/idempotent/fix2712.md @@ -9,8 +9,27 @@ mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b mapWithKey f m = Tip ``` +``` ucm :added-by-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 Map k v + mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Map k v + mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b ``` ``` unison @@ -25,3 +44,16 @@ naiomi = mapWithKey susan pam ``` + +``` ucm :added-by-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`: + + naiomi : Map Nat () +``` diff --git a/unison-src/transcripts/idempotent/fix2795.md b/unison-src/transcripts/idempotent/fix2795.md index bee964c5ae..6dcde3bad3 100644 --- a/unison-src/transcripts/idempotent/fix2795.md +++ b/unison-src/transcripts/idempotent/fix2795.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.mergeio + + Done. ``` ```` unison @@ -17,6 +19,29 @@ test = {{ t1 = "hi" ```` +``` ucm :added-by-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`: + + t1 : Text + test : Doc2 +``` + ``` ucm scratch/main> display test + + t : Text + t = "hi" + t + ⧨ + "hi" + + t1 : Text + t1 = "hi" ``` diff --git a/unison-src/transcripts/idempotent/fix2822.md b/unison-src/transcripts/idempotent/fix2822.md index f48149ace6..8dadc1c54c 100644 --- a/unison-src/transcripts/idempotent/fix2822.md +++ b/unison-src/transcripts/idempotent/fix2822.md @@ -12,13 +12,42 @@ _a.blah = 2 b = _a.blah + 1 ``` -Or even that _are_ a single “blank” component +``` ucm :added-by-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.blah : Nat + b : Nat +``` + +Or even that *are* a single “blank” component ``` unison _b = 2 x = _b + 1 ``` + +``` ucm :added-by-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`: + + _b : Nat + x : Nat +``` + Types can also have underscore-led components. ``` unison @@ -28,6 +57,20 @@ c : _a.Blah c = A ``` +``` ucm :added-by-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 _a.Blah + c : Blah +``` + And we should also be able to access underscore-led fields. ``` unison @@ -36,6 +79,23 @@ type Hello = {_value : Nat} doStuff = _value.modify ``` +``` ucm :added-by-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 Hello + Hello._value : Hello -> Nat + Hello._value.modify : (Nat ->{g} Nat) -> Hello ->{g} Hello + Hello._value.set : Nat -> Hello -> Hello + doStuff : (Nat ->{g} Nat) -> Hello ->{g} Hello +``` + But pattern matching shouldn’t bind to underscore-led names. ``` unison :error @@ -44,6 +104,24 @@ dontMap f = cases Some _used -> f _used ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what _used refers to here: + + 3 | Some _used -> f _used + + I also don't know what type it should be. + + Some common causes of this error include: + * Your current namespace is too deep to contain the + definition in its subtree + * The definition is part of a library which hasn't been + added to this project + * You have a typo in the name +``` + But we can use them as unbound patterns. ``` unison @@ -51,3 +129,16 @@ dontMap f = cases None -> false Some _unused -> f 2 ``` + +``` ucm :added-by-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`: + + dontMap : (Nat ->{g} Boolean) -> Optional a ->{g} Boolean +``` diff --git a/unison-src/transcripts/idempotent/fix2826.md b/unison-src/transcripts/idempotent/fix2826.md index bdbc788a85..46ea907bad 100644 --- a/unison-src/transcripts/idempotent/fix2826.md +++ b/unison-src/transcripts/idempotent/fix2826.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.mergeio + + Done. ``` Supports fences that are longer than three backticks. @@ -14,10 +16,49 @@ doc = {{ ```` +``` ucm :added-by-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`: + + doc : Doc2 +``` + And round-trips properly. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + doc : Doc2 scratch/main> edit doc + + ☝️ + + I added 1 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. scratch/main> load scratch.u + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. ``` + +```` unison :added-by-ucm scratch.u +doc : Doc2 +doc = + {{ + @typecheck ``` + x = 3 + ``` + }} +```` diff --git a/unison-src/transcripts/idempotent/fix2970.md b/unison-src/transcripts/idempotent/fix2970.md index a3afcd1e0a..bcbbf93c4f 100644 --- a/unison-src/transcripts/idempotent/fix2970.md +++ b/unison-src/transcripts/idempotent/fix2970.md @@ -1,10 +1,25 @@ -Also fixes #1519 (it's the same issue). +Also fixes \#1519 (it's the same issue). ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison foo.+.doc : Nat foo.+.doc = 10 ``` + +``` ucm :added-by-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.+.doc : Nat +``` diff --git a/unison-src/transcripts/idempotent/fix3037.md b/unison-src/transcripts/idempotent/fix3037.md index d4a1fd18b4..b3bd705af6 100644 --- a/unison-src/transcripts/idempotent/fix3037.md +++ b/unison-src/transcripts/idempotent/fix3037.md @@ -17,6 +17,25 @@ runner : Runner {IO} runner = pureRunner ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found an ability mismatch when checking the expression in red + + 3 | pureRunner : Runner {} + 4 | pureRunner = Runner base.force + 5 | + 6 | -- this compiles, but shouldn't the effect type parameter on Runner be invariant? + 7 | runner : Runner {IO} + 8 | runner = pureRunner + + + When trying to match Runner {} with Runner {IO} the right hand + side contained extra abilities: {IO} + +``` + Application version: ``` unison :error @@ -30,3 +49,17 @@ h _ = () > h anA ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found an ability mismatch when checking the application + + 9 | > h anA + + + When trying to match A {} with A {IO} the right hand side + contained extra abilities: {IO} + +``` diff --git a/unison-src/transcripts/idempotent/fix3171.md b/unison-src/transcripts/idempotent/fix3171.md index a759bcfce3..e15ba83254 100644 --- a/unison-src/transcripts/idempotent/fix3171.md +++ b/unison-src/transcripts/idempotent/fix3171.md @@ -12,3 +12,27 @@ f x y z _ = x + y * z > f 1 2 > f 1 2 3 ``` + +``` ucm :added-by-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`: + + f : Nat -> Nat -> Nat -> 'Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 4 | > f 1 2 + ⧩ + z _ -> 1 Nat.+ 2 Nat.* z + + 5 | > f 1 2 3 + ⧩ + _ -> 1 Nat.+ 2 Nat.* 3 +``` diff --git a/unison-src/transcripts/idempotent/fix3196.md b/unison-src/transcripts/idempotent/fix3196.md index 0139fff35f..02f78449f7 100644 --- a/unison-src/transcripts/idempotent/fix3196.md +++ b/unison-src/transcripts/idempotent/fix3196.md @@ -32,3 +32,29 @@ w2 = cases W -> W > w2 w1 ``` + +``` ucm :added-by-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 C + structural type W es + ability Zoot + ex : '{Zoot} r + w1 : W {Zoot} + w2 : W {g} -> W {g} + woot : W {g} -> '{g, Zoot} a ->{Zoot} a + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 22 | > w2 w1 + ⧩ + W +``` diff --git a/unison-src/transcripts/idempotent/fix3215.md b/unison-src/transcripts/idempotent/fix3215.md index cfa9c63266..43f652eb67 100644 --- a/unison-src/transcripts/idempotent/fix3215.md +++ b/unison-src/transcripts/idempotent/fix3215.md @@ -19,3 +19,17 @@ f = cases {flo -> k} -> 5 {x} -> 5 ``` + +``` ucm :added-by-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 ability T + f : Request {g, T} x -> Nat +``` diff --git a/unison-src/transcripts/idempotent/fix3244.md b/unison-src/transcripts/idempotent/fix3244.md index 7a5525e754..8159eb8b28 100644 --- a/unison-src/transcripts/idempotent/fix3244.md +++ b/unison-src/transcripts/idempotent/fix3244.md @@ -19,3 +19,23 @@ foo t = > foo (10,20) ``` + +``` ucm :added-by-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 : (Nat, Nat) -> Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 11 | > foo (10,20) + ⧩ + 30 +``` diff --git a/unison-src/transcripts/idempotent/fix3265.md b/unison-src/transcripts/idempotent/fix3265.md index 08d1b580be..11547b8bf3 100644 --- a/unison-src/transcripts/idempotent/fix3265.md +++ b/unison-src/transcripts/idempotent/fix3265.md @@ -4,11 +4,12 @@ scratch/main> builtins.merge Tests cases that produced bad decompilation output previously. There are three cases that need to be 'fixed up.' - 1. lambda expressions with free variables need to be beta reduced - 2. let defined functions need to have arguments removed and - occurrences rewritten. - 3. let-rec defined functions need to have arguments removed, but - it is a more complicated process. + +1. lambda expressions with free variables need to be beta reduced +2. let defined functions need to have arguments removed and + occurrences rewritten. +3. let-rec defined functions need to have arguments removed, but + it is a more complicated process. ``` unison > Any (w x -> let @@ -24,6 +25,35 @@ are three cases that need to be 'fixed up.' g (z -> x + f0 z)) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > Any (w x -> let + ⧩ + Any + (w x -> + let + use Nat + drop + f1 y = match y with + 0 -> w + x + n -> 1 + f0 (drop y 1) + f0 y = match y with + 0 -> x + n -> 1 + f1 (drop y 1) + f2 x = f2 x + f3 x y = 1 + y + f2 x + g h = h 1 + x + g (z -> x + f0 z)) +``` + Also check for some possible corner cases. `f` should not have its `x` argument eliminated, because it doesn't @@ -39,3 +69,25 @@ discard its arguments, where `f` also occurs. f x 20) ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > Any (x -> let + ⧩ + Any + (x -> + let + f x y = match y with + 0 -> 0 + _ -> f x (f y (Nat.drop y 1)) + f x 20) +``` diff --git a/unison-src/transcripts/idempotent/fix3424.md b/unison-src/transcripts/idempotent/fix3424.md index b0ac64b26c..95a1b880ea 100644 --- a/unison-src/transcripts/idempotent/fix3424.md +++ b/unison-src/transcripts/idempotent/fix3424.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge lib.builtins + + Done. ``` ``` unison :hide @@ -10,7 +12,15 @@ c = "World" ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a : 'Text + b : Text + c : Text scratch/main> run a + + "Hello, World!" ``` ``` unison :hide @@ -20,7 +30,18 @@ c = "Unison" ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> run a + + "Hello, Unison!" ``` -The result should be "Hello, Unison!". +The result should be "Hello, Unison\!". diff --git a/unison-src/transcripts/idempotent/fix3634.md b/unison-src/transcripts/idempotent/fix3634.md index c162cc7a12..fcd46aade7 100644 --- a/unison-src/transcripts/idempotent/fix3634.md +++ b/unison-src/transcripts/idempotent/fix3634.md @@ -2,7 +2,6 @@ scratch/main> builtins.mergeio ``` - ``` unison structural type M a = N | J a @@ -15,7 +14,32 @@ d = {{ }} ``` +``` ucm :added-by-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 M a + (also named builtin.Optional) + d : Doc2 +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type M a + (also named builtin.Optional) + d : Doc2 scratch/main> display d + + `x -> J x` + + J ``` diff --git a/unison-src/transcripts/idempotent/fix3678.md b/unison-src/transcripts/idempotent/fix3678.md index 066bb45e10..f8c1dff0fb 100644 --- a/unison-src/transcripts/idempotent/fix3678.md +++ b/unison-src/transcripts/idempotent/fix3678.md @@ -11,3 +11,23 @@ arr = Scope.run do > compare arr arr ``` + +``` ucm :added-by-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`: + + arr : ImmutableArray Text + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 5 | > compare arr arr + ⧩ + +0 +``` diff --git a/unison-src/transcripts/idempotent/fix3752.md b/unison-src/transcripts/idempotent/fix3752.md index fa66e9c5d3..25d17717ba 100644 --- a/unison-src/transcripts/idempotent/fix3752.md +++ b/unison-src/transcripts/idempotent/fix3752.md @@ -19,3 +19,17 @@ bar = do id () id "hello" ``` + +``` ucm :added-by-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`: + + bar : 'Text + foo : 'Text +``` diff --git a/unison-src/transcripts/idempotent/fix3773.md b/unison-src/transcripts/idempotent/fix3773.md index e16fe791f9..b781453bb3 100644 --- a/unison-src/transcripts/idempotent/fix3773.md +++ b/unison-src/transcripts/idempotent/fix3773.md @@ -10,3 +10,23 @@ foo = > foo + 20 ``` + +``` ucm :added-by-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 : Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 6 | > foo + 20 + ⧩ + 62 +``` diff --git a/unison-src/transcripts/idempotent/fix3977.md b/unison-src/transcripts/idempotent/fix3977.md index 0e324b3977..cac95349b6 100644 --- a/unison-src/transcripts/idempotent/fix3977.md +++ b/unison-src/transcripts/idempotent/fix3977.md @@ -12,6 +12,34 @@ foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + failure : Text -> context -> Failure + foo : Either Failure b scratch/main> edit foo + + ☝️ + + I added 1 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. scratch/main> load scratch.u + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. +``` + +``` unison :added-by-ucm scratch.u +foo : Either Failure b +foo = + use Text ++ + Left + (failure + ("a loooooooooooooooooooooooooooooooooong" + ++ "message with concatenation") + ()) ``` diff --git a/unison-src/transcripts/idempotent/fix4172.md b/unison-src/transcripts/idempotent/fix4172.md index e132631bb2..e87835951c 100644 --- a/unison-src/transcripts/idempotent/fix4172.md +++ b/unison-src/transcripts/idempotent/fix4172.md @@ -15,16 +15,84 @@ bool = true allowDebug = debug [1,2,3] ``` +``` ucm :added-by-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`: + + allowDebug : Text + bool : Boolean + debug : a -> Text + t1 : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 6 | test> t1 = if bool then [Ok "Yay"] + + ✅ Passed Yay +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + allowDebug : Text + bool : Boolean + debug : a -> Text + t1 : [Result] scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. t1 ◉ Yay + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ``` unison bool = false ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + bool : Boolean +``` + ``` ucm :error scratch/main> update.old + + ⍟ I've updated these names to your new definition: + + bool : Boolean scratch/main> test + + ✅ + + + + New test results: + + 1. t1 ✗ [1, 2, 3] + + 🚫 1 test(s) failing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/fix4280.md b/unison-src/transcripts/idempotent/fix4280.md index d4d2caed4b..8d7ff2c2d0 100644 --- a/unison-src/transcripts/idempotent/fix4280.md +++ b/unison-src/transcripts/idempotent/fix4280.md @@ -10,3 +10,17 @@ bonk = use foo.bar _baz _baz ``` + +``` ucm :added-by-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 + foo.bar._baz : Nat +``` diff --git a/unison-src/transcripts/idempotent/fix4397.md b/unison-src/transcripts/idempotent/fix4397.md index f00fa26a28..fa95e4a577 100644 --- a/unison-src/transcripts/idempotent/fix4397.md +++ b/unison-src/transcripts/idempotent/fix4397.md @@ -6,3 +6,14 @@ unique type Baz = Baz (Foo Bar) unique type Bar = Bar Baz ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 3 | unique type Baz = Baz (Foo Bar) + + Foo expects an argument of kind: Type -> Type; however, it + is applied to Bar which has kind: Type. +``` diff --git a/unison-src/transcripts/idempotent/fix4415.md b/unison-src/transcripts/idempotent/fix4415.md index fd196c124a..541d736413 100644 --- a/unison-src/transcripts/idempotent/fix4415.md +++ b/unison-src/transcripts/idempotent/fix4415.md @@ -2,3 +2,17 @@ unique type Foo = Foo unique type sub.Foo = ``` + +``` ucm :added-by-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 + type sub.Foo +``` diff --git a/unison-src/transcripts/idempotent/fix4424.md b/unison-src/transcripts/idempotent/fix4424.md index 3e5b05a5ca..8915119bd9 100644 --- a/unison-src/transcripts/idempotent/fix4424.md +++ b/unison-src/transcripts/idempotent/fix4424.md @@ -14,6 +14,12 @@ countCat = cases ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Cat.Dog + type Rat.Dog + countCat : Cat.Dog -> Rat.Dog ``` Now I want to add a constructor. @@ -24,4 +30,13 @@ unique type Rat.Dog = Bird | Mouse ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix4482.md b/unison-src/transcripts/idempotent/fix4482.md index c1306b2704..8cabe342e1 100644 --- a/unison-src/transcripts/idempotent/fix4482.md +++ b/unison-src/transcripts/idempotent/fix4482.md @@ -10,7 +10,56 @@ lib.foo1.lib.bonk2.qux = 1 mybar = bar + bar ``` +``` ucm :added-by-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`: + + lib.foo0.baz : Nat + lib.foo0.lib.bonk1.bar : Nat + lib.foo1.lib.bonk2.qux : Nat + lib.foo1.zonk : Nat + mybar : Nat +``` + ``` ucm :error myproj/main> add + + ⍟ I've added these definitions: + + lib.foo0.baz : Nat + lib.foo0.lib.bonk1.bar : Nat + lib.foo1.lib.bonk2.qux : Nat + lib.foo1.zonk : Nat + mybar : Nat myproj/main> upgrade foo0 foo1 + + I couldn't automatically upgrade foo0 to foo1. However, I've + added the definitions that need attention to the top of + scratch.u. + + When you're done, you can run + + upgrade.commit + + to merge your changes back into main and delete the temporary + branch. Or, if you decide to cancel the upgrade instead, you + can run + + delete.branch /upgrade-foo0-to-foo1 + + to delete the temporary branch and switch back to main. +``` + +``` unison :added-by-ucm scratch.u +mybar : Nat +mybar = + use Nat + + use lib.foo0.lib.bonk1 bar + bar + bar ``` diff --git a/unison-src/transcripts/idempotent/fix4498.md b/unison-src/transcripts/idempotent/fix4498.md index 84a475edbc..00614c6a9e 100644 --- a/unison-src/transcripts/idempotent/fix4498.md +++ b/unison-src/transcripts/idempotent/fix4498.md @@ -9,7 +9,35 @@ lib.dep0.lib.dep1.foo = 6 myterm = foo + 2 ``` +``` ucm :added-by-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`: + + lib.dep0.bonk.foo : Nat + lib.dep0.lib.dep1.foo : Nat + lib.dep0.zonk.foo : Text + myterm : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.dep0.bonk.foo : Nat + lib.dep0.lib.dep1.foo : Nat + lib.dep0.zonk.foo : Text + myterm : Nat scratch/main> view myterm + + myterm : Nat + myterm = + use Nat + + bonk.foo + 2 ``` diff --git a/unison-src/transcripts/idempotent/fix4515.md b/unison-src/transcripts/idempotent/fix4515.md index 7ee66bb08f..87e3c19cea 100644 --- a/unison-src/transcripts/idempotent/fix4515.md +++ b/unison-src/transcripts/idempotent/fix4515.md @@ -12,14 +12,60 @@ useBar = cases Bar.X _ -> 1 ``` +``` ucm :added-by-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 Bar + type Baz + type Foo + useBar : Bar -> Nat +``` + ``` ucm myproject/main> add + + ⍟ I've added these definitions: + + type Bar + type Baz + type Foo + useBar : Bar -> Nat ``` ``` unison unique type Foo = Foo1 | Foo2 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm myproject/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix4528.md b/unison-src/transcripts/idempotent/fix4528.md index 4d43f772e6..6c7f76915f 100644 --- a/unison-src/transcripts/idempotent/fix4528.md +++ b/unison-src/transcripts/idempotent/fix4528.md @@ -9,7 +9,28 @@ main : () -> Foo main _ = MkFoo 5 ``` +``` ucm :added-by-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 Foo + main : 'Foo +``` + ``` ucm foo/main> add + + ⍟ I've added these definitions: + + structural type Foo + main : 'Foo foo/main> run main + + MkFoo 5 ``` diff --git a/unison-src/transcripts/idempotent/fix4556.md b/unison-src/transcripts/idempotent/fix4556.md index 28c2bb97f9..30048e4bb3 100644 --- a/unison-src/transcripts/idempotent/fix4556.md +++ b/unison-src/transcripts/idempotent/fix4556.md @@ -9,14 +9,60 @@ bar.hello = 5 + thing hey = foo.hello ``` +``` ucm :added-by-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`: + + bar.hello : Nat + foo.hello : Nat + hey : Nat + thing : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar.hello : Nat + foo.hello : Nat + hey : Nat + thing : Nat ``` ``` unison thing = 2 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + thing : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix4592.md b/unison-src/transcripts/idempotent/fix4592.md index bbbbd47a8e..4379da14a5 100644 --- a/unison-src/transcripts/idempotent/fix4592.md +++ b/unison-src/transcripts/idempotent/fix4592.md @@ -6,3 +6,16 @@ scratch/main> builtins.mergeio doc = {{ {{ bug "bug" 52 }} }} ``` + +``` ucm :added-by-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`: + + doc : Doc2 +``` diff --git a/unison-src/transcripts/idempotent/fix4618.md b/unison-src/transcripts/idempotent/fix4618.md index 2ff1a042e6..b8e775dc2a 100644 --- a/unison-src/transcripts/idempotent/fix4618.md +++ b/unison-src/transcripts/idempotent/fix4618.md @@ -7,8 +7,27 @@ foo = 5 unique type Bugs.Zonk = Bugs ``` +``` ucm :added-by-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 Bugs.Zonk + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Bugs.Zonk + foo : Nat ``` ``` unison @@ -16,6 +35,29 @@ foo = 4 unique type Bugs = ``` +``` ucm :added-by-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 Bugs + + ⍟ These names already exist. You can `update` them to your + new definition: + + foo : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix4711.md b/unison-src/transcripts/idempotent/fix4711.md index 5087b4802a..20c94397cf 100644 --- a/unison-src/transcripts/idempotent/fix4711.md +++ b/unison-src/transcripts/idempotent/fix4711.md @@ -10,10 +10,49 @@ thisWorks = '(+1) thisDoesNotWork = ['(+1)] ``` +``` ucm :added-by-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`: + + thisDoesNotWork : ['{g} Int] + thisWorks : 'Int +``` + Since this is fixed, `thisDoesNotWork` now does work. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + thisDoesNotWork : ['{g} Int] + thisWorks : 'Int scratch/main> edit thisWorks thisDoesNotWork + + ☝️ + + I added 2 definitions to the top of scratch.u + + You can edit them there, then run `update` to replace the + definitions currently in this namespace. scratch/main> load + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. +``` + +``` unison :added-by-ucm scratch.u +thisDoesNotWork : ['{g} Int] +thisDoesNotWork = [do +1] + +thisWorks : 'Int +thisWorks = do +1 ``` diff --git a/unison-src/transcripts/idempotent/fix4722.md b/unison-src/transcripts/idempotent/fix4722.md index 4b682a66cc..b7568064f7 100644 --- a/unison-src/transcripts/idempotent/fix4722.md +++ b/unison-src/transcripts/idempotent/fix4722.md @@ -1,6 +1,6 @@ Tests an improvement to type checking related to abilities. -`foo` below typechecks fine as long as all the branches are _checked_ +`foo` below typechecks fine as long as all the branches are *checked* against their expected type. However, it's annoying to have to annotate them. The old code was checking a match by just synthesizing and subtyping, but we can instead check a match by pushing the @@ -37,3 +37,26 @@ foo = cases Branch l r -> f (_ -> ()) (foo l) (foo r) ``` + +``` ucm :added-by-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 Bar a + type Foo b a + ability X a + ability Y + abra : a -> '{Y, X z} r + cadabra : (y ->{h} z) -> '{g, X y} r -> '{g, X z} r + f : (a ->{h} ()) + -> '{g, X a} () + -> '{g, X a} () + -> '{g, X a} () + foo : Bar (Optional b) -> '{Y, X (Foo z ('{Y} r))} () +``` diff --git a/unison-src/transcripts/idempotent/fix4731.md b/unison-src/transcripts/idempotent/fix4731.md index 0cae588bdf..23b743a42e 100644 --- a/unison-src/transcripts/idempotent/fix4731.md +++ b/unison-src/transcripts/idempotent/fix4731.md @@ -2,8 +2,25 @@ structural type Void = ``` +``` ucm :added-by-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 Void +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Void ``` We should be able to `match` on empty types like `Void`. @@ -13,11 +30,37 @@ Void.absurdly : '{e} Void ->{e} a Void.absurdly v = match !v with ``` +``` ucm :added-by-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`: + + Void.absurdly : '{e} Void ->{e} a +``` + ``` unison Void.absurdly : Void -> a Void.absurdly v = match v with ``` +``` ucm :added-by-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`: + + Void.absurdly : Void -> a +``` + And empty `cases` should also work. ``` unison @@ -25,9 +68,30 @@ Void.absurdly : Void -> a Void.absurdly = cases ``` +``` ucm :added-by-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`: + + Void.absurdly : Void -> a +``` + But empty function bodies are not allowed. ``` unison :error Void.absurd : Void -> a Void.absurd x = ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I expected a block after this (in red), but there wasn't one. Maybe check your indentation: + 2 | Void.absurd x = +``` diff --git a/unison-src/transcripts/idempotent/fix4780.md b/unison-src/transcripts/idempotent/fix4780.md index 63912baded..266ac610d6 100644 --- a/unison-src/transcripts/idempotent/fix4780.md +++ b/unison-src/transcripts/idempotent/fix4780.md @@ -8,3 +8,19 @@ builtins decompile properly. ``` unison > (+) 2 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > (+) 2 + ⧩ + (Nat.+) 2 +``` diff --git a/unison-src/transcripts/idempotent/fix4898.md b/unison-src/transcripts/idempotent/fix4898.md index c34f170932..f8c1948545 100644 --- a/unison-src/transcripts/idempotent/fix4898.md +++ b/unison-src/transcripts/idempotent/fix4898.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,38 @@ redouble : Int -> Int redouble x = double x + double x ``` +``` ucm :added-by-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`: + + double : Int -> Int + redouble : Int -> Int +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + double : Int -> Int + redouble : Int -> Int scratch/main> dependents double + + Dependents of: double + + Terms: + + 1. redouble + + Tip: Try `view 1` to see the source of any numbered item in + the above list. scratch/main> delete.term 1 + + Done. ``` diff --git a/unison-src/transcripts/idempotent/fix5055.md b/unison-src/transcripts/idempotent/fix5055.md index 300db1fb8a..a19493dce8 100644 --- a/unison-src/transcripts/idempotent/fix5055.md +++ b/unison-src/transcripts/idempotent/fix5055.md @@ -1,5 +1,7 @@ ``` ucm test-5055/main> builtins.merge + + Done. ``` ``` unison @@ -8,8 +10,35 @@ foo.add x y = x Int.+ y foo.subtract x y = x Int.- y ``` +``` ucm :added-by-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.add : Int -> Int -> Int + foo.subtract : Int -> Int -> Int +``` + ``` ucm test-5055/main> add + + ⍟ I've added these definitions: + + foo.add : Int -> Int -> Int + foo.subtract : Int -> Int -> Int test-5055/main> ls foo + + 1. add (Int -> Int -> Int) + 2. subtract (Int -> Int -> Int) test-5055/main> view 1 + + foo.add : Int -> Int -> Int + foo.add x y = + use Int + + x + y ``` diff --git a/unison-src/transcripts/idempotent/fix5076.md b/unison-src/transcripts/idempotent/fix5076.md index ce77784ce3..4fadef5b75 100644 --- a/unison-src/transcripts/idempotent/fix5076.md +++ b/unison-src/transcripts/idempotent/fix5076.md @@ -10,3 +10,16 @@ x = {{ ``do "me"`` in }} ``` + +``` ucm :added-by-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 : Doc2 +``` diff --git a/unison-src/transcripts/idempotent/fix5080.md b/unison-src/transcripts/idempotent/fix5080.md index fd24f552f5..97accafa83 100644 --- a/unison-src/transcripts/idempotent/fix5080.md +++ b/unison-src/transcripts/idempotent/fix5080.md @@ -7,12 +7,62 @@ test> fix5080.tests.success = [Ok "success"] test> fix5080.tests.failure = [Fail "fail"] ``` +``` ucm :added-by-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`: + + fix5080.tests.failure : [Result] + fix5080.tests.success : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | test> fix5080.tests.success = [Ok "success"] + + ✅ Passed success + + 2 | test> fix5080.tests.failure = [Fail "fail"] + + 🚫 FAILED fail +``` + ``` ucm :error scratch/main> add + + ⍟ I've added these definitions: + + fix5080.tests.failure : [Result] + fix5080.tests.success : [Result] scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. fix5080.tests.success ◉ success + + 2. fix5080.tests.failure ✗ fail + + 🚫 1 test(s) failing, ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ``` ucm scratch/main> delete.term 2 + + Done. scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. fix5080.tests.success ◉ success + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/fix5168.md b/unison-src/transcripts/idempotent/fix5168.md index f049f9959e..b5ece8dc7a 100644 --- a/unison-src/transcripts/idempotent/fix5168.md +++ b/unison-src/transcripts/idempotent/fix5168.md @@ -1,4 +1,18 @@ -The `edit` seems to suppress a following ```` ``` unison ```` block: +The `edit` seems to suppress a following ` ``` unison ` block: + ``` unison b = 2 ``` + +``` ucm :added-by-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`: + + b : ##Nat +``` diff --git a/unison-src/transcripts/idempotent/fix5349.md b/unison-src/transcripts/idempotent/fix5349.md index 16a8b65436..6d9b0d4b99 100644 --- a/unison-src/transcripts/idempotent/fix5349.md +++ b/unison-src/transcripts/idempotent/fix5349.md @@ -11,11 +11,70 @@ README = {{ }} ```` -```` unison :error +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I expected a block after this (in red), but there wasn't one. Maybe check your indentation: + 0 | README = {{ +``` + +``` unison :error README = {{ {{ }} }} -```` +``` +``` ucm :added-by-ucm -```` unison :error + Loading changes detected in scratch.u. + + I got confused here: + + + + I was surprised to find an end of input here. + I was expecting one of these instead: + + * bang + * do + * false + * force + * handle + * if + * lambda + * let + * quote + * termLink + * true + * tuple + * typeLink +``` + +``` unison :error README = {{ `` `` }} -```` +``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + + + I was surprised to find an end of input here. + I was expecting one of these instead: + + * bang + * do + * false + * force + * handle + * if + * lambda + * let + * quote + * termLink + * true + * tuple + * typeLink +``` diff --git a/unison-src/transcripts/idempotent/fix614.md b/unison-src/transcripts/idempotent/fix614.md index 974a301c5d..ebd58ef50c 100644 --- a/unison-src/transcripts/idempotent/fix614.md +++ b/unison-src/transcripts/idempotent/fix614.md @@ -15,6 +15,20 @@ ex1 = do 42 ``` +``` ucm :added-by-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 ability Stream a + ex1 : '{Stream Nat} Nat +``` + ``` ucm :hide scratch/main> add ``` @@ -27,6 +41,20 @@ ex2 = do 42 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a value of type: a ->{Stream a} Unit + where I expected to find: Unit + + 2 | Stream.emit + 3 | 42 + + Hint: Actions within a block must have type Unit. + Use _ = to ignore a result. +``` + We can explicitly ignore an unused result like so: ``` unison @@ -35,6 +63,19 @@ ex3 = do () ``` +``` ucm :added-by-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`: + + ex3 : '() +``` + Using a helper function like `void` also works fine: ``` unison @@ -45,6 +86,20 @@ ex4 = () ``` +``` ucm :added-by-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`: + + ex4 : () + void : x -> () +``` + One more example: ``` unison :error @@ -52,3 +107,21 @@ ex4 = [1,2,3] -- no good () ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a value of type: [Nat] + where I expected to find: Unit + + 2 | [1,2,3] -- no good + 3 | () + + from right here: + + 2 | [1,2,3] -- no good + + Hint: Actions within a block must have type Unit. + Use _ = to ignore a result. +``` diff --git a/unison-src/transcripts/idempotent/fix689.md b/unison-src/transcripts/idempotent/fix689.md index cf83336164..c3ff7cdc80 100644 --- a/unison-src/transcripts/idempotent/fix689.md +++ b/unison-src/transcripts/idempotent/fix689.md @@ -10,3 +10,17 @@ structural ability SystemTime where tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) ``` + +``` ucm :added-by-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 ability SystemTime + tomorrow : '{SystemTime} Nat +``` diff --git a/unison-src/transcripts/idempotent/fix693.md b/unison-src/transcripts/idempotent/fix693.md index 1937241b32..1680e443ca 100644 --- a/unison-src/transcripts/idempotent/fix693.md +++ b/unison-src/transcripts/idempotent/fix693.md @@ -10,8 +10,27 @@ structural ability Abort where abort : a ``` +``` ucm :added-by-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 ability Abort + structural ability X t +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural ability Abort + structural ability X t ``` This code should not type check. The match on X.x ought to introduce a @@ -26,6 +45,24 @@ h0 req = match req with { d } -> Some d ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Each case of a match / with expression need to have the same + type. + + Here, one is: Optional b + and another is: Optional a + + + 3 | { X.x _ c -> _ } -> handle c with h0 + + from these spots, respectively: + + 1 | h0 : Request {X t} b -> Optional b +``` + This code should not check because `t` does not match `b`. ``` unison :error @@ -35,6 +72,24 @@ h1 req = match req with { d } -> Some d ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Each case of a match / with expression need to have the same + type. + + Here, one is: Optional b + and another is: Optional t + + + 3 | { X.x t _ -> _ } -> handle t with h1 + + from these spots, respectively: + + 1 | h1 : Request {X t} b -> Optional b +``` + This code should not check for reasons similar to the first example, but with the continuation rather than a parameter. @@ -45,6 +100,18 @@ h2 req = match req with { r } -> r ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + The 1st argument to `k` + + has type: Nat + but I expected: a + + 3 | { Abort.abort -> k } -> handle k 5 with h2 +``` + This should work fine. ``` unison @@ -54,3 +121,16 @@ h3 = cases { Abort.abort -> _ } -> None { X.x b _ -> _ } -> Some b ``` + +``` ucm :added-by-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`: + + h3 : Request {X b, Abort} b -> Optional b +``` diff --git a/unison-src/transcripts/idempotent/fix845.md b/unison-src/transcripts/idempotent/fix845.md index 3028721cf4..d837030803 100644 --- a/unison-src/transcripts/idempotent/fix845.md +++ b/unison-src/transcripts/idempotent/fix845.md @@ -12,6 +12,20 @@ Text.zonk : Text -> Text Text.zonk txt = txt ++ "!! " ``` +``` ucm :added-by-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.zonk : [a] -> [a] + Text.zonk : Text -> Text +``` + ``` ucm :hide scratch/main> add ``` @@ -23,6 +37,26 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th > Blah.zonk [1,2,3] ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what Blah.zonk refers to here: + + 2 | > Blah.zonk [1,2,3] + + I think its type should be: + + [Nat] -> o + + Some common causes of this error include: + * Your current namespace is too deep to contain the + definition in its subtree + * The definition is part of a library which hasn't been + added to this project + * You have a typo in the name +``` + Here's another example, just checking that TDNR works for definitions in the same file: ``` unison @@ -35,6 +69,28 @@ ex = baz ++ ", world!" > ex ``` +``` ucm :added-by-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`: + + ex : Text + foo.bar.baz : Nat + qux.baz : Text + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 7 | > ex + ⧩ + "hello, world!" +``` + Here's another example, checking that TDNR works when multiple codebase definitions have matching names: ``` unison @@ -43,6 +99,26 @@ ex = zonk "hi" > ex ``` +``` ucm :added-by-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`: + + ex : Text + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 3 | > ex + ⧩ + "hi!! " +``` + Last example, showing that TDNR works when there are multiple matching names in both the file and the codebase: ``` unison @@ -54,3 +130,25 @@ ex = zonk "hi" -- should resolve to Text.zonk, from the codebase > ex ``` + +``` ucm :added-by-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`: + + ex : Text + woot.zonk : Text + woot2.zonk : Nat + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 7 | > ex + ⧩ + "hi!! woot" +``` diff --git a/unison-src/transcripts/idempotent/fix849.md b/unison-src/transcripts/idempotent/fix849.md index 38be1fc07d..12321025e4 100644 --- a/unison-src/transcripts/idempotent/fix849.md +++ b/unison-src/transcripts/idempotent/fix849.md @@ -9,3 +9,23 @@ x = 42 > x ``` + +``` ucm :added-by-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 + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 3 | > x + ⧩ + 42 +``` diff --git a/unison-src/transcripts/idempotent/fix942.md b/unison-src/transcripts/idempotent/fix942.md index 3cdee073b0..fc2522afef 100644 --- a/unison-src/transcripts/idempotent/fix942.md +++ b/unison-src/transcripts/idempotent/fix942.md @@ -10,8 +10,29 @@ y = x + 1 z = y + 2 ``` +``` ucm :added-by-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 + y : Nat + z : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + x : Nat + y : Nat + z : Nat ``` Now we edit `x` to be `7`, which should make `z` equal `10`: @@ -20,18 +41,86 @@ Now we edit `x` to be `7`, which should make `z` equal `10`: x = 7 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view x y z + + x : Nat + x = 7 + + y : Nat + y = + use Nat + + x + 1 + + z : Nat + z = + use Nat + + y + 2 ``` -Uh oh! `z` is still referencing the old version. Just to confirm: +Uh oh\! `z` is still referencing the old version. Just to confirm: ``` unison test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` +``` ucm :added-by-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`: + + t1 : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] + + ✅ Passed great +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + t1 : [Result] scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. t1 ◉ great + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/fix987.md b/unison-src/transcripts/idempotent/fix987.md index 6679f876bc..524ade93ae 100644 --- a/unison-src/transcripts/idempotent/fix987.md +++ b/unison-src/transcripts/idempotent/fix987.md @@ -14,10 +14,29 @@ spaceAttack1 x = "All done" ``` +``` ucm :added-by-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 ability DeathStar + spaceAttack1 : x ->{DeathStar} Text +``` + Add it to the codebase: ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural ability DeathStar + spaceAttack1 : x ->{DeathStar} Text ``` Now we'll try to add a different definition that runs the actions in a different order. This should work fine: @@ -29,8 +48,25 @@ spaceAttack2 x = "All done" ``` +``` ucm :added-by-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`: + + spaceAttack2 : x ->{DeathStar} Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + spaceAttack2 : x ->{DeathStar} Text ``` 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/idempotent/formatter.md b/unison-src/transcripts/idempotent/formatter.md index e8cb56a677..186695e07e 100644 --- a/unison-src/transcripts/idempotent/formatter.md +++ b/unison-src/transcripts/idempotent/formatter.md @@ -91,12 +91,118 @@ with a strike-through block~ scratch/main> debug.format ``` +``` unison :added-by-ucm scratch.u +x.doc = + {{ + # Doc This is a **doc**! + + term link {x} + + type link {type Optional} + }} +x : Nat -> Nat +x y = + use Nat + + x = 1 + 1 + x + y +-- Should keep comments after + +-- symbolyDefinition +(<|>) : Nat -> Nat -> (Nat, Nat) +a <|> b = (a, b) + +symbolyEndOfBlock = + x = 1 + (+:) + + +-- Test for a previous regression that added extra brackets. +oneLiner = {{ one liner }} +-- After + +-- Before +explicit.doc = + {{ + # Here's a top-level doc + + With a paragraph + + Or two + }} +-- After + +Thing.doc = {{ A doc before an ability }} +ability Thing where + more : Nat -> Text ->{Thing} Nat + doThing : Nat ->{Thing} Int + + +Ask.doc = {{ Ability with single constructor }} +structural ability Ask a where ask : {Ask a} a + +-- Regression test for: https://github.com/unisonweb/unison/issues/4666 +provide : a -> '{Ask a} r -> r +provide a action = + h = cases + { ask -> resume } -> handle resume a with h + { r } -> r + handle action() with h + +Optional.doc = {{ A Doc before a type }} +structural type Optional a = More Text | Some | Other a | None Nat + +Two.doc = {{ A doc before a type with no type-vars }} +type Two = One Nat | Two Text + +-- Regression for https://github.com/unisonweb/unison/issues/4669 + +multilineBold = + {{ + **This paragraph is really really really really really long and spans + multiple lines with a strike-through block** + + __This paragraph is really really really really really long and spans + multiple lines with a strike-through block__ + + ~~This paragraph is really really really really really long and spans + multiple lines with a strike-through block~~ + }} +``` + Formatter should leave things alone if the file doesn't typecheck. ``` unison :error brokenDoc = {{ hello }} + 1 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what + refers to here: + + 1 | brokenDoc = {{ hello }} + 1 + + The name + is ambiguous. I tried to resolve it by type but no + term with that name would pass typechecking. I think its type + should be: + + Doc2 -> Nat -> o + + If that's not what you expected, you may have a type error + somewhere else in your code. + Help me out by using a more specific name here or adding a + type annotation. + + I found some terms in scope with matching names but different + types. If one of these is what you meant, try using its full + name: + + (Float.+) : Float -> Float -> Float + (Int.+) : Int -> Int -> Int + (Nat.+) : Nat -> Nat -> Nat +``` + ``` ucm scratch/main> debug.format ``` diff --git a/unison-src/transcripts/idempotent/fuzzy-options.md b/unison-src/transcripts/idempotent/fuzzy-options.md index d8b1b1cd56..bdc558c114 100644 --- a/unison-src/transcripts/idempotent/fuzzy-options.md +++ b/unison-src/transcripts/idempotent/fuzzy-options.md @@ -2,10 +2,11 @@ If an argument is required but doesn't have a fuzzy resolver, the command should just print the help. - ``` ucm :error -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver scratch/main> move.term + + `move.term foo bar` renames `foo` to `bar`. ``` If a fuzzy resolver doesn't have any options available it should print a message instead of @@ -13,8 +14,11 @@ opening an empty fuzzy-select. ``` ucm :error scratch/empty> view -``` + ⚠️ + + Sorry, I was expecting an argument for the definition to view, and I couldn't find any to suggest to you. 😅 +``` ``` unison :hide optionOne = 1 @@ -26,20 +30,47 @@ Definition args ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + nested.optionTwo : ##Nat + optionOne : ##Nat scratch/main> debug.fuzzy-options view _ -``` + Select a definition to view: + * optionOne + * nested.optionTwo +``` Namespace args ``` ucm scratch/main> add + + ⊡ Ignored previously added definitions: nested.optionTwo + optionOne scratch/main> debug.fuzzy-options find-in _ + + Select a namespace: + * nested ``` Project Branch args ``` ucm 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`. scratch/main> debug.fuzzy-options switch _ + + Select a project or branch to switch to: + * myproject/main + * myproject/mybranch + * scratch/empty + * scratch/main + * myproject + * scratch ``` diff --git a/unison-src/transcripts/idempotent/generic-parse-errors.md b/unison-src/transcripts/idempotent/generic-parse-errors.md index c70638e5ac..38da7ff587 100644 --- a/unison-src/transcripts/idempotent/generic-parse-errors.md +++ b/unison-src/transcripts/idempotent/generic-parse-errors.md @@ -5,22 +5,141 @@ x = foo.123 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 2 | foo.123 + + + I was surprised to find a 1 here. + I was expecting one of these instead: + + * end of input + * hash (ex: #af3sj3) + * identifier (ex: abba1, snake_case, .foo.bar#xyz, .foo.++#xyz, or 🌻) +``` + ``` unison :error namespace.blah = 1 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 1 | namespace.blah = 1 + + + I was surprised to find a = here. + I was expecting one of these instead: + + * ability + * bang + * binding + * do + * false + * force + * handle + * if + * lambda + * let + * newline or semicolon + * quote + * termLink + * true + * tuple + * type + * typeLink + * use +``` + ``` unison :error x = 1 ] ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found a closing ']' here without a matching '['. + + 1 | x = 1 ] +``` + ``` unison :error x = a.#abc ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 1 | x = a.#abc + + + I was surprised to find a '.' here. + I was expecting one of these instead: + + * and + * bang + * do + * false + * force + * handle + * if + * infixApp + * let + * newline or semicolon + * or + * quote + * termLink + * true + * tuple + * typeLink +``` + ``` unison :error x = "hi ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 2 | + + I was surprised to find an end of input here. + I was expecting one of these instead: + + * " + * \s + * literal character +``` + ``` unison :error y : a ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I got confused here: + + 2 | + + I was surprised to find an end of section here. + I was expecting one of these instead: + + * -> + * newline or semicolon +``` diff --git a/unison-src/transcripts/idempotent/help.md b/unison-src/transcripts/idempotent/help.md index 947a3f2459..8180b08e21 100644 --- a/unison-src/transcripts/idempotent/help.md +++ b/unison-src/transcripts/idempotent/help.md @@ -2,13 +2,1007 @@ ``` ucm scratch/main> help + + add + `add` adds to the codebase all the definitions from the most recently typechecked file. + + add.preview + `add.preview` previews additions to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. + + add.run + `add.run name` adds to the codebase the result of the most recent `run` command as `name`. + + alias.many (or copy) + `alias.many [relative2...] ` creates + aliases `relative1`, `relative2`, ... in the namespace + `namespace`. + `alias.many foo.foo bar.bar .quux` creates aliases + `.quux.foo.foo` and `.quux.bar.bar`. + + alias.term + `alias.term foo bar` introduces `bar` with the same definition as `foo`. + + alias.type + `alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`. + + api + `api` provides details about the API. + + auth.login + Obtain an authentication session with Unison Share. + `auth.login`authenticates ucm with Unison Share. + + back (or popd) + `back` undoes the last `switch` command. + + branch (or branch.create, create.branch) + `branch foo` forks the current project branch to a new + branch `foo` + `branch /bar foo` forks the branch `bar` of the current + project to a new branch `foo` + + branch.empty (or branch.create-empty, create.empty-branch) + Create a new empty branch. + + branch.rename (or rename.branch) + `branch.rename foo` renames the current branch to `foo` + + branches (or list.branch, ls.branch, branch.list) + `branches` lists all branches in the current project + `branches foo` lists all branches in the project `foo` + + clear + `clear` Clears the screen. + + clone + `clone @unison/json/topic json/my-topic` creates + `json/my-topic` from + the remote branch + `@unison/json/topic` + `clone @unison/base base/` creates `base/main` + from the remote + branch + `@unison/base/main` + `clone @unison/base /main2` creates the branch + `main2` in the + current project from + the remote branch + `@unison/base/main` + `clone /main /main2` creates the branch + `main2` in the + current project from + the remote branch + `main` of the + current project's + associated remote + (see + `help-topics remotes`) + `clone /main my-fork/` creates + `my-fork/main` from + the branch `main` of + the current + project's associated + remote (see + `help-topics remotes`) + + compile (or compile.output) + `compile main file` Outputs a stand alone file that can be + directly loaded and executed by unison. + Said execution will have the effect of + running `!main`. + + create.author + `create.author alicecoder "Alice McGee"` creates `alicecoder` + values in `metadata.authors` and `metadata.copyrightHolders.` + + debug.clear-cache + Clear the watch expression cache + + debug.doc-to-markdown + `debug.doc-to-markdown term.doc` Render a doc to markdown. + + debug.doctor + Analyze your codebase for errors and inconsistencies. + + debug.dump-namespace + Dump the namespace to a text file + + debug.dump-namespace-simple + Dump the namespace to a text file + + debug.file + View details about the most recent successfully typechecked file. + + debug.find.global + `find` lists all definitions in the + current namespace. + `find foo` lists all definitions with a + name similar to 'foo' in the + current namespace (excluding + those under 'lib'). + `find foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the current + namespace (excluding those + under 'lib'). + `find-in namespace` lists all definitions in the + specified subnamespace. + `find-in namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace. + find.all foo lists all definitions with a + name similar to 'foo' in the + current namespace (including + one level of 'lib'). + `find-in.all namespace` lists all definitions in the + specified subnamespace + (including one level of its + 'lib'). + `find-in.all namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace (including one + level of its 'lib'). + debug.find.global foo Iteratively searches all + projects and branches and + lists all definitions with a + name similar to 'foo'. Note + that this is a very slow + operation. + + debug.names.global + `debug.names.global foo` Iteratively search across all + projects and branches for names matching `foo`. Note that this + is expected to be quite slow and is primarily for debugging + issues with your codebase. + + debug.numberedArgs + Dump the contents of the numbered args state. + + delete + `delete foo` removes the term or type name `foo` from the namespace. + `delete foo bar` removes the term or type name `foo` and `bar` from the namespace. + + delete.branch (or branch.delete) + `delete.branch foo/bar` deletes the branch `bar` in the + project `foo` + `delete.branch /bar` deletes the branch `bar` in the + current project + + delete.namespace + `delete.namespace ` deletes the namespace `foo` + + delete.namespace.force + `delete.namespace.force ` deletes the namespace `foo`,deletion will proceed even if other code depends on definitions in foo. + + delete.project (or project.delete) + `delete.project foo` deletes the local project `foo` + + delete.term + `delete.term foo` removes the term name `foo` from the namespace. + `delete.term foo bar` removes the term name `foo` and `bar` from the namespace. + + delete.term.verbose + `delete.term.verbose foo` removes the term name `foo` from the namespace. + `delete.term.verbose foo bar` removes the term name `foo` and `bar` from the namespace. + + delete.type + `delete.type foo` removes the type name `foo` from the namespace. + `delete.type foo bar` removes the type name `foo` and `bar` from the namespace. + + delete.type.verbose + `delete.type.verbose foo` removes the type name `foo` from the namespace. + `delete.type.verbose foo bar` removes the type name `foo` and `bar` from the namespace. + + delete.verbose + `delete.verbose foo` removes the term or type name `foo` from the namespace. + `delete.verbose foo bar` removes the term or type name `foo` and `bar` from the namespace. + + dependencies + List the dependencies of the specified definition. + + dependents + List the named dependents of the specified definition. + + deprecated.cd (or deprecated.namespace) + Moves your perspective to a different namespace. Deprecated for now because too many important things depend on your perspective selection. + + `deprecated.cd foo.bar` descends into foo.bar from the + current namespace. + `deprecated.cd .cat.dog` sets the current namespace to the + absolute namespace .cat.dog. + `deprecated.cd ..` moves to the parent of the current + namespace. E.g. moves from + '.cat.dog' to '.cat' + `deprecated.cd` invokes a search to select which + namespace to move to, which requires + that `fzf` can be found within your + PATH. + + deprecated.root-reflog + `deprecated.root-reflog` lists the changes that have affected the root namespace. This has been deprecated in favor of `reflog` which shows the reflog for the current project. + + diff.namespace + `diff.namespace before after` shows how the namespace `after` + differs from the namespace + `before` + `diff.namespace before` shows how the current namespace + differs from the namespace + `before` + + display + `display foo` prints a rendered version of the term `foo`. + `display` without arguments invokes a search to select a definition to display, which requires that `fzf` can be found within your PATH. + + display.to + `display.to foo` prints a rendered version of the + term `foo` to the given file. + + docs + `docs foo` shows documentation for the definition `foo`. + `docs` without arguments invokes a search to select which definition to view documentation for, which requires that `fzf` can be found within your PATH. + + docs.to-html + `docs.to-html .path.to.ns doc-dir` Render + all docs + contained + within + the + namespace + `.path.to.ns`, + no matter + how deep, + to html + files in + `doc-dir` + in the + directory + UCM was + run from. + `docs.to-html project0/branch0:a.path /tmp/doc-dir` Renders + all docs + anywhere + in the + namespace + `a.path` + from + `branch0` + of + `project0` + to html + in + `/tmp/doc-dir`. + + edit + `edit foo` prepends the definition of `foo` to the top of the most recently saved file. + `edit` without arguments invokes a search to select a definition for editing, which requires that `fzf` can be found within your PATH. + + edit.namespace + `edit.namespace` will load all terms and types contained within the current namespace into your scratch file. This includes definitions in namespaces, but excludes libraries. + `edit.namespace ns1 ns2 ...` loads the terms and types contained within the provided namespaces. + + find + `find` lists all definitions in the + current namespace. + `find foo` lists all definitions with a + name similar to 'foo' in the + current namespace (excluding + those under 'lib'). + `find foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the current + namespace (excluding those + under 'lib'). + `find-in namespace` lists all definitions in the + specified subnamespace. + `find-in namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace. + find.all foo lists all definitions with a + name similar to 'foo' in the + current namespace (including + one level of 'lib'). + `find-in.all namespace` lists all definitions in the + specified subnamespace + (including one level of its + 'lib'). + `find-in.all namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace (including one + level of its 'lib'). + debug.find.global foo Iteratively searches all + projects and branches and + lists all definitions with a + name similar to 'foo'. Note + that this is a very slow + operation. + + find-in + `find` lists all definitions in the + current namespace. + `find foo` lists all definitions with a + name similar to 'foo' in the + current namespace (excluding + those under 'lib'). + `find foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the current + namespace (excluding those + under 'lib'). + `find-in namespace` lists all definitions in the + specified subnamespace. + `find-in namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace. + find.all foo lists all definitions with a + name similar to 'foo' in the + current namespace (including + one level of 'lib'). + `find-in.all namespace` lists all definitions in the + specified subnamespace + (including one level of its + 'lib'). + `find-in.all namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace (including one + level of its 'lib'). + debug.find.global foo Iteratively searches all + projects and branches and + lists all definitions with a + name similar to 'foo'. Note + that this is a very slow + operation. + + find-in.all + `find` lists all definitions in the + current namespace. + `find foo` lists all definitions with a + name similar to 'foo' in the + current namespace (excluding + those under 'lib'). + `find foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the current + namespace (excluding those + under 'lib'). + `find-in namespace` lists all definitions in the + specified subnamespace. + `find-in namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace. + find.all foo lists all definitions with a + name similar to 'foo' in the + current namespace (including + one level of 'lib'). + `find-in.all namespace` lists all definitions in the + specified subnamespace + (including one level of its + 'lib'). + `find-in.all namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace (including one + level of its 'lib'). + debug.find.global foo Iteratively searches all + projects and branches and + lists all definitions with a + name similar to 'foo'. Note + that this is a very slow + operation. + + find.all + `find` lists all definitions in the + current namespace. + `find foo` lists all definitions with a + name similar to 'foo' in the + current namespace (excluding + those under 'lib'). + `find foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the current + namespace (excluding those + under 'lib'). + `find-in namespace` lists all definitions in the + specified subnamespace. + `find-in namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace. + find.all foo lists all definitions with a + name similar to 'foo' in the + current namespace (including + one level of 'lib'). + `find-in.all namespace` lists all definitions in the + specified subnamespace + (including one level of its + 'lib'). + `find-in.all namespace foo bar` lists all definitions with a + name similar to 'foo' or + 'bar' in the specified + subnamespace (including one + level of its 'lib'). + debug.find.global foo Iteratively searches all + projects and branches and + lists all definitions with a + name similar to 'foo'. Note + that this is a very slow + operation. + + find.all.verbose + `find.all.verbose` searches for definitions like `find.all`, but includes hashes and aliases in the results. + + find.verbose + `find.verbose` searches for definitions like `find`, but includes hashes and aliases in the results. + + fork (or copy.namespace) + `fork src dest` creates + the + namespace + `dest` as + a copy of + `src`. + `fork project0/branch0:a.path project1/branch1:foo` creates + the + namespace + `foo` in + `branch1` + of + `project1` + as a copy + of + `a.path` + in + `project0/branch0`. + `fork srcproject/srcbranch dest` creates + the + namespace + `dest` as + a copy of + the + branch + `srcbranch` + of + `srcproject`. + + help (or ?) + `help` shows general help and `help ` shows help for one command. + + help-topics (or help-topic) + `help-topics` lists all topics and `help-topics ` shows an explanation of that topic. + + history + `history` Shows the history of the current + path. + `history .foo` Shows history of the path .foo. + `history #9dndk3kbsk13nbpeu` Shows the history of the + namespace with the given hash. + The full hash must be provided. + + io.test (or test.io) + `io.test mytest` Runs `!mytest`, where `mytest` is a delayed + test that can use the `IO` and `Exception` + abilities. + + io.test.all (or test.io.all) + `io.test.all` runs unit tests for the current branch that use + IO + + lib.install (or install.lib) + The `lib.install` command installs a dependency into the `lib` + namespace. + + `lib.install @unison/base/releases/latest` installs the + latest release of + `@unison/base` + `lib.install @unison/base/releases/3.0.0` installs version + 3.0.0 of + `@unison/base` + `lib.install @unison/base/topic` installs the + `topic` branch of + `@unison/base` + + list (or ls, dir) + `list` lists definitions and namespaces at the current + level of the current namespace. + `list foo` lists the 'foo' namespace. + `list .foo` lists the '.foo' namespace. + + load + `load` parses, typechecks, and evaluates the + most recent scratch file. + `load ` parses, typechecks, and evaluates the + given scratch file. + + merge + `merge /branch` merges `branch` into the current branch + + merge.commit (or commit.merge) + `merge.commit` merges a temporary branch created by the + `merge` command back into its parent branch, and removes the + temporary branch. + + For example, if you've done `merge topic` from main, then + `merge.commit` is equivalent to doing + + * switch /main + * merge /merge-topic-into-main + * delete.branch /merge-topic-into-main + + move (or rename) + `move foo bar` renames the term, type, and namespace foo to bar. + + move.namespace (or rename.namespace) + `move.namespace foo bar` renames the path `foo` to `bar`. + + move.term (or rename.term) + `move.term foo bar` renames `foo` to `bar`. + + move.type (or rename.type) + `move.type foo bar` renames `foo` to `bar`. + + names + `names foo` List all known names for `foo` in the current + branch. + + namespace.dependencies + List the external dependencies of the specified namespace. + + project.create (or create.project) + `project.create` creates a project with a random name + `project.create foo` creates a project named `foo` + + project.reflog (or reflog.project) + `project.reflog` lists all the changes that have affected any branches in the current project. + `project.reflog myproject` lists all the changes that have affected any branches in myproject. + + project.rename (or rename.project) + `project.rename foo` renames the current project to `foo` + + projects (or list.project, ls.project, project.list) + List projects. + + pull + The `pull` command merges a remote namespace into a local + branch + + `pull @unison/base/main` merges the branch + `main` of the Unison + Share hosted project + `@unison/base` into + the current branch + `pull @unison/base/main my-base/topic` merges the branch + `main` of the Unison + Share hosted project + `@unison/base` into + the branch `topic` of + the local `my-base` + project + + where `remote` is a project or project branch, such as: + Project (defaults to the /main branch) `@unison/base` + Project Branch `@unison/base/feature` + Contributor Branch `@unison/base/@johnsmith/feature` + Project Release `@unison/base/releases/1.0.0` + + pull.without-history + The `pull.without-history` command merges a remote namespace + into a local branch without including the remote's history. + This usually results in smaller codebase sizes. + + `pull.without-history @unison/base/main` merges + the + branch + `main` + of the + Unison + Share + hosted + project + `@unison/base` + into + the + current + branch + `pull.without-history @unison/base/main my-base/topic` merges + the + branch + `main` + of the + Unison + Share + hosted + project + `@unison/base` + into + the + branch + `topic` + of the + local + `my-base` + project + + where `remote` is a project or project branch, such as: + Project (defaults to the /main branch) `@unison/base` + Project Branch `@unison/base/feature` + Contributor Branch `@unison/base/@johnsmith/feature` + Project Release `@unison/base/releases/1.0.0` + + push + The `push` command merges a local project or namespace into a + remote project or namespace. + + `push ` publishes the contents of a local + namespace or branch into a remote + namespace or branch. + `push ` publishes the current namespace or + branch into a remote namespace or + branch + `push` publishes the current namespace or + branch. Remote mappings for + namespaces are configured in your + `.unisonConfig` at the key + `RemoteMappings.` where + `` is the current + namespace. Remote mappings for + branches default to the branch that + you cloned from or pushed to + initially. Otherwise, it is pushed to + @/ + + where `remote` is a project or project branch, such as: + Project (defaults to the /main branch) `@unison/base` + Project Branch `@unison/base/feature` + Contributor Branch `@unison/base/@johnsmith/feature` + + push.create + The `push.create` command pushes a local namespace to an empty + remote namespace. + + `push.create remote local` pushes the contents of the local + namespace `local` into the empty + remote namespace `remote`. + `push.create remote` publishes the current namespace + into the empty remote namespace + `remote` + `push.create` publishes the current namespace + into the remote namespace + configured in your `.unisonConfig` + at the key + `RemoteMappings.` where + `` is the current + namespace, then publishes the + current namespace to that + location. + + where `remote` is a project or project branch, such as: + Project (defaults to the /main branch) `@unison/base` + Project Branch `@unison/base/feature` + Contributor Branch `@unison/base/@johnsmith/feature` + + quit (or exit, :q) + Exits the Unison command line interface. + + reflog (or reflog.branch, branch.reflog) + `reflog` lists all the changes that have affected the current branch. + `reflog /mybranch` lists all the changes that have affected /mybranch. + + reflog.global + `reflog.global` lists all recent changes across all projects and branches. + + release.draft (or draft.release) + Draft a release. + + reset + `reset #pvfd222s8n` reset the current namespace to the + hash `#pvfd222s8n` + `reset foo` reset the current namespace to the + state of the `foo` namespace. + `reset #pvfd222s8n /topic` reset the branch `topic` of the + current project to the causal + `#pvfd222s8n`. + + If you make a mistake using reset, consult the `reflog` + command and use another `reset` command to return to a + previous state. + + rewrite (or sfind.replace) + `rewrite rule1` rewrites definitions in the latest scratch file. + + The argument `rule1` must refer to a `@rewrite` block or a + function that immediately returns a `@rewrite` block. It can + be in the codebase or scratch file. An example: + + rule1 x = @rewrite term x + 1 ==> Nat.increment x + + Here, `x` will stand in for any expression wherever this + rewrite is applied, so this rule will match `(42+10+11) + 1` + and replace it with `Nat.increment (42+10+11)`. + + See https://unison-lang.org/learn/structured-find to learn more. + + Also see the related command `rewrite.find` + + rewrite.find (or sfind) + `rewrite.find rule1` finds definitions that match any of the + left side(s) of `rule` in the current namespace. + + The argument `rule1` must refer to a `@rewrite` block or a + function that immediately returns a `@rewrite` block. It can + be in the codebase or scratch file. An example: + + -- right of ==> is ignored by this command + rule1 x = @rewrite term x + 1 ==> () + + Here, `x` will stand in for any expression, so this rule will + match `(42+10+11) + 1`. + + See https://unison-lang.org/learn/structured-find to learn more. + + Also see the related command `rewrite` + + run + `run mymain args...` Runs `!mymain`, where `mymain` is + searched for in the most recent + typechecked file, or in the codebase. + Any provided arguments will be passed as + program arguments as though they were + provided at the command line when + running mymain as an executable. + + run.native + `run.native main args` Executes !main using native + compilation via scheme. + + switch + `switch` opens an interactive selector to pick a + project and branch + `switch foo/bar` switches to the branch `bar` in the project + `foo` + `switch foo/` switches to the last branch you visited in + the project `foo` + `switch /bar` switches to the branch `bar` in the current + project + + test + `test` runs unit tests for the current branch + `test foo` runs unit tests for the current branch defined in + namespace `foo` + + test.all + `test.all` runs unit tests for the current branch (including the `lib` namespace). + + text.find (or grep) + `text.find token1 "99" token2` finds terms with literals (text + or numeric) containing `token1`, `99`, and `token2`. + + Numeric literals must be quoted (ex: "42") but single words + need not be quoted. + + Use `text.find.all` to include search of `lib`. + + text.find.all (or grep.all) + `text.find.all token1 "99" token2` finds terms with literals + (text or numeric) containing `token1`, `99`, and `token2`. + + Numeric literals must be quoted (ex: "42") but single words + need not be quoted. + + Use `text.find` to exclude `lib` from search. + + todo + `todo` lists the current namespace's outstanding issues, + including conflicted names, dependencies with missing names, + and merge precondition violations. + + ui + `ui` opens the Local UI in the default browser. + + undo + `undo` reverts the most recent change to the codebase. + + update + Adds everything in the most recently typechecked file to the + namespace, replacing existing definitions having the same + name, and attempts to update all the existing dependents + accordingly. If the process can't be completed automatically, + the dependents will be added back to the scratch file for your + review. + + update.old + `update.old` works like `add`, except that if a definition in + the file has the same name as an existing definition, the name + gets updated to point to the new definition. If the old + definition has any dependents, `update` will add those + dependents to a refactoring session, specified by an optional + patch.`update.old` adds all definitions in + the .u file, noting replacements + in the default patch for the + current namespace. + `update.old ` adds all definitions in the .u + file, noting replacements in the + specified patch. + `update.old foo bar` adds `foo`, `bar`, and their + dependents from the .u file, + noting any replacements into the + specified patch. + + update.old.nopatch + `update.old.nopatch` works like `update.old`, except it + doesn't add a patch entry for any updates. Use this when you + want to make changes to definitions without pushing those + changes to dependents beyond your codebase. An example is when + updating docs, or when updating a term you just added.`update.old.nopatch` updates + all definitions in the .u file. + `update.old.nopatch foo bar` updates `foo`, `bar`, and their + dependents from the .u file. + + update.old.preview + `update.old.preview` previews updates to the codebase from the most recently typechecked file. This command only displays cached typechecking results. Use `load` to reparse & typecheck the file if the context has changed. + + upgrade + `upgrade old new` upgrades library dependency `lib.old` to + `lib.new`, and, if successful, deletes `lib.old`. + + upgrade.commit (or commit.upgrade) + `upgrade.commit` merges a temporary branch created by the + `upgrade` command back into its parent branch, and removes the + temporary branch. + + For example, if you've done `upgrade foo bar` from main, then + `upgrade.commit` is equivalent to doing + + * switch /main + * merge /upgrade-foo-to-bar + * delete.branch /upgrade-foo-to-bar + + version + Print the version of unison you're running + + view + `view foo` shows definitions named `foo` within your current + namespace. + `view` without arguments invokes a search to select + definitions to view, which requires that `fzf` can be found + within your PATH. + + Supports glob syntax, where ? acts a wildcard, so + `view List.?` will show `List.map`, `List.filter`, etc, but + not `List.map.doc` (since ? only matches 1 name segment). + + view.global + `view.global foo` prints definitions of `foo` within your codebase. + `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. scratch/main> help-topics + + 🌻 + + Here's a list of topics I can tell you more about: + + filestatus + messages.disallowedAbsolute + namespaces + projects + remotes + testcache + + Example: use `help-topics filestatus` to learn more about that topic. scratch/main> help-topic filestatus + + 📓 + + Here's a list of possible status messages you might see for + definitions in a .u file. + + needs update A definition with the same name as an + existing definition. Doing `update` + instead of `add` will turn this failure + into a successful update. + + term/ctor collision A definition with the same name as an + existing constructor for some data type. + Rename your definition or the data type + before trying again to `add` or `update`. + + ctor/term collision A type defined in the file has a + constructor that's named the same as an + existing term. Rename that term or your + constructor before trying again to `add` + or `update`. + + blocked This definition was blocked because it + dependended on a definition with a failed + status. + + extra dependency This definition was added because it was + a dependency of a definition explicitly + selected. scratch/main> help-topic messages.disallowedAbsolute + + 🤖 + + Although I can understand absolute (ex: .foo.bar) or relative + (ex: util.math.sqrt) references to existing definitions + (help namespaces to learn more), I can't yet handle giving new + definitions with absolute names in a .u file. + + As a workaround, you can give definitions with a relative name + temporarily (like `exports.blah.foo`) and then use `move.*`. scratch/main> help-topic namespaces + + 🧐 + + There are two kinds of namespaces, absolute, such as (.foo.bar + or .base.math.+) and relative, such as (math.sqrt or + util.List.++). + + Relative names are converted to absolute names by prepending + the current namespace. For example, if your Unison prompt + reads: + + .foo.bar> + + and your .u file looks like: + + x = 41 + + then doing an add will create the definition with the absolute + name .foo.bar.x = 41 + + and you can refer to x by its absolute name .foo.bar.x + elsewhere in your code. For instance: + + answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 scratch/main> help-topic projects + + A project is a versioned collection of code that can be + edited, published, and depended on other projects. Unison + projects are analogous to Git repositories. + + project.create create a new project + projects list all your projects + branch create a new workstream + branches list all your branches + merge merge one branch into another + switch switch to a project or branch + push upload your changes to Unison Share + pull download code(/changes/updates) from Unison Share + clone download a Unison Share project or branch for contribution + + Tip: Use `help project.create` to learn more. + + For full documentation, see + https://unison-lang.org/learn/projects scratch/main> help-topic remotes + + 🤖 + + Local projects may be associated with at most one remote + project on Unison Share. When this relationship is + established, it becomes the default argument for a number of + share commands. For example, running `push` or `pull` in a + project with no arguments will push to or pull from the + associated remote, if it exists. + + This association is created automatically on when a project is + created by `clone`. If the project was created locally then + the relationship will be established on the first `push`. scratch/main> help-topic testcache + + 🎈 + + Unison caches the results of test> watch expressions. Since + these expressions are pure and always yield the same result + when evaluated, there's no need to run them more than once! + + A test is rerun only if it has changed, or if one of the + definitions it depends on has changed. ``` We should add a command to show help for hidden commands also. diff --git a/unison-src/transcripts/idempotent/higher-rank.md b/unison-src/transcripts/idempotent/higher-rank.md index dfd3ef4d19..cedbd148dc 100644 --- a/unison-src/transcripts/idempotent/higher-rank.md +++ b/unison-src/transcripts/idempotent/higher-rank.md @@ -15,6 +15,26 @@ f id = (id 1, id "hi") > f (x -> x) ``` +``` ucm :added-by-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`: + + f : (∀ a. a ->{g} a) ->{g} (Nat, Text) + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 4 | > f (x -> x) + ⧩ + (1, "hi") +``` + Another example, involving abilities. Here the ability-polymorphic function is instantiated with two different ability lists, `{}` and `{IO}`: ``` unison @@ -24,6 +44,19 @@ f id _ = () ``` +``` ucm :added-by-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`: + + f : (∀ a g. '{g} a ->{h} '{g} a) -> '{h} () +``` + Here's an example, showing that polymorphic functions can be fields of a constructor, and the functions remain polymorphic even when the field is bound to a name during pattern matching: ``` unison @@ -39,6 +72,22 @@ Functor.blah = cases Functor f -> () ``` +``` ucm :added-by-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 Functor f + Functor.blah : Functor f -> () + Functor.map : Functor f + -> (∀ a b. (a -> b) -> f a -> f b) +``` + This example is similar, but involves abilities: ``` unison @@ -67,6 +116,27 @@ Loc.transform2 nt = cases Loc f -> Loc f' ``` +``` ucm :added-by-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 Loc + ability Remote t + Loc.blah : Loc -> () + Loc.transform : (∀ t a. '{Remote t} a -> '{Remote t} a) + -> Loc + -> Loc + Loc.transform2 : (∀ t a. '{Remote t} a -> '{Remote t} a) + -> Loc + -> Loc +``` + ## Types with polymorphic fields ``` unison :hide @@ -77,5 +147,11 @@ We should be able to add and view records with higher-rank fields. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type HigherRanked scratch/main> view HigherRanked + + structural type HigherRanked = HigherRanked (∀ a. a -> a) ``` diff --git a/unison-src/transcripts/idempotent/input-parse-errors.md b/unison-src/transcripts/idempotent/input-parse-errors.md index 7a8f70c80e..73f99779a3 100644 --- a/unison-src/transcripts/idempotent/input-parse-errors.md +++ b/unison-src/transcripts/idempotent/input-parse-errors.md @@ -7,21 +7,47 @@ scratch/main> builtins.merge lib.builtin ``` unison :hide x = 55 ``` + ``` ucm :hide scratch/main> add ``` `handleNameArg` parse error in `add` + ``` ucm :error scratch/main> add . + + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + 1:2: + | + 1 | . + | ^ + unexpected end of input + expecting '`' or operator (valid characters: !$%&*+-/:<=>\^|~) + + + You can run `help add` for more information on using `add`. scratch/main> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/main> add 1 + scratch/main> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/main> add 2 + + ⊡ Ignored previously added definitions: x ``` todo: -```haskell + +``` haskell SA.Name name -> pure name SA.NameWithBranchPrefix (Left _) name -> pure name SA.NameWithBranchPrefix (Right prefix) name -> pure $ Path.prefixNameIfRel (Path.AbsolutePath' prefix) name @@ -40,19 +66,29 @@ aliasMany: skipped -- similar to `add` ``` ucm :error scratch/main> update arg + + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I expected no arguments, but received one. + + You can run `help update` for more information on using + `update`. ``` aliasTerm -``` + +``` scratch/main> alias.term ##Nat.+ Nat.+ ``` aliasTermForce, aliasType, - todo: -``` + +``` aliasMany, api, diff --git a/unison-src/transcripts/idempotent/io-test-command.md b/unison-src/transcripts/idempotent/io-test-command.md index 14d83c902e..a2012915ba 100644 --- a/unison-src/transcripts/idempotent/io-test-command.md +++ b/unison-src/transcripts/idempotent/io-test-command.md @@ -27,17 +27,54 @@ Run a IO tests one by one ``` ucm scratch/main> io.test ioAndExceptionTest + + New test results: + + 1. ioAndExceptionTest ◉ Success + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. scratch/main> io.test ioTest + + New test results: + + 1. ioTest ◉ Success + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` `io.test` doesn't cache results ``` ucm scratch/main> io.test ioAndExceptionTest + + New test results: + + 1. ioAndExceptionTest ◉ Success + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` `io.test.all` will run all matching tests except those in the `lib` namespace. ``` ucm scratch/main> io.test.all + + + + + + New test results: + + 1. ioAndExceptionTest ◉ Success + 2. ioTest ◉ Success + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/io.md b/unison-src/transcripts/idempotent/io.md index 25daa096e3..4d0be24599 100644 --- a/unison-src/transcripts/idempotent/io.md +++ b/unison-src/transcripts/idempotent/io.md @@ -25,11 +25,12 @@ scratch/main> add ### Creating/Deleting/Renaming Directories Tests: -- createDirectory, -- isDirectory, -- fileExists, -- renameDirectory, -- deleteDirectory + + - createDirectory, + - isDirectory, + - fileExists, + - renameDirectory, + - deleteDirectory ``` unison testCreateRename : '{io2.IO} [Result] @@ -57,17 +58,49 @@ testCreateRename _ = runTest test ``` +``` ucm :added-by-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`: + + testCreateRename : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testCreateRename : '{IO} [Result] scratch/main> io.test testCreateRename + + New test results: + + 1. testCreateRename ◉ create a foo directory + ◉ directory should exist + ◉ foo should no longer exist + ◉ directory should no longer exist + ◉ bar should now exist + ◉ removeDirectory works recursively + ◉ removeDirectory works recursively + + ✅ 7 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Opening / Closing files Tests: -- openFile -- closeFile -- isFileOpen + + - openFile + - closeFile + - isFileOpen ``` unison testOpenClose : '{io2.IO} [Result] @@ -108,18 +141,49 @@ testOpenClose _ = runTest test ``` +``` ucm :added-by-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`: + + testOpenClose : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testOpenClose : '{IO} [Result] scratch/main> io.test testOpenClose + + New test results: + + 1. testOpenClose ◉ file should be open + ◉ file handle buffering should match what we just set. + ◉ file should be closed + ◉ bytes have been written + ◉ bytes have been written + ◉ file should be closed + + ✅ 6 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Reading files with getSomeBytes Tests: -- getSomeBytes -- putBytes -- isFileOpen -- seekHandle + + - getSomeBytes + - putBytes + - isFileOpen + - seekHandle ``` unison testGetSomeBytes : '{io2.IO} [Result] @@ -168,22 +232,55 @@ testGetSomeBytes _ = runTest test ``` +``` ucm :added-by-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`: + + testGetSomeBytes : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testGetSomeBytes : '{IO} [Result] scratch/main> io.test testGetSomeBytes + + New test results: + + 1. testGetSomeBytes ◉ chunk size splits data into 2 uneven sides + ◉ file should be closed + ◉ first chunk matches first part of testData + ◉ second chunk matches rest of testData + ◉ should be at end of file + ◉ reading at end of file results in Bytes.empty + ◉ requesting many bytes results in what's available + ◉ file should be closed + + ✅ 8 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Seeking in open files Tests: -- openFile -- putBytes -- closeFile -- isSeekable -- isFileEOF -- seekHandle -- getBytes -- getLine + + - openFile + - putBytes + - closeFile + - isSeekable + - isFileEOF + - seekHandle + - getBytes + - getLine ``` unison testSeek : '{io2.IO} [Result] @@ -243,13 +340,55 @@ testAppend _ = runTest test ``` +``` ucm :added-by-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`: + + testAppend : '{IO} [Result] + testSeek : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testAppend : '{IO} [Result] + testSeek : '{IO} [Result] scratch/main> io.test testSeek + + New test results: + + 1. testSeek ◉ seeked + ◉ readable file should be seekable + ◉ shouldn't be the EOF + ◉ we should be at position 0 + ◉ we should be at position 1 + ◉ should be able to read our temporary file after seeking + ◉ getLine should get a line + + ✅ 7 test(s) passing + + Tip: Use view 1 to view the source of a test. scratch/main> io.test testAppend + + New test results: + + 1. testAppend ◉ should be able to read our temporary file + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### SystemTime + ``` unison testSystemTime : '{io2.IO} [Result] testSystemTime _ = @@ -260,9 +399,34 @@ testSystemTime _ = runTest test ``` +``` ucm :added-by-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`: + + testSystemTime : '{IO} [Result] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testSystemTime : '{IO} [Result] scratch/main> io.test testSystemTime + + New test results: + + 1. testSystemTime ◉ systemTime should be sane + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Get temp directory @@ -279,7 +443,20 @@ testGetTempDirectory _ = ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testGetTempDirectory : '{IO} [Result] scratch/main> io.test testGetTempDirectory + + New test results: + + 1. testGetTempDirectory ◉ Temp directory is directory + ◉ Temp directory should exist + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Get current directory @@ -296,7 +473,20 @@ testGetCurrentDirectory _ = ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testGetCurrentDirectory : '{IO} [Result] scratch/main> io.test testGetCurrentDirectory + + New test results: + + 1. testGetCurrentDirectory ◉ Current directory is directory + ◉ Current directory should exist + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Get directory contents @@ -315,7 +505,20 @@ testDirContents _ = ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testDirContents : '{IO} [Result] scratch/main> io.test testDirContents + + New test results: + + 1. testDirContents ◉ directory size should be + ◉ directory contents should have current directory and parent + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Read environment variables @@ -331,9 +534,23 @@ testGetEnv _ = Left _ -> emit (Ok "DOESNTEXIST didn't exist") runTest test ``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testGetEnv : '{IO} [Result] scratch/main> io.test testGetEnv + + New test results: + + 1. testGetEnv ◉ PATH environent variable should be set + ◉ DOESNTEXIST didn't exist + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ### Read command line args @@ -371,28 +588,80 @@ testGetArgs.runMeWithTwoArgs = 'let ``` Test that they can be run with the right number of args. + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testGetArgs.fail : Text -> Failure + testGetArgs.runMeWithNoArgs : '{IO, Exception} () + testGetArgs.runMeWithOneArg : '{IO, Exception} () + testGetArgs.runMeWithTwoArgs : '{IO, Exception} () 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 scratch/main> run runMeWithNoArgs foo + + 💔💥 + + The program halted with an unhandled exception: + + Failure (typeLink IOFailure) "called with args" (Any ()) + + Stack trace: + ##raise ``` ``` ucm :error scratch/main> run runMeWithOneArg + + 💔💥 + + The program halted with an unhandled exception: + + Failure (typeLink IOFailure) "called with no args" (Any ()) + + Stack trace: + ##raise ``` + ``` ucm :error scratch/main> run runMeWithOneArg foo bar + + 💔💥 + + The program halted with an unhandled exception: + + Failure + (typeLink IOFailure) "called with too many args" (Any ()) + + Stack trace: + ##raise ``` ``` ucm :error scratch/main> run runMeWithTwoArgs + + 💔💥 + + The program halted with an unhandled exception: + + Failure (typeLink IOFailure) "called with no args" (Any ()) + + Stack trace: + ##raise ``` ### Get the time zone @@ -406,7 +675,13 @@ testTimeZone = do ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testTimeZone : '{IO} () scratch/main> run testTimeZone + + () ``` ### Get some random bytes @@ -422,5 +697,18 @@ testRandom = do ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + testRandom : '{IO} [Result] scratch/main> io.test testGetEnv + + New test results: + + 1. testGetEnv ◉ PATH environent variable should be set + ◉ DOESNTEXIST didn't exist + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/keyword-identifiers.md b/unison-src/transcripts/idempotent/keyword-identifiers.md index 1eb03b1334..d8574e0995 100644 --- a/unison-src/transcripts/idempotent/keyword-identifiers.md +++ b/unison-src/transcripts/idempotent/keyword-identifiers.md @@ -4,34 +4,34 @@ In particular, following a keyword with a `wordyIdChar` should be a valid identi Related issues: -- https://github.com/unisonweb/unison/issues/2091 -- https://github.com/unisonweb/unison/issues/2727 + - https://github.com/unisonweb/unison/issues/2091 + - https://github.com/unisonweb/unison/issues/2727 ## Keyword list Checks the following keywords: -- `type` -- `ability` -- `structural` -- `unique` -- `if` -- `then` -- `else` -- `forall` -- `handle` -- `with` -- `where` -- `use` -- `true` -- `false` -- `alias` -- `typeLink` -- `termLink` -- `let` -- `namespace` -- `match` -- `cases` + - `type` + - `ability` + - `structural` + - `unique` + - `if` + - `then` + - `else` + - `forall` + - `handle` + - `with` + - `where` + - `use` + - `true` + - `false` + - `alias` + - `typeLink` + - `termLink` + - `let` + - `namespace` + - `match` + - `cases` Note that although `∀` is a keyword, it cannot actually appear at the start of identifier. diff --git a/unison-src/transcripts/idempotent/kind-inference.md b/unison-src/transcripts/idempotent/kind-inference.md index abbd936098..eb80e6a616 100644 --- a/unison-src/transcripts/idempotent/kind-inference.md +++ b/unison-src/transcripts/idempotent/kind-inference.md @@ -5,85 +5,228 @@ scratch/main> builtins.merge ## A type param cannot have conflicting kind constraints within a single decl conflicting constraints on the kind of `a` in a product + ``` unison :error unique type T a = T a (a Nat) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 1 | unique type T a = T a (a Nat) + + a doesn't expect an argument; however, it is applied to Nat. +``` + conflicting constraints on the kind of `a` in a sum + ``` unison :error unique type T a = Star a | StarStar (a Nat) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 3 | | StarStar (a Nat) + + a doesn't expect an argument; however, it is applied to Nat. +``` + ## Kinds are inferred by decl component Successfully infer `a` in `Ping a` to be of kind `* -> *` by inspecting its component-mate `Pong`. + ``` unison unique type Ping a = Ping Pong unique type Pong = Pong (Ping Optional) ``` +``` ucm :added-by-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 Ping a + type Pong +``` + Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts `a` to `*`, whereas `Pong` restricts `a` to `* -> *`. + ``` unison :error unique type Ping a = Ping a Pong unique type Pong = Pong (Ping Optional) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 1 | unique type Ping a = Ping a Pong + + The arrow type (->) expects arguments of kind Type; however, + it is applied to a which has kind: Type -> Type. +``` + Successful example between mutually recursive type and ability + ``` unison unique type Ping a = Ping (a Nat -> {Pong Nat} ()) unique ability Pong a where pong : Ping Optional -> () ``` +``` ucm :added-by-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 Ping a + ability Pong a +``` + Catch conflict between mutually recursive type and ability + ``` unison :error unique type Ping a = Ping (a -> {Pong Nat} ()) unique ability Pong a where pong : Ping Optional -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 3 | pong : Ping Optional -> () + + Ping expects an argument of kind: Type; however, it is + applied to Optional which has kind: Type -> Type. +``` + Consistent instantiation of `T`'s `a` parameter in `S` + ``` unison unique type T a = T a unique type S = S (T Nat) ``` +``` ucm :added-by-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 S + type T a +``` + Delay kind defaulting until all components are processed. Here `S` constrains the kind of `T`'s `a` parameter, although `S` is not in the same component as `T`. + ``` unison unique type T a = T unique type S = S (T Optional) ``` +``` ucm :added-by-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 S + type T a +``` + Catch invalid instantiation of `T`'s `a` parameter in `S` + ``` unison :error unique type T a = T a unique type S = S (T Optional) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 3 | unique type S = S (T Optional) + + T expects an argument of kind: Type; however, it is applied + to Optional which has kind: Type -> Type. +``` + ## Checking annotations Catch kind error in type annotation + ``` unison :error test : Nat Nat test = 0 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 1 | test : Nat Nat + + Nat doesn't expect an argument; however, it is applied to + Nat. +``` + Catch kind error in annotation example 2 + ``` unison :error test : Optional -> () test _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 1 | test : Optional -> () + + The arrow type (->) expects arguments of kind Type; however, + it is applied to Optional which has kind: Type -> Type. +``` + Catch kind error in annotation example 3 + ``` unison :error unique type T a = T (a Nat) @@ -91,7 +234,19 @@ test : T Nat -> () test _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 3 | test : T Nat -> () + + T expects an argument of kind: Type -> Type; however, it is + applied to Nat which has kind: Type. +``` + Catch kind error in scoped type variable annotation + ``` unison :error unique type StarStar a = StarStar (a Nat) unique type Star a = Star a @@ -103,9 +258,21 @@ test _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 6 | buggo : Star a + + Star expects an argument of kind: Type; however, it is + applied to a which has kind: Type -> Type. +``` + ## Effect/type mismatch Effects appearing where types are expected + ``` unison :error unique ability Foo where foo : () @@ -114,23 +281,84 @@ test : Foo -> () test _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 4 | test : Foo -> () + + The arrow type (->) expects arguments of kind Type; however, + it is applied to Foo which has kind: Ability. +``` + Types appearing where effects are expected + ``` unison :error test : {Nat} () test _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Kind mismatch arising from + 1 | test : {Nat} () + + An ability list must consist solely of abilities; however, + this list contains Nat which has kind Type. Abilities are of + kind Ability. +``` + ## Cyclic kinds ``` unison :error unique type T a = T (a a) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Cannot construct infinite kind + 1 | unique type T a = T (a a) + + The above application constrains the kind of a to be + infinite, generated by the constraint k = k -> Type where k + is the kind of a. +``` + ``` unison :error unique type T a b = T (a b) (b a) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Cannot construct infinite kind + 1 | unique type T a b = T (a b) (b a) + + The above application constrains the kind of b to be + infinite, generated by the constraint + k = (k -> Type) -> Type where k is the kind of b. +``` + ``` unison :error unique type Ping a = Ping (a Pong) unique type Pong a = Pong (a Ping) ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Cannot construct infinite kind + 1 | unique type Ping a = Ping (a Pong) + + The above application constrains the kind of a to be + infinite, generated by the constraint + k = (((k -> Type) -> Type) -> Type) -> Type where k is the + kind of a. +``` diff --git a/unison-src/transcripts/idempotent/lambdacase.md b/unison-src/transcripts/idempotent/lambdacase.md index 7fe926f620..28f46ed248 100644 --- a/unison-src/transcripts/idempotent/lambdacase.md +++ b/unison-src/transcripts/idempotent/lambdacase.md @@ -12,6 +12,19 @@ isEmpty x = match x with _ -> false ``` +``` ucm :added-by-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`: + + isEmpty : [t] -> Boolean +``` + ``` ucm :hide scratch/main> add ``` @@ -24,10 +37,29 @@ isEmpty2 = cases _ -> false ``` +``` ucm :added-by-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`: + + isEmpty2 : [t] -> Boolean + (also named isEmpty) +``` + Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ``` ucm scratch/main> view isEmpty + + isEmpty : [t] -> Boolean + isEmpty = cases + [] -> true + _ -> false ``` it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -48,6 +80,10 @@ merge xs ys = match (xs, ys) with ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + merge : [a] -> [a] -> [a] ``` And here's a version using `cases`. The patterns are separated by commas: @@ -62,10 +98,32 @@ merge2 = cases else h2 +: merge2 (h +: t) t2 ``` +``` ucm :added-by-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`: + + merge2 : [a] -> [a] -> [a] + (also named merge) +``` + Notice that Unison detects this as an alias of `merge`, and if we view `merge` ``` ucm scratch/main> view merge + + merge : [a] -> [a] -> [a] + merge = cases + [], ys -> ys + xs, [] -> xs + h +: t, h2 +: t2 -> + if h <= h2 then h +: merge t (h2 +: t2) + else h2 +: merge (h +: t) t2 ``` it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -89,6 +147,36 @@ blorf = cases > blorf T F ``` +``` ucm :added-by-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 B + blah : B -> B -> Text + blorf : B -> B -> B + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 12 | > blah T F + ⧩ + "hi" + + 13 | > blah F F + ⧩ + "bye" + + 14 | > blorf T F + ⧩ + F +``` + ## Patterns with multiple guards ``` unison @@ -100,9 +188,34 @@ merge3 = cases | otherwise -> h2 +: merge3 (h +: t) t2 ``` +``` ucm :added-by-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`: + + merge3 : [a] -> [a] -> [a] +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + merge3 : [a] -> [a] -> [a] scratch/main> view merge3 + + merge3 : [a] -> [a] -> [a] + merge3 = cases + [], ys -> ys + xs, [] -> xs + h +: t, h2 +: t2 + | h <= h2 -> h +: merge3 t (h2 +: t2) + | otherwise -> h2 +: merge3 (h +: t) t2 ``` This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. @@ -115,3 +228,17 @@ merge4 a b = match (a,b) with h +: t, h2 +: t2 | h <= h2 -> h +: merge4 t (h2 +: t2) h +: t, h2 +: t2 | otherwise -> h2 +: merge4 (h +: t) t2 ``` + +``` ucm :added-by-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`: + + merge4 : [a] -> [a] -> [a] + (also named merge3) +``` diff --git a/unison-src/transcripts/idempotent/lsp-fold-ranges.md b/unison-src/transcripts/idempotent/lsp-fold-ranges.md index c523d4f3b2..50f3242b57 100644 --- a/unison-src/transcripts/idempotent/lsp-fold-ranges.md +++ b/unison-src/transcripts/idempotent/lsp-fold-ranges.md @@ -30,4 +30,28 @@ test> z = let ``` ucm scratch/main> debug.lsp.fold-ranges + + + 《{{ Type doc }}》 + 《structural type Optional a = + None + | Some a》 + + 《{{ + Multi line + + Term doc + }}》 + 《List.map : + (a -> b) + -> [a] + -> [b] + List.map f = cases + (x +: xs) -> f x +: List.map f xs + [] -> []》 + + 《test> z = let + x = "hello" + y = "world" + [Ok (x ++ y)]》 ``` diff --git a/unison-src/transcripts/idempotent/lsp-name-completion.md b/unison-src/transcripts/idempotent/lsp-name-completion.md index b3abf2e53a..c3af7b2e61 100644 --- a/unison-src/transcripts/idempotent/lsp-name-completion.md +++ b/unison-src/transcripts/idempotent/lsp-name-completion.md @@ -27,9 +27,20 @@ prioritizing exact matches over partial matches. We don't have any control over ``` ucm scratch/main> debug.lsp-name-completion foldMap + + Matching Path Name Hash + foldMap foldMap #o38ps8p4q6 + foldMapWith foldMapWith #r9rs4mcb0m + foldMap nested.deeply.foldMap #snrjegr5dk + foldMap lib.base.foldMap #jf4buul17k + foldMap lib.dep.lib.transitive.foldMap #0o01gvr3fi ``` Should still find the term which has a matching hash to a better name if the better name doesn't match. + ``` ucm scratch/main> debug.lsp-name-completion transitive_same_hash.foldMap + + Matching Path Name Hash + transitive_same_hash.foldMap lib.dep.lib.transitive_same_hash.foldMap #o38ps8p4q6 ``` diff --git a/unison-src/transcripts/idempotent/move-all.md b/unison-src/transcripts/idempotent/move-all.md index a9db7659f5..927fadf5e0 100644 --- a/unison-src/transcripts/idempotent/move-all.md +++ b/unison-src/transcripts/idempotent/move-all.md @@ -15,8 +15,31 @@ Foo.termInA = 1 unique type Foo.T = T ``` +``` ucm :added-by-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 + type Foo.T + Foo : Nat + Foo.termInA : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + type Foo.T + Foo : Nat + Foo.termInA : Nat ``` ``` unison @@ -24,17 +47,65 @@ Foo.termInA = 2 unique type Foo.T = T1 | T2 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo.T + Foo.termInA : Nat + (also named Foo) +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ``` ucm scratch/main> move Foo Bar + + Done. scratch/main> ls + + 1. Bar (Nat) + 2. Bar (type) + 3. Bar/ (4 terms, 1 type) + 4. builtin/ (469 terms, 74 types) scratch/main> ls Bar + + 1. Foo (Bar) + 2. T (type) + 3. T/ (2 terms) + 4. termInA (Nat) scratch/main> history Bar + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #o7vuviel4c + + + Adds / updates: + + T T.T1 T.T2 termInA + + - Deletes: + + T.T + + □ 2. #c5cggiaumo (start of history) ``` ## Happy Path - Just term @@ -43,11 +114,35 @@ scratch/main> history Bar bonk = 5 ``` +``` ucm :added-by-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 z/main> builtins.merge + + Done. z/main> add + + ⍟ I've added these definitions: + + bonk : Nat z/main> move bonk zonk + + Done. z/main> ls + + 1. builtin/ (469 terms, 74 types) + 2. zonk (Nat) ``` ## Happy Path - Just namespace @@ -56,16 +151,48 @@ z/main> ls bonk.zonk = 5 ``` +``` ucm :added-by-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.zonk : Nat + (also named zonk) +``` + ``` ucm a/main> builtins.merge + + Done. a/main> add + + ⍟ I've added these definitions: + + bonk.zonk : Nat a/main> move bonk zonk + + Done. a/main> ls + + 1. builtin/ (469 terms, 74 types) + 2. zonk/ (1 term) a/main> view zonk.zonk + + zonk.zonk : Nat + zonk.zonk = 5 ``` ## Sad Path - No term, type, or namespace named src ``` ucm :error scratch/main> move doesntexist foo + + ⚠️ + + There is no term, type, or namespace at doesntexist. ``` diff --git a/unison-src/transcripts/idempotent/move-namespace.md b/unison-src/transcripts/idempotent/move-namespace.md index 8fcc1f5573..4a2fcd117e 100644 --- a/unison-src/transcripts/idempotent/move-namespace.md +++ b/unison-src/transcripts/idempotent/move-namespace.md @@ -1,6 +1,5 @@ # Tests for `move.namespace` - ## Moving the Root I should be able to move the root into a sub-namespace @@ -11,33 +10,86 @@ foo = 1 ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : ##Nat -- 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 + + 1. root/ (1 term) scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #g97lh1m2v7 (start of history) ``` ``` ucm scratch/main> ls .root.at.path + + 1. foo (##Nat) scratch/main> 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. +I should be able to move a sub namespace *over* the root. ``` 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 + + 1. foo (##Nat) scratch/main> history -``` + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #08a6hgi6s4 (start of history) +``` ``` ucm :error -- should be empty scratch/main> ls .root.at.path + + nothing to show scratch/main> history .root.at.path + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #sg60bvjo91 (start of history) ``` ``` ucm :hide @@ -53,8 +105,27 @@ a.termInA = 1 unique type a.T = T ``` +``` ucm :added-by-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 a.T + a.termInA : Nat +``` + ``` ucm scratch/happy> add + + ⍟ I've added these definitions: + + type a.T + a.termInA : Nat ``` ``` unison @@ -62,18 +133,58 @@ a.termInA = 2 unique type a.T = T1 | T2 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type a.T + a.termInA : Nat +``` + ``` ucm scratch/happy> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` Should be able to move the namespace, including its types, terms, and sub-namespaces. ``` ucm scratch/happy> move.namespace a b + + Done. scratch/happy> ls b + + 1. T (type) + 2. T/ (2 terms) + 3. termInA (Nat) scratch/happy> history b -``` + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #rkvfe5p8fu + + + Adds / updates: + + T T.T1 T.T2 termInA + + - Deletes: + + T.T + + □ 2. #avlnmh0erc (start of history) +``` ## Namespace history @@ -88,8 +199,27 @@ a.termInA = 1 b.termInB = 10 ``` +``` ucm :added-by-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.termInA : Nat + b.termInB : Nat +``` + ``` ucm scratch/history> add + + ⍟ I've added these definitions: + + a.termInA : Nat + b.termInB : Nat ``` ``` unison @@ -97,8 +227,28 @@ a.termInA = 2 b.termInB = 11 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + a.termInA : Nat + b.termInB : Nat +``` + ``` ucm scratch/history> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` Deleting a namespace should not leave behind any history, @@ -107,14 +257,35 @@ of the moved namespace. ``` ucm scratch/history> delete.namespace b + + Done. scratch/history> move.namespace a b + + Done. -- Should be the history from 'a' scratch/history> history b + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #j0cjjqepb3 + + + Adds / updates: + + termInA + + □ 2. #m8smmmgjso (start of history) -- Should be empty scratch/history> history a -``` + + Note: The most recent namespace hash is immediately below this + message. + + □ 1. #sg60bvjo91 (start of history) +``` + ## Moving over an existing branch ``` ucm :hide @@ -128,8 +299,27 @@ a.termInA = 1 b.termInB = 10 ``` +``` ucm :added-by-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.termInA : Nat + b.termInB : Nat +``` + ``` ucm scratch/existing> add + + ⍟ I've added these definitions: + + a.termInA : Nat + b.termInB : Nat ``` ``` unison @@ -137,7 +327,36 @@ a.termInA = 2 b.termInB = 11 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + a.termInA : Nat + b.termInB : Nat +``` + ``` ucm scratch/existing> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/existing> move.namespace a b + + ⚠️ + + A branch existed at the destination: b so I over-wrote it. + + Tip: You can use `undo` or use a hash from `reflog` to undo + this change. + + Done. ``` diff --git a/unison-src/transcripts/idempotent/name-resolution.md b/unison-src/transcripts/idempotent/name-resolution.md index c14d18442a..59a40fdcc3 100644 --- a/unison-src/transcripts/idempotent/name-resolution.md +++ b/unison-src/transcripts/idempotent/name-resolution.md @@ -5,14 +5,33 @@ ambiguous. A reference to `Namespace.Foo` or `File.Foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison type Namespace.Foo = Bar ``` +``` ucm :added-by-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 Namespace.Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Namespace.Foo ``` ``` unison :error @@ -20,11 +39,43 @@ type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + + ❓ + + I couldn't resolve any of these symbols: + + 2 | type UsesFoo = UsesFoo Foo + + + Symbol Suggestions + + Foo File.Foo + Namespace.Foo +``` + ``` unison type File.Foo = Baz type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` +``` ucm :added-by-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 File.Foo + type UsesFoo +``` + ``` ucm scratch/main> project.delete scratch ``` @@ -36,14 +87,33 @@ it refers to the namespace type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison type Foo = Bar ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo ``` ``` unison @@ -51,9 +121,30 @@ type File.Foo = Baz type UsesFoo = UsesFoo Foo ``` +``` ucm :added-by-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 File.Foo + type UsesFoo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type File.Foo + type UsesFoo scratch/main> view UsesFoo + + type UsesFoo = UsesFoo Foo ``` ``` ucm @@ -67,14 +158,33 @@ it refers to the file type (because it is an exact match). ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison type Namespace.Foo = Bar ``` +``` ucm :added-by-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 Namespace.Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Namespace.Foo ``` ``` unison @@ -82,9 +192,30 @@ type Foo = Baz type UsesFoo = UsesFoo Foo ``` +``` ucm :added-by-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 + type UsesFoo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + type UsesFoo scratch/main> view UsesFoo + + type UsesFoo = UsesFoo Foo ``` ``` ucm @@ -98,6 +229,8 @@ but resolves to `ns.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison @@ -105,8 +238,25 @@ ns.foo : Nat ns.foo = 42 ``` +``` ucm :added-by-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`: + + ns.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ns.foo : Nat ``` ``` unison @@ -117,6 +267,20 @@ bar : Text bar = foo ++ "bar" ``` +``` ucm :added-by-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`: + + bar : Text + file.foo : Text +``` + ``` ucm scratch/main> project.delete scratch ``` @@ -128,6 +292,8 @@ but resolves to `file.foo` via TDNR. ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison @@ -135,8 +301,25 @@ ns.foo : Nat ns.foo = 42 ``` +``` ucm :added-by-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`: + + ns.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ns.foo : Nat ``` ``` unison @@ -147,6 +330,20 @@ bar : Nat bar = foo + 42 ``` +``` ucm :added-by-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`: + + bar : Nat + file.foo : Text +``` + ``` ucm scratch/main> project.delete scratch ``` @@ -158,6 +355,8 @@ A reference to `ns.foo` or `file.foo` work fine. ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison @@ -165,8 +364,25 @@ ns.foo : Nat ns.foo = 42 ``` +``` ucm :added-by-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`: + + ns.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + ns.foo : Nat ``` ``` unison :error @@ -177,6 +393,23 @@ bar : Nat bar = foo + 10 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what foo refers to here: + + 5 | bar = foo + 10 + + The name foo is ambiguous. Its type should be: Nat + + I found some terms in scope that have matching names and + types. Maybe you meant one of these: + + file.foo : Nat + ns.foo : Nat +``` + ``` unison file.foo : Nat file.foo = 43 @@ -185,9 +418,33 @@ bar : Nat bar = file.foo + ns.foo ``` +``` ucm :added-by-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`: + + bar : Nat + file.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + file.foo : Nat scratch/main> view bar + + bar : Nat + bar = + use Nat + + file.foo + ns.foo ``` ``` ucm diff --git a/unison-src/transcripts/idempotent/name-segment-escape.md b/unison-src/transcripts/idempotent/name-segment-escape.md index 5e28564ea5..da62438c48 100644 --- a/unison-src/transcripts/idempotent/name-segment-escape.md +++ b/unison-src/transcripts/idempotent/name-segment-escape.md @@ -2,7 +2,17 @@ You can use a keyword or reserved operator as a name segment if you surround it ``` ucm :error scratch/main> view `match` + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + `match` scratch/main> view `=` + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + `=` ``` You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` @@ -11,5 +21,15 @@ This allows you to spell `.` or `()` as name segments (which historically have a ``` ucm :error scratch/main> view `.` + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + `.` scratch/main> view `()` + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + `()` ``` diff --git a/unison-src/transcripts/idempotent/name-selection.md b/unison-src/transcripts/idempotent/name-selection.md index 5f9bc6f623..34690c9855 100644 --- a/unison-src/transcripts/idempotent/name-selection.md +++ b/unison-src/transcripts/idempotent/name-selection.md @@ -1,8 +1,8 @@ This transcript shows how the pretty-printer picks names for a hash when multiple are available. The algorithm is: -1. Names that are "name-only" come before names that are hash qualified. So `List.map` comes before `List.map#2384a` and also `aaaa#xyz`. -2. Shorter names (in terms of segment count) come before longer ones, for instance `base.List.map` comes before `somelibrary.external.base.List.map`. -3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. +1. Names that are "name-only" come before names that are hash qualified. So `List.map` comes before `List.map#2384a` and also `aaaa#xyz`. +2. Shorter names (in terms of segment count) come before longer ones, for instance `base.List.map` comes before `somelibrary.external.base.List.map`. +3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. ``` ucm :hide scratch/main> builtins.merge lib.builtins @@ -19,7 +19,18 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a.a : Nat + a.aaa.but.more.segments : Nat + a.b : Nat scratch/main> view a.a + + a.a : Nat + a.a = + use Nat + + b + 1 ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: @@ -42,8 +53,33 @@ a3.long.name.but.shortest.suffixification = 1 ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + a2.a : Nat + (also named a.a) + a2.aaa.but.more.segments : Nat + (also named a.b and a.aaa.but.more.segments) + a2.b : Nat + (also named a.b and a.aaa.but.more.segments) + a2.c : Nat + a2.d : Nat + a2.long.name.but.shortest.suffixification : Nat + a3.a : Nat + (also named a.a) + a3.aaa.but.more.segments : Nat + (also named a.b and a.aaa.but.more.segments) + a3.b : Nat + (also named a.b and a.aaa.but.more.segments) + a3.c : Nat + a3.d : Nat + a3.long.name.but.shortest.suffixification : Nat scratch/main> debug.alias.term.force a2.c a3.c + + Done. scratch/main> debug.alias.term.force a2.d a3.d + + Done. ``` At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. @@ -52,6 +88,32 @@ The original `a2` namespace has an unconflicted definition for `c` and `d`, but ``` ucm scratch/main> 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 @@ -65,12 +127,38 @@ deeply.nested.num = 10 a = 10 ``` +``` ucm :added-by-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 scratch/biasing> add + + ⍟ 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. scratch/biasing> view deeply.nested.term + + deeply.nested.term : Nat + deeply.nested.term = + use Nat + + num + 1 ``` Add another term with `num` suffix to force longer suffixification of `deeply.nested.num` @@ -79,9 +167,31 @@ Add another term with `num` suffix to force longer suffixification of `deeply.ne other.num = 20 ``` +``` ucm :added-by-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 +``` + ``` ucm scratch/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. scratch/biasing> view deeply.nested.term + + deeply.nested.term : Nat + deeply.nested.term = + use Nat + + nested.num + 1 ``` diff --git a/unison-src/transcripts/idempotent/names.md b/unison-src/transcripts/idempotent/names.md index a875b0bfd7..254a1cd2c8 100644 --- a/unison-src/transcripts/idempotent/names.md +++ b/unison-src/transcripts/idempotent/names.md @@ -2,6 +2,8 @@ ``` ucm scratch/main> builtins.merge lib.builtins + + Done. ``` Example uses of the `names` command and output @@ -16,20 +18,59 @@ somewhere.z = 1 somewhere.y = 2 ``` +``` ucm :added-by-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`: + + some.otherplace.x : Nat + some.otherplace.y : Nat + some.place.x : Nat + somewhere.y : Nat + somewhere.z : Nat +``` + ``` ucm scratch/main> add -``` + ⍟ I've added these definitions: + + some.otherplace.x : Nat + some.otherplace.y : Nat + some.place.x : Nat + somewhere.y : Nat + somewhere.z : Nat +``` `names` searches relative to the current path. ``` ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. scratch/main> names 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 scratch/main> names #gjmq673r1v + + Term + Hash: #gjmq673r1v + Names: some.otherplace.y some.place.x somewhere.z -- Works with absolute names too scratch/main> names .some.place.x + + Term + Hash: #gjmq673r1v + Names: some.otherplace.y some.place.x somewhere.z ``` `debug.names.global` searches from the root, and absolutely qualifies results @@ -37,8 +78,29 @@ scratch/main> names .some.place.x ``` ucm -- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively. scratch/other> debug.names.global x + + Found results in scratch/main + + 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 scratch/other> debug.names.global #gjmq673r1v + + Found results in scratch/main + + Term + Hash: #gjmq673r1v + Names: some.otherplace.y some.place.x somewhere.z -- We can search using an absolute name scratch/other> debug.names.global .some.place.x + + Found results in scratch/main + + Term + Hash: #gjmq673r1v + Names: some.otherplace.y some.place.x somewhere.z ``` diff --git a/unison-src/transcripts/idempotent/namespace-deletion-regression.md b/unison-src/transcripts/idempotent/namespace-deletion-regression.md index 14909326c1..fa3adfbe0b 100644 --- a/unison-src/transcripts/idempotent/namespace-deletion-regression.md +++ b/unison-src/transcripts/idempotent/namespace-deletion-regression.md @@ -9,8 +9,18 @@ unexpectedly 😬. ``` ucm scratch/main> alias.term ##Nat.+ Nat.+ + + Done. scratch/main> ls Nat + + 1. + (##Nat -> ##Nat -> ##Nat) scratch/main> move.namespace Nat Nat.operators + + Done. scratch/main> ls Nat + + 1. operators/ (1 term) scratch/main> ls Nat.operators + + 1. + (##Nat -> ##Nat -> ##Nat) ``` diff --git a/unison-src/transcripts/idempotent/namespace-dependencies.md b/unison-src/transcripts/idempotent/namespace-dependencies.md index b7eb348ac8..c803a2009a 100644 --- a/unison-src/transcripts/idempotent/namespace-dependencies.md +++ b/unison-src/transcripts/idempotent/namespace-dependencies.md @@ -2,6 +2,8 @@ ``` ucm scratch/main> builtins.merge lib.builtins + + Done. ``` ``` unison :hide @@ -12,5 +14,18 @@ mynamespace.dependsOnText = const external.mynat 10 ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + const : a -> b -> a + external.mynat : Nat + mynamespace.dependsOnText : Nat scratch/main> namespace.dependencies mynamespace + + External dependency Dependents in scratch/main:.mynamespace + lib.builtins.Nat 1. dependsOnText + + const 1. dependsOnText + + external.mynat 1. dependsOnText ``` diff --git a/unison-src/transcripts/idempotent/namespace-directive.md b/unison-src/transcripts/idempotent/namespace-directive.md index afb1c140c3..fa3c5f67b7 100644 --- a/unison-src/transcripts/idempotent/namespace-directive.md +++ b/unison-src/transcripts/idempotent/namespace-directive.md @@ -2,11 +2,13 @@ A `namespace foo` directive is optional, and may only appear at the top of a fil It affects the contents of the file as follows: -1. All bindings like `x.y.z` are prefixed with the namespace; note that when this file is saved, the feedback mentions -the full bindings' names. +1. All bindings like `x.y.z` are prefixed with the namespace; note that when this file is saved, the feedback mentions + the full bindings' names. ``` ucm scratch/main> builtins.mergeio lib.builtins + + Done. ``` ``` unison @@ -16,8 +18,21 @@ baz : Nat baz = 17 ``` -2. Free variables whose names exactly match bindings in the file are rewritten to refer to the prefixed binder instead. -That is, a term like `factorial = ... factorial ...` is rewritten to `foo.factorial = ... foo.factorial ...`. +``` ucm :added-by-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.baz : Nat +``` + +2. Free variables whose names exactly match bindings in the file are rewritten to refer to the prefixed binder instead. + That is, a term like `factorial = ... factorial ...` is rewritten to `foo.factorial = ... foo.factorial ...`. ``` unison namespace foo @@ -31,9 +46,36 @@ longer.evil.factorial : Int -> Int longer.evil.factorial n = n ``` +``` ucm :added-by-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.factorial : Int -> Int + foo.longer.evil.factorial : Int -> Int +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo.factorial : Int -> Int + foo.longer.evil.factorial : Int -> Int scratch/main> view factorial + + foo.factorial : Int -> Int + foo.factorial = cases + +0 -> +1 + n -> n Int.* foo.factorial (n Int.- +1) + + foo.longer.evil.factorial : Int -> Int + foo.longer.evil.factorial n = n ``` Note that in the above example, we do not want the existence of a `namespace foo` directive to determine whether the @@ -49,8 +91,35 @@ type longer.foo.Foo = Bar type longer.foo.Baz = { qux : Nat } ``` +``` ucm :added-by-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 longer.foo.Baz + type longer.foo.Foo + longer.foo.Baz.qux : Baz -> Nat + longer.foo.Baz.qux.modify : (Nat ->{g} Nat) + -> Baz + ->{g} Baz + longer.foo.Baz.qux.set : Nat -> Baz -> Baz +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type longer.foo.Baz + type longer.foo.Foo + longer.foo.Baz.qux : Baz -> Nat + longer.foo.Baz.qux.modify : (Nat ->{g} Nat) -> Baz ->{g} Baz + longer.foo.Baz.qux.set : Nat -> Baz -> Baz ``` ``` unison @@ -71,8 +140,61 @@ hasTypeLink = {{ {type Foo} }} ``` +``` ucm :added-by-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.Baz + type foo.Foo + type foo.RefersToFoo + foo.Baz.qux : foo.Baz -> Nat + foo.Baz.qux.modify : (Nat ->{g} Nat) + -> foo.Baz + ->{g} foo.Baz + foo.Baz.qux.set : Nat -> foo.Baz -> foo.Baz + foo.hasTypeLink : Doc2 + foo.refersToBar : foo.Foo -> Nat + foo.refersToQux : foo.Baz -> Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type foo.Baz + type foo.Foo + type foo.RefersToFoo + foo.Baz.qux : foo.Baz -> Nat + foo.Baz.qux.modify : (Nat ->{g} Nat) + -> foo.Baz + ->{g} foo.Baz + foo.Baz.qux.set : Nat -> foo.Baz -> foo.Baz + foo.hasTypeLink : Doc2 + foo.refersToBar : foo.Foo -> Nat + foo.refersToQux : foo.Baz -> Nat scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink + + type foo.RefersToFoo = RefersToFoo foo.Foo + + foo.hasTypeLink : Doc2 + foo.hasTypeLink = {{ {type foo.Foo} }} + + foo.refersToBar : foo.Foo -> Nat + foo.refersToBar = cases foo.Foo.Bar -> 17 + + foo.refersToQux : foo.Baz -> Nat + foo.refersToQux baz = + use Nat + + use foo.Baz qux + qux baz + qux baz scratch/main> todo + + You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/idempotent/numbered-args.md b/unison-src/transcripts/idempotent/numbered-args.md index 01afcd65bb..27f26ebfa2 100644 --- a/unison-src/transcripts/idempotent/numbered-args.md +++ b/unison-src/transcripts/idempotent/numbered-args.md @@ -15,8 +15,35 @@ quux = "quux" corge = "corge" ``` +``` ucm :added-by-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`: + + bar : Text + baz : Text + corge : Text + foo : Text + quux : Text + qux : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Text + baz : Text + corge : Text + foo : Text + quux : Text + qux : Text ``` We can get the list of things in the namespace, and UCM will give us a numbered @@ -24,32 +51,111 @@ list: ``` ucm scratch/main> find + + 1. bar : Text + 2. baz : Text + 3. corge : Text + 4. foo : Text + 5. quux : Text + 6. qux : Text + 7. builtin type Text ``` We can ask to `view` the second element of this list: ``` ucm scratch/main> find + + 1. bar : Text + 2. baz : Text + 3. corge : Text + 4. foo : Text + 5. quux : Text + 6. qux : Text + 7. builtin type Text scratch/main> view 2 + + baz : Text + baz = "baz" ``` And we can `view` multiple elements by separating with spaces: ``` ucm scratch/main> find + + 1. bar : Text + 2. baz : Text + 3. corge : Text + 4. foo : Text + 5. quux : Text + 6. qux : Text + 7. builtin type Text scratch/main> view 2 3 5 + + baz : Text + baz = "baz" + + corge : Text + corge = "corge" + + quux : Text + quux = "quux" ``` We can also ask for a range: ``` ucm scratch/main> find + + 1. bar : Text + 2. baz : Text + 3. corge : Text + 4. foo : Text + 5. quux : Text + 6. qux : Text + 7. builtin type Text scratch/main> view 2-4 + + baz : Text + baz = "baz" + + corge : Text + corge = "corge" + + foo : Text + foo = "foo" ``` And we can ask for multiple ranges and use mix of ranges and numbers: ``` ucm scratch/main> find + + 1. bar : Text + 2. baz : Text + 3. corge : Text + 4. foo : Text + 5. quux : Text + 6. qux : Text + 7. builtin type Text scratch/main> view 1-3 4 5-6 + + bar : Text + bar = "bar" + + baz : Text + baz = "baz" + + corge : Text + corge = "corge" + + foo : Text + foo = "foo" + + quux : Text + quux = "quux" + + qux : Text + qux = "qux" ``` diff --git a/unison-src/transcripts/idempotent/old-fold-right.md b/unison-src/transcripts/idempotent/old-fold-right.md index 4caa8bace0..a73bcebd0e 100644 --- a/unison-src/transcripts/idempotent/old-fold-right.md +++ b/unison-src/transcripts/idempotent/old-fold-right.md @@ -14,3 +14,17 @@ pecan = 'let oldRight f la ``` + +``` ucm :added-by-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`: + + oldRight : (b ->{e} a ->{e} b) -> [a] ->{e} [b] + pecan : '[Text] +``` diff --git a/unison-src/transcripts/idempotent/pattern-match-coverage.md b/unison-src/transcripts/idempotent/pattern-match-coverage.md index 9c327b98aa..75c628b11e 100644 --- a/unison-src/transcripts/idempotent/pattern-match-coverage.md +++ b/unison-src/transcripts/idempotent/pattern-match-coverage.md @@ -3,7 +3,9 @@ scratch/main> builtins.merge ``` # Basics + ## non-exhaustive patterns + ``` unison :error unique type T = A | B | C @@ -12,6 +14,21 @@ test = cases A -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 4 | test = cases + 5 | A -> () + + + Patterns not matched: + + * B + * C +``` + ``` unison :error unique type T = A | B @@ -23,7 +40,24 @@ test = cases (B, None) -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 4 | test = cases + 5 | (A, Some _) -> () + 6 | (A, None) -> () + 7 | (B, Some A) -> () + 8 | (B, None) -> () + + + Patterns not matched: + * (B, Some B) +``` + ## redundant patterns + ``` unison :error unique type T = A | B | C @@ -35,6 +69,15 @@ test = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 8 | _ -> () + +``` + ``` unison :error unique type T = A | B @@ -47,9 +90,19 @@ test = cases (A, Some A) -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 9 | (A, Some A) -> () + +``` + # Uninhabited patterns match is complete without covering uninhabited patterns + ``` unison unique type V = @@ -59,7 +112,22 @@ test = cases Some None -> () ``` +``` ucm :added-by-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 V + test : Optional (Optional V) -> () +``` + uninhabited patterns are reported as redundant + ``` unison :error unique type V = @@ -68,6 +136,15 @@ test0 = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 5 | _ -> () + +``` + ``` unison :error unique type V = @@ -78,15 +155,38 @@ test = cases Some _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 7 | Some _ -> () + +``` + # Guards ## Incomplete patterns due to guards should be reported + ``` unison :error test : () -> () test = cases () | false -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | () | false -> () + + + Patterns not matched: + * () +``` + ``` unison :error test : Optional Nat -> Nat test = cases @@ -95,7 +195,23 @@ test = cases | isEven x -> x ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | None -> 0 + 4 | Some x + 5 | | isEven x -> x + + + Patterns not matched: + * Some _ +``` + ## Complete patterns with guards should be accepted + ``` unison :error test : Optional Nat -> Nat test = cases @@ -105,10 +221,24 @@ test = cases | otherwise -> 0 ``` +``` ucm :added-by-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`: + + test : Optional Nat -> Nat +``` + # Pattern instantiation depth Uncovered patterns are only instantiated as deeply as necessary to distinguish them from existing patterns. + ``` unison :error unique type T = A | B | C @@ -118,6 +248,20 @@ test = cases Some None -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 4 | test = cases + 5 | None -> () + 6 | Some None -> () + + + Patterns not matched: + * Some (Some _) +``` + ``` unison :error unique type T = A | B | C @@ -128,27 +272,73 @@ test = cases Some (Some A) -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 4 | test = cases + 5 | None -> () + 6 | Some None -> () + 7 | Some (Some A) -> () + + + Patterns not matched: + + * Some (Some B) + * Some (Some C) +``` + # Literals ## Non-exhaustive Nat + ``` unison :error test : Nat -> () test = cases 0 -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | 0 -> () + + + Patterns not matched: + * _ +``` + Boolean + ``` unison :error test : Boolean -> () test = cases true -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | true -> () + + + Patterns not matched: + * false +``` + ## Exhaustive Nat + ``` unison test : Nat -> () test = cases @@ -156,7 +346,21 @@ test = cases _ -> () ``` +``` ucm :added-by-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`: + + test : Nat -> () +``` + Boolean + ``` unison test : Boolean -> () test = cases @@ -164,9 +368,23 @@ test = cases false -> () ``` +``` ucm :added-by-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`: + + test : Boolean -> () +``` + # Redundant Nat + ``` unison :error test : Nat -> () test = cases @@ -175,7 +393,17 @@ test = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 4 | 0 -> () + +``` + Boolean + ``` unison :error test : Boolean -> () test = cases @@ -184,9 +412,19 @@ test = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 5 | _ -> () + +``` + # Sequences ## Exhaustive + ``` unison test : [()] -> () test = cases @@ -194,25 +432,78 @@ test = cases x +: xs -> () ``` +``` ucm :added-by-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`: + + test : [()] -> () +``` + ## Non-exhaustive + ``` unison :error test : [()] -> () test = cases [] -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | [] -> () + + + Patterns not matched: + * (() +: _) +``` + ``` unison :error test : [()] -> () test = cases x +: xs -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | x +: xs -> () + + + Patterns not matched: + * [] +``` + ``` unison :error test : [()] -> () test = cases xs :+ x -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | xs :+ x -> () + + + Patterns not matched: + * [] +``` + ``` unison :error test : [()] -> () test = cases @@ -220,6 +511,20 @@ test = cases [] -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | x0 +: (x1 +: xs) -> () + 4 | [] -> () + + + Patterns not matched: + * (() +: []) +``` + ``` unison :error test : [()] -> () test = cases @@ -227,9 +532,24 @@ test = cases x0 +: [] -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 2 | test = cases + 3 | [] -> () + 4 | x0 +: [] -> () + + + Patterns not matched: + * (() +: (() +: _)) +``` + ## Uninhabited `Cons` is not expected since `V` is uninhabited + ``` unison unique type V = @@ -238,6 +558,20 @@ test = cases [] -> () ``` +``` ucm :added-by-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 V + test : [V] -> () +``` + ## Length restrictions can equate cons and nil patterns Here the first pattern matches lists of length two or greater, the @@ -246,6 +580,7 @@ final element is `false`, while the fourth pattern matches when the first element is `true`. However, the only possible list length at the third or fourth clause is 1, so the first and final element must be equal. Thus, the pattern match is exhaustive. + ``` unison test : [Boolean] -> () test = cases @@ -255,7 +590,21 @@ test = cases true +: xs -> () ``` +``` ucm :added-by-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`: + + test : [Boolean] -> () +``` + This is the same idea as above but shows that fourth match is redundant. + ``` unison :error test : [Boolean] -> () test = cases @@ -266,12 +615,22 @@ test = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 6 | true +: xs -> () + +``` + This is another similar example. The first pattern matches lists of length 5 or greater. The second matches lists of length 4 or greater where the first and third element are true. The third matches lists of length 4 or greater where the final 4 elements are `true, false, true, false`. The list must be exactly of length 4 to arrive at the second or third clause, so the third pattern is redundant. + ``` unison :error test : [Boolean] -> () test = cases @@ -281,6 +640,15 @@ test = cases _ -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 5 | _ ++ [true, false, true, false] -> () + +``` + # bugfix: Sufficient data decl map ``` unison @@ -291,8 +659,27 @@ unit2t = cases () -> A ``` +``` ucm :added-by-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 T + unit2t : 'T +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type T + unit2t : 'T ``` Pattern coverage checking needs the data decl map to contain all @@ -302,12 +689,26 @@ transitive type dependencies of references that appear in the expression. This test ensures that we have fetched the `T` type although there is no data decl reference to `T` in `witht`. + ``` unison witht : Unit witht = match unit2t () with x -> () ``` +``` ucm :added-by-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`: + + witht : () +``` + ``` unison unique type V = @@ -315,8 +716,27 @@ evil : Unit -> V evil = bug "" ``` +``` ucm :added-by-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 V + evil : 'V +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type V + evil : 'V ``` ``` unison :error @@ -325,12 +745,38 @@ withV = match evil () with x -> () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 3 | x -> () + +``` + ``` unison unique type SomeType = A ``` +``` ucm :added-by-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 SomeType +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type SomeType ``` ``` unison @@ -340,10 +786,40 @@ get x = match x with R y -> y ``` +``` ucm :added-by-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 R + get : R -> SomeType +``` + ``` unison unique type R = { someType : SomeType } ``` +``` ucm :added-by-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 R + R.someType : R -> SomeType + R.someType.modify : (SomeType ->{g} SomeType) -> R ->{g} R + R.someType.set : SomeType -> R -> R +``` + # Ability handlers ## Exhaustive ability handlers are accepted @@ -359,6 +835,20 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` +``` ucm :added-by-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 ability Abort + result : '{e, Abort} a ->{e} a +``` + ``` unison structural ability Abort where abort : {Abort} a @@ -372,6 +862,25 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` +``` ucm :added-by-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 ability Abort + result : '{e, Abort} T ->{e} () + + ⍟ These names already exist. You can `update` them to your + new definition: + + type T +``` + ``` unison structural ability Abort where abort : {Abort} a @@ -384,6 +893,20 @@ result f = handle !f with impl ``` +``` ucm :added-by-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 ability Abort + result : '{e, Abort} V ->{e} V +``` + ``` unison structural ability Abort where abort : {Abort} a @@ -400,6 +923,21 @@ handleMulti c = handle !c with impl [] ``` +``` ucm :added-by-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 ability Abort + structural ability Stream a + handleMulti : '{Abort, Stream a} r -> (Optional r, [a]) +``` + ## Non-exhaustive ability handlers are rejected ``` unison :error @@ -413,6 +951,21 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 7 | result f = handle !f with cases + 8 | { abort -> _ } -> bug "aborted" + + + Patterns not matched: + + * { _ } + * { abortWithMessage _ -> _ } +``` + ``` unison :error structural ability Abort where abort : {Abort} a @@ -425,6 +978,20 @@ result f = handle !f with cases { abort -> _ } -> bug "aborted" ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 7 | result f = handle !f with cases + 8 | { T.A } -> () + 9 | { abort -> _ } -> bug "aborted" + + + Patterns not matched: + * { B } +``` + ``` unison :error unique ability Give a where give : a -> {Give a} Unit @@ -437,6 +1004,20 @@ result f = handle !f with cases { give T.A -> resume } -> result resume ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 7 | result f = handle !f with cases + 8 | { x } -> x + 9 | { give T.A -> resume } -> result resume + + + Patterns not matched: + * { give B -> _ } +``` + ``` unison :error structural ability Abort where abort : {Abort} a @@ -453,6 +1034,20 @@ handleMulti c = handle !c with impl [] ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 10 | impl xs = cases + 11 | { r } -> (Some r, xs) + 12 | { emit x -> resume } -> handle !resume with impl (xs :+ x) + + + Patterns not matched: + * { abort -> _ } +``` + ## Redundant handler cases are rejected ``` unison :error @@ -468,6 +1063,15 @@ result f = handle !f with cases { give T.A -> resume } -> result resume ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 10 | { give T.A -> resume } -> result resume + +``` + ## Exhaustive ability reinterpretations are accepted ``` unison @@ -483,6 +1087,20 @@ result f = handle !f with cases { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) ``` +``` ucm :added-by-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 ability Abort + result : '{e, Abort} a ->{e, Abort} a +``` + ``` unison structural ability Abort a where abort : {Abort a} r @@ -497,6 +1115,20 @@ result f = handle !f with impl ``` +``` ucm :added-by-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 ability Abort a + result : '{e, Abort V} a ->{e, Abort V} a +``` + ## Non-exhaustive ability reinterpretations are rejected ``` unison :error @@ -511,6 +1143,20 @@ result f = handle !f with cases { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 7 | result f = handle !f with cases + 8 | { x } -> x + 9 | { abortWithMessage msg -> _ } -> abortWithMessage ("aborting: " ++ msg) + + + Patterns not matched: + * { abort -> _ } +``` + ## Hacky workaround for uninhabited abilities Although all of the constructors of an ability might be uninhabited, @@ -537,6 +1183,21 @@ result f = handle !f with impl ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + Pattern match doesn't cover all possible cases: + 8 | impl = cases + 9 | { x } -> x + + + Patterns not matched: + + * { give _ -> _ } + * { give2 _ -> _ } +``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -551,6 +1212,20 @@ result f = handle !f with impl ``` +``` ucm :added-by-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`: + + ability Give a + result : '{e, Give V} r ->{e} r +``` + ``` unison unique ability Give a where give : a -> {Give a} Unit @@ -565,6 +1240,20 @@ result f = handle !f with impl ``` +``` ucm :added-by-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`: + + ability Give a + result : '{e, Give V} r ->{e} r +``` + ``` unison :error unique ability Give a where give : a -> {Give a} Unit @@ -580,6 +1269,15 @@ result f = handle !f with impl ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 11 | { give2 _ -> resume } -> bug "impossible" + +``` + ``` unison :error unique ability GiveA a where giveA : a -> {GiveA a} Unit @@ -601,6 +1299,15 @@ result f = handle !f with impl ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + This case would be ignored because it's already covered by the preceding case(s): + 15 | { giveA2 _ -> _ } -> bug "impossible" + +``` + ``` unison unique ability GiveA a where giveA : a -> {GiveA a} Unit @@ -619,3 +1326,18 @@ result f = { giveB _ -> _ } -> bug "impossible" handle !f with impl ``` + +``` ucm :added-by-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`: + + ability GiveA a + ability GiveB a + result : '{e, GiveA V, GiveB V} r ->{e} r +``` diff --git a/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md b/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md index e0665d867b..c09675c9c1 100644 --- a/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md +++ b/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md @@ -1,6 +1,5 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 - ``` ucm :hide scratch/main> builtins.merge ``` @@ -64,21 +63,131 @@ doc = cases _ -> () ``` +``` ucm :added-by-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 ability Ab + agitated : Nat -> () + angry : [t] -> () + bashful : Optional a -> () + demure : [Nat] -> () + doc : Nat -> () + dopey : Char -> () + grumpy : ff284oqf651 -> () + happy : Boolean -> () + mouthy : [t] -> () + pokey : [t] -> () + sleepy : [t] -> () + sneezy : Int -> () + throaty : Request {g, Ab} x -> () + tremulous : (Nat, Nat) -> () +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural ability Ab + agitated : Nat -> () + angry : [t] -> () + bashful : Optional a -> () + demure : [Nat] -> () + doc : Nat -> () + dopey : Char -> () + grumpy : ff284oqf651 -> () + happy : Boolean -> () + mouthy : [t] -> () + pokey : [t] -> () + sleepy : [t] -> () + sneezy : Int -> () + throaty : Request {g, Ab} x -> () + tremulous : (Nat, Nat) -> () scratch/main> view dopey + + dopey : Char -> () + dopey = cases + ?0 -> () + _ -> () scratch/main> view grumpy + + grumpy : ff284oqf651 -> () + grumpy = cases d -> () scratch/main> view happy + + happy : Boolean -> () + happy = cases + true -> () + false -> () scratch/main> view sneezy + + sneezy : Int -> () + sneezy = cases + +1 -> () + _ -> () scratch/main> view bashful + + bashful : Optional a -> () + bashful = cases + Some a -> () + _ -> () scratch/main> view mouthy + + mouthy : [t] -> () + mouthy = cases + [] -> () + _ -> () scratch/main> view pokey + + pokey : [t] -> () + pokey = cases + h +: t -> () + _ -> () scratch/main> view sleepy + + sleepy : [t] -> () + sleepy = cases + i :+ l -> () + _ -> () scratch/main> view demure + + demure : [Nat] -> () + demure = cases + [0] -> () + _ -> () scratch/main> view angry + + angry : [t] -> () + angry = cases a ++ [] -> () scratch/main> view tremulous + + tremulous : (Nat, Nat) -> () + tremulous = cases + (0, 1) -> () + _ -> () scratch/main> view throaty + + throaty : Request {g, Ab} x -> () + throaty = cases + { Ab.a a -> k } -> () + { _ } -> () scratch/main> view agitated + + agitated : Nat -> () + agitated = cases + a | a == 2 -> () + _ -> () scratch/main> view doc + doc : Nat -> () + doc = cases + y@4 -> () + _ -> () ``` diff --git a/unison-src/transcripts/idempotent/patternMatchTls.md b/unison-src/transcripts/idempotent/patternMatchTls.md index 751bdf2d04..88b34574b2 100644 --- a/unison-src/transcripts/idempotent/patternMatchTls.md +++ b/unison-src/transcripts/idempotent/patternMatchTls.md @@ -5,8 +5,6 @@ scratch/main> builtins.merge We had bugs in the calling conventions for both send and terminate which would cause pattern matching on the resulting (Right ()) would cause a runtime error. - - ``` unison use builtin.io2.Tls newClient send handshake terminate @@ -26,9 +24,28 @@ assertRight = cases Left _ -> bug "expected a right but got a left" ``` +``` ucm :added-by-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`: + + assertRight : Either a b -> b + frank : '{IO} () +``` ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + assertRight : Either a b -> b + frank : '{IO} () scratch/main> run frank + + () ``` diff --git a/unison-src/transcripts/idempotent/patterns.md b/unison-src/transcripts/idempotent/patterns.md index a0476f2a2f..56b0474376 100644 --- a/unison-src/transcripts/idempotent/patterns.md +++ b/unison-src/transcripts/idempotent/patterns.md @@ -10,3 +10,27 @@ p1 = join [literal "blue", literal "frog"] > Pattern.run (many p1) "bluefrogbluegoat" > Pattern.run (many.corrected p1) "bluefrogbluegoat" ``` + +``` ucm :added-by-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`: + + p1 : Pattern Text + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 3 | > Pattern.run (many p1) "bluefrogbluegoat" + ⧩ + Some ([], "goat") + + 4 | > Pattern.run (many.corrected p1) "bluefrogbluegoat" + ⧩ + Some ([], "bluegoat") +``` diff --git a/unison-src/transcripts/idempotent/propagate.md b/unison-src/transcripts/idempotent/propagate.md index 430170acea..dd5838bedf 100644 --- a/unison-src/transcripts/idempotent/propagate.md +++ b/unison-src/transcripts/idempotent/propagate.md @@ -13,12 +13,44 @@ fooToInt : Foo -> Int fooToInt _ = +42 ``` +``` ucm :added-by-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 + fooToInt : Foo -> Int +``` + And then we add it. ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + fooToInt : Foo -> Int scratch/main> find.verbose + + 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo + type Foo + + 2. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo#0 + Foo.Foo : Foo + + 3. -- #j6hbm1gc2ak4f46b6705q90ld4bmhoi8etq2q45j081i9jgn95fvk3p6tjg67e7sm0021035i8qikmk4p6k845l5d00u26cos5731to + fooToInt : Foo -> Int + scratch/main> view fooToInt + + fooToInt : Foo -> Int + fooToInt _ = +42 ``` Then if we change the type `Foo`... @@ -27,16 +59,37 @@ Then if we change the type `Foo`... unique type Foo = Foo | Bar ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + and update the codebase to use the new type `Foo`... ``` ucm scratch/main> update.old + + ⍟ I've updated these names to your new definition: + + type Foo ``` ... it should automatically propagate the type to `fooToInt`. ``` ucm scratch/main> view fooToInt + + fooToInt : Foo -> Int + fooToInt _ = +42 ``` ### Preserving user type variables @@ -52,10 +105,29 @@ preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y ``` +``` ucm :added-by-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`: + + preserve.otherTerm : Optional baz -> Optional baz + preserve.someTerm : Optional foo -> Optional foo +``` + Add that to the codebase: ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + preserve.otherTerm : Optional baz -> Optional baz + preserve.someTerm : Optional foo -> Optional foo ``` Let's now edit the dependency: @@ -65,10 +137,28 @@ preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + preserve.someTerm : Optional x -> Optional x +``` + Update... ``` ucm scratch/main> update.old + + ⍟ I've updated these names to your new definition: + + preserve.someTerm : Optional x -> Optional x ``` Now the type of `someTerm` should be `Optional x -> Optional x` and the @@ -76,5 +166,11 @@ type of `otherTerm` should remain the same. ``` ucm scratch/main> view preserve.someTerm + + preserve.someTerm : Optional x -> Optional x + preserve.someTerm _ = None scratch/main> view preserve.otherTerm + + preserve.otherTerm : Optional baz -> Optional baz + preserve.otherTerm y = someTerm y ``` diff --git a/unison-src/transcripts/idempotent/pull-errors.md b/unison-src/transcripts/idempotent/pull-errors.md index 8ea9d820a8..9a1b0e4cdf 100644 --- a/unison-src/transcripts/idempotent/pull-errors.md +++ b/unison-src/transcripts/idempotent/pull-errors.md @@ -1,6 +1,39 @@ ``` ucm :error test/main> pull @aryairani/test-almost-empty/main lib.base_latest + + The use of `pull` to install libraries is now deprecated. + Going forward, you can use + `lib.install @aryairani/test-almost-empty/main`. + + Downloaded 2 entities. + + I installed @aryairani/test-almost-empty/main as + aryairani_test_almost_empty_main. test/main> pull @aryairani/test-almost-empty/main a.b + + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I think you want to merge @aryairani/test-almost-empty/main + into the a.b namespace, but the `pull` command only supports + merging into the top level of a local project branch. + + You can run `help pull` for more information on using `pull`. test/main> pull @aryairani/test-almost-empty/main a + + I think you want to merge @aryairani/test-almost-empty/main + into the a branch, but it doesn't exist. If you want, you can + create it with `branch.empty a`, and then `pull` again. test/main> pull @aryairani/test-almost-empty/main .a + + ⚠️ + + Sorry, I wasn’t sure how to process your request: + + I think you want to merge @aryairani/test-almost-empty/main + into the .a namespace, but the `pull` command only supports + merging into the top level of a local project branch. + + You can run `help pull` for more information on using `pull`. ``` diff --git a/unison-src/transcripts/idempotent/records.md b/unison-src/transcripts/idempotent/records.md index 66a42538f2..26548ab236 100644 --- a/unison-src/transcripts/idempotent/records.md +++ b/unison-src/transcripts/idempotent/records.md @@ -17,6 +17,8 @@ scratch/main> add ``` ucm scratch/main> view Record1 + + type Record1 = { a : Text } ``` ## Record with 2 fields @@ -31,6 +33,8 @@ scratch/main> add ``` ucm scratch/main> view Record2 + + type Record2 = { a : Text, b : Int } ``` ## Record with 3 fields @@ -45,6 +49,8 @@ scratch/main> add ``` ucm scratch/main> view Record3 + + type Record3 = { a : Text, b : Int, c : Nat } ``` ## Record with many fields @@ -67,6 +73,15 @@ scratch/main> add ``` ucm scratch/main> view Record4 + + type Record4 + = { a : Text, + b : Int, + c : Nat, + d : Bytes, + e : Text, + f : Nat, + g : [Nat] } ``` ## Record with many many fields @@ -103,6 +118,29 @@ scratch/main> add ``` ucm scratch/main> view Record5 + + type Record5 + = { zero : Nat, + one : [Nat], + two : [[Nat]], + three : [[[Nat]]], + four : [[[[Nat]]]], + five : [[[[[Nat]]]]], + six : [[[[[[Nat]]]]]], + seven : [[[[[[[Nat]]]]]]], + eight : [[[[[[[[Nat]]]]]]]], + nine : [[[[[[[[[Nat]]]]]]]]], + ten : [[[[[[[[[[Nat]]]]]]]]]], + eleven : [[[[[[[[[[[Nat]]]]]]]]]]], + twelve : [[[[[[[[[[[[Nat]]]]]]]]]]]], + thirteen : [[[[[[[[[[[[[Nat]]]]]]]]]]]]], + fourteen : [[[[[[[[[[[[[[Nat]]]]]]]]]]]]]], + fifteen : [[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]], + sixteen : [[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]], + seventeen : [[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]], + eighteen : [[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]], + nineteen : [[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]], + twenty : [[[[[[[[[[[[[[[[[[[[Nat]]]]]]]]]]]]]]]]]]]] } ``` ## Record with user-defined type fields @@ -119,12 +157,14 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } 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) +If you `view` or `edit` it, it *should* be treated as a record type, but it does not (which is a bug) ``` ucm scratch/main> view RecordWithUserType -``` + type RecordWithUserType + = { a : Text, b : Record4, c : UserType } +``` ## Syntax @@ -136,3 +176,30 @@ unique type Record5 = b : Int, } ``` + +``` ucm :added-by-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`: + + Record5.a : Record5 -> Text + Record5.a.modify : (Text ->{g} Text) + -> Record5 + ->{g} Record5 + Record5.a.set : Text -> Record5 -> Record5 + Record5.b : Record5 -> Int + Record5.b.modify : (Int ->{g} Int) + -> Record5 + ->{g} Record5 + Record5.b.set : Int -> Record5 -> Record5 + + ⍟ These names already exist. You can `update` them to your + new definition: + + type Record5 +``` diff --git a/unison-src/transcripts/idempotent/reflog.md b/unison-src/transcripts/idempotent/reflog.md index cfd81a8400..75a5c5d7b5 100644 --- a/unison-src/transcripts/idempotent/reflog.md +++ b/unison-src/transcripts/idempotent/reflog.md @@ -7,35 +7,128 @@ First we make some changes to the codebase so there's data in the reflog. ``` unison x = 1 ``` + +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + x : Nat ``` + ``` unison y = 2 ``` + +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + y : Nat scratch/main> branch /other + + Done. I've created the other branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /other`. scratch/other> alias.term y z + + Done. newproject/main> builtins.merge lib.builtins + + Done. newproject/main> alias.type lib.builtins.Nat MyNat + + Done. ``` Should see reflog entries from the current branch ``` ucm scratch/main> reflog + + Below is a record of recent changes, you can use + `reset #abcdef` to reset the current branch to a previous + state. + + Tip: Use `diff.namespace 1 7` to compare between points in + history. + + Branch Hash Description + 1. scratch/main #6mdl5gruh5 add + 2. scratch/main #3rqf1hbev7 add + 3. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins + 4. scratch/main #sg60bvjo91 Project Created ``` Should see reflog entries from the current project ``` ucm scratch/main> project.reflog -``` + Below is a record of recent changes, you can use + `reset #abcdef` to reset the current branch to a previous + state. + + Tip: Use `diff.namespace 1 7` to compare between points in + history. + + Branch Hash Description + 1. scratch/other #148flqs4b1 alias.term scratch/other:.y scratch/other:z + 2. scratch/other #6mdl5gruh5 Branch created from scratch/main + 3. scratch/main #6mdl5gruh5 add + 4. scratch/main #3rqf1hbev7 add + 5. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins + 6. scratch/main #sg60bvjo91 Project Created +``` Should see reflog entries from all projects ``` ucm scratch/main> reflog.global + + Below is a record of recent changes, you can use + `reset #abcdef` to reset the current branch to a previous + state. + + Tip: Use `diff.namespace 1 7` to compare between points in + history. + + Branch Hash Description + 1. newproject/main #2rjhs2vq43 alias.term newproject/main:lib.builtins.Nat newproject/main:... + 2. newproject/main #ms9lggs2rg builtins.merge newproject/main:lib.builtins + 3. newproject/main #sg60bvjo91 Branch Created + 4. scratch/other #148flqs4b1 alias.term scratch/other:.y scratch/other:z + 5. scratch/other #6mdl5gruh5 Branch created from scratch/main + 6. scratch/main #6mdl5gruh5 add + 7. scratch/main #3rqf1hbev7 add + 8. scratch/main #ms9lggs2rg builtins.merge scratch/main:lib.builtins + 9. scratch/main #sg60bvjo91 Project Created ``` diff --git a/unison-src/transcripts/idempotent/release-draft-command.md b/unison-src/transcripts/idempotent/release-draft-command.md index 03a370c160..a1136ec464 100644 --- a/unison-src/transcripts/idempotent/release-draft-command.md +++ b/unison-src/transcripts/idempotent/release-draft-command.md @@ -10,8 +10,25 @@ Some setup: someterm = 18 ``` +``` ucm :added-by-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`: + + someterm : Nat +``` + ``` ucm foo/main> add + + ⍟ I've added these definitions: + + someterm : Nat ``` Now, the `release.draft` demo: @@ -20,10 +37,27 @@ Now, the `release.draft` demo: ``` ucm foo/main> release.draft 1.2.3 + + 😎 Great! I've created a draft release for you at + /releases/drafts/1.2.3. + + You can create a `ReleaseNotes : Doc` in this branch to give + an overview of the release. It'll automatically show up on + Unison Share when you publish. + + When ready to release 1.2.3 to the world, `push` the release + to Unison Share, navigate to the release, and click "Publish". + + Tip: if you get pulled away from drafting your release, you + can always get back to it with + `switch /releases/drafts/1.2.3`. ``` It's an error to try to create a `releases/drafts/x.y.z` branch that already exists. ``` ucm :error foo/main> release.draft 1.2.3 + + foo/releases/drafts/1.2.3 already exists. You can switch to it + with `switch foo/releases/drafts/1.2.3`. ``` diff --git a/unison-src/transcripts/idempotent/reset.md b/unison-src/transcripts/idempotent/reset.md index 35c66495c6..54e23fb64c 100644 --- a/unison-src/transcripts/idempotent/reset.md +++ b/unison-src/transcripts/idempotent/reset.md @@ -6,6 +6,19 @@ scratch/main> builtins.merge def = "first value" ``` +``` ucm :added-by-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`: + + def : Text +``` + ``` ucm :hide scratch/main> update ``` @@ -18,26 +31,107 @@ Can reset to a value from history by number. ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #5vq851j3hg + + + Adds / updates: + + def + + ⊙ 2. #ujvq6e87kp + + + Adds / updates: + + def + + □ 3. #4bigcpnl7t (start of history) scratch/main> reset 2 + + Done. scratch/main> view def + + def : Text + def = "first value" scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #ujvq6e87kp + + + Adds / updates: + + def + + □ 2. #4bigcpnl7t (start of history) ``` Can reset to a value from reflog by number. ``` ucm scratch/main> reflog + + Below is a record of recent changes, you can use + `reset #abcdef` to reset the current branch to a previous + state. + + Tip: Use `diff.namespace 1 7` to compare between points in + history. + + Branch Hash Description + 1. scratch/main #ujvq6e87kp reset ujvq6e87kp4288eq3al9v5luctic0ocd7ug1fu0go5bicrr2vfnrb0... + 2. scratch/main #5vq851j3hg update + 3. scratch/main #ujvq6e87kp update + 4. scratch/main #4bigcpnl7t builtins.merge + 5. scratch/main #sg60bvjo91 Project Created -- Reset the current branch to the first history element scratch/main> reset 2 + + Done. scratch/main> view def + + def : Text + def = "second value" scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #5vq851j3hg + + + Adds / updates: + + def + + ⊙ 2. #ujvq6e87kp + + + Adds / updates: + + def + + □ 3. #4bigcpnl7t (start of history) ``` # reset branch ``` ucm foo/main> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #sg60bvjo91 (start of history) ``` ``` unison :hide @@ -46,18 +140,54 @@ a = 5 ``` ucm foo/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. foo/empty> reset /main: + + Done. foo/empty> view a + + a : ##Nat + a = 5 foo/empty> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #5l94rduvel (start of history) ``` ## second argument is always interpreted as a branch + ``` unison :hide main.a = 3 ``` ``` ucm foo/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. foo/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #0i64kpfccl + + + Adds / updates: + + main.a + + □ 2. #5l94rduvel (start of history) foo/main> reset 2 main + + Done. ``` diff --git a/unison-src/transcripts/idempotent/resolution-failures.md b/unison-src/transcripts/idempotent/resolution-failures.md index ff54a56a26..863ce848b2 100644 --- a/unison-src/transcripts/idempotent/resolution-failures.md +++ b/unison-src/transcripts/idempotent/resolution-failures.md @@ -6,6 +6,8 @@ This transcript tests the errors printed to the user when a name cannot be resol ``` ucm scratch/main> builtins.merge lib.builtins + + Done. ``` First we define differing types with the same name in different namespaces: @@ -18,8 +20,31 @@ one.ambiguousTerm = "term one" two.ambiguousTerm = "term two" ``` +``` ucm :added-by-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 one.AmbiguousType + type two.AmbiguousType + one.ambiguousTerm : Text + two.ambiguousTerm : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type one.AmbiguousType + type two.AmbiguousType + one.ambiguousTerm : Text + two.ambiguousTerm : Text ``` ## Tests @@ -29,8 +54,8 @@ It is ambiguous which type from which namespace we mean. We expect the output to: -1. Print all ambiguous usage sites separately -2. Print possible disambiguation suggestions for each unique ambiguity +1. Print all ambiguous usage sites separately +2. Print possible disambiguation suggestions for each unique ambiguity ``` unison :error -- We intentionally avoid using a constructor to ensure the constructor doesn't @@ -46,9 +71,54 @@ separateAmbiguousTypeUsage : AmbiguousType -> () separateAmbiguousTypeUsage _ = () ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + + ❓ + + I couldn't resolve any of these symbols: + + 3 | useAmbiguousType : AmbiguousType -> () + 4 | useAmbiguousType _ = () + 5 | + 6 | useUnknownType : UnknownType -> () + 7 | useUnknownType _ = () + 8 | + 9 | -- Despite being a duplicate disambiguation, this should still be included in the annotations printout + 10 | separateAmbiguousTypeUsage : AmbiguousType -> () + + + Symbol Suggestions + + AmbiguousType one.AmbiguousType + two.AmbiguousType + + UnknownType No matches +``` + Currently, ambiguous terms are caught and handled by type directed name resolution, but expect it to eventually be handled by the above machinery. ``` unison :error useAmbiguousTerm = ambiguousTerm ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what ambiguousTerm refers to here: + + 1 | useAmbiguousTerm = ambiguousTerm + + The name ambiguousTerm is ambiguous. I couldn't narrow it down + by type, as any type would work here. + + I found some terms in scope that have matching names and + types. Maybe you meant one of these: + + one.ambiguousTerm : Text + two.ambiguousTerm : Text +``` diff --git a/unison-src/transcripts/idempotent/rsa.md b/unison-src/transcripts/idempotent/rsa.md index b211fcb875..cd07c425a3 100644 --- a/unison-src/transcripts/idempotent/rsa.md +++ b/unison-src/transcripts/idempotent/rsa.md @@ -34,3 +34,40 @@ sigKo = match signature with > sigOkay > sigKo ``` + +``` ucm :added-by-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`: + + down : Bytes + incorrectPublicKey : Bytes + message : Bytes + publicKey : Bytes + secret : Bytes + sigKo : Either Failure Boolean + sigOkay : Either Failure Boolean + signature : Either Failure Bytes + up : Bytes + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 28 | > signature + ⧩ + Right + 0xs84b02b6bb0e1196b65378cb12b727f7b4b38e5979f0632e8a51cfab088827f6d3da4221788029f75a0a5f4d740372cfa590462888a1189bbd9de9b084f26116640e611af5a1a17229beec7fb2570887181bbdced8f0ebfec6cad6bdd318a616ba4f01c90e1436efe44b18417d18ce712a0763be834f8c76e0c39b2119b061373 + + 29 | > sigOkay + ⧩ + Right true + + 30 | > sigKo + ⧩ + Right false +``` diff --git a/unison-src/transcripts/idempotent/scope-ref.md b/unison-src/transcripts/idempotent/scope-ref.md index b9a05b70fc..ac1972098d 100644 --- a/unison-src/transcripts/idempotent/scope-ref.md +++ b/unison-src/transcripts/idempotent/scope-ref.md @@ -16,3 +16,23 @@ test = Scope.run 'let > test ``` + +``` ucm :added-by-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`: + + test : (Nat, Nat, Nat) + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 10 | > test + ⧩ + (1, 2, 5) +``` diff --git a/unison-src/transcripts/idempotent/suffixes.md b/unison-src/transcripts/idempotent/suffixes.md index a14ff458ed..ad8d1d3e69 100644 --- a/unison-src/transcripts/idempotent/suffixes.md +++ b/unison-src/transcripts/idempotent/suffixes.md @@ -21,14 +21,29 @@ This also affects commands like find. Notice lack of qualified names in output: ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo.bar.a : Int + optional.isNone : Optional a -> Boolean scratch/main> find take + + 1. builtin.Bytes.take : Nat -> Bytes -> Bytes + 2. builtin.List.take : Nat -> [a] -> [a] + 3. builtin.Text.take : Nat -> Text -> Text + 4. builtin.io2.MVar.take.impl : MVar a ->{IO} Either Failure a + 5. builtin.io2.MVar.tryTake : MVar a ->{IO} Optional a ``` The `view` and `display` commands also benefit from this: ``` ucm scratch/main> view List.drop + + builtin builtin.List.drop : builtin.Nat -> [a] -> [a] scratch/main> display bar.a + + +99 ``` In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. @@ -37,6 +52,9 @@ Type-based search also benefits from this, we can just say `Nat` rather than `.b ``` ucm scratch/main> find : Nat -> [a] -> [a] + + 1. builtin.List.drop : Nat -> [a] -> [a] + 2. builtin.List.take : Nat -> [a] -> [a] ``` ## Preferring names not in `lib.*.lib.*` @@ -50,26 +68,99 @@ lib.distributed.baz.qux = "direct dependency 2" lib.distributed.lib.baz.qux = "indirect dependency" ``` +``` ucm :added-by-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`: + + cool.abra.cadabra : Text + lib.distributed.abra.cadabra : Text + lib.distributed.baz.qux : Text + lib.distributed.lib.baz.qux : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + cool.abra.cadabra : Text + lib.distributed.abra.cadabra : Text + lib.distributed.baz.qux : Text + lib.distributed.lib.baz.qux : Text ``` ``` unison :error > abra.cadabra ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I couldn't figure out what abra.cadabra refers to here: + + 1 | > abra.cadabra + + The name abra.cadabra is ambiguous. I couldn't narrow it down + by type, as any type would work here. + + I found some terms in scope that have matching names and + types. Maybe you meant one of these: + + cool.abra.cadabra : Text + distributed.abra.cadabra : Text +``` + ``` unison > baz.qux ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > baz.qux + ⧩ + "direct dependency 2" +``` + ``` ucm scratch/main> view abra.cadabra + + cool.abra.cadabra : Text + cool.abra.cadabra = "my project" + + lib.distributed.abra.cadabra : Text + lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> view baz.qux + + lib.distributed.baz.qux : Text + lib.distributed.baz.qux = "direct dependency 2" ``` Note that we can always still view indirect dependencies by using more name segments: ``` ucm scratch/main> view distributed.abra.cadabra + + lib.distributed.abra.cadabra : Text + lib.distributed.abra.cadabra = "direct dependency 1" scratch/main> names distributed.lib.baz.qux + + Term + Hash: #nhup096n2s + Names: lib.distributed.lib.baz.qux ``` diff --git a/unison-src/transcripts/idempotent/sum-type-update-conflicts.md b/unison-src/transcripts/idempotent/sum-type-update-conflicts.md index 075779348a..ec032c8949 100644 --- a/unison-src/transcripts/idempotent/sum-type-update-conflicts.md +++ b/unison-src/transcripts/idempotent/sum-type-update-conflicts.md @@ -12,11 +12,30 @@ First we add a sum-type to the codebase. structural type X = x ``` +``` ucm :added-by-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 X + (also named lib.builtins.Unit) +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type X + (also named lib.builtins.Unit) ``` -Now we update the type, changing the name of the constructors, _but_, we simultaneously +Now we update the type, changing the name of the constructors, *but*, we simultaneously add a new top-level term with the same name as the old constructor. ``` unison @@ -28,9 +47,39 @@ X.x = "some text that's not in the codebase" dependsOnX = Text.size X.x ``` +``` ucm :added-by-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.x : Text + dependsOnX : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + structural type X + (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 scratch/main> update.old + + ⍟ I've added these definitions: + + X.x : Text + dependsOnX : Nat + + ⍟ I've updated these names to your new definition: + + structural type X + (The old definition was also named lib.builtins.Unit.) ``` diff --git a/unison-src/transcripts/idempotent/switch-command.md b/unison-src/transcripts/idempotent/switch-command.md index ed7053ee28..4c8b6e1377 100644 --- a/unison-src/transcripts/idempotent/switch-command.md +++ b/unison-src/transcripts/idempotent/switch-command.md @@ -11,10 +11,37 @@ Setup stuff. someterm = 18 ``` +``` ucm :added-by-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`: + + someterm : Nat +``` + ``` ucm foo/main> add + + ⍟ I've added these definitions: + + someterm : Nat foo/main> branch bar + + Done. I've created the bar branch based off of main. + + Tip: To merge your work back into the main branch, first + `switch /main` then `merge /bar`. foo/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`. ``` Now, the demo. When unambiguous, `switch` switches to either a project or a branch in the current project. A branch in @@ -33,18 +60,34 @@ It's an error to try to switch to something ambiguous. ``` ucm :error foo/main> switch bar + + I'm not sure if you wanted to switch to the branch foo/bar or + the project bar. Could you be more specific? + + 1. /bar (the branch bar in the current project) + 2. bar/ (the project bar, with the branch left unspecified) + + Tip: use `switch 1` or `switch 2` to pick one of these. ``` It's an error to try to switch to something that doesn't exist, of course. ``` ucm :error scratch/main> switch foo/no-such-branch + + foo/no-such-branch does not exist. ``` ``` ucm :error scratch/main> switch no-such-project + + Neither project no-such-project nor branch /no-such-project + exists. ``` ``` ucm :error foo/main> switch no-such-project-or-branch + + Neither project no-such-project-or-branch nor branch + /no-such-project-or-branch exists. ``` diff --git a/unison-src/transcripts/idempotent/tab-completion.md b/unison-src/transcripts/idempotent/tab-completion.md index 67f6995b48..0a6336d99a 100644 --- a/unison-src/transcripts/idempotent/tab-completion.md +++ b/unison-src/transcripts/idempotent/tab-completion.md @@ -6,7 +6,20 @@ Test that tab completion works as expected. ``` ucm scratch/main> debug.tab-complete vi + + view + view.global scratch/main> debug.tab-complete delete. + + delete.branch + delete.namespace + delete.namespace.force + delete.project + delete.term + delete.term.verbose + delete.type + delete.type.verbose + delete.verbose ``` ## Tab complete terms & types @@ -20,6 +33,23 @@ othernamespace.someName = 4 unique type subnamespace.AType = A | B ``` +``` ucm :added-by-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 subnamespace.AType + othernamespace.someName : ##Nat + subnamespace.someName : ##Nat + subnamespace.someOtherName : ##Nat + subnamespace2.thing : ##Nat +``` + ``` ucm :hide scratch/main> add ``` @@ -27,15 +57,34 @@ scratch/main> add ``` ucm -- Should tab complete namespaces since they may contain terms/types 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 scratch/main> debug.tab-complete view subnamespace + + subnamespace. + subnamespace2. -- Should complete things from child namespaces of the current query if it's dot-suffixed scratch/main> debug.tab-complete view subnamespace. + + * subnamespace.AType + subnamespace.AType. + * subnamespace.someName + * subnamespace.someOtherName -- Should complete things from child namespaces of the current query if there are no more completions at this level. scratch/main> debug.tab-complete view subnamespace2 + + subnamespace2. + * subnamespace2.thing -- Should prefix-filter by query suffix scratch/main> debug.tab-complete view subnamespace.some + + * subnamespace.someName + * subnamespace.someOtherName scratch/main> debug.tab-complete view subnamespace.someOther + + * subnamespace.someOtherName ``` ``` unison :hide @@ -44,8 +93,14 @@ absolute.term = "absolute" ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + absolute.term : ##Text -- Should tab complete absolute names scratch/main> debug.tab-complete view .absolute.te + + * .absolute.term ``` ## Tab complete namespaces @@ -53,11 +108,29 @@ scratch/main> debug.tab-complete view .absolute.te ``` ucm -- Should tab complete namespaces scratch/main> debug.tab-complete find-in sub + + subnamespace + subnamespace2 scratch/main> debug.tab-complete find-in subnamespace + + subnamespace + subnamespace2 scratch/main> debug.tab-complete find-in subnamespace. + + subnamespace.AType scratch/main> debug.tab-complete io.test sub + + subnamespace. + subnamespace2. scratch/main> debug.tab-complete io.test subnamespace + + subnamespace. + subnamespace2. scratch/main> debug.tab-complete io.test subnamespace. + + subnamespace.AType. + * subnamespace.someName + * subnamespace.someOtherName ``` Tab Complete Delete Subcommands @@ -68,18 +141,51 @@ add : a -> a add b = b ``` +``` ucm :added-by-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 + add : a -> a +``` + ``` ucm scratch/main> update.old + + ⍟ I've added these definitions: + + type Foo + add : a -> a scratch/main> debug.tab-complete delete.type Foo + + * Foo + Foo. scratch/main> debug.tab-complete delete.term add + + * add ``` ## Tab complete projects and branches ``` ucm 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`. myproject/main> debug.tab-complete branch.delete /mybr + + /mybranch myproject/main> debug.tab-complete project.rename my + + myproject ``` Commands which complete namespaces OR branches should list both @@ -88,8 +194,26 @@ Commands which complete namespaces OR branches should list both mybranchsubnamespace.term = 1 ``` +``` ucm :added-by-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`: + + mybranchsubnamespace.term : ##Nat +``` ``` ucm myproject/main> add + + ⍟ I've added these definitions: + + mybranchsubnamespace.term : ##Nat myproject/main> debug.tab-complete merge mybr + + /mybranch ``` diff --git a/unison-src/transcripts/idempotent/tdnr.md b/unison-src/transcripts/idempotent/tdnr.md index 991531f32f..cbb138389b 100644 --- a/unison-src/transcripts/idempotent/tdnr.md +++ b/unison-src/transcripts/idempotent/tdnr.md @@ -10,6 +10,21 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + bad.foo : Text + good.foo : Nat + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -24,8 +39,25 @@ scratch/main> builtins.merge lib.builtin bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text ``` ``` unison @@ -33,6 +65,20 @@ good.foo = 17 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + good.foo : Nat + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -47,8 +93,25 @@ scratch/main> builtins.merge lib.builtin bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text ``` ``` unison @@ -57,6 +120,25 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + good.foo : Nat + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + bad.foo : Text +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -71,8 +153,25 @@ scratch/main> builtins.merge lib.builtin good.foo = 17 ``` +``` ucm :added-by-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`: + + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat ``` ``` unison @@ -80,6 +179,20 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + bad.foo : Text + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -95,14 +208,46 @@ good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + good.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -118,8 +263,27 @@ good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + good.foo : Nat ``` ``` unison @@ -127,6 +291,24 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + bad.foo : Text +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -141,8 +323,25 @@ scratch/main> builtins.merge lib.builtin good.foo = 17 ``` +``` ucm :added-by-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`: + + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat ``` ``` unison @@ -151,6 +350,25 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + bad.foo : Text + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + good.foo : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -166,8 +384,27 @@ good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + good.foo : Nat ``` ``` unison @@ -175,6 +412,24 @@ good.foo = 18 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + good.foo : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -190,8 +445,27 @@ good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + good.foo : Nat ``` ``` unison @@ -200,11 +474,30 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + bad.foo : Text + good.foo : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` -=== start local over direct dep +\=== start local over direct dep TDNR selects local term (in file) that typechecks over direct dependency that doesn't. @@ -216,8 +509,25 @@ scratch/main> builtins.merge lib.builtin lib.bad.foo = "bar" ``` +``` ucm :added-by-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`: + + lib.bad.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.bad.foo : Text ``` ``` unison @@ -225,6 +535,20 @@ good.foo = 17 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + good.foo : Nat + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -240,14 +564,46 @@ good.foo = 17 lib.bad.foo = "bar" ``` +``` ucm :added-by-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`: + + good.foo : Nat + lib.bad.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat + lib.bad.foo : Text ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -263,8 +619,27 @@ good.foo = 17 lib.bad.foo = "bar" ``` +``` ucm :added-by-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`: + + good.foo : Nat + lib.bad.foo : Text +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat + lib.bad.foo : Text ``` ``` unison @@ -272,6 +647,24 @@ good.foo = 18 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + good.foo : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -286,8 +679,25 @@ scratch/main> builtins.merge lib.builtin lib.dep.lib.dep.foo = 217 ``` +``` ucm :added-by-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`: + + lib.dep.lib.dep.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.dep.lib.dep.foo : Nat ``` ``` unison @@ -295,6 +705,20 @@ good.foo = 17 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + good.foo : Nat + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -310,14 +734,46 @@ good.foo = 17 lib.dep.lib.dep.foo = 217 ``` +``` ucm :added-by-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`: + + good.foo : Nat + lib.dep.lib.dep.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat + lib.dep.lib.dep.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -333,8 +789,27 @@ good.foo = 17 lib.dep.lib.dep.foo = 217 ``` +``` ucm :added-by-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`: + + good.foo : Nat + lib.dep.lib.dep.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + good.foo : Nat + lib.dep.lib.dep.foo : Nat ``` ``` unison @@ -342,6 +817,24 @@ good.foo = 18 thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + good.foo : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -356,8 +849,25 @@ scratch/main> builtins.merge lib.builtin lib.good.foo = 17 ``` +``` ucm :added-by-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`: + + lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.good.foo : Nat ``` ``` unison @@ -365,6 +875,20 @@ bad.foo = "bar" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + bad.foo : Text + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -380,14 +904,46 @@ lib.good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + lib.good.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -403,8 +959,27 @@ lib.good.foo = 17 bad.foo = "bar" ``` +``` ucm :added-by-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`: + + bad.foo : Text + lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bad.foo : Text + lib.good.foo : Nat ``` ``` unison @@ -412,6 +987,24 @@ bad.foo = "baz" thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat + + ⍟ These names already exist. You can `update` them to your + new definition: + + bad.foo : Text +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -427,14 +1020,46 @@ lib.good.foo = 17 lib.bad.foo = "bar" ``` +``` ucm :added-by-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`: + + lib.bad.foo : Text + lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.bad.foo : Text + lib.good.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -450,14 +1075,46 @@ lib.good.foo = 17 lib.dep.lib.dep.foo = 217 ``` +``` ucm :added-by-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`: + + lib.dep.lib.dep.foo : Nat + lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.dep.lib.dep.foo : Nat + lib.good.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` @@ -473,14 +1130,46 @@ lib.dep.lib.good.foo = 17 lib.dep.lib.bad.foo = "bar" ``` +``` ucm :added-by-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`: + + lib.dep.lib.bad.foo : Text + lib.dep.lib.good.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.dep.lib.bad.foo : Text + lib.dep.lib.good.foo : Nat ``` ``` unison thing = foo Nat.+ foo ``` +``` ucm :added-by-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`: + + thing : Nat +``` + ``` ucm :hide scratch/main> delete.project scratch ``` diff --git a/unison-src/transcripts/idempotent/test-command.md b/unison-src/transcripts/idempotent/test-command.md index adcb48c4b2..202c8b4525 100644 --- a/unison-src/transcripts/idempotent/test-command.md +++ b/unison-src/transcripts/idempotent/test-command.md @@ -14,18 +14,56 @@ foo.test2 : [Result] foo.test2 = [Ok "test2"] ``` +``` ucm :added-by-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.test2 : [Result] + test1 : [Result] +``` + ``` ucm :hide scratch/main> add ``` ``` ucm scratch/main> test + + ✅ + + + + + + New test results: + + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` Tests should be cached if unchanged. ``` ucm scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` `test` won't descend into the `lib` namespace, but `test.all` will. @@ -35,23 +73,81 @@ lib.dep.testInLib : [Result] lib.dep.testInLib = [Ok "testInLib"] ``` +``` ucm :added-by-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`: + + lib.dep.testInLib : [Result] +``` + ``` ucm :hide scratch/main> add ``` ``` ucm scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 + + ✅ 2 test(s) passing + + Tip: Use view 1 to view the source of a test. scratch/main> test.all + + + Cached test results (`help testcache` to learn more) + + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 + + ✅ 2 test(s) passing + + ✅ + + + + New test results: + + 1. lib.dep.testInLib ◉ testInLib + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` `test` WILL run tests within `lib` if specified explicitly. ``` ucm scratch/main> test lib.dep + + Cached test results (`help testcache` to learn more) + + 1. lib.dep.testInLib ◉ testInLib + + ✅ 1 test(s) passing + + Tip: Use view 1 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. ``` ucm scratch/main> test foo + + Cached test results (`help testcache` to learn more) + + 1. foo.test2 ◉ test2 + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/text-literals.md b/unison-src/transcripts/idempotent/text-literals.md index ee0258df63..1ecc7b517a 100644 --- a/unison-src/transcripts/idempotent/text-literals.md +++ b/unison-src/transcripts/idempotent/text-literals.md @@ -35,7 +35,93 @@ lit2 = """" > Some lit2 ``` +``` ucm :added-by-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`: + + lit1 : Text + lit2 : Text + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 15 | > lit1 + ⧩ + """ + This is a raw text literal. + It can start with 3 or more ", + and is terminated by the same number of quotes. + Nothing is escaped. \n + + The initial newline, if it exists, is ignored. + The last line, if it's just whitespace up to the closing quotes, + is ignored. + + Use an extra blank line if you'd like a trailing newline. Like so: + + """ + + 16 | > Some lit1 + ⧩ + Some + "This is a raw text literal.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThe initial newline, if it exists, is ignored.\nThe last line, if it's just whitespace up to the closing quotes,\nis ignored.\n\nUse an extra blank line if you'd like a trailing newline. Like so:\n" + + 27 | > lit2 + ⧩ + """" + This is a raw text literal, indented. + It can start with 3 or more ", + and is terminated by the same number of quotes. + Nothing is escaped. \n + + This doesn't terminate the literal - """ + """" + + 28 | > Some lit2 + ⧩ + Some + "This is a raw text literal, indented.\nIt can start with 3 or more \",\nand is terminated by the same number of quotes.\nNothing is escaped. \\n\n\nThis doesn't terminate the literal - \"\"\"" +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lit1 : Text + lit2 : Text scratch/main> view lit1 lit2 + + lit1 : Text + lit1 = + """ + This is a raw text literal. + It can start with 3 or more ", + and is terminated by the same number of quotes. + Nothing is escaped. \n + + The initial newline, if it exists, is ignored. + The last line, if it's just whitespace up to the closing quotes, + is ignored. + + Use an extra blank line if you'd like a trailing newline. Like so: + + """ + + lit2 : Text + lit2 = + """" + This is a raw text literal, indented. + It can start with 3 or more ", + and is terminated by the same number of quotes. + Nothing is escaped. \n + + This doesn't terminate the literal - """ + """" ``` diff --git a/unison-src/transcripts/idempotent/textfind.md b/unison-src/transcripts/idempotent/textfind.md index f7e88edd83..41c0d8ac54 100644 --- a/unison-src/transcripts/idempotent/textfind.md +++ b/unison-src/transcripts/idempotent/textfind.md @@ -8,10 +8,28 @@ The `text.find` (or `grep`) command can be used to search for text or numeric li ``` ucm scratch/main> help grep + + text.find (or grep) + `text.find token1 "99" token2` finds terms with literals (text + or numeric) containing `token1`, `99`, and `token2`. + + Numeric literals must be quoted (ex: "42") but single words + need not be quoted. + + Use `text.find.all` to include search of `lib`. ``` ``` ucm scratch/main> help text.find.all + + text.find.all (or grep.all) + `text.find.all token1 "99" token2` finds terms with literals + (text or numeric) containing `token1`, `99`, and `token2`. + + Numeric literals must be quoted (ex: "42") but single words + need not be quoted. + + Use `text.find` to exclude `lib` from search. ``` Here's an example: @@ -33,37 +51,154 @@ lib.foo = [Any 46, Any "hi", Any "zoink"] lib.bar = 3 ``` +``` ucm :added-by-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`: + + bar : Nat + baz : [Text] + foo : Nat + lib.bar : Nat + lib.foo : [Any] + qux : Nat +``` + ``` ucm :hide scratch/main> add ``` ``` ucm scratch/main> grep hi + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. bar + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + + bar : Nat + bar = match "well hi there" with + "ooga" -> 99 + "booga" -> 23 + _ -> 0 scratch/main> grep "hi" + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. bar + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> text.find.all hi + + 🔎 + + These definitions from the current namespace have matches: + + 1. bar + 2. lib.foo + + Tip: Try `edit 1` or `edit 1-2` to bring these into your + scratch file. scratch/main> view 1-5 + + bar : Nat + bar = match "well hi there" with + "ooga" -> 99 + "booga" -> 23 + _ -> 0 + + lib.foo : [Any] + lib.foo = [Any 46, Any "hi", Any "zoink"] scratch/main> grep oog + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. bar + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + + bar : Nat + bar = match "well hi there" with + "ooga" -> 99 + "booga" -> 23 + _ -> 0 ``` ``` ucm scratch/main> grep quaffle + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. baz + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 + + baz : [Text] + baz = ["an", "quaffle", "tres"] scratch/main> text.find "interesting const" + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. foo + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1-5 + + foo : Nat + foo = + _ = "an interesting constant" + 1 scratch/main> text.find "99" "23" + + 🔎 + + These definitions from the current namespace (excluding `lib`) have matches: + + 1. bar + + Tip: Try `edit 1` to bring this into your scratch file. scratch/main> view 1 + + bar : Nat + bar = match "well hi there" with + "ooga" -> 99 + "booga" -> 23 + _ -> 0 ``` Now some failed searches: ``` ucm :error scratch/main> grep lsdkfjlskdjfsd + + 😶 I couldn't find any matches. + + Tip: `text.find.all` will search `lib` as well. ``` Notice it gives the tip about `text.find.all`. But not here: ``` ucm :error scratch/main> grep.all lsdkfjlskdjfsd + + 😶 I couldn't find any matches. ``` diff --git a/unison-src/transcripts/idempotent/todo-bug-builtins.md b/unison-src/transcripts/idempotent/todo-bug-builtins.md index 762cc509f8..b1db33c768 100644 --- a/unison-src/transcripts/idempotent/todo-bug-builtins.md +++ b/unison-src/transcripts/idempotent/todo-bug-builtins.md @@ -5,23 +5,101 @@ 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. + ``` unison :error > todo "implement me later" ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 💔💥 + + I've encountered a call to builtin.todo with the following + value: + + "implement me later" + + Stack trace: + todo + #qe5e1lcfn8 +``` + ``` unison :error > bug "there's a bug in my code" ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 💔💥 + + I've encountered a call to builtin.bug with the following + value: + + "there's a bug in my code" + + Stack trace: + bug + #m67hcdcoda +``` + ## Todo + `todo` is useful if you want to come back to a piece of code later but you want your project to compile. + ``` unison complicatedMathStuff x = todo "Come back and to something with x here" ``` +``` ucm :added-by-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`: + + complicatedMathStuff : x -> r +``` + ## Bug + `bug` is used to indicate that a particular branch is not expected to execute. + ``` unison test = match true with true -> "Yay" false -> bug "Wow, that's unexpected" ``` + +``` ucm :added-by-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`: + + test : Text +``` diff --git a/unison-src/transcripts/idempotent/todo.md b/unison-src/transcripts/idempotent/todo.md index 074e096f68..a985d1177b 100644 --- a/unison-src/transcripts/idempotent/todo.md +++ b/unison-src/transcripts/idempotent/todo.md @@ -4,6 +4,8 @@ When there's nothing to do, `todo` says this: ``` ucm scratch/main> todo + + You have no pending todo items. Good work! ✅ ``` # Dependents of `todo` @@ -22,9 +24,32 @@ bar : Nat bar = foo + foo ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat scratch/main> todo + + These terms call `todo`: + + 1. foo ``` ``` ucm :hide @@ -45,10 +70,43 @@ foo.bar = 15 baz = foo.bar + foo.bar ``` +``` ucm :added-by-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`: + + baz : Nat + foo.bar : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + baz : Nat + foo.bar : Nat scratch/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 scratch/main> todo + + These terms do not have any names in the current namespace: + + 1. #1jujb8oelv ``` ``` ucm :hide @@ -68,10 +126,41 @@ foo = 16 bar = 17 ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat scratch/main> debug.alias.term.force foo bar + + Done. scratch/main> todo + + ❓ + + The term bar has conflicting definitions: + + 1. bar#14ibahkll6 + 2. bar#cq22mm4sca + + Tip: Use `move.term` or `delete.term` to resolve the + conflicts. ``` ``` ucm :hide @@ -90,9 +179,30 @@ scratch/main> builtins.mergeio lib.builtins lib.foo = 16 ``` +``` ucm :added-by-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`: + + lib.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + lib.foo : Nat scratch/main> todo + + There's a type or term at the top level of the `lib` + namespace, where I only expect to find subnamespaces + representing library dependencies. Please move or remove it. ``` ``` ucm :hide @@ -111,10 +221,36 @@ scratch/main> builtins.mergeio lib.builtins type Foo = One ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> alias.term Foo.One Foo.Two + + Done. scratch/main> todo + + The type Foo has a constructor with multiple names. + + 1. Foo.One + 2. Foo.Two + + Please delete all but one name for each constructor. ``` ``` ucm :hide @@ -133,10 +269,37 @@ scratch/main> builtins.mergeio lib.builtins type Foo = Bar ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> delete.term Foo.Bar + + Done. scratch/main> todo + + These types have some constructors with missing names. + + 1. Foo + + You can use `view 1` and + `alias.term .` to give names + to each unnamed constructor. ``` ``` ucm :hide @@ -156,9 +319,34 @@ structural type Foo a = One a | Two a a structural type Foo.inner.Bar a = Uno a | Dos a a ``` +``` ucm :added-by-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 Foo a + structural type Foo.inner.Bar a +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type Foo a + structural type Foo.inner.Bar a scratch/main> todo + + These types are aliases, but one is nested under the other. + Please separate them or delete one copy. + + 1. Foo + 2. Foo.inner.Bar ``` ``` ucm :hide @@ -177,10 +365,37 @@ scratch/main> builtins.mergeio lib.builtins type Foo = Bar ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> alias.term Foo.Bar Baz + + Done. scratch/main> todo + + These constructors are not nested beneath their corresponding + type names: + + 1. Baz + + For each one, please either use `move` to move if, or if it's + an extra copy, you can simply `delete` it. ``` ``` ucm :hide diff --git a/unison-src/transcripts/idempotent/top-level-exceptions.md b/unison-src/transcripts/idempotent/top-level-exceptions.md index f46bfff89d..9e7b49520d 100644 --- a/unison-src/transcripts/idempotent/top-level-exceptions.md +++ b/unison-src/transcripts/idempotent/top-level-exceptions.md @@ -8,6 +8,12 @@ FYI, here are the `Exception` and `Failure` types: ``` ucm scratch/main> view Exception Failure + + structural ability builtin.Exception where + raise : Failure ->{builtin.Exception} x + + type builtin.io2.Failure + = Failure Type Text Any ``` Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: @@ -22,10 +28,39 @@ mytest : '{IO, Exception} [Test.Result] mytest _ = [Ok "Great"] ``` +``` ucm :added-by-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`: + + main : '{IO, Exception} () + mytest : '{IO, Exception} [Result] +``` + ``` ucm scratch/main> run main + + () scratch/main> add + + ⍟ I've added these definitions: + + main : '{IO, Exception} () + mytest : '{IO, Exception} [Result] scratch/main> io.test mytest + + New test results: + + 1. mytest ◉ Great + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` Now a test to show the handling of uncaught exceptions: @@ -40,6 +75,30 @@ error msg a = unique type RuntimeError = ``` +``` ucm :added-by-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 RuntimeError + error : Text -> a ->{Exception} x + main2 : '{Exception} r +``` + ``` ucm :error scratch/main> run main2 + + 💔💥 + + The program halted with an unhandled exception: + + Failure (typeLink RuntimeError) "oh noes!" (Any ()) + + Stack trace: + ##raise ``` diff --git a/unison-src/transcripts/idempotent/transcript-parser-commands.md b/unison-src/transcripts/idempotent/transcript-parser-commands.md index af8a5b7976..147db1caf7 100644 --- a/unison-src/transcripts/idempotent/transcript-parser-commands.md +++ b/unison-src/transcripts/idempotent/transcript-parser-commands.md @@ -10,32 +10,59 @@ The transcript parser is meant to parse `ucm` and `unison` blocks. x = 1 ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + x : Nat ``` -``` unison :hide:error:scratch.u +``` unison :hide:error :scratch.u z ``` ``` ucm :error scratch/main> delete foo + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + foo ``` ``` ucm :error scratch/main> delete lineToken.call + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + lineToken.call ``` However handling of blocks of other languages should be supported. -```python +``` python some python code ``` -```c_cpp +``` c_cpp some C++ code ``` -```c9search +``` c9search some cloud9 code ``` diff --git a/unison-src/transcripts/idempotent/type-deps.md b/unison-src/transcripts/idempotent/type-deps.md index d66c4baf0d..f30039d736 100644 --- a/unison-src/transcripts/idempotent/type-deps.md +++ b/unison-src/transcripts/idempotent/type-deps.md @@ -6,7 +6,6 @@ https://github.com/unisonweb/unison/pull/2821 scratch/main> builtins.merge ``` - Define a type. ``` unison :hide @@ -24,9 +23,42 @@ structural type Z = Z Y structural type Y = Y Nat ``` +``` ucm :added-by-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 Z + + ⍟ These names already exist. You can `update` them to your + new definition: + + structural type Y + (The old definition is also named builtin.Unit.) +``` + Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. + ``` ucm :error scratch/main> add + + x These definitions failed: + + Reason + needs update structural type Y + blocked structural type Z + + Tip: Use `help filestatus` to learn more. -- This shouldn't exist, because it should've been blocked. scratch/main> view Z + + ⚠️ + + The following names were not found in the codebase. Check your spelling. + Z ``` diff --git a/unison-src/transcripts/idempotent/type-modifier-are-optional.md b/unison-src/transcripts/idempotent/type-modifier-are-optional.md index ea012f3a0a..4d2459a147 100644 --- a/unison-src/transcripts/idempotent/type-modifier-are-optional.md +++ b/unison-src/transcripts/idempotent/type-modifier-are-optional.md @@ -15,3 +15,22 @@ ability MyAbility where const : a unique ability MyAbilityU where const : a structural ability MyAbilityS where const : a ``` + +``` ucm :added-by-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 Abc + type Def + structural type Ghi + (also named builtin.Unit) + ability MyAbility + structural ability MyAbilityS + ability MyAbilityU +``` diff --git a/unison-src/transcripts/idempotent/undo.md b/unison-src/transcripts/idempotent/undo.md index 4c283f2e61..42d5854e74 100644 --- a/unison-src/transcripts/idempotent/undo.md +++ b/unison-src/transcripts/idempotent/undo.md @@ -8,17 +8,75 @@ x = 1 ``` ucm scratch/main> builtins.merge lib.builtins + + Done. scratch/main> add + + ⍟ I've added these definitions: + + x : Nat scratch/main> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/main> alias.term x y + + Done. scratch/main> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) + 3. y (Nat) scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #nmem6r6no1 + + + Adds / updates: + + y + + = Copies: + + Original name New name(s) + x y + + ⊙ 2. #3rqf1hbev7 + + + Adds / updates: + + x + + □ 3. #ms9lggs2rg (start of history) scratch/main> undo + + Here are the changes I undid + + Name changes: + + Original Changes + 1. x 2. y (added) scratch/main> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/main> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #3rqf1hbev7 + + + Adds / updates: + + x + + □ 2. #ms9lggs2rg (start of history) ``` ---- +----- It should not be affected by changes on other branches. @@ -28,24 +86,94 @@ x = 1 ``` ucm scratch/branch1> builtins.merge lib.builtins + + Done. scratch/branch1> add + + ⍟ I've added these definitions: + + x : Nat scratch/branch1> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/branch1> alias.term x y + + Done. scratch/branch1> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) + 3. y (Nat) scratch/branch1> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #nmem6r6no1 + + + Adds / updates: + + y + + = Copies: + + Original name New name(s) + x y + + ⊙ 2. #3rqf1hbev7 + + + Adds / updates: + + x + + □ 3. #ms9lggs2rg (start of history) -- Make some changes on an unrelated branch scratch/branch2> builtins.merge lib.builtins + + Done. scratch/branch2> delete.namespace lib + + Done. scratch/branch1> undo + + Here are the changes I undid + + Name changes: + + Original Changes + 1. x 2. y (added) scratch/branch1> ls + + 1. lib/ (469 terms, 74 types) + 2. x (Nat) scratch/branch1> history + + Note: The most recent namespace hash is immediately below this + message. + + ⊙ 1. #3rqf1hbev7 + + + Adds / updates: + + x + + □ 2. #ms9lggs2rg (start of history) ``` ---- +----- Undo should be a no-op on a newly created branch ``` ucm :error scratch/main> branch.create-empty new + + Done. I've created an empty branch scratch/new. + + Tip: Use `merge /somebranch` to initialize this branch. scratch/new> undo + + ⚠️ + + Nothing more to undo. ``` diff --git a/unison-src/transcripts/idempotent/unique-type-churn.md b/unison-src/transcripts/idempotent/unique-type-churn.md index 3a1f7fc3b2..c1014c5546 100644 --- a/unison-src/transcripts/idempotent/unique-type-churn.md +++ b/unison-src/transcripts/idempotent/unique-type-churn.md @@ -8,8 +8,29 @@ unique type B = B C unique type C = C B ``` +``` ucm :added-by-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 A + type B + type C +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type A + type B + type C ``` ``` unison @@ -19,28 +40,98 @@ unique type B = B C unique type C = C B ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. +``` + If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ``` ucm scratch/main> names A + + Type + Hash: #uj8oalgadr + Names: A + + Term + Hash: #uj8oalgadr#0 + Names: A.A ``` ``` unison unique type A = A () ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type A +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> names A + + Type + Hash: #ufo5tuc7ho + Names: A + + Term + Hash: #ufo5tuc7ho#0 + Names: A.A ``` ``` unison unique type A = A ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type A +``` + Note that `A` is back to its original hash. ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> names A + + Type + Hash: #uj8oalgadr + Names: A + + Term + Hash: #uj8oalgadr#0 + Names: A.A ``` diff --git a/unison-src/transcripts/idempotent/unitnamespace.md b/unison-src/transcripts/idempotent/unitnamespace.md index 13b2202a4e..287736fb2a 100644 --- a/unison-src/transcripts/idempotent/unitnamespace.md +++ b/unison-src/transcripts/idempotent/unitnamespace.md @@ -2,9 +2,32 @@ `()`.foo = "bar" ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + `()`.foo : ##Text scratch/main> find + + 1. `()`.foo : ##Text scratch/main> find-in `()` + + 1. foo : ##Text scratch/main> delete.namespace `()` + + Done. ``` diff --git a/unison-src/transcripts/idempotent/universal-cmp.md b/unison-src/transcripts/idempotent/universal-cmp.md index 8a72211e7b..23c1c618bc 100644 --- a/unison-src/transcripts/idempotent/universal-cmp.md +++ b/unison-src/transcripts/idempotent/universal-cmp.md @@ -14,9 +14,30 @@ threadEyeDeez _ = (t1 == t2, t1 < t2) ``` +``` ucm :added-by-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 A + threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type A + threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) scratch/main> run threadEyeDeez + + (false, true) ``` ``` unison @@ -25,3 +46,31 @@ scratch/main> run threadEyeDeez > typeLink Text == typeLink A > termLink threadEyeDeez == termLink threadEyeDeez ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > typeLink A == typeLink A + ⧩ + true + + 2 | > typeLink Text == typeLink Text + ⧩ + true + + 3 | > typeLink Text == typeLink A + ⧩ + false + + 4 | > termLink threadEyeDeez == termLink threadEyeDeez + ⧩ + true +``` diff --git a/unison-src/transcripts/idempotent/unsafe-coerce.md b/unison-src/transcripts/idempotent/unsafe-coerce.md index b85e0d773f..db2aaa7460 100644 --- a/unison-src/transcripts/idempotent/unsafe-coerce.md +++ b/unison-src/transcripts/idempotent/unsafe-coerce.md @@ -15,8 +15,39 @@ main _ = if n == 5 then [Ok ""] else [Fail ""] ``` +``` ucm :added-by-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`: + + f : 'Nat + fc : '{IO, Exception} Nat + main : '{IO, Exception} [Result] +``` + ``` ucm scratch/main> find unsafe.coerceAbilities + + 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b scratch/main> add + + ⍟ I've added these definitions: + + f : 'Nat + fc : '{IO, Exception} Nat + main : '{IO, Exception} [Result] scratch/main> io.test main + + New test results: + + 1. main ◉ + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` diff --git a/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md b/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md index aa21dbaa4f..31032b48c7 100644 --- a/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md +++ b/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md @@ -11,15 +11,58 @@ foo = 100 lib.foo = 100 ``` +``` ucm :added-by-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 : Nat + lib.foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : Nat + lib.foo : Nat ``` ``` unison foo = 200 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Nat + (The old definition is also named lib.foo.) +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> names foo + + Term + Hash: #9ntnotdp87 + Names: foo ``` diff --git a/unison-src/transcripts/idempotent/update-on-conflict.md b/unison-src/transcripts/idempotent/update-on-conflict.md index 351a7d3750..078f2cfdda 100644 --- a/unison-src/transcripts/idempotent/update-on-conflict.md +++ b/unison-src/transcripts/idempotent/update-on-conflict.md @@ -11,16 +11,57 @@ x = 1 temp = 2 ``` +``` ucm :added-by-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`: + + temp : Nat + x : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + temp : Nat + x : Nat scratch/main> debug.alias.term.force temp x + + Done. scratch/main> delete.term temp + + Done. ``` ``` unison x = 3 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + x : Nat +``` + ``` ucm :error scratch/main> update + + This branch has more than one term with the name `x`. Please + delete or rename all but one of them, then try the update + again. ``` diff --git a/unison-src/transcripts/idempotent/update-suffixifies-properly.md b/unison-src/transcripts/idempotent/update-suffixifies-properly.md index f784978387..8edef4df26 100644 --- a/unison-src/transcripts/idempotent/update-suffixifies-properly.md +++ b/unison-src/transcripts/idempotent/update-suffixifies-properly.md @@ -11,14 +11,87 @@ d.y.y.y.y = foo + 10 bar = a.x.x.x.x + c.y.y.y.y ``` +``` ucm :added-by-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.x.x.x.x : Nat + b.x.x.x.x : Nat + bar : Nat + c.y.y.y.y : Nat + d.y.y.y.y : Nat + foo : Nat +``` + ``` ucm myproject/main> add + + ⍟ I've added these definitions: + + a.x.x.x.x : Nat + b.x.x.x.x : Nat + bar : Nat + c.y.y.y.y : Nat + d.y.y.y.y : Nat + foo : Nat ``` ``` unison foo = +30 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Int +``` + ``` ucm :error myproject/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +foo = +30 + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +bar : Nat +bar = + use Nat + + x + c.y.y.y.y + +c.y.y.y.y : Nat +c.y.y.y.y = + use Nat + + foo + 10 + +d.y.y.y.y : Nat +d.y.y.y.y = + use Nat + + foo + 10 + ``` diff --git a/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md b/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md index 9debb3ee2c..e8b3d4ef9f 100644 --- a/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md +++ b/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,27 @@ bar : Nat bar = 5 ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat ``` ``` unison @@ -22,7 +43,35 @@ bar : Nat bar = 7 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + bar : Nat + (The old definition is also named foo.) + foo : Nat + (The old definition is also named bar.) +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view foo bar + + bar : Nat + bar = 7 + + foo : Nat + foo = 6 ``` diff --git a/unison-src/transcripts/idempotent/update-term-to-different-type.md b/unison-src/transcripts/idempotent/update-term-to-different-type.md index abebf99d87..ee2d0d88af 100644 --- a/unison-src/transcripts/idempotent/update-term-to-different-type.md +++ b/unison-src/transcripts/idempotent/update-term-to-different-type.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -7,8 +9,25 @@ foo : Nat foo = 5 ``` +``` ucm :added-by-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 : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : Nat ``` ``` unison @@ -16,7 +35,29 @@ foo : Int foo = +5 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Int +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view foo + + foo : Int + foo = +5 ``` diff --git a/unison-src/transcripts/idempotent/update-term-with-alias.md b/unison-src/transcripts/idempotent/update-term-with-alias.md index 45ba7681b7..a13bfd8150 100644 --- a/unison-src/transcripts/idempotent/update-term-with-alias.md +++ b/unison-src/transcripts/idempotent/update-term-with-alias.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,27 @@ bar : Nat bar = 5 ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat ``` ``` unison @@ -19,7 +40,33 @@ foo : Nat foo = 6 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Nat + (The old definition is also named bar.) +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view foo bar + + bar : Nat + bar = 5 + + foo : Nat + foo = 6 ``` diff --git a/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md b/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md index 7286843482..e590bc1b04 100644 --- a/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md +++ b/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,27 @@ bar : Nat bar = foo + 10 ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat ``` ``` unison @@ -19,6 +40,43 @@ foo : Int foo = +5 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Int +``` + ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +foo : Int +foo = +5 + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +bar : Nat +bar = + use Nat + + foo + 10 + ``` diff --git a/unison-src/transcripts/idempotent/update-term-with-dependent.md b/unison-src/transcripts/idempotent/update-term-with-dependent.md index 233f1b2b55..aba7ad6b70 100644 --- a/unison-src/transcripts/idempotent/update-term-with-dependent.md +++ b/unison-src/transcripts/idempotent/update-term-with-dependent.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -10,8 +12,27 @@ bar : Nat bar = foo + 10 ``` +``` ucm :added-by-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`: + + bar : Nat + foo : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + bar : Nat + foo : Nat ``` ``` unison @@ -19,7 +40,35 @@ foo : Nat foo = 6 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view bar + + bar : Nat + bar = + use Nat + + foo + 10 ``` diff --git a/unison-src/transcripts/idempotent/update-term.md b/unison-src/transcripts/idempotent/update-term.md index 895d595e79..753eab2cf0 100644 --- a/unison-src/transcripts/idempotent/update-term.md +++ b/unison-src/transcripts/idempotent/update-term.md @@ -1,5 +1,7 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison @@ -7,8 +9,25 @@ foo : Nat foo = 5 ``` +``` ucm :added-by-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 : Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : Nat ``` ``` unison @@ -16,7 +35,29 @@ foo : Nat foo = 6 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Nat +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view foo + + foo : Nat + foo = 6 ``` diff --git a/unison-src/transcripts/idempotent/update-test-to-non-test.md b/unison-src/transcripts/idempotent/update-test-to-non-test.md index 2ab698bf6d..21965f8a19 100644 --- a/unison-src/transcripts/idempotent/update-test-to-non-test.md +++ b/unison-src/transcripts/idempotent/update-test-to-non-test.md @@ -1,25 +1,75 @@ ``` ucm scratch/main> builtins.merge + + Done. ``` ``` unison test> foo = [] ``` +``` ucm :added-by-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 : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | test> foo = [] + +``` + After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : [Result] scratch/main> view foo + + foo : [Result] + foo = [] ``` ``` unison foo = 1 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : Nat +``` + After updating `foo` to not be a test, we expect `view` to not render it like a test. ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view foo + + foo : Nat + foo = 1 ``` diff --git a/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md index d45a8a92dd..0c3cac7aaa 100644 --- a/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md +++ b/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md @@ -14,6 +14,11 @@ test> mynamespace.foo.test = ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + foo : Nat -> Nat + mynamespace.foo.test : [Result] ``` if we change the type of the dependency, the test should show in the scratch file as a test watch. @@ -22,6 +27,41 @@ if we change the type of the dependency, the test should show in the scratch fil foo n = "hello, world!" ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + foo : n -> Text +``` + ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +foo n = "hello, world!" + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +test> mynamespace.foo.test = + n = 2 + if foo n == 2 then [Ok "passed"] else [Fail "wat"] + ``` diff --git a/unison-src/transcripts/idempotent/update-type-add-constructor.md b/unison-src/transcripts/idempotent/update-type-add-constructor.md index b5e68ff704..6ca215cd51 100644 --- a/unison-src/transcripts/idempotent/update-type-add-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-add-constructor.md @@ -7,8 +7,25 @@ unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo ``` ``` unison @@ -17,8 +34,39 @@ unique type Foo | Baz Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = Bar Nat | Baz Nat Nat scratch/main> find.verbose + + 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog + type Foo + + 2. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#0 + Foo.Bar : Nat -> Foo + + 3. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#1 + Foo.Baz : Nat -> Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-add-field.md b/unison-src/transcripts/idempotent/update-type-add-field.md index 023c76d7ae..6cfe366468 100644 --- a/unison-src/transcripts/idempotent/update-type-add-field.md +++ b/unison-src/transcripts/idempotent/update-type-add-field.md @@ -6,16 +6,61 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = Bar Nat Nat scratch/main> find.verbose + + 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g + type Foo + + 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 + Foo.Bar : Nat -> Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-add-new-record.md b/unison-src/transcripts/idempotent/update-type-add-new-record.md index b204de5c1e..4527bc19bb 100644 --- a/unison-src/transcripts/idempotent/update-type-add-new-record.md +++ b/unison-src/transcripts/idempotent/update-type-add-new-record.md @@ -6,7 +6,30 @@ scratch/main> builtins.merge lib.builtins unique type Foo = { bar : Nat } ``` +``` ucm :added-by-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 + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = { bar : Nat } ``` diff --git a/unison-src/transcripts/idempotent/update-type-add-record-field.md b/unison-src/transcripts/idempotent/update-type-add-record-field.md index 595575b125..bef52e1367 100644 --- a/unison-src/transcripts/idempotent/update-type-add-record-field.md +++ b/unison-src/transcripts/idempotent/update-type-add-record-field.md @@ -6,16 +6,94 @@ scratch/main> builtins.merge lib.builtin unique type Foo = { bar : Nat } ``` +``` ucm :added-by-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 + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo ``` ``` unison unique type Foo = { bar : Nat, baz : Int } ``` +``` ucm :added-by-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.baz : Foo -> Int + Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo + Foo.baz.set : Int -> Foo -> Foo + + ⍟ These names already exist. You can `update` them to your + new definition: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose + + 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 + type Foo + + 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 + Foo.bar : Foo -> Nat + + 3. -- #7m1n2178r5u12jdnb6crcmanu2gm961kdvbjul5m6hta1s57avibsvk6p5g9efut8sennpgstbb8kf97eujbbuiplsoloa4cael7t90 + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + + 4. -- #ghuqoel4pao6v8e7un238i3e86vv7a7pnvgaq8m9s32edm1upgv35gri2iu32ipn9r4poli56r5kr3vtjfrltem696grfl75al4jkgg + Foo.bar.set : Nat -> Foo -> Foo + + 5. -- #p8emkm2s09n3nsd8ne5f6fro0vsldk8pn7n6rcf417anuvvun43qrk1ioofs6pdq4537eosao17c7ibvktktr3lfqglmj26gmbulmj0 + Foo.baz : Foo -> Int + + 6. -- #0il9pl29jpe3fh6vp3qeqai73915k3qffhf4bgttrgsj000b9fgs3bqoj8ugjop6kdr04acc34m1bj7lf417tslfeva7dmmoqdu5hug + Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo + + 7. -- #87rjeqltvvd4adffsheqae62eefoge8p78pvnjdkc9q1stq20lhubvtpos0io4v3vhnol8nn2uollup97l4orq1fh2h12b0imeuuc58 + Foo.baz.set : Int -> Foo -> Foo + + 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 + Foo.Foo : Nat -> Int -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-constructor-alias.md index cee732dd8e..564977360d 100644 --- a/unison-src/transcripts/idempotent/update-type-constructor-alias.md +++ b/unison-src/transcripts/idempotent/update-type-constructor-alias.md @@ -6,15 +6,59 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> alias.term Foo.Bar Foo.BarAlias + + Done. ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> update + + Sorry, I wasn't able to perform the update: + + The type Foo has a constructor with multiple names, and I + can't perform an update in this situation: + + * Foo.Bar + * Foo.BarAlias + + Please delete all but one name for each constructor, and then + try updating again. ``` diff --git a/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md b/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md index bed7f3eb72..d267239d61 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md +++ b/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md @@ -13,8 +13,27 @@ foo = cases Baz n m -> n + m ``` +``` ucm :added-by-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 + foo : Foo -> Nat +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + foo : Foo -> Nat ``` ``` unison @@ -22,6 +41,42 @@ unique type Foo = Bar Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +type Foo = Bar Nat + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +foo : Foo -> Nat +foo = cases + Bar n -> n + Baz n m -> n Nat.+ m + ``` diff --git a/unison-src/transcripts/idempotent/update-type-delete-constructor.md b/unison-src/transcripts/idempotent/update-type-delete-constructor.md index 001c643379..1d3f8ab182 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-delete-constructor.md @@ -8,8 +8,25 @@ unique type Foo | Baz Nat Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo ``` ``` unison @@ -17,8 +34,36 @@ unique type Foo = Bar Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = Bar Nat scratch/main> find.verbose + + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 + type Foo + + 2. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 + Foo.Bar : Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-delete-record-field.md b/unison-src/transcripts/idempotent/update-type-delete-record-field.md index 682256bac4..418d886e24 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-record-field.md +++ b/unison-src/transcripts/idempotent/update-type-delete-record-field.md @@ -6,18 +6,117 @@ scratch/main> builtins.merge lib.builtin unique type Foo = { bar : Nat, baz : Int } ``` +``` ucm :added-by-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 + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo + Foo.baz : Foo -> Int + Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo + Foo.baz.set : Int -> Foo -> Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo + Foo.baz : Foo -> Int + Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo + Foo.baz.set : Int -> Foo -> Foo ``` ``` unison unique type Foo = { bar : Nat } ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo +``` + We want the field accessors to go away; but for now they are here, causing the update to fail. ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. scratch/main> view Foo + + type Foo = { bar : Nat, baz : Int } scratch/main> find.verbose + + 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 + type Foo + + 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 + Foo.bar : Foo -> Nat + + 3. -- #7m1n2178r5u12jdnb6crcmanu2gm961kdvbjul5m6hta1s57avibsvk6p5g9efut8sennpgstbb8kf97eujbbuiplsoloa4cael7t90 + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + + 4. -- #ghuqoel4pao6v8e7un238i3e86vv7a7pnvgaq8m9s32edm1upgv35gri2iu32ipn9r4poli56r5kr3vtjfrltem696grfl75al4jkgg + Foo.bar.set : Nat -> Foo -> Foo + + 5. -- #p8emkm2s09n3nsd8ne5f6fro0vsldk8pn7n6rcf417anuvvun43qrk1ioofs6pdq4537eosao17c7ibvktktr3lfqglmj26gmbulmj0 + Foo.baz : Foo -> Int + + 6. -- #0il9pl29jpe3fh6vp3qeqai73915k3qffhf4bgttrgsj000b9fgs3bqoj8ugjop6kdr04acc34m1bj7lf417tslfeva7dmmoqdu5hug + Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo + + 7. -- #87rjeqltvvd4adffsheqae62eefoge8p78pvnjdkc9q1stq20lhubvtpos0io4v3vhnol8nn2uollup97l4orq1fh2h12b0imeuuc58 + Foo.baz.set : Int -> Foo -> Foo + + 8. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58#0 + Foo.Foo : Nat -> Int -> Foo + +``` + +``` unison :added-by-ucm scratch.u +type Foo = { bar : Nat } + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +Foo.baz : Foo -> Int +Foo.baz = cases Foo _ baz -> baz + +Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo +Foo.baz.modify f = cases Foo bar baz -> Foo bar (f baz) + +Foo.baz.set : Int -> Foo -> Foo +Foo.baz.set baz1 = cases Foo bar _ -> Foo bar baz1 + ``` diff --git a/unison-src/transcripts/idempotent/update-type-missing-constructor.md b/unison-src/transcripts/idempotent/update-type-missing-constructor.md index aec2a47008..20f9b77371 100644 --- a/unison-src/transcripts/idempotent/update-type-missing-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-missing-constructor.md @@ -6,9 +6,28 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> delete.term Foo.Bar + + Done. ``` Now we've set up a situation where the original constructor missing. @@ -17,7 +36,32 @@ Now we've set up a situation where the original constructor missing. unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> view Foo + + type Foo = #b509v3eg4k#0 Nat scratch/main> update + + Sorry, I wasn't able to perform the update: + + The type Foo has some constructors with missing names, and I + can't perform an update in this situation. + + You can use `view Foo` and + `alias.term Foo.` to give names to + each unnamed constructor, and then try the update again. ``` diff --git a/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md b/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md index bbdbd7f439..b6cdaacd02 100644 --- a/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md +++ b/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md @@ -9,14 +9,54 @@ structural type A.B = OneAlias Foo structural type A = B.TheOtherAlias Foo ``` +``` ucm :added-by-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 A + structural type A.B + type Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + structural type A + structural type A.B + type Foo ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> update + + The type A.B is an alias of A. I'm not able to perform an + update when a type exists nested under an alias of itself. + Please separate them or delete one copy, and then try updating + again. ``` diff --git a/unison-src/transcripts/idempotent/update-type-no-op-record.md b/unison-src/transcripts/idempotent/update-type-no-op-record.md index 5a03f05775..c810b32965 100644 --- a/unison-src/transcripts/idempotent/update-type-no-op-record.md +++ b/unison-src/transcripts/idempotent/update-type-no-op-record.md @@ -6,12 +6,40 @@ scratch/main> builtins.merge lib.builtin unique type Foo = { bar : Nat } ``` +``` ucm :added-by-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 + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + Foo.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo ``` Bug: this no-op update should (of course) succeed. ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md index c3395a1f57..dc9e4bf2f8 100644 --- a/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md +++ b/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md @@ -6,15 +6,57 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> alias.term Foo.Bar Stray.BarAlias + + Done. ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> update + + Sorry, I wasn't able to perform the update, because I need all + constructor names to be nested somewhere beneath the + corresponding type name. + + The constructor Stray.BarAlias is not nested beneath the + corresponding type name. Please either use `move` to move it, + or if it's an extra copy, you can simply `delete` it. Then try + the update again. ``` diff --git a/unison-src/transcripts/idempotent/update-type-stray-constructor.md b/unison-src/transcripts/idempotent/update-type-stray-constructor.md index 584aae8389..9af0c8065d 100644 --- a/unison-src/transcripts/idempotent/update-type-stray-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-stray-constructor.md @@ -6,9 +6,28 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Bar Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo scratch/main> move.term Foo.Bar Stray.Bar + + Done. ``` Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. @@ -17,9 +36,34 @@ Now we've set up a situation where the constructor is not where it's supposed to unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + 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 scratch/main> view Foo + + type Foo = Stray.Bar Nat scratch/main> update + + Sorry, I wasn't able to perform the update: + + The type Foo has some constructors with missing names, and I + can't perform an update in this situation. + + You can use `view Foo` and + `alias.term Foo.` to give names to + each unnamed constructor, and then try the update again. ``` diff --git a/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md b/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md index 00995c06fe..0808ba0660 100644 --- a/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md @@ -9,8 +9,27 @@ makeFoo : Nat -> Foo makeFoo n = Bar (n+10) ``` +``` ucm :added-by-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 + makeFoo : Nat -> Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + makeFoo : Nat -> Foo ``` ``` unison @@ -20,8 +39,47 @@ Foo.Bar : Nat -> Foo Foo.Bar n = internal.Bar n ``` +``` ucm :added-by-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: + + ⊡ Previously added definitions will be ignored: Foo + + ⍟ These new definitions are ok to `add`: + + Foo.Bar : Nat -> Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view Foo + + type Foo = internal.Bar Nat scratch/main> find.verbose + + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 + type Foo + + 2. -- #36rn6jqt1k5jccb3c7vagp3jam74dngr92kgcntqhs6dbkua54verfert2i6hsku6uitt9s2jvt1msric0tgemal52d5apav6akn25o + Foo.Bar : Nat -> Foo + + 3. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 + Foo.internal.Bar : Nat -> Foo + + 4. -- #204frdcl0iid1ujkkfbkc6b3v7cgqp56h1q3duc46i5md6qb4m6am1fqbceb335u87l05gkdnaa7fjn4alj1diukgme63e41lh072l8 + makeFoo : Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md b/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md index 13405b62a4..7c4574a088 100644 --- a/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md +++ b/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md @@ -6,16 +6,76 @@ scratch/main> builtins.merge lib.builtin unique type Foo = Nat ``` +``` ucm :added-by-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 scratch/main> add + + ⍟ I've added these definitions: + + type Foo ``` ``` unison unique type Foo = { bar : Nat } ``` +``` ucm :added-by-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.bar : Foo -> Nat + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + Foo.bar.set : Nat -> Foo -> Foo + + ⍟ These names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. scratch/main> view Foo + + type Foo = { bar : Nat } scratch/main> find.verbose + + 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 + type Foo + + 2. -- #ovhevqfin94qhq5fu0mujfi20mbpvg5mh4vsfklrohp84cch4lhvrn5p29cnbsqfm92l7bt8c1vpjooh72a0psbddvvten4gq2sipag + Foo.bar : Foo -> Nat + + 3. -- #as72md2u70e0u9s2ig2ug7jvlbrk1mubo8qlfokpuvgusg35svh05r7nsj27sqo5edeghjnk8g8259fi4ismse736v4n5ojrb3o2le8 + Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo + + 4. -- #5cbctoor75nbtn4ppp10qm1i25gqt2lgth3itqa0lloib32je4ijfj2n3qcdfhmdcnbgum2jg46opntlohv7ladun3dmefl1ucgobeg + Foo.bar.set : Nat -> Foo -> Foo + + 5. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 + Foo.Foo : Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-term.md b/unison-src/transcripts/idempotent/update-type-with-dependent-term.md index 301418df0b..c56e884d6c 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-term.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-term.md @@ -9,14 +9,67 @@ incrFoo : Foo -> Foo incrFoo = cases Bar n -> Bar (n+1) ``` +``` ucm :added-by-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 + incrFoo : Foo -> Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Foo + incrFoo : Foo -> Foo ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +type Foo = Bar Nat Nat + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +incrFoo : Foo -> Foo +incrFoo = cases Bar n -> Bar (n Nat.+ 1) + ``` diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md index 936af2265e..c8d569aa01 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md @@ -7,14 +7,66 @@ unique type Foo = Bar Nat unique type Baz = Qux Foo ``` +``` ucm :added-by-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 Baz + type Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Baz + type Foo ``` ``` unison unique type Foo a = Bar Nat a ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo a +``` + ``` ucm :error scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Typechecking failed. I've updated your scratch file with the + definitions that need fixing. Once the file is compiling, try + `update` again. +``` + +``` unison :added-by-ucm scratch.u +type Foo a = Bar Nat a + +-- The definitions below no longer typecheck with the changes above. +-- Please fix the errors and try `update` again. + +type Baz = Qux Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-type.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type.md index b88e174d90..9fe59c9183 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-type.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-type.md @@ -7,17 +7,76 @@ unique type Foo = Bar Nat unique type Baz = Qux Foo ``` +``` ucm :added-by-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 Baz + type Foo +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + type Baz + type Foo ``` ``` unison unique type Foo = Bar Nat Nat ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + type Foo +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + That's done. Now I'm making sure everything typechecks... + + Everything typechecks, so I'm saving the results... + + Done. scratch/main> view Foo + + type Foo = Bar Nat Nat scratch/main> view Baz + + type Baz = Qux Foo scratch/main> find.verbose + + 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 + type Baz + + 2. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08#0 + Baz.Qux : Foo -> Baz + + 3. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g + type Foo + + 4. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 + Foo.Bar : Nat -> Nat -> Foo + ``` diff --git a/unison-src/transcripts/idempotent/update-watch.md b/unison-src/transcripts/idempotent/update-watch.md index c1129b8610..9024cc741a 100644 --- a/unison-src/transcripts/idempotent/update-watch.md +++ b/unison-src/transcripts/idempotent/update-watch.md @@ -2,6 +2,27 @@ > 1 ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > 1 + ⧩ + 1 +``` + ``` ucm scratch/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. ``` diff --git a/unison-src/transcripts/idempotent/upgrade-happy-path.md b/unison-src/transcripts/idempotent/upgrade-happy-path.md index bc71ae5691..7d92085582 100644 --- a/unison-src/transcripts/idempotent/upgrade-happy-path.md +++ b/unison-src/transcripts/idempotent/upgrade-happy-path.md @@ -8,21 +8,63 @@ lib.new.foo = 18 thingy = lib.old.foo + 10 ``` +``` ucm :added-by-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`: + + lib.new.foo : Nat + lib.old.foo : Nat + thingy : Nat +``` ``` ucm proj/main> add + + ⍟ I've added these definitions: + + lib.new.foo : Nat + lib.old.foo : Nat + thingy : Nat ``` Test tab completion and fzf options of upgrade command. ``` ucm proj/main> debug.tab-complete upgrade ol + + old proj/main> debug.fuzzy-options upgrade _ + + Select a dependency to upgrade: + * builtin + * new + * old proj/main> debug.fuzzy-options upgrade old _ + + Select a dependency to upgrade to: + * builtin + * new + * old ``` ``` ucm proj/main> upgrade old new + + I upgraded old to new, and removed old. proj/main> ls lib + + 1. builtin/ (469 terms, 74 types) + 2. new/ (1 term) proj/main> view thingy + + thingy : Nat + thingy = + use Nat + + foo + 10 ``` diff --git a/unison-src/transcripts/idempotent/upgrade-sad-path.md b/unison-src/transcripts/idempotent/upgrade-sad-path.md index 60972e4303..128079cdb4 100644 --- a/unison-src/transcripts/idempotent/upgrade-sad-path.md +++ b/unison-src/transcripts/idempotent/upgrade-sad-path.md @@ -8,12 +8,56 @@ lib.new.foo = +18 thingy = lib.old.foo + 10 ``` +``` ucm :added-by-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`: + + lib.new.foo : Int + lib.old.foo : Nat + thingy : Nat +``` + ``` ucm proj/main> add + + ⍟ I've added these definitions: + + lib.new.foo : Int + lib.old.foo : Nat + thingy : Nat ``` ``` ucm :error proj/main> upgrade old new + + I couldn't automatically upgrade old to new. However, I've + added the definitions that need attention to the top of + scratch.u. + + When you're done, you can run + + upgrade.commit + + to merge your changes back into main and delete the temporary + branch. Or, if you decide to cancel the upgrade instead, you + can run + + delete.branch /upgrade-old-to-new + + to delete the temporary branch and switch back to main. +``` + +``` unison :added-by-ucm scratch.u +thingy : Nat +thingy = + use Nat + + foo + 10 ``` Resolve the error and commit the upgrade. @@ -22,10 +66,42 @@ Resolve the error and commit the upgrade. thingy = foo + +10 ``` +``` ucm :added-by-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 names already exist. You can `update` them to your + new definition: + + thingy : Int +``` + ``` ucm proj/upgrade-old-to-new> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. proj/upgrade-old-to-new> upgrade.commit + + I fast-forward merged proj/upgrade-old-to-new into proj/main. proj/main> view thingy + + thingy : Int + thingy = + use Int + + foo + +10 proj/main> ls lib + + 1. builtin/ (469 terms, 74 types) + 2. new/ (1 term) proj/main> branches + + Branch Remote branch + 1. main ``` diff --git a/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md b/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md index 16c92a6e0c..17272a8510 100644 --- a/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md +++ b/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md @@ -12,10 +12,72 @@ d.y.y.y.y = lib.old.foo + 10 bar = a.x.x.x.x + c.y.y.y.y ``` +``` ucm :added-by-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.x.x.x.x : Nat + b.x.x.x.x : Nat + bar : Nat + c.y.y.y.y : Nat + d.y.y.y.y : Nat + lib.new.foo : Int + lib.old.foo : Nat +``` + ``` ucm myproject/main> add + + ⍟ I've added these definitions: + + a.x.x.x.x : Nat + b.x.x.x.x : Nat + bar : Nat + c.y.y.y.y : Nat + d.y.y.y.y : Nat + lib.new.foo : Int + lib.old.foo : Nat ``` ``` ucm :error myproject/main> upgrade old new + + I couldn't automatically upgrade old to new. However, I've + added the definitions that need attention to the top of + scratch.u. + + When you're done, you can run + + upgrade.commit + + to merge your changes back into main and delete the temporary + branch. Or, if you decide to cancel the upgrade instead, you + can run + + delete.branch /upgrade-old-to-new + + to delete the temporary branch and switch back to main. +``` + +``` unison :added-by-ucm scratch.u +bar : Nat +bar = + use Nat + + x + c.y.y.y.y + +c.y.y.y.y : Nat +c.y.y.y.y = + use Nat + + foo + 10 + +d.y.y.y.y : Nat +d.y.y.y.y = + use Nat + + foo + 10 ``` diff --git a/unison-src/transcripts/idempotent/upgrade-with-old-alias.md b/unison-src/transcripts/idempotent/upgrade-with-old-alias.md index cae97a4749..d635a912f0 100644 --- a/unison-src/transcripts/idempotent/upgrade-with-old-alias.md +++ b/unison-src/transcripts/idempotent/upgrade-with-old-alias.md @@ -9,9 +9,40 @@ bar = 141 mything = lib.old.foo + 100 ``` +``` ucm :added-by-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`: + + bar : Nat + lib.new.foo : Nat + lib.old.foo : Nat + mything : Nat +``` + ``` ucm myproject/main> update + + Okay, I'm searching the branch for code that needs to be + updated... + + Done. myproject/main> upgrade old new + + I upgraded old to new, and removed old. myproject/main> view mything + + mything : Nat + mything = + use Nat + + foo + 100 myproject/main> view bar + + bar : Nat + bar = 141 ``` diff --git a/unison-src/transcripts/idempotent/view.md b/unison-src/transcripts/idempotent/view.md index 64a6854972..b84c8c9427 100644 --- a/unison-src/transcripts/idempotent/view.md +++ b/unison-src/transcripts/idempotent/view.md @@ -16,14 +16,22 @@ scratch/main> add ``` ucm -- Should suffix-search and find values in sub-namespaces scratch/main> view thing + + a.thing : Text + a.thing = "a" + + b.thing : Text + b.thing = "b" -- Should support absolute paths scratch/main> view .b.thing -``` + .b.thing : Text + .b.thing = "b" +``` TODO: swap this back to a 'ucm' block when view.global is re-implemented -``` +``` -- view.global should search globally and be absolutely qualified scratch/other> view.global thing -- Should support branch relative paths diff --git a/unison-src/transcripts/idempotent/watch-expressions.md b/unison-src/transcripts/idempotent/watch-expressions.md index bc024ceb85..b1f9869ccf 100644 --- a/unison-src/transcripts/idempotent/watch-expressions.md +++ b/unison-src/transcripts/idempotent/watch-expressions.md @@ -1,25 +1,96 @@ ``` ucm scratch/main> builtins.mergeio + + Done. ``` ``` unison test> pass = [Ok "Passed"] ``` +``` ucm :added-by-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`: + + pass : [Result] + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | test> pass = [Ok "Passed"] + + ✅ Passed Passed +``` + ``` ucm scratch/main> add + + ⍟ I've added these definitions: + + pass : [Result] ``` ``` unison test> pass = [Ok "Passed"] ``` +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + I found and typechecked the definitions in scratch.u. This + file has been previously added to the codebase. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | test> pass = [Ok "Passed"] + + ✅ Passed Passed (cached) +``` + ``` ucm scratch/main> add + + ⊡ Ignored previously added definitions: pass scratch/main> test + + Cached test results (`help testcache` to learn more) + + 1. pass ◉ Passed + + ✅ 1 test(s) passing + + Tip: Use view 1 to view the source of a test. ``` ``` unison > ImmutableArray.fromList [?a, ?b, ?c] > ImmutableByteArray.fromBytes 0xs123456 ``` + +``` ucm :added-by-ucm + + Loading changes detected in scratch.u. + + ✅ + + scratch.u changed. + + Now evaluating any watch expressions (lines starting with + `>`)... Ctrl+C cancels. + + 1 | > ImmutableArray.fromList [?a, ?b, ?c] + ⧩ + ImmutableArray.fromList [?a, ?b, ?c] + + 2 | > ImmutableByteArray.fromBytes 0xs123456 + ⧩ + fromBytes 0xs123456 +``` From e6632a54b20e2eb0e1e9e7d304fe512c0b5db9cd Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 9 Oct 2024 14:15:32 -0600 Subject: [PATCH 10/15] Hide output on a few transcripts Idempotent transcripts can get large, so using `:hide` more liberally is probably a good idea. This tries that out on a few transcripts. --- .../transcripts/idempotent/abilities.md | 16 +--- .../ability-order-doesnt-affect-hash.md | 18 +---- unison-src/transcripts/idempotent/add-run.md | 77 ++----------------- 3 files changed, 7 insertions(+), 104 deletions(-) diff --git a/unison-src/transcripts/idempotent/abilities.md b/unison-src/transcripts/idempotent/abilities.md index 32c7116d98..20d0f9745b 100644 --- a/unison-src/transcripts/idempotent/abilities.md +++ b/unison-src/transcripts/idempotent/abilities.md @@ -4,7 +4,7 @@ scratch/main> builtins.merge Some random ability stuff to ensure things work. -``` unison +``` unison :hide unique ability A where one : Nat ->{A} Nat @@ -21,20 +21,6 @@ ha = cases { four i -> c } -> handle c (j k l -> i+j+k+l) with ha ``` -``` ucm :added-by-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`: - - ability A - ha : Request {A} r -> r -``` - ``` ucm scratch/main> add diff --git a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md index 9e34873a6e..d0cbce1e96 100644 --- a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md +++ b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md @@ -1,6 +1,6 @@ The order of a set of abilities is normalized before hashing. -``` unison +``` unison :hide unique ability Foo where foo : () @@ -14,22 +14,6 @@ term2 : () ->{Bar, Foo} () term2 _ = () ``` -``` ucm :added-by-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`: - - ability Bar - ability Foo - term1 : '{Bar, Foo} () - term2 : '{Bar, Foo} () -``` - ``` ucm scratch/main> add diff --git a/unison-src/transcripts/idempotent/add-run.md b/unison-src/transcripts/idempotent/add-run.md index 77b9559294..8181861e7c 100644 --- a/unison-src/transcripts/idempotent/add-run.md +++ b/unison-src/transcripts/idempotent/add-run.md @@ -6,7 +6,7 @@ scratch/main> builtins.merge ``` -``` unison +``` unison :hide even : Nat -> Boolean even x = if x == 0 then true else odd (drop x 1) @@ -17,21 +17,6 @@ is2even : 'Boolean is2even = '(even 2) ``` -``` ucm :added-by-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`: - - even : Nat -> Boolean - is2even : 'Boolean - odd : Nat -> Boolean -``` - it errors if there isn't a previous run ``` ucm :error @@ -146,24 +131,11 @@ scratch/main> add inc inc : Nat -> Nat ``` -``` unison +``` unison :hide main : '(Nat -> Nat) main _ x = inc x ``` -``` ucm :added-by-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`: - - main : '(Nat -> Nat) -``` - ``` ucm scratch/main> run main @@ -208,23 +180,10 @@ scratch/main> run main 2 ``` -``` unison +``` unison :hide x = 50 ``` -``` ucm :added-by-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 -``` - this saves 2 to xres, rather than 100 ``` ucm @@ -241,23 +200,10 @@ scratch/main> view xres ## It fails with a message if add cannot complete cleanly -``` unison +``` unison :hide main = '5 ``` -``` ucm :added-by-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`: - - main : 'Nat -``` - ``` ucm :error scratch/main> run main @@ -274,23 +220,10 @@ scratch/main> add.run xres ## It works with absolute names -``` unison +``` unison :hide main = '5 ``` -``` ucm :added-by-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`: - - main : 'Nat -``` - ``` ucm scratch/main> run main From ade889f24eaccace47bb7cbc26afa173521bebf9 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 11 Nov 2024 10:21:41 -0700 Subject: [PATCH 11/15] Add verification for non-test transcripts Checks that other transcripts in the source tree (currently just the GitHub bug-report template) are valid. This also fixes a bug where a transcript block like ` ``` ucm :hidec` would be parsed like ` ``` ucm :hide c`, rather than complaining that there is no `hidec` tag. This currently fails because of a typo introduced earlier in this PR. --- .../src/Unison/Codebase/Transcript/Parser.hs | 15 +- unison-cli/transcripts/Transcripts.hs | 137 ++-- .../ISSUE_TEMPLATE/bug_report.output.md | 35 + .../docs/ability-typechecking.output.md | 81 +++ .../docs/adding-builtins.output.md | 236 +++++++ .../docs/branchless-scratch.output.md | 54 ++ .../project-outputs/docs/branchless.output.md | 656 ++++++++++++++++++ .../docs/codebase-editor-design.output.md | 511 ++++++++++++++ .../docs/commandline-editor-dev.output.md | 11 + .../docs/comments-and-docs.output.md | 226 ++++++ .../docs/configuration.output.md | 176 +++++ .../project-outputs/docs/data-types.output.md | 34 + .../distributed-api-discussion-v1.output.md | 285 ++++++++ .../distributed-garbage-collection.output.md | 94 +++ .../distributed-programming-rfc.output.md | 223 ++++++ .../docs/github-actions-help.output.md | 92 +++ .../docs/language-server.output.md | 223 ++++++ .../project-outputs/docs/metadata.output.md | 34 + .../project-outputs/docs/nix.output.md | 65 ++ .../docs/publishing-library1.output.md | 389 +++++++++++ .../docs/publishing-library2.output.md | 179 +++++ .../project-outputs/docs/publishing.output.md | 10 + .../docs/release-steps.output.md | 92 +++ .../runtime-calling-conventions.output.md | 51 ++ .../docs/sharing-code.output.md | 135 ++++ .../project-outputs/docs/testing.output.md | 57 ++ .../docs/type-declarations.output.md | 150 ++++ 27 files changed, 4196 insertions(+), 55 deletions(-) create mode 100644 unison-src/transcripts/project-outputs/.github/ISSUE_TEMPLATE/bug_report.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/ability-typechecking.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/adding-builtins.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/branchless-scratch.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/branchless.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/codebase-editor-design.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/commandline-editor-dev.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/comments-and-docs.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/configuration.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/data-types.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/distributed-api-discussion-v1.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/distributed-garbage-collection.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/distributed-programming-rfc.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/github-actions-help.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/language-server.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/metadata.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/nix.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/publishing-library1.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/publishing-library2.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/publishing.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/release-steps.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/runtime-calling-conventions.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/sharing-code.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/testing.output.md create mode 100644 unison-src/transcripts/project-outputs/docs/type-declarations.output.md diff --git a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs index f186ae0e29..4943b5442a 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Parser.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Parser.hs @@ -22,6 +22,7 @@ import Data.Bool (bool) import Data.Char qualified as Char import Data.Text qualified as Text import Text.Megaparsec qualified as P +import Text.Megaparsec.Char qualified as P import Unison.Codebase.Transcript hiding (expectingError, generated, hidden) import Unison.Prelude import Unison.Project (fullyQualifiedProjectAndBranchNamesParser) @@ -75,16 +76,18 @@ ucmLine = ucmOutputLine <|> ucmComment <|> ucmCommand ucmCommand :: P UcmLine ucmCommand = UcmCommand - <$> fmap UcmContextProject (fullyQualifiedProjectAndBranchNamesParser <* lineToken (word ">") <* nonNewlineSpaces) + <$> fmap + UcmContextProject + (fullyQualifiedProjectAndBranchNamesParser <* lineToken (P.chunk ">") <* nonNewlineSpaces) <*> restOfLine ucmComment :: P UcmLine ucmComment = P.label "comment (delimited with “--”)" $ - UcmComment <$> (word "--" *> restOfLine) + UcmComment <$> (P.chunk "--" *> restOfLine) ucmOutputLine :: P UcmLine - ucmOutputLine = UcmOutputLine <$> (word " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") + ucmOutputLine = UcmOutputLine <$> (P.chunk " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") restOfLine :: P Text restOfLine = P.takeWhileP Nothing (/= '\n') <* P.single '\n' @@ -92,8 +95,8 @@ restOfLine = P.takeWhileP Nothing (/= '\n') <* P.single '\n' apiRequest :: P APIRequest apiRequest = GetRequest <$> (word "GET" *> spaces *> restOfLine) - <|> APIComment <$> (word "--" *> restOfLine) - <|> APIResponseLine <$> (word " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") + <|> APIComment <$> (P.chunk "--" *> restOfLine) + <|> APIResponseLine <$> (P.chunk " " *> restOfLine <|> "" <$ P.single '\n' <|> "" <$ P.chunk " \n") formatInfoString :: (a -> Text) -> Text -> InfoTags a -> Text formatInfoString formatA language infoTags = @@ -124,7 +127,7 @@ fenced = do _ -> pure Nothing word :: Text -> P Text -word = P.chunk +word text = P.chunk text <* P.notFollowedBy P.alphaNumChar lineToken :: P a -> P a lineToken p = p <* nonNewlineSpaces diff --git a/unison-cli/transcripts/Transcripts.hs b/unison-cli/transcripts/Transcripts.hs index d06875a371..8f76d379fd 100644 --- a/unison-cli/transcripts/Transcripts.hs +++ b/unison-cli/transcripts/Transcripts.hs @@ -37,7 +37,18 @@ data TestConfig = TestConfig } deriving (Show) -type TestBuilder = FilePath -> FilePath -> [String] -> String -> Test () +type TestBuilder = + -- | path to the native runtime + FilePath -> + -- | directory containing prelude & transcript `FilePath`s + FilePath -> + -- | directory to write output files to (often the same as the previous argument) + FilePath -> + -- | prelude files (relative to previous directory `FilePath`) + [FilePath] -> + -- | transcript file (relative to earlier directory `FilePath`) + FilePath -> + Test () testBuilder :: Bool -> @@ -45,63 +56,88 @@ testBuilder :: ((FilePath, Text) -> IO ()) -> FilePath -> FilePath -> - [String] -> - String -> + FilePath -> + [FilePath] -> + FilePath -> Test () -testBuilder expectFailure replaceOriginal recordFailure runtimePath dir prelude transcript = scope transcript $ do - outputs <- io . withTemporaryUcmCodebase SC.init Verbosity.Silent "transcript" SC.DoLock $ \(codebasePath, codebase) -> - let isTest = True - in Transcript.withRunner isTest Verbosity.Silent "TODO: pass version here" runtimePath \runTranscript -> - for files \filePath -> do - transcriptSrc <- readUtf8 filePath - out <- silence $ runTranscript filePath transcriptSrc (codebasePath, codebase) - pure (filePath, out) - for_ outputs \case - (filePath, Left err) -> do - let outputFile = outputFileForTranscript filePath - case err of - Transcript.ParseError errors -> do - let bundle = MP.errorBundlePretty errors - errMsg = "Error parsing " <> filePath <> ": " <> bundle - -- Drop the file name, to avoid POSIX/Windows conflicts - io . writeUtf8 outputFile . Text.dropWhile (/= ':') $ Text.pack bundle - when (not expectFailure) $ do - io $ recordFailure (filePath, Text.pack errMsg) - crash errMsg - Transcript.RunFailure errOutput -> do - let errText = Transcript.formatStanzas $ toList errOutput - io $ writeUtf8 outputFile errText - when (not expectFailure) $ do - io $ Text.putStrLn errText - io $ recordFailure (filePath, errText) - crash $ "Failure in " <> filePath - (filePath, Right out) -> do - let outputFile = if replaceOriginal then filePath else outputFileForTranscript filePath - io . writeUtf8 outputFile . Transcript.formatStanzas $ toList out - when expectFailure $ do - let errMsg = "Expected a failure, but transcript was successful." - io $ recordFailure (filePath, Text.pack errMsg) - crash errMsg - ok +testBuilder expectFailure replaceOriginal recordFailure runtimePath inputDir outputDir prelude transcript = + scope transcript do + outputs <- + io $ withTemporaryUcmCodebase SC.init Verbosity.Silent "transcript" SC.DoLock \(codebasePath, codebase) -> + let isTest = True + in Transcript.withRunner isTest Verbosity.Silent "TODO: pass version here" runtimePath \runTranscript -> + for files \filePath -> do + transcriptSrc <- readUtf8 $ inputDir filePath + out <- silence $ runTranscript filePath transcriptSrc (codebasePath, codebase) + pure (filePath, out) + for_ outputs \case + (filePath, Left err) -> do + let outputFile = outputDir outputFileForTranscript filePath + case err of + Transcript.ParseError errors -> do + let bundle = MP.errorBundlePretty errors + errMsg = "Error parsing " <> filePath <> ": " <> bundle + -- Drop the file name, to avoid POSIX/Windows conflicts + io . writeUtf8 outputFile . Text.dropWhile (/= ':') $ Text.pack bundle + when (not expectFailure) $ do + io $ recordFailure (inputDir filePath, Text.pack errMsg) + crash errMsg + Transcript.RunFailure errOutput -> do + let errText = Transcript.formatStanzas $ toList errOutput + io $ writeUtf8 outputFile errText + when (not expectFailure) $ do + io $ Text.putStrLn errText + io $ recordFailure (inputDir filePath, errText) + crash $ "Failure in " <> filePath + (filePath, Right out) -> do + let outputFile = outputDir if replaceOriginal then filePath else outputFileForTranscript filePath + io . createDirectoryIfMissing True $ takeDirectory outputFile + io . writeUtf8 outputFile . Transcript.formatStanzas $ toList out + when expectFailure $ do + let errMsg = "Expected a failure, but transcript was successful." + io $ recordFailure (filePath, Text.pack errMsg) + crash errMsg + ok where - files = fmap (dir ) (prelude ++ [transcript]) + files = prelude ++ [transcript] outputFileForTranscript :: FilePath -> FilePath outputFileForTranscript filePath = replaceExtension filePath ".output.md" -buildTests :: TestConfig -> TestBuilder -> FilePath -> Test () -buildTests TestConfig {..} testBuilder dir = do +enumerateTests :: TestConfig -> TestBuilder -> [FilePath] -> Test () +enumerateTests TestConfig {..} testBuilder files = do + io . putStrLn . unlines $ + [ "", + "Running explicitly-named transcripts" + ] + -- Any files that start with _ are treated as prelude + let (prelude, transcripts) = + files + & sort + & partition (isPrefixOf "_" . snd . splitFileName) + -- if there is a matchPrefix set, filter non-prelude files by that prefix - or return True + & second (filter (\f -> maybe True (`isPrefixOf` f) matchPrefix)) + + case length transcripts of + 0 -> pure () + -- EasyTest exits early with "no test results recorded" if you don't give it any tests, this keeps it going till the + -- end so we can search all transcripts for prefix matches. + _ -> + tests (testBuilder runtimePath "." ("unison-src" "transcripts" "project-outputs") prelude <$> transcripts) + +buildTests :: TestConfig -> TestBuilder -> FilePath -> Maybe FilePath -> Test () +buildTests TestConfig {..} testBuilder inputDir outputDir = do io . putStrLn . unlines $ [ "", - "Searching for transcripts to run in: " ++ dir + "Searching for transcripts to run in: " ++ inputDir ] - files <- io $ listDirectory dir + files <- io $ listDirectory inputDir -- Any files that start with _ are treated as prelude let (prelude, transcripts) = files & sort - & filter (\f -> takeExtensions f == ".md") + & filter (\f -> let ext = takeExtensions f in ext == ".md" || ext == ".markdown") & partition (isPrefixOf "_" . snd . splitFileName) -- if there is a matchPrefix set, filter non-prelude files by that prefix - or return True & second (filter (\f -> maybe True (`isPrefixOf` f) matchPrefix)) @@ -112,7 +148,7 @@ buildTests TestConfig {..} testBuilder dir = do -- if you don't give it any tests, this keeps it going -- till the end so we can search all transcripts for -- prefix matches. - _ -> tests (testBuilder runtimePath dir prelude <$> transcripts) + _ -> tests (testBuilder runtimePath inputDir (fromMaybe inputDir outputDir) prelude <$> transcripts) -- Transcripts that exit successfully get cleaned-up by the transcript parser. -- Any remaining folders matching "transcript-.*" are output directories @@ -138,10 +174,13 @@ test config = do -- what went wrong in CI failuresVar <- io $ STM.newTVarIO [] let recordFailure failure = STM.atomically $ STM.modifyTVar' failuresVar (failure :) - buildTests config (testBuilder False False recordFailure) $ "unison-src" "transcripts" - buildTests config (testBuilder False True recordFailure) $ "unison-src" "transcripts" "idempotent" - buildTests config (testBuilder False False recordFailure) $ "unison-src" "transcripts-using-base" - buildTests config (testBuilder True False recordFailure) $ "unison-src" "transcripts" "errors" + buildTests config (testBuilder False False recordFailure) ("unison-src" "transcripts") Nothing + buildTests config (testBuilder False True recordFailure) ("unison-src" "transcripts" "idempotent") Nothing + buildTests config (testBuilder False False recordFailure) ("unison-src" "transcripts-using-base") Nothing + buildTests config (testBuilder True False recordFailure) ("unison-src" "transcripts" "errors") Nothing + buildTests config (testBuilder False False recordFailure) "docs" . Just $ + "unison-src" "transcripts" "project-outputs" "docs" + enumerateTests config (testBuilder False False recordFailure) [".github/ISSUE_TEMPLATE/bug_report.md"] failures <- io $ STM.readTVarIO failuresVar -- Print all aggregated failures when (not $ null failures) . io $ Text.putStrLn $ "Failures:" diff --git a/unison-src/transcripts/project-outputs/.github/ISSUE_TEMPLATE/bug_report.output.md b/unison-src/transcripts/project-outputs/.github/ISSUE_TEMPLATE/bug_report.output.md new file mode 100644 index 0000000000..287ba0bb94 --- /dev/null +++ b/unison-src/transcripts/project-outputs/.github/ISSUE_TEMPLATE/bug_report.output.md @@ -0,0 +1,35 @@ +----- + +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +----- + +**Describe and demonstrate the bug** +This should be written as a [ucm transcript](https://www.unison-lang.org/docs/tooling/transcripts/) if possible, calling out the unexpected behavior in the text. e.g. + +``` unison :hide +a = 1 +``` + +Here I typo the next command and `ucm` silently does nothing, I would have expected an error message: + +``` ucm +scratch/main> add b + +``` + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + + - `ucm --version` \[e.g. "0.5.21", or "1cb2437 (built on 2024-06-03)"\] + - OS/Architecture: \[e.g. "macOS 14.5, Intel"\] + - Browser, if applicable: \[e.g. "chrome 125.0.6422.142"\] (Version numbers are typically found the about menu option) + +**Additional context** +Add any other context about the problem here. diff --git a/unison-src/transcripts/project-outputs/docs/ability-typechecking.output.md b/unison-src/transcripts/project-outputs/docs/ability-typechecking.output.md new file mode 100644 index 0000000000..9d8b398604 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/ability-typechecking.output.md @@ -0,0 +1,81 @@ +Brief document discussing Unison's algebraic effects. + + - The type `a ->{IO} b` type is a function from `a` to `b`, which requires the `IO` ability. The `{}` should be thought of as being attached to the `->`. + - The `{}` syntax can contain any number of comma separated types, like `a ->{IO, Abort, State Nat} b`. We call the `{}` list the "required abilities" of the function. + - Within an abilities list, type variables like `{e1, e2}` can be instantiated to sets of abilities, so we should think of the `{}` as just taking the union of all the sets contained therein. `IO` within `{IO}` is really the singleton set. + - Unison's typechecker prevents calling a function whose required abilities aren't available in the currrent expression. We say that at each subexpression of the program, there's an *ambient* set of abilities available, and when calling a function `f : a ->{e1,e2} b`, the ambient abilities must be at least as big as as `{e1, e2}` (according to the subtyping judgement). Verifying that these requested abilities are available is called an "ability check". + - The ambient abilities at a subterm is defined to be equal to the required abilities on the type of the *nearest enclosing lambda*. For instance, within the body of a lambda of type `a ->{Remote} b`, `{Remote}` is the ambient set. + - Okay the above isn't quite right because `handle` blocks prepend new abilities to the ambient based on the abilities that the handler eliminates. So a handler `h : Request {IO} a -> b` will grant access to `IO` within the `body` of `handle h in body`. So the ambient set is really the required abilities on the type of the nearest enclosing lambda, plus the abilities eliminated by enclosing handlers. + +Here are a few examples: + +``` haskell +foo : Text ->{} () +foo name = IO.printLine ("Hello, " ++ name) +``` + +Triggers an ability check failure, since the nearest enclosing lambda requires `{}`, the empty set of abilities. Therefore the body of that lambda doesn't have access to `IO`. + +``` haskell +foo2 : Text ->{IO} Text ->{} () +foo2 name1 name = IO.printLine ("Hello, " ++ name) +``` + +This also triggers an ability check failure. The inner lambda still requires only `{}` and we don't get access to abilities required by outer lambdas. This would be unsound (you could partially apply the function, then obtain a function with a smaller abilities requirement than what it actually used). + +This would work: + +``` haskell +foo2 : Text ->{IO} Text ->{} () +foo2 name1 = + IO.printLine ("Hello, " ++ name1) + name -> () +``` + +Notice that we get access to `IO` after just the first argument is supplied. The lambda we return though can't use `IO`. + +TODO: handle blocks + +## Type annotations and ability inference + +The type of the nearest enclosing lambda and therefore the ambient set can't always be known in advance, if the user hasn't provided type annotations. In this case, we invent an existential type parameter for the ambient set and allow the existential to be refined by the normal ability checks. + +I realized it's not sound to do Frank-style effect generalization after typechecking and have a different proposal instead. For instance, suppose we have the function: + +``` haskell +map : (a -> b) -> [a] -> [b] +``` + +Which we typecheck and then afterwards generalize to: + +``` haskell +map : (a ->{e} b) -> [a] ->{e} [b] +``` + +Except, what if that function `a ->{e} b` were actually being passed (within the body of `map`) to some other function that was expecting an `a ->{} b`? We can't just generalize this willy nilly, we actually need to typecheck with the enriched type. + +So I propose the following: + + - The type `a -> b` means `a ->{e} b` for some existential `e` to be inferrered by Unison. It doesn't mean `forall e . a ->{e} b` or `a ->{} b`. + - And as before: + - The type `a ->{} b` means a function with no required abilities, AKA a pure function + - The type `a ->{e} b` means a function with exactly `e` as its required abilities + +So, the `map` function, assuming it were implemented in an ability-polymorphic way, would get the signature: + +``` haskell +map : (a ->{e} b) -> [a] ->{e} [b] +``` + +This would be the type it would get if inferred, or if the user provided the signature `(a -> b) -> [a] -> [b]` to the function, it would note this elaborated type for the user (and possibly link to some docs about what this means). + +This is sound and should work fine. It has the benefit of being highly nonmagical. I think it could also good for teaching about abilities: one can write "simple" type signatures and have them be elaborated automatically, which builds some familiarity. A downside is that the user will see more ability type variables. But maybe that's a feature, not a bug. + +A couple usability improvements can elide ability type variables in various cases: + + - When displaying a type signature, we can elide any ability type variables that are mentioned just once by the type (as in `forall e . Nat ->{e} Nat`). If the variable is mentioned more than once in the signature, we include it, since it's adding useful information about what the function does and how it works. A principle here is that it's okay to eliminate informtaion from an arrow `a ->{e} b` and show that as `a -> b` if the user can use that as an `a ->{e} b` for any choice of `e`, including `{}`. + - Another possible usability thing that's maybe more questionable, eliminate any empty `{}` that aren't to the left of an `->`. So for instance `Nat ->{} Nat ->{} Text` would display as just `Nat -> Nat -> Text`, but like `(a ->{} b) -> blah` would still display as `(a ->{} b) -> blah` since the `{}` appear to the left of an `->`. + +### Question + +Given the above, wow do we decide when a type signature is redundant, for purposes of determining whether to store that signature along with the type? diff --git a/unison-src/transcripts/project-outputs/docs/adding-builtins.output.md b/unison-src/transcripts/project-outputs/docs/adding-builtins.output.md new file mode 100644 index 0000000000..4a5029f870 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/adding-builtins.output.md @@ -0,0 +1,236 @@ +This document explains how to add builtins to the language by working +through the example of adding `MVar` and some associated functions. + +## Builtin Data + +The logical first step for this example is to add a built-in `MVar` +type, whose values will simply be wrapped values of the Haskell type +with the same name. The 'old' runtime deviates from this approach for +several types, but this is how e.g. `Text` works even there. + +Data types, including opaque pseudo data types of this sort are +referred to by `Reference`. Builtin, opaque data types use the +`Builtin` constructor with an appropriate name. The ones in actual +use are listed in the `Unison.Type` module, so we'll add a definition +there: + +``` haskell +mvarRef :: Reference +mvarRef = Reference.Builtin "MVar" +``` + +This definition alone won't do anything, however. It is merely +something for other definitions to refer to. If the reference is used +in e.g. the type of a function definitions without giving it an actual +name in the codebase, the type will be displayed with the raw hash, +which looks like `#MVar`. + +The builtin reference can be given a name during the `builtins.merge` +ucm command. To make this happen, we must modify the `builtinTypesSrc` +definition in the `Unison.Builtin` module. This is just a list of +values that describe various builtin type related actions to be +performed during that command. In this case, we will add two values to +the list: + +``` haskell +B' "MVar" CT.Data +``` + +This specifies that there should be a builtin data type referring to +the `Builtin "MVar"` reference. The codebase name assigned to this is +the same as the reference (MVar here), but nested in the `builtin` +namespace. However, we will also add the value: + +``` haskell +Rename' "MVar" "io2.MVar" +``` + +because this is a type to be used with the new IO functions, which are +currently nested under the `io2` namespace. With both of these added +to the list, running `builtins.merge` should have a `builtin.io2.MVar` +type referring to the `Builtin "MVar"` reference. + +The reason for both a `B'` and a `Rename'` is that eventually one +would expect the IO functionality to be moved from the `io2` +namespace. However, the builtin reference name may not be changed +easily, so it is preferable to have it named in the eventual expected +way, rather than permanently named `io2.MVar` internally. + +## Builtin function declarations + +The next step is to declare builtin functions that make use of the new +type. These are declared in a similar way to the type names above. +There is another list in `Unison.Builtin`, `builtinsSrc`, that defines +values specifying what builtin functions should exist. + +Like the builtin type list, there are declarations for adding a +builtin function with a given name, and declarations for renaming from +the given name to a different namespace location. For the `MVar` +functions, we'll again give them their intended names as the original, +and rename them to the `io2` namespace for the time being. + +Builtin functions also have an associated type as part of the initial +declaration. So for the complete specification of a function, we will +add declarations similar to: + +``` haskell +B "MVar.new" $ forall1 "a" (\a -> a --> io (mvar a)) +Rename "MVar.new" "io2.MVar.new" +B "MVar.take" $ forall1 "a" (\a -> mvar a --> iof a) +Rename "MVar.take" "io2.MVar.take" +``` + +The `forall1`, `io`, `iof` and `-->` functions are local definitions +in `Unison.Builtin` for assistance in writing the types. `iof` +indicates that an error result may be returned, while `io` should +always succeed. Note that when the `{IO}` ability appears as a type +parameter rather than the return type of a function, you will need to +use `iot` instead. +`mvar` can be defined locally using some other +helpers in scope: + +``` haskell +mvar :: Type -> Type +mvar a = Type.ref () Type.mvarRef `app` a +``` + +For the actual `MVar` implementation, we'll be doing many definitions +followed by renames, so it'll be factored into a list of the name and +type, and we can then call the `moveUnder` helper to generate the `B` +declaration and the `Rename`. + +## Builtin function implementation -- new runtime + +What we have done so far only declares the functions and their types. +There is nothing yet implementing them. This section will proceed +through the implementation backing the declarations of the `MVar.new` +and `MVar.take` above. + +In this case, we will implement the operations using the 'foreign +function' machinery. This path is somewhat less optimized, but +doesn't require inventing opcodes and modifying the runtime at +quite as low a level. The builtin 'foreign' functions are declared +in `Unison.Runtime.Builtin`, in a definition `declareForeigns`. We +can declare our builtins there by adding: + +``` haskell + declareForeign Tracked "MVar.new" boxDirect + . mkForeign $ \(c :: Closure) -> newMVar c + declareForeign Tracked "MVar.take" boxToEFBox + . mkForeignIOF $ \(mv :: MVar Closure) -> takeMVar mv +``` + +These lines do multiple things at once. The first argument to +`declareForeign` determines whether the function should be explicitly +tracked by the Unison Cloud sandboxing functionality or not. As a +general guideline, functions in `{IO}` are `Tracked`, and pure +functions are `Untracked`. The second argument must match the name +from `Unison.Builtin`, as this is how they are associated. The third +argument is wrapper code that defines the conversion from the Haskell +runtim calling convention into Unison, and the definitions for these +two cases will be shown later. The last argument is the actual Haskell +implementation of the operation. However, the format for foreign +functions is somewhat more limited than 'any Haskell function,' so the +`mkForeign` and `mkForeignIOF` helpers assist in wrapping Haskell +functions correctly. The latter will catch some exceptions and yield +them as explicit results. + +The wrapper code for these two operations looks like: + +``` haskell +-- a -> b +boxDirect :: ForeignOp +boxDirect instr = + ([BX],) + . TAbs arg + $ TFOp instr [arg] + where + arg = fresh1 + +-- a -> Either Failure b +boxToEFBox :: ForeignOp +boxToEFBox = + inBx arg result $ + outIoFailBox stack1 stack2 stack3 any fail result + where + (arg, result, stack1, stack2, stack3, any, fail) = fresh +``` + +The breakdown of what is happening here is as follows: + + - `instr` is an identifier that is used to decouple the wrapper + code from the actual Haskell implementation functions. It is + made up in `declareForeign` and passed to the wrapper to use as a + sort of instruction code. + - A `ForeignOp` may take many arguments, and the list in the tuple + section specifies the calling convention for them. `[BX]` means + one boxed argument, which in this case is the value of type `a`. + `[BX,BX]` would be two boxed arguments, and `[BX,UN]` would be + one boxed and one unboxed argument. Builtin wrappers will + currently be taking all boxed arguments, because there is no way + to talk about unboxed values in the surface syntax where they are + called. + - `TAbs arg` abstracts the argument variable, which we got from + `fresh1'` at the bottom. Multiple arguments may be abstracted with + e.g. `TAbss [x,y,z]`. You can call `fresh` to instantiate a tuple of + fresh variables of a certain arity. + - `inBx` and `outIoFailBox` are helper functions for calling the + instruction and wrapping up a possible error result. + - `TFOp` simply calls the instruction with the assumption that the + result value is acceptable for directly returning. `MVar` values + will be represented directly by their Haskell values wrapped into + a closure, so the `boxDirect` code doesn't need to do any + processing of the results of its foreign function. + +The names of the helpers generally follow a form of form of Hungarian +notation, e.g. `boxToEFBox` means "boxed value to either a failure or +a boxed value", i.e. `a -> Either a b`. +However, not all helpers are named consistently at the moment, and +different builtins use slightly different implementations, so looking +at other parts of the file may be instructive, depending on what is +being added. + +At first, our declarations will cause an error, because some of the +automatic machinery for creating builtin 'foreign' functions does not +exist for `MVar`. To rectify this, we can add a `ForeignConvention` +instance in `Unison.Runtime.Foreign.Function` that specifies how to +automatically marshal `MVar Closure`, which is the representation +we'll be using. + +``` haskell +instance ForeignConvention (MVar Closure) where + readForeign = readForeignAs (unwrapForeign . marshalToForeign) + writeForeign = writeForeignAs (Foreign . Wrap mvarRef) +``` + +This takes advantage of the `Closure` instance, and uses helper +functions that apply (un)wrappers from another convention. + +With these in place, the functions should now be usable in the new +runtime. + +## Decompilation + +If it makes sense for an added type, it is possible to add to Unison's +ability to decompile runtime values or test for universal +equality/ordering. Directly embedded Haskell types are wrapped in the +`Foreign` type, and are decompiled in `Unison.Runtime.Decompile` using +the `decompileForeign` function. For instance, `Text` is decompiled in +the case: + +``` haskell + | Just t <- maybeUnwrapBuiltin f = Right $ text () t +``` + +Further cases may be added using the `maybeUnwrapBuiltin`, which just +requires adding an instance to the `BuiltinForeign` class in +`Unison.Runtime.Foreign`, specifying which builtin reference +corresponds to the type. + +## Transcripts + +One last thing remains. The additional builtin operations will have +changed some of the transcript output. The transcript runner should be +executed, and modified files should be checked and committed, so that +CI tests will pass (which check transcripts against an expected +result). diff --git a/unison-src/transcripts/project-outputs/docs/branchless-scratch.output.md b/unison-src/transcripts/project-outputs/docs/branchless-scratch.output.md new file mode 100644 index 0000000000..cbcef53ae6 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/branchless-scratch.output.md @@ -0,0 +1,54 @@ +### Remembering local/remote codetree associations? + +``` haskell +-- Designates remote paths to sync local paths against +newtype RemoteMap = RemoteMap { toMap :: Map (Path, RemoteName) RemotePath } +``` + +If I have some branch (tree node) that I want to sync with github on an ongoing basis. e.g. `/projects/foo` to `github:aryairani/foo` — that becomes a place I can publish to or pull from, how should I associate the two? If I + +If I associate it by path, then what should happen when I move or copy the node in the tree? What do I have to update to make that happen? + +What happens if I associate it by `Causal` hash? + +``` +# parenthesized hashes represent the branch hash + +/projects (mZm)> remote.set github:user/foo foo + Set remote github:user/foo for /projects/foo (0e9). +``` + +/projects/foo (0e9) linked to github:user/foo + +``` +/projects (mZm)> cp foo foo-fork +/projects (wkP)> cd foo-fork +/projects/foo-fork (0e9)> add myFunc + Added myFunc. +/projects/foo-fork (p3z)> + +Should now have: +/projects/foo (0e9) linked to github:user/foo +/projects/foo-fork (p3z) linked to github:user/foo +``` + +``` +# types +.unison/types//compiled.ub +.unison/types//dependents/ +.unison/types/_builtin//dependents/ +# terms +.unison/terms/_builtin//dependents/ +.unison/terms//compiled.ub +.unison/terms//type.ub +.unison/terms//dependents/ +# branches +.unison/branches/.ubf +.unison/branches/head/ -- if several, merge entries to produce new head. +# edits +.unison/edits// +.unison/edits//name/ -- (base58encode (utf8encode "name of the edit")) +.unison/edits//head/ -- if several, merge entries +# remotes +.unison/remotes/ +``` diff --git a/unison-src/transcripts/project-outputs/docs/branchless.output.md b/unison-src/transcripts/project-outputs/docs/branchless.output.md new file mode 100644 index 0000000000..ed371b16b1 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/branchless.output.md @@ -0,0 +1,656 @@ +----- + +### Dependents + +The reason we keep track of dependents is for the `todo` calculation. When we make an edit, what are the things that need to be updated as a result? + +When adding term `a` that depends on "derived" term `b` or type `B`, then a change to `b` or `B` affects `a`, so we record that `a` is a dependent of `b` and `B`. + +When adding type `A` that depends on type `B`, a change to `B` affects `A`, so we record that `A` is a dependent of `B`. + +We don't do anything for constructors, because constructors don't change. Depending on the constructor really means you depend on the type that constructor comes from. (i.e. a constructor doesn't have dependents.) Similarly, constructor doesn't have dependencies, but its declaring type may depend on other types. + +----- + +Commands + +``` +/> cd libs/Foo +/libs/Foo> cd .. +/libs> fork Foo Foo2 +/libs> fork thing +/libs> fork Foo /outside/Foo +/libs> fork /outside/Foo /outside/Foo2 +/libs> help merge + `> merge src dest` +/libs> merge /outside/Foo Foo +/libs> merge Foo2 Foo + +/libs/Foo> +/libs> move /libs/Foo /libs/Foo' +/libs> + +A.B.c +A.B.d + +arya renames, and has: -> +A.Z.c +A.Z.d + +paul adds, and has -> +A.B.e +A.B.c +A.B.d + +then merge -> +"Merge introduces the following aliases:" +A.Z.c -> A.B.c +A.Z.d -> A.B.d + +/libs> delete /libs/Foo +"warning: /libs/Foo includes the following definitions that aren't anywhere else: + + A.B.e#123 + +run it again to proceed with deletion" + +/libs> alias /libs/Foo/sqrt /libs/Foo2/butt +-- we talked about combining alias & fork into a single "copy" command +/libs> +``` + +Weird thing: There's no history for `sqrt`\! + +Suppose: + +``` +data Raw = Raw + { _termsR :: Set Referent + , _typesR :: Set Reference + , _childrenR :: Map NameSegment Hash + } +``` + +``` +/libfoo/Foo <- type +/libfoo/Foo <- constructor +/libfoo/Foo.f <- term in child namespace + +/libfoo> move Foo Foo2 +/libfoo> alias Foo Foo2 +``` + +``` + +``` + +## Data types: + +Old **PrettyPrintEnv** is for pretty-pretting code, and \_\_\_ + +``` haskell +{ terms :: Referent -> Maybe HashQualified +, types :: Reference -> Maybe HashQualified } +``` + +Q: How do we want to handle lookup of names that are outside of our branch? + +Old **Namespace** + +``` haskell +{ _terms :: Relation Name Referent +, _types :: Relation Name Reference } +``` + +Old **Names** is an unconflicted **Namespace**. is for parsing code? Not sufficient to parse hash-qualified names. + +``` haskell +{ termNames :: Map Name Referent +, typeNames :: Map Name Reference } +``` + +New **Names** combines old **PrettyPrintEnv** and old **Names**: + +``` haskell +-- these HashQualified are fully qualified +{ terms :: Relation HashQualified Referent +, types :: Relation HashQualified Reference } +``` + +We should be able to construct one from a `Codebase2`, given: + +``` haskell +root :: Branch +current :: Branch +terms :: Set HashQualified +types :: Set HashQualified +``` + +or + +``` haskell +root :: Branch +current :: Branch +terms :: Set Referent +types :: Set Reference +``` + +### Needed functionality + +Parsing a .u file: + + - Look up a Reference by name + + - Look up a Reference by hash-qualified name? We could avoid this by requiring that the user deconflict the names before parsing. + +Parsing command-line arguments: + + - Look up a Reference by name. + + - Look up a Reference by hash-qualified name (possibly from among deleted names); for resolving conflicted names and edits. + + ``` + /foo> todo + + These names are conflicted: + foo#abc + foo#xyz + Use `rename` to change a names, or `unname` to remove one. + + These edits are conflicted: + bar#fff -> bar#ggg : Nat (12 usages) + bar#fff -> bar#hhh : Nat -> Nat (7 usages) + bar#fff (Deprecated) + + Use `view bar#ggg bar#hhh` to view these choices. + Use `edit.resolve` to choose a canonical replacement. + Use `edit.unreplace` to cancel a replacement. + Use `edit.undeprecate` to cancel a deprecation. + Use `edit.replace bar#hhh bar#ggg` to start replacing the 7 usages of `bar#hhh` with `bar#ggg`. + + /foo> alias bar baz + + Not sure which bar you meant? + bar#ggg + bar#hhh + Try specifying the hash-qualified name, or sort out the conflicts before + making the alias. + ``` + + ``` + /foo> edit.resolve bar#fff bar#ggg + + Cleared bar#fff -> bar#hhh + Added bar#ggg -> bar#hhh + ``` + + or + + ``` + /foo> edit.unreplace bar#fff bar#ggg + + Cleared bar#fff -> bar#ggg + ``` + +Pretty-printing: + + - Select a name by Reference + +Q: What to do about names outside the current branch? + +Option 1: Don't support names outside the current branch; user must go up a level (possibly to the root), set up the names as desired, and then descend again. + +Option 2: Introduce some syntax for names outside the current branch, e.g. `_root_.Foo.bar`. We could first lookup references in the current branch, then in the root branch, then in the history of the root branch? + +## TODO tracking refactoring of existing functionality + + - \[ \] Add edits/patches to Namespace / Branch + + - \[ \] Add patch to `NameTarget` + + - \[ \] rename `propagate` to `patch` + + - moves names from old hash to new hash, transitively, to the type-preserving frontier + + - \[ \] `list [path]` + + - ~~by default, don't descend into links with names that start with `_`~~ + + - \[ \] `todo [path]` + + - list conflicted names (hash-qualified) and edit frontier + + - \[ \] `update [path]` + + - ~~when updating a term, old names goes into `./_archived`, which will be largely conflicted.~~ + + - \[ \] `propagate [path]` + + - \[ \] `edit.resolve ` + + - +Old names use case 1: + +``` +patch: +#a -> #b +#a -> #c + +namelookup: +#b -> "foo" +#c -> "foo2" + +"You have a conflicted edit: + #a -> foo#b + #a -> foo2#c + Please choose one. +" + +/pc/libs/x> edit.resolve #a foo#b +``` + +You're in the middle of an edit, it's not type preserving + + - \[ \] `rename / move` + + - \[ \] `rename.edits` + - \[ \] `rename.type` + - \[ \] `rename.term` + + - \[ \] name / copy `copy <[src][#hash]> ` + + - \[ \] `todo [path]`, `update [path]`, `propagate [path]` + + - \[x\] Implement `Branch.sync` operation that synchronizes a monadic `Branch` to disk + + - \[x\] Implement something like `Branch.fromDirectory : FilePath -> IO (Branch IO)` for getting a lazy proxy for a `Branch` + + - Also `Branch.fromExternal : (Path -> m ByteString) -> Hash -> m (Branch m)` + - Could we create a `Branch` from a GitHub reference? Seems like yeah, it's just going to do some HTTP fetching. + + - \[x\] Tweak `Codebase` to `Codebase2` + + - \[x\] Implement a `Codebase2` for `FileCodebase2` + + - \[ \] Implement `Actions2` + + - \[ \] Implement `Editor2` + + - \[ \] Implement `OutputMessages2` + + - \[ \] Implement `InputPatterns2` + + - \[ \] Go back and leave a spot for Link in serialized Branch0 format. + + - \[ \] Split Edits out of `Branch0` + + - \[ \] Delete `oldNamespace`, and instead add deprecated names + + - \[ \] Parsing takes a `Names`, a map from `Name`(fully-qualified name) to `Referent`/`Reference`. We should switch these from `Map` to `Name -> Optional xxx`, or even `Name -> m (Optional xxx)` + + - \[ \] `Context.synthesizeClosed` takes a `TypeLookup`, which includes a map from `Reference` to `Type`, `DataDecl`, `EffectDecl`. Shall we plan to include the full codebase here, or load them on demand? Maybe it doesn't matter yet. + + - `parseAndSynthesizeFile` takes a `Set Reference -> m (TypeLookup v Ann)`, maybe that's a good model. + + - \[ \] `add` and `update` will need a way to update the `Branch'` at the current level, and all the way back to the root. Some kind of zipper? + + - \[ \] `find` takes an optional path + + - \[ \] `fork` takes a `RepoPath` (or we could have a dedicated command like `clone`) + + - \[ \] `merge` takes at least a path, if not a `RepoPath` + + - \[ \] `publish` or `push`that takes a local path and a remote path? + +## Branchless codebase format + +## Commands / Usage + +``` +/> clone gh:aryairani/libfoo + Copied gh:aryairani/libfoo blah blah to /libfoo +/> undo +/> clone gh:aryairani/libfoo /libs/DeepLearning/Foo + Copied gh:aryairani/libfoo blah blah to /libs/DeepLearning/Foo +/> +``` + +`clone [path]` + +`push [path] ` + +``` +/> cd projects +/projects> rename FaceDetector FaceDetector/V1 +/projects> cd FaceDetector +/projects/FaceDetector> cp V1 V2 +``` + +`cd ` — support relative paths? + +`cp ` + +``` +/projects/FaceDetector> replace.scoped V2 /libs/DeepLearning/Foo/thing1 mything1 + + Noted replacement of thing1#af2 with mything#i9d within /projects/FaceDetector/V2. +``` + +``` +replace.write +todo + +``` + +``` +/projects/FaceDetector> todo + ...7 things... +/projects/FaceDetector> todo / + ...33 things... +/projects/FaceDetector> +``` + +`mv` / `rename` command: can refer to Terms, Types, Directories, or all three. Use hash-qualified names to discriminate. + +## Namespaces + +``` haskell +data Branch' m = Branch' (Causal m Namespace) + +data Causal m e + = One { currentHash :: Hash, head :: e } + | Cons { currentHash :: Hash, head :: e, tail :: m (Causal e) } + -- The merge operation `<>` flattens and normalizes for order + | Merge { currentHash :: Hash, head :: e, tails :: Map Hash (m (Causal e)) } + +-- just one level of name, like Foo or Bar, but not Foo.Bar +newtype NameSegment = NameSegment { toText :: Text } -- no dots, no slashes +newtype Path = Path { toList :: [NameSegment] } + +data Namespace m = Namespace + { terms :: Relation NameSegment Referent + , types :: Relation NameSegment Reference + , children :: Relation NameSegment (Branch' m) + } +``` + +**Repo format:** + +``` +# types +.unison/types//compiled.ub +.unison/types//dependents/ +.unison/types/_builtin//dependents/ + +# terms +.unison/terms//compiled.ub +.unison/terms//type.ub +.unison/terms//dependents/ +.unison/terms/_builtin//dependents/ + +# branches (hashes of Causal m Namespace) +.unison/branches/.ubf +.unison/branches/head/ -- if several, merge to produce new head. +``` + +### Backup Names? + +For pretty-printing, we want a name for every hash. Even for hashes we deleted the names for. 😐 + + - When we delete a name `x` from path `/p` (i.e. `/p/x`), we add the name `/_deleted/p/x`. + + - Or, do we just disallow removing the last name of things with dependencies? + + - When deleting a name, notify the user of the remaining names. + +## Edits + +``` haskell +newtype EditMap = EditMap { toMap :: Map GUID (Causal Edits) } + +data Edits = Edits + { terms :: Relation Reference TermEdit + , types :: Relation Reference TypeEdit + } + +type FriendlyEditNames = Relation Text GUID +``` + +**Repo format:** + +``` +.unison/edits// +.unison/edits//name/ -- (base58encode (utf8encode "name of the edit")) +.unison/edits//head/ -- if several, merge to produce new head. +``` + +### TODO: How to share these edits? + + - It could be the same as sharing Unison names (e.g. if the edits were Unison terms) + - It could be the same as sharing Unison definitions: + Make up a URI that references a repo and an edit GUID. + e.g. `https://github.com///<...>/[/hash]` + - `clone.edits [local-name]` + - `guid` comes from remote-url, and is locally given the name `local-name` + - if `local-name` is omitted, then copy name from `remote-url`. + - if `local-name` already exists locally with a different `guid`, then abort. + +### Editsets as first-class unison terms: + +Benefits: + + - Don't have two separate dimensions of forking and causality (namespace vs edits). + - Makes codebase model way simpler to explain. \<— BFD + +Costs / todo: + +Q: Do we allow users to edit `EditSets` using standard `view` and `edit` in M1? + +If Yes: + + - EditSets are arbitrary Unison programs that need to be evaluated. Once evaluated, they would have a known structure that can be decomposed for EditSet operations. We would need: + + - - \[ \] some new or existing syntax for constructing EditSet values + - \[x\] a way to evaluate these unison programs + - \[ \] a way to save evaluated results back to the codebase / namespace + - Q: Do we evaluate and save these eagerly or lazily? + - \[ \] a way in Haskell to deconstruct the EditSet value + - \[ \] a way to modify (append to) values of that type using CLI commands. e.g. `update` ? + - either `update` calls a unison function that + +If no (we don't provide user syntax for constructing `EditSets` in .u file): + + - EditSets are part of the term language? + - Or a constructor with a particular hash? (Applied to Unison terms) + +## Collecting external dependencies + +If a subtree references external dependencies, they should be given local names when exporting. + +Given: + +``` +/A/B/c#xxx +/D/E/f#yyy (depends on #xxx, #zzz) +/D/G/h#zzz +/libs/G/bar#zzz +``` + +If `/D/E` is published, what names should be assigned to `#xxx`, `#zzz`? + +### Idea 1: Names relative to nearest parent + +Collect external dependencies under `Dependencies`, using names relative to the nearest parent in common with the publication point? + +i.e.: + +``` +f#yyy +Dependencies/A/B/C#xxx +Dependencies/G/h#zzz +``` + + + + + +### Idea 2: Somehow derive from qualified imports used? + +If + +### Idea 3: Surface the condition\* to the user + +\*the condition = the publication node contains definitions that reference definitions not under the publication node. + +Ask them to create aliases below the publication point? + +### Idea 4: Add external names to `./_auxNames/` + +The nearest aux-name would only be used to render code only if there were no primary names known. + +### Idea 5: Something with symlinks + +``` haskell +data Branch' m = Branch' (Causal m Namespace) + +data Causal m e + = One { currentHash :: Hash, head :: e } + | Cons { currentHash :: Hash, head :: e, tail :: m (Causal m e) } + -- The merge operation `<>` flattens and normalizes for order + | Merge { currentHash :: Hash, head :: e, tails :: Map Hash (m (Causal m e)) } + +-- just one level of name, like Foo or Bar, but not Foo.Bar +newtype NameSegment = NameSegment { toText :: Text } -- no dots, no slashes +newtype Path = Path { toList :: [NameSegment] } + +data Namespace m = Namespace + { terms :: Relation NameSegment Referent + , types :: Relation NameSegment Reference + , children :: Relation NameSegment (Link m) + } + +data Link m = LocalLink (Branch' m) | RemoteLink RemotePath +data RemotePath = Github { username :: Text, repo :: Text, commit :: Text } -- | ... future +``` + +This lets us avoid redistributing libs unnecessarily — let the requesting user get it from wherever we got it from. But it doesn't specifically address this external naming question. + +We might be publishing `/app/foo` which references definitions we got from `repo1`. Somewhere in our tree (possibly under `/app/foo` and possibly not?) we have a link to `repo1`. + +Somewhere under `/app/foo` we reference some defn from `repo1`. + +Transitive publication algorithm: + + - find all the things that you're referencing + - the things you're publishing that aren't under the pbulication point need to be resolved + - they're local, and need to be given names under the publication point + - user is notified, or we do something automatic + - they're remote, and we need to include, in the publication, a link to the remote repo. + - user is notified, or we do something automatic + - "Something automatic" will be: + - mirror the dependency names from our namespace into `./_Libs`; if it would produce naming conflicts to use `./_Libs`, then `_Libs1`, etc. + - Or, just dump them into `./_Libs` and if doing so produces naming conflicts, force the user to resolve them before publishing. + +## Syncing with remote codetrees + +``` haskell +-- names tbd +data BranchPath = BranchPath RepoRef Path +data RepoRef = Local | GithubRef { username :: Text, repo :: Text, treeish :: Text } + +``` + +``` +/libs/community/DL +``` + +becomes +​\`\`\`haskell +BranchPath Local (Path \["libs","community","DL"\]) + +``` + + + +``` + +gh:/\[/\]\[?ref=\] -- defaults to repo's `default_branch` + +e.g. gh:aryairani/unison/libs?ref=topic/370 + +```` +becomes +​```haskell +BranchPath (GithubRef "aryairani" "unison" "topic/370") (Path ["libs"]) +```` + +or + +``` +gh:user/repo[:treeish][/path] + +e.g. github:aryairani/unison:topic/370/libs +``` + +becomes + +``` haskell +BranchPath (GithubRef "'aryairani" "unison" "topic/370") (Path ["libs"]) +``` + +## Github Notes + +Github uses a few different URL schemes. They call the ones you can pluck off their website "html\_url"s. They let you refer to files and directories, and can be parameterized by git *treeish* (branch, tag, commit). + +We can interpret these to refer to the root of a namespace. https://github.com/unisonweb/unison can be interpreted as: + +``` haskell +GithubRef "unisonweb" "unison" <$> getDefaultBranch "unisonweb" "unison" +``` + +The Github website will let you navigate to a git branch, e.g https://github.com/unisonweb/unison/tree/topic/370/ can be interpreted as: + +``` haskell +GithubRef "unisonweb" "unison" <$> matchBranch "unisonweb" "unison" "topic/370/" +``` + +Branch names can contain slashes, such as `topic/370`, complicating parsing if there's meant to be path info following the branch name. + +1. Fortunately, if you have a git branch `a/b` then it's not possible to create branches `a` or `a/b/c`. So you can load the [list of branches](https://api.github.com/repos/unisonweb/unison/branches) from JSON, and then test them against that treeish-prefixed path without ambiguity. +2. Github's website doesn't know how to navigate into `Causal` structures, so it's never going to give us URLs with paths into a Unison namespace. So maybe this is a moot point. + +So, I would still go ahead with the made-up `gh:username/repo[:treeish][/path]` URI scheme; we can try to support the other URLs mentioned above, and let them refer to the root of the published namespace. + +Our Javascript viewer can be made to create URLs with query params or fragments in them that can indicate the Unison path, and those can be the ones we share in tweets, etc: + +http(s)://.github.io/?branch=\&path= with the default branch being the head, and the default path being `/`. + +``` + + +``` diff --git a/unison-src/transcripts/project-outputs/docs/codebase-editor-design.output.md b/unison-src/transcripts/project-outputs/docs/codebase-editor-design.output.md new file mode 100644 index 0000000000..8d3f24f0f0 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/codebase-editor-design.output.md @@ -0,0 +1,511 @@ +Note: initial draft, probably a lot of rough edges. Comments/questions/ideas are welcome\! + +# Editing a Unison codebase + +The Unison codebase is not just a mutable bag of text files, it's a structured object that undergoes a series of well-typed transformations over the course of development, yet we can still make arbitrary edits to a codebase. The benefits of the Unison approach which we'll see are: + + - Incremental compilation is perfectly precise and comes for free, regardless of what editor you use. You'll almost never spend time [waiting for Unison code to compile](https://xkcd.com/303/), *no matter how large your codebase*. + - Refactoring is a controlled experience where the refactoring always typechecks and you can precisely measure your progress, so arbitrary changes to a codebase can be completed without ever dealing with a depressingly long list of (often misleading) compile errors or broken tests\! + - Codebase changes can be worked on concurrently by multiple developers, and many situations that traditionally result in incidental merge conflicts or build issues can no longer occur. (e.g., Alice swapped the order of two definitions in a file, conflicting with Bob's adding an unrelated definition.) + - Renames, even bulk renames of whole packages of definitions, are 100% accurate and fast. When it's this easy to rename things, there's less anxiety about picking names and less need to pick the perfect name at the moment you start writing something. + - We can assign multiple names to the same definitions, and you can choose which naming you prefer and publish your naming schemes for others to use if they wish. [Bikeshedding](http://bikeshed.com/) over names can be a thing of the past (or at least vastly reduced 😀). + - Dependency hell is also vastly reduced: many situations that contribute to dependency hell simply cannot arise with the Unison codebase model. + - As an added bonus, it's no problem to use different versions of some library in different parts of your application when convenient, just as you might use two unrelated libraries in your application. + - It's easy to mix and match parts of different libraries into a custom bundle, which others can use, all while retaining full compatibility with the existing libraries that the bundle draws from. + - Publishing code is trivial; it won't require any additional steps beyond pushing to a git repository or shared filesystem. (Other filesystem-like services can be supported in the future.) + - Import statements are first-class values which can be shared and aggregated and published for consumption by others. No more project-wide import boilerplate at the top of every file\! + - And this is all done in a backwards compatible way using existing tools: you can still use your favorite text editor, can still version your code with Git, use GitHub, etc. + +Warning: once you experience this mode of editing a codebase and the control, safety, and ease of it, the "mutable bag of text files" model of a codebase may start to seem barbaric in comparison. 😱 + +## The big idea 🧠 + +Here it is: *Unison definitions are identified by content.* Therefore, there's no such thing as changing a definition, there's only introducing new definitions. What can change is how we map definitions to human-friendly names. e.g. `x -> x + 1` (a definition) vs `Integer.increment` (a name we associate with it for the purposes of writing and reading other code that references it). An analogy: Unison definitions are like stars in the sky. We can discover new stars and create new star maps that pick different names for the stars, but the stars exist independently of what we choose to call them. + +With this model, we don't ever change a definition, nor do we ever change the mapping from names to definitions (we call such mappings "namespaces"). A namespace is simply another kind of definition. Like all definitions, it is immutable. When we want to "change" a namespace, we create a new one, and *change which namespace mapping we are interested in*. This might seem limited, but it isn't at all, as we'll see. + +From this simple idea of making definitions (including definitions of namespaces) immutable, we can build a better development experience around codebase editing with all of the above benefits. + +## The model + +This section gives the model of what a Unison codebase is and gives its API. Later we'll cover what the actual user experience is for interacting with the model, along with various concrete usage scenarios. The model deals with a few types, `Code`, `Codebase`, `Release`, and `Branch`: + + - `Code` could be a function or value definition (a `Term`) or a `TypeDeclaration`. Each `Term` in the `Codebase` also includes its `Type`. A Unison codebase contains no ill-typed terms. Each `Code` also knows its `Author` and `License`, which are just terms. + - `Namespace` denotes a `Map Name Code`. It defines a subset of the universe of possible Unison definitions, along with names for these definitions. (The set of definitions it talks about is just the set of values of this `Map`.) + - `Release` denotes a `Namespace -> Namespace`. It provides a function for "upgrading" from old definitions, and the "current" `Namespace` can be obtained by giving the `Release` the empty `Namespace`. + - `Branch` denotes a `Causal (Map Code (Conflicted CodeEdit, Conflicted NameEdits))`, which comes equipped with a commutative `merge` operation and can be converted to a `Release` assuming no conflicts. A `Branch` represents a `Release` "in progress". We discuss the `Causal` and `Conflicted` types later. + - `Codebase` denotes a `Set Code`, a `Map Name Branch` of named branches, and a `Map Name Release` of named releases. + +A `Release` can be sequenced with another `Release`: + +``` haskell +sequence : Release -> Release -> Release +sequence up1 up2 nsi = Map.unionWith const (up2 . up1 $ nsi) (up1 nsi) +``` + +A `Branch` has two important operations: + + - A commutative `merge` operation for combining concurrent edits. + - An associative `sequence` operation for sequencing edits. + +`Causal a` has 5 operations, specified algebraically here (we give an implementation later): + + - `before : Causal a -> Causal a -> Bool` defines a partial order on `Causal`. + - `head : Causal a -> a`, which represents the "latest" `a` value in a causal chain. + - `one : a -> Causal a`, satisfying `head (one hd) == hd` + - `cons : a -> Causal a -> Causal a`, satisfying `head (cons hd tl) == hd` and also `before tl (cons hd tl)`. + - `merge : CommutativeSemigroup a => Causal a -> Causal a -> Causal a`, which is associative and commutative and satisfies: + - `before c1 (merge c1 c2)` + - `before c2 (merge c1 c2)` + - `sequence : Causal a -> Causal a -> Causal a`, which is defined as `sequence c1 c2 = cons (head c2) (merge c1 c2)`. + - `before c1 (sequence c1 c2)` + - `head (sequence c1 c2) == head c2` + +Question: can we give a simple denotation for `Causal a`? (That doesn't mention hashes or anything) + +Thought: `Causal` could also be a `Comonad` (in the category of commutative semigroups), where each value has access to the past history at each point. + +``` haskell +merge : Branch -> Branch -> Branch +merge = Causal.merge + +mergePickRight : Branch -> Branch -> Branch +mergePickRight b1 b2 = Causal.mergePickRight + +data Conflicted a = Conflicted (Set a) deriving Monoid via Set + +-- note: +instance (Semigroup v, Ord k) => Monoid (Map k v) where + mempty = Map.empty + m1 `mappend` m2 = Map.unionWith (<>) m1 m2 + +-- Add a new definition; if one already exists for that name, produce a conflict +add : Name -> Code -> Branch +add n c = step (Map.insertWith (<>) n (Conflicted.one c)) + +-- Add or replace a definition, clobber any existing definitions for given name +set : Name -> Code -> Branch +set n c = step (Map.insert n (Conflicted.one c)) + +step : (a -> a) -> Causal a -> Causal a +step f c = f (head c) `cons` c + +deleteName : Name -> Branch +deleteName n = step (Map.delete n) + +deleteCode : Code -> Branch +deleteCode c = step (Map.filterValues (/= c)) +``` + +Here's `Codebase` and `Code` types: + +``` haskell +data Codebase = + Codebase { code : Set Code + , branches : Map Name Branch + , releases : Map Name Release } + +-- All code knows its dependencies, author, and license +Code.dependencies : Code -> Set Code +Code.author : Code -> Author +Code.license : Code -> License +``` + +### Implementation + +Now that we've given the denotation, here's some ideas for implementation: + +``` haskell +-- A branch can have unresolved conflicts, and we maintain some +-- history to help merge branches, respecting causality +data Branch' = Branch' + { namespace :: Map Code (Conflicted NameEdits) + , edited :: Map Term (Conflicted Edit) + , editedTypes :: Map TypeDeclaration (Conflicted TypeEdit) } + +data Branch = Branch (Causal Branch') + +-- A release doesn't have history or conflicts. +data Release' = Release' + { namespace :: Map Name Code + , edited :: Map Term Edit + , editedTypes :: Map TypeDeclaration TypeEdit } + +data Release = Release (Causal Release') + +data Conflicted a = One a | Many (Set a) + +instance Eq a => Semigroup (Conflicted a) where + One a <> One a2 = if a == a2 then One a else Many (Set.fromList [a,a2]) + One a <> Many as = Many (Set.add a as) + Many as <> One a = Many (Set.add a as) + Many as <> Many as2 = Many (as `Set.union` as2) + +data Edit = Replace Term Typing | Deprecated | .. -- SwapArguments Permutation, etc +data TypeEdit = Replace TypeDeclaration | Deprecated +data NameEdits = NameEdits { adds :: Set Code, removes :: Set Code } +data Typing = Same | Subtype | Different + +merge :: Branch -> Branch -> Branch +merge (Branch b1) (Branch b2) = Branch (Causal.merge b1 b2) + +-- produces a release if the branch is not conflicted +Branch.toRelease :: Branch -> Either Conflicts Release +Release.toBranch :: Release -> Branch +Release.toBranch = ... -- trivial, just promoting a to `Causal (Conflicted a)` +``` + +A couple notes: + + - The `Typing` indicates whether the replacement `Code` is the same type as the old `Code`, a subtype of it, or a different type. This is useful for knowing how far we can automatically apply changes in a `Branch`. + - The `Edit` type produces a `Conflict` when merged, though with more structured edits (*e.g.*, in the case of the `SwapArguments` data constructor), even more could be done here. + - A common workflow will be grabbing a release and then applying it to a branch you have in progress. There are some choices about how you do this: + - You can `sequence` the release into your branch, either before or after your existing changes. If you `sequence` the release *before* your changes, then any edits to the same `Code` will keep your version. Etc. + - You can `merge` the release into your branch, which can result in conflicts that you can then resolve however you like. + - You can break apart a release `Branch` and cherry-pick elements of the release, making different `sequence` / `merge` decisions on even a per-definition basis. It would be interesting to try to come up with some UX for doing this that isn't totally overwhelming for the user. + +Here's the `Causal` type, which is used above in `Branch`: + +``` haskell +newtype Causal e + = One { currentHash :: Hash, head :: e } + | Cons { currentHash :: Hash, head :: e, tail :: Causal e } + | Merge { currentHash :: Hash, head :: e, tail1 :: Causal e, tail2 :: Causal e } + +instance Semigroup e => Semigroup (Causal e) where + Causal a1 h1 <> Causal a2 h2 + | before h1 h2 = Causal a2 h2 + | before h2 h1 = Causal a1 h1 + | otherwise = Causal (a1 <> a2) (h1 `merge` h2) + +one :: Hashable e => e -> Causal e +one e h = One (hash e) e + +cons :: Hashable e => e -> Causal e -> Causal e +cons e tl = Cons (hash e <> currentHash tl) e tl + +merge :: (Hashable e, Semigroup e) => Causal e -> Causal e -> Causal e +merge h1 h2 | h1 `before` h2 = h2 + | h2 `before` h1 = h1 + | otherwise = Merge (currentHash h1 <> currentHash h2) (head h1 <> head h2) h1 h2 + +sequence :: Hashable e => Causal e -> Causal e -> Causal e +sequence a (One h e) = cons e a +sequence a (Cons h e tl) = cons e (sequence a tl) +sequence a (Merge h e l r) = merge e (sequence a l) r +-- note: if causal had a `split` operation, we'd need to sequence on both sides + +-- Does `h2` incorporate all of `h1`? +before :: Causal e -> Causal e -> Bool +before h1 h2 = go (currentHash h1) h2 where + go h1 (One h _) = h == h1 + go h1 (Cons h _ tl) = h == h1 || go h1 tl + go h1 (Merge h _ left right) = h == h1 || go h1 left || go h1 right +``` + +Operations on a `Branch`: + + - `add` a `Name` and associated `Code` to a `Branch`. + - `rename name1 name2`, checks that `name2` is available, and if so does the rename. + - `update oldcode oldnameafter newcode newname`, check that `newname` is available, if so add it to `edited` map. `oldcode` will be referred to using some fully-qualified name. `oldnameafter` will be the name for `oldcode` after the update, just like for `deprecate`. + - `deprecate oldcode newname` marks `oldcode` for deprecation, with optional `newname`, also adds this to `edited` map. + - `empty` creates a `Branch 0 newGuid Map.empty Map.empty Map.empty`, satisfies `merge b empty ~= b` and `merge empty b ~= b`, where `~=` compares branches ignoring their `branchId`. + - `fork b == merge new-branch b` + +A branch is said to *cover* a `cb : Set Code` when it has been developed to the point that the remaining updates are type-preserving and can thus be applied automatically. More precisely, a Branch `c` covers a `cb : Set Code` when all dependents in `cb` of type-changing edits in `c` (including deprecations) also have an edit in `c`, and none of the edits are in a conflicted state. If we want to measure how much work remains for a Branch `c` to cover a `cb : Codebase`, we can count the transitive dependents of all *escaped dependents* of type-changing edits in `c`. An *escaped dependent* is in `cb` but not `c`. This number will decrease monotonically as the `Branch` is developed. + +*Related:* There are some useful computations we can do to suggest which dependents of the frontier to upgrade next, based on what will make maximal progress in decreasing the remaining work. The idea is that it's useful to focus first on the "trunk" of a refactoring, which lots of code depend on, rather than the branches and leaves. Programmers sometimes try to do something like this when refactoring, but it can be difficult to know what's what when the main feedback you get from the compiler is just a big list of compile errors. + +We also typically want to encourage the user to work on updates by expanding outward from initial changes, such that the set of edits form a connected dependency graph. If the user "skips over" nodes in the graph, there's a chance they'll need to redo their work, and we should notify the user about this. It's not something we need to prevent but we want the user to be aware that it's happening. + +Thought: we may want to prevent a merge of `source` into `target` unless `source` covers all the definitions in `target` (either in the `namespace` or in the values of the `edited` `Map`). The user could develop `source` until it covers `target`, then the two branches can be merged. Alternately, we could just allow the branches to exist in an inconsistent state and prompt the user to fix these inconsistencies. + +The `namespace` portion of a `Branch` can be built up using whatever logic the programmer wishes, including picking arbitrary new names for definitions, though very often, the names output by a `Branch` will be the same as or based on the names assigned to old versions of definitions. + +This is it for the model. The rest of this document focuses on how to expose this nice model for use by the Unison programmer. + +## The developer experience + +This section very much a work in progress. + +When writing code, a developer has full access to all code that's been written, just by using different imports. Here's a sketch of developer experience: + +``` +> branch scratch +There's no branch named 'scratch' yet. +Would you like me to create it and switch to it? y/n +> y +✅ I've created and switched to branch 'scratch'. + Note: `> branch` can be used to show the active branch. +> branch +'scratch' at version 0 +> watch foo.u +Watching foo.u for definitions to add to 'scratch' branch... +Noticed a change, parsing and typechecking... +🛑 I've found errors in 'foo.u', here's what I know: +... +✅ I've parsed and typechecked definitions in foo.u: `wrangle` + Would you like to add this to the codebase? y/n +> y +✅ It's done, using 'Alice' as author, Acme, Inc. as copyright holder, + license is BSD3 (your chosen defaults). Use `> help license` if you'd + like guidance on how to change any of this. +> branch +'scratch' at version 1 +> branch series/24 +✅ Switched to 'series/24' branch +> alias scratch.wrangle Acme.Alice.utils.wrangle +✅ I've marked a new definition 'Acme.Alice.utils.wrangle' for publication + in 'series/24' branch. +``` + +*Question:* what if `Acme.Alice.utils.wrangle` already exists in the 'series/24' branch? Unison reports a conflict and forces the user to pick a unique name: + +``` +> alias scratch.wrangle Acme.Alice.utils.wrangle +🛑 I'm afraid there's already a definition in this branch called 'Acme.Alice.utils.wrangle'. + You can either `> move Acme.Alice.utils.wrangle ` or choose + a different local name for `scratch.wrangle`. +``` + +Another possibility: the name already exists locally and is coincidentally bound to the exact same `Code`, in which case we get a warning: + +``` +> alias scratch.wrangle Acme.Alice.utils.wrangle +🔸 There was already a definition `Acme.Alice.utils.wrangle` which was + exactly equivalent to `scratch.wrangle`. +``` + +*Question:* what if `scratch.wrangle` also exists in this branch? If you're using `alias`, you are always referring to another branch as the first argument. You can't alias a definition in the current branch as that would mean that a `Code` in this branch no longer had a unique name. (Alternate answer: some special syntax to disambiguate referring to another branch, like `scratch:wrangle` or `scratch/wrangle`, though if we do that, we would need to disallow that separator in branch identifiers) + +*Question:* How does Alice test that her changes actually work? She probably needs to propagate them out as far as her tests, assuming that's possible. But we obviously don't want to be recompiling and regenerating binaries on every edit. *Answer:* The namespace of a branch refers to the latest version of everything, propagated as far as possible. Anything else has the prefix `old`. We achieve this just by keep a `Map Reference Reference` of type-compatible replacements which we then use in various places (such as the runtime) to do on-the-fly rewriting. + +*Question:* What about "third-party" dependencies? How do those fit in here? *Answer:* These are tracked with first-class imports. + +Assuming that is successful: + +``` +> delete branch scratch +✅ I've deleted the 'scratch' branch. +> git commit push +✅ I've committed and pushed 'series/24' updates (listed below) + to https://github.com/acme/acme + ... +``` + +It's not generally necessary to create a new branch every time, you can also just add definitions directly to the current base branch. + +The `> branch blah` command creates a new branch with no ancestors. You can also create branches whose ancestor is the current branch, which is useful for a refactoring that you eventually want to merge back into the current branch. + +``` +> fork major-refactoring +✅ I've created and switched to new branch 'major-refactoring'. + It's a child of branch 'series/24' version 29381. +> watch foo.u +... +✅ Added definition 'Acme.transmogrify' +> branch series/24 +✅ Switched to 'series/24' branch +> merge major-refactoring +✅ Updated 182 definitions, no conflicts +> save release/24 +✅ Saved 'series/24' as branch 'release/24' +``` + +Note that a `use release/24` in your Unison code can be used to access the namespace of a branch. + +### Publishing + +To publish something for use by others, users just share a URL that links to their GitHub repository. There's no separate step of creating some artifact like a jar and uploading that to some third-party package repository. That URL is something like `https://acme.github.io/unison/QjdBS8sdbWdj`, where the `QjdBS8sdbWdj` is a Base 58 encoding of a particular Unison hash. The GitHub repository format for Unison doubles as a GitHub pages site so anyone can explore the repository from that point, obtaining pretty-printed and hyperlinked source code, pretty HTML documentation, and so on. + +To start using someone else's published code, you can do a `get`: + +``` +> get https://acme.github.io/unison/QjdBS8sdbWdj +About to fetch 'https://acme.github.io/unison/release/24'. +choose a name for the namespace (suggest 'acme'): acme + +Fetching... + +✅ Loaded 1089 definitions into acme/release/24 + Use `> docs acme/release/24` +``` + +The URL here can point to a single definition, in which case it along with its transitive dependencies are added to the local codebase. In this case, it doesn't get a name, but you can refer to it by hash. Nameless code in the codebase probably records the URL where it was loaded from since that URL might have useful information about the hash. We might also by default look for `/docs-**.link` or something to fetch documentation. + +Alternately, we can juse `use` a release URL directly, as a namespace, without a `> get` happening first. Perhaps `use from `. `` includes the hash of the release, which is a Unison Term including the namespace itself and references to a bunch of code. This is downloaded, along with all of its transitive dependencies. The namespace is spliced into the current parsing environment according to the import expression of the `use` statement. + +Question: How do you discover new versions of hashes? (including hashes that refer to docs) + +**Note:** In the event of naming conflicts when doing a `get` (if you already have a branch with that name locally), Unison will force you to pick a different name. + +## Repository format + +A design goal of the repository format is that it can be versioned using Git (or Hg, or whatever), and there should never be merge conflicts when merging two Unison repositories. That is, Git merge conflicts are a bad UX for surfacing concurrent edits that the user may wish to reconcile. We use a few tricks to achieve this property: + + - Sets are represented by directories of immutable empty files whose file names represent the elements of the set - the sets are union'd as a result of a Git merge. Deletions are handled without conflicts as well. + - Likewise, maps are represented by directories with a subdirectory named by each key in the map. The content of each subdirectory represents the value for that key in the map. + - When naming files according to a hash of their content, git will never produce a conflict as a result of a `merge`. + +Here's a proposed repository representation: + +``` text +terms/ + jAjGDJnsdfL/ + compiled.ub -- compiled form of the term + type.ub -- binary representation of the type of the term + index.html -- pretty, hyperlinked source code of the term + reference-english-JasVXOEBBV8.link -- link to docs, in English + reference-spanish-9JasdfjHNBdjj.link -- link to docs, in Spanish + doc-english-OD03VvvsjK.link -- other docs + license-8JSJdkVvvow92.link -- reference to the license for this term + author-38281234jf.link -- link to the hash of the authors list +types/ -- directory of all type declarations + 8sdfA1baBw/ + compiled.ub -- compiled form of the type declaration + index.html -- pretty, hyperlinked source code of the type decl + reference-english-KgLfAIBw312.link -- reference docs + doc-english-8AfjKBCXdkw.link -- other docs + license-8JSJdkVvvow92.link -- reference to the license for this term + author-38281234jf.link -- link to + constructors/ + 0/type.ub -- the type of the first ctor + 1/type.ub -- the type of the second ctor +branches/ + branchGuid7/ + myAwesomeBranch.name + asdf8j23jd.ubf -- unison branch file, named according to its hash (so no conflicts), deserializes to a `Branch` +releases/ + releaseName1/ + asdf8j23jd.ur -- unison release file, named according to its hash, deserializes to a `Release` +``` + +Thought: might want to make `Release` representation more granular, so can pull out the namespace separate from the upgrade function. + +When doing a `git pull` or `git merge`, this can sometimes result in multiple `.ubf` files under a branch. We simply deserialize both `Branch` values, `merge` them, and serialize the result back to a file. The previous `.ubf` files can be deleted. + +Observation: we'll probably want some additional indexing structure (which won't be versioned) which can be cached on disk and derived from the primary repo format. This is useful for answering different queries on the codebase more efficiently. + +## Questions + +Some good questions from @atacratic: + +> What's a typical workflow, say for a few developers working on different topics? + +I think very similar to now in "masterless" development. You create `series/1` branch, branch topics off that and merge into it, cut `release/1`, then create `series/2`, etc. + +To cut a release: + + - Convert `series/1` to `release/1`. + - Create a new branch, `series/2`, which is *empty*. + - Start hacking on `series/2`, likely referencing things by name in `release/1` (`edit release/1/math.random` might be a thing you do to edit a definition from a prior release) + +Questions: + + - Maybe it's fine to just have an indefinitely-long running master branch and just cut releases off of that? This might be equivalent to sequencing all the releases that come before each release (maybe less flexible). + - Let's keep in mind that we might want to expose some simplified workflow for beginners so they aren't forced to learn about all this branch management stuff before even writing "hello world\!" + - Should be easy for advanced users too, no unnecessary juggling. + +> Where in the old ways people would have made a commit, do they now make a `Branch`? How do things proceed as we build up several of those for a topic? + +Same as now. You don't create a branch for every little change necessarily, though you could. You often just make changes to a branch directly. In terms of recording history, we can "git commit" whenever is convenient. + +> How does it work if you're editing "your" code as well as "other" people's code? + +Thought: You can reference any code in any release just with imports. You can also edit any code from any release, even from a release you didn't create. I suspect you'll want to give some qualified name to a definition that you edit which comes from another user's library. (For instance, I might republish a new version of `Runar.sort` under `Paul.patches.Runar.sort` in the branch I'm working on... and then I might contact `Runar` to get that change merged "upstream", something something...) + +> Where can they see their version history? Presumably not in the underlying git repo, if there's a branch for every incremental change? + +To start, git history is probably okay (though we could probably present it nicer). + +> Is the typical github PR now the addition of a branch? Or an in-place update to the master release? + +Might be addition of a new Unison branch, a merge or commits to some Unison branch, or a new Unison release. + +> When is a branch B converted to a release? + +Whenever is convenient or you want to record a snapshot. + +> What are the implications of the loss of all the Causal history at that point? Will other people find it harder to merge onto that release, if they've been working concurrently with what was in B, maybe sharing changes with it? + +Good questions. Maybe convention is to just use a single long-running branch, with all releases cut from that branch (similar to how people use `master` today?) For efficiency, want to have branch representation such that don't have to load it all in memory. + +I think this is overall TBD. + +> I can't actually put my finger on why we need a commutative merge operation. + +It needs to be commutative so that Alice and Bob can apply their changes in either order and still reach the same repository state. + +> Ditto I can't explain why we need Causal. I guess it helps spot when one edit is a merge ancestor of another. But why do we need that? + +So that in merging, we have enough information to know that one edit supercedes another. Similar to Git tracking enough info to be able to do "fast-forward" merges. If we didn't have this, we'd get spurious conflicts when forking off branches and then merging them back in. + +> Why is Causal being applied on a per-name basis? i.e. why is it Map Name Causal (Conflicted Edit) rather than Causal (Map Name (Conflicted Edit))? + +No good reason\! We changed this, to put the `Causal` on the outside. + +> You've got Edit as a forgetful thing - it knows the new term but not the old one. I've got a feeling we're going to want to be able to reverse edits (and hence branch upgrades), so we should store the old value too. + +Now we are keying on `Code` instead of `Name` so I think we have enough information in the current representation to be able to invert a `Branch`? + +> If Alice renames a term from X to Y, and Bob renames it from X to Z, what's their experience when merging? + +They get a conflict which is easy to merge automatically, and you can imagine different choices: a) Allow both names b) Use Alice's name c) Use Bob's name. It's fine to have multiple names for the same code, though you will have to pick one when pretty-printing the code. + +> How does conflict resolution interact with propagation? So, if term f has some conflicting edits, does that mean that all its transitive dependents have conflicts too? How does someone resolve that? + +Yes, but we'll give tooling to help resolve all these conflicts in an efficient order (probably want to resolve conflicts in dependencies of a term before resolving conflicts in the term itself). + +> How are you going to render a Conflicted Edit to the user doing conflict resolution? Surely they want to know which source branches/releases each version of the edit is coming from, but I can't see how you'll know that. + +Good point. We could include some more metadata on each `Edit` to help with this. + +> Is this bit still current? "The namespace of a branch refers to the latest version of everything, propagated as far as possible. Anything else has the prefix old." Is doing propagations going to add a bunch of new names to the namespace automatically? + +No longer current. The branch's namespace is actually minimal and doesn't include any transitive updates by default (though you could "bake" the branch to propagate updates). + +> Is it possible to rename a branch or a release? + +Sure. Might have a GUID for each branch and/or release, with a name that can be changed associated with that GUID. + +> I have an urge to make it turtles all the way down: to make the names of branches and releases part of the namespaces we're trying to manage. Have you explored that line of thinking? + +I like it. It would be cool if the codebase is something you can talk about from within Unison, so `Branch` and `Release` are types in Unison that come with some nice Unison API. + +Not sure if we need to do this right away though. + +> Trying to work out the boundary between the unison codebase editor and the underlying VCS: is there a 'git blame' of any kind, in the new world? is there a history (of a term, a name, or the codebase as a whole)? + +Might track this in the `Edit`, also any new `Code` will have associated metadata such as author, license, timestamp, possibly descendants / ancestors... + +Note: we won't very granular information about who wrote which part of each expression, though we could recover information by doing tree diffs on the history. + +> is there a way to rewind the clock and get access to a previous revision in Unison-land, i.e. without using the VCS? + +Yeah, all branches and releases are accessible to you. But if you want to access a point in time of some branch, you need to use the VCS. Could imagine doing something about that. + +Sketch: + + - Can refer a branch at particular state just by hash, which picks out some subgraph of a `Causal`. But refering to hashes is annoying (though we can view a log of changes). + - Put timestamp and user id in `Causal`, in addition to the hash. + - Now can do queries like "go back in time to 1 week ago". + +> How much of the codebase model will be internalised into Unison? Will I be able to talk about a Namespace or a Branch in Unison code, say if I'm using a Codebase ability? I have a smalltalk-ish desire for the answer to be yes: if Unison can describe its own UI domain model, and is its own domain language, then we might end up with a more consistent and composable world, in which Unison tooling can be written in Unison, and in which people can talk about Unison in the same universe as they talk in Unison. + +I like it. This API should be exposed to Unison so you can write tooling for Unison in Unison. + +> In your code for Semigroup Causal here, I can't work out if it's meant to be right-biased or left-biased - the first two lines make it seem like the former, and the next two the latter. Might have misunderstood though. + +Code might be wrong, but I think the `Causal` semigroup was meant to be a commutative merge operation, but we should make that more explicit (the semigroup calls `Causal.merge` for instance) + +## Notes and ideas + +You can have first-class imports with a type like: + +``` haskell +type Namespace = Map Name (Set Code) -> Map Code [NameEdit] +``` + +There's a nice little combinator library you can write to build up `Namespace` values in various ways, and we can imagine the Unison `use` syntax to be sugar for this library. + +**Arya**: I'm still thinking we'll want something like scopes to be able to apply a branch to a prefix in a "clone package foo.x to foo.y and apply these changes" sort of way. diff --git a/unison-src/transcripts/project-outputs/docs/commandline-editor-dev.output.md b/unison-src/transcripts/project-outputs/docs/commandline-editor-dev.output.md new file mode 100644 index 0000000000..6db18f6768 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/commandline-editor-dev.output.md @@ -0,0 +1,11 @@ +The Unison CLI code is made up of a few components: + +`CommandLine.Main` sets up threads to watch the filesystem and parse `stdin` to produce `Editor.Event`s and `Editor.Input`s respectively. + +`Editor.Input` parsers are defined in InputPattern.hs and InputPatterns.hs. + +`Action.loop` receives `Editor.Event`s and `Editor.Input`s and executes `Editor.Command`s. This loop can't use `IO` or access the `Codebase` -- any access to these things must come from what `Editor.Command` provides. + +`Editor.Command`s are defined in Editor.hs and interpreted by `Editor.commandLine`. `Editor.commandLine` *does* use `IO` and access the `Codebase`.\` + +One of the `Editor.Commands` that can be executed is `Notify`, which presents an `Editor.Output` to the user. Our current implementation is in `OutputMessages.notifyUser`. diff --git a/unison-src/transcripts/project-outputs/docs/comments-and-docs.output.md b/unison-src/transcripts/project-outputs/docs/comments-and-docs.output.md new file mode 100644 index 0000000000..49a7f34635 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/comments-and-docs.output.md @@ -0,0 +1,226 @@ +# Design for Unison documentation and comments + +This is a rough design of a way to supply commentary and formal documentation for Unison code. [Discuss here](https://github.com/unisonweb/unison/issues/462) and also be sure to view the raw markdown file for some embedded comments. + +## Comments + +Comments in Unison can be either line comments or block comments. It’s probably only necessary to implement one of these for a first release of Unison, but ultimately we may want to offer both. + + + +### Line comments + +Line comments can be introduced in code with a special token. For example, if we want Haskell-like syntax, the `--` token introduces a comment: + +``` +foo x y = + -- This is a comment + x + y +``` + +Line comments follow these syntactic rules: + +1. A line comment must occupy the whole line. For simplicity, it’s a syntax error to put a comment at the end of a line that contains anything other than whitespace. +2. The comment is attached to the abstract syntax tree node that is BEGUN by the token following the comment. +3. When rendering comments, the indentation should be the same as the token that follows the comment. + + + +### Block comments + +Block comments can be introduced with special brackets. For example, if we want Haskell-like syntax, the `{-``-}` brackets delimit a block comment: + +``` +foo x y = + {- This is a comment. -} x + y + +foo x y = {- comment -} (x + y) + +foo x y = + {- comment -} + (x + y) + +foo x y = + {- comment -} + x + y +``` + +Block comments follow these syntactic rules: + +1. A block comment can appear anywhere. +2. The comment is attached to the abstract syntax tree node that is BEGUN by the token following the comment. If that's not defined, could be an error, or could just use some ad hoc heuristic to find "nearest" AST node. +3. When rendering comments, the indentation should be the same as the token that follows the comment. + + + +### Comments and code structure + +Comments should not have any effect on the hash of a Unison term or type. I propose that comments be kept as an annotation on the AST rather than as part of the AST itself. This way, comments can be edited, added, or removed, without touching the AST. + + + +### Comments and the codebase + +Comments should be stored in the codebase as annotations on the syntax tree. For example, under the hash for the term (or type), we could add a new file `comments.ub` that contains the comments in pairs of `(AST node index, comment text)`. + +A future version might allow for multiple comment sets (commentary with different purposes or audiences) by adding e.g. a tag field to the comments, or having a whole `comments` directory instead of just one file. + + + +## API documentation + +Any hash in the codebase can have formal API documentation associated with it. This might include basic usage, free-text explanations, examples, links to further reading, and links to related hashes. + +Probably some flavor of Markdown is ideal for API docs. + + + +### The Unison CLI and API docs + +Ultimately we’ll want to have a more visual codebase editor (see e.g. Pharo Smalltalk), but for now we have the Unison CLI. So there ought to be a special syntax for indicating that you want to associate API docs to a definition when you `add` it to the codebase (or `update`). This syntax should be light-weight and easy to type. + +For example: + +``` +{| `foo x y` adds `x` to `y` |} + +foo x y = x + y +``` + +The rule here would be that the documentation block gets associated with the definition that immediately follows. + +Alternatively, something like: + +``` +{foo| `foo x y` adds `x` to `y`|}. +``` + + + +This would associate the documentation block to the hash named `foo` even if that hash isn’t being otherwise edited in the file. + +### Semantic content of API docs + +Wherever docs have code (in Markdown between fences or backticks), Unison should parse that code, resolve names, and substitute hashes for names. + +E.g., the doc might have a usage example: + +``` +{| +Usage: `foo x y` adds `x` to `y`. +|} +``` + +When this doc block gets processed by Unison, it should parse `foo x y` and recognize that `foo`, `x`, and `y` are free. It should replace `foo` with a hyperlink to the hash of `foo`. It should do this for every name that exists in the codebase. + +There should be some syntax to exclude a code block from this processing. + +Alternatively, we could have special syntax to indicate that something should be parsed as a Unison name. E.g. + +``` +{| +Usage: `@foo x y` adds `x` to `y`. +|} +``` + +Where `@foo` indicates that `foo` is a Unison name, we’d like an error if it isn’t, and it should be replaced in the rendered docs with a hyperlink to `foo`. + +### Opinionated doc format + +It’s possible that we’ll want to be very opinionated about how what goes into API documentation, for uniformity across libraries and ease of use. + +For example, we might have API docs support the following fields for a function definition: + + - Usage: How to call the function. E.g. “`foo x y` adds `x` to `y`”. We should maintain the invariant that the usage is correct (that it matches the name of the function and its arity). + - Examples: discussed above. + +Note that author name, time stamp, etc, can be inferred from the codebase. These are data that can be displayed in the API docs when rendered, but don’t need to be written by the author. + + + +## Docbase/Wiki + +Separately from API documentation, it would be good to be able to write tutorials or long-form explanations of Unison libraries, with links into the codebase API docs. + +We’d need to write a tool that can process e.g. Github-flavoured Markdown together with a Unison codebase. The markdown format would have Unison-specific extensions to allow hyperlinking Unison hashes as well as Tut-style evaluation of examples. + +Ideally, the documentation would be kept automatically up to date in the face of renames, etc. + +Processing has to have two distinct phases, authoring and rendering. + + - *Authoring*: you write the markdown document and use Unison human-readable names in your code. When you add your document to the docbase, all the names get replaced with Unison hashes before being stored. + - *Rendering*: A document stored in the docbase could then be rendered as e.g. HTML (or Markdown) where Unison hashes are turned back to human-readable names from the codebase, and hyperlinked to the API documentation for the hashes. + + + +### Transclusion + +A particularly useful feature for this kind of documentation tool would be *transclusion* of code. E.g. with a syntax like… + +``` +{:transclude MyLibrary.myFun} +``` + +The tool could render that as a code block containing the definition of `MyLibrary.myFun`. Ideally that would register this document as a dependency of `MyLibrary.myFun` and propagation of updates could work the same way as for code. + +It would be good to also have a way (as in Elm) of transcluding the API docs of individual types and functions in a document. + +This is a way of keeping documentation automatically up to date, at least partially. diff --git a/unison-src/transcripts/project-outputs/docs/configuration.output.md b/unison-src/transcripts/project-outputs/docs/configuration.output.md new file mode 100644 index 0000000000..0bf4d06de5 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/configuration.output.md @@ -0,0 +1,176 @@ +# Configuration + + - [UCM Configuration](#ucm-configuration) + - [`UNISON_DEBUG`](#unison_debug) + - [`UNISON_PAGER`](#unison_pager) + - [`UNISON_LSP_PORT`](#unison_lsp_port) + - [`UNISON_LSP_ENABLED`](#unison_lsp_enabled) + - [`UNISON_SHARE_HOST`](#unison_share_host) + - [`UNISON_SHARE_ACCESS_TOKEN`](#unison_share_access_token) + - [`UNISON_READONLY`](#unison_readonly) + - [`UNISON_ENTITY_VALIDATION`](#unison_entity_validation) + - [Local Codebase Server](#local-codebase-server) + - [Codebase Configuration](#codebase-configuration) + +## UCM Configuration + +### `UNISON_DEBUG` + +Enable debugging output for various portions of the application. +See `lib/unison-prelude/src/Unison/Debug.hs` for the full list of supported flags. + +E.g. + +``` sh +# Enable ALL debugging flags (likely quite noisy) +$ UNISON_DEBUG= ucm +# Enable timing debugging, printing how long different actions take. +$ UNISON_DEBUG=timing ucm +# Enable LSP and TIMING debugging +$ UNISON_DEBUG=lsp,timing ucm +``` + +### `UNISON_PAGER` + +Allows selecting which pager to use for long command outputs. +Defaults to `less` on Linux & Mac, `more` on Windows + +E.g. + +``` sh +# User more instead of less +$ UNISON_PAGER=more ucm +``` + +### `UNISON_LSP_PORT` + +Allows selecting the port to run the LSP server on. Defaults to `5757`. + +E.g. + +``` sh +$ UNISON_LSP_PORT=8080 ucm +``` + +### `UNISON_LSP_ENABLED` + +Allows explicitly enabling or disabling the LSP server. +Acceptable values are 'true' or 'false' + +Note for Windows users: Due to an outstanding issue with GHC's IO manager on Windows, the LSP is **disabled by default** on Windows machines. +Enabling the LSP on windows can cause UCM to hang on exit and may require the process to be killed by the operating system or via Ctrl-C. +Note that this doesn't pose any risk of codebase corruption or cause any known issues, it's simply an annoyance. + +If you accept this annoyance, you can enable the LSP server on Windows by exporting the `UNISON_LSP_ENABLED=true` environment variable. + +You can set this persistently in powershell using: + +``` powershell +[System.Environment]::SetEnvironmentVariable('UNISON_LSP_ENABLED','true') +``` + +See [this issue](https://github.com/unisonweb/unison/issues/3487) for more details. + +E.g. + +``` sh +$ UNISON_LSP_ENABLED=true ucm +``` + +### `UNISON_SHARE_HOST` + +Allows selecting the location for the default Share server. + +E.g. + +``` sh +$ UNISON_SHARE_HOST="http://localhost:5424" ucm +``` + +### `UNISON_SHARE_ACCESS_TOKEN` + +Allows overriding the credentials used when authenticating with the Share server. + +E.g. + +``` sh +$ UNISON_SHARE_ACCESS_TOKEN="my.token.string" ucm +``` + +### `UNISON_READONLY` + +Force unison to use readonly connections to codebases. + +``` sh +$ UNISON_READONLY="true" ucm +``` + +### `UNISON_ENTITY_VALIDATION` + +Allows disabling validation of entities pulled from a codebase server. +It's generally a good idea to leave this enabled unless you know exactly what you're doing. + +Defaults to enabled. + +``` sh +$ UNISON_ENTITY_VALIDATION="false" ucm +``` + +### `UNISON_PULL_WORKERS` + +Allows setting the number of workers to use when pulling from a codebase server. +Defaults to 5. + +``` sh +$ UNISON_PULL_WORKERS=6 ucm +``` + +### `UNISON_PUSH_WORKERS` + +Allows setting the number of workers to use when pushing to a codebase server. +Defaults to 1. + +``` sh +$ UNISON_PULL_WORKERS=2 ucm +``` + +### `UNISON_SYNC_CHUNK_SIZE` + +Allows setting the chunk size used in requests when syncing a codebase. +Defaults to 50. + +``` sh +$ UNISON_SYNC_CHUNK_SIZE=100 ucm +``` + +### Local Codebase Server + +The port, host and token to be used for the local codebase server can all be configured by providing environment +variables when starting `ucm`, using `UCM_PORT`, `UCM_HOST`, and `UCM_TOKEN`. + +E.g. + +``` sh +UCM_PORT=8080 UCM_HOST=localhost UCM_TOKEN=1234 ucm +``` + +## Codebase Configuration + +Also, see the guide [here](https://www.unison-lang.org/learn/tooling/configuration/) + +The following configuration options can be provided within the `.unisonConfig` file, +which exists within the codebase directory, or at `~/.unisonConfig` for your default codebase. + +``` +# Attach myself as author and use BSD license for all of my contributions +DefaultMetadata = [ ".metadata.authors.chrispenner" + , ".metadata.licenses.chrispenner" ] + +# RemoteMapping allows mapping a path in the codebase to a specific location on share. +# Here I state that I want my .share namespace to push to .chrispenner.public +# Everything inside .share will be mapped accordingly, e.g. .share.foo will map to +# chrispenner.public.foo on share. +RemoteMapping { + share = "chrispenner.public" +} +``` diff --git a/unison-src/transcripts/project-outputs/docs/data-types.output.md b/unison-src/transcripts/project-outputs/docs/data-types.output.md new file mode 100644 index 0000000000..7adf0b87c2 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/data-types.output.md @@ -0,0 +1,34 @@ +# Type declaration hashing and identity + +This doc describes how data types are uniquely identified in Unison. There's been a bunch of discussion on this topic (todo - I can't seem to find the link to past discussions, help\!) but for v1 we'll keep it simple. We may add other ways of generating data type identities if/when we decide we really need it. + +> 🚧 There's duplication between this doc and type-declarations.markdown ([github link](https://github.com/unisonweb/unison/blob/master/docs/type-declarations.markdown)). + +**Background:** In most languages, a data type is uniquely identified by some named type within some package. If either the package name is changed (due to a new numbered release of the package) or the module name or name of the type is changed, this results in a type that the language type system considers to be different. + +In Unison, a type declaration (introduced by either the `type` or `ability` keyword) creates a type which is uniquely identified in one of two ways: + + - A *structural* type declaration is identified by a hash of its structure, exactly as is done for hashing of a term. This is the current default if you just write: `type Blah = ...`. + - A *nominal* type declaration is identified by a GUID generated at the time the declaration. Syntax for this is TBD, but perhaps: `nominal type Blah = ...` + +Notes: + + - Structural types have unordered constructors, and their identity isn't affected by the names chosen, so `type O a = N | S a` is the same type as `type Maybe a = Just a | Nothing`. + - If the user writes a structural type where two constructors have the same structure, that's a type error and the user should be prompted to either make the structure different or choose a different. + - Nominal types have ordered constructors. The order of the constructors is frozen at the time of the creation of the type. The constructors and the type may be renamed, but the GUID associated with the type never changes. + +Nominal types are to be used for things like "days of the week". Structural types are to be used for things like `List` or `Maybe`. + +That's it for now. + +## Other ideas and notes + +Possibly for later: + + - *opaque/whatever* - a newtype with some privileged functions that can treat it as a type alias instead of newtype + - *algebraic* - defined by a set of laws (Monoid, Semilattice, etc) Question around how those laws are encoded + +Other notes: + + - Want a nice story for refactoring: e.g. if I have a conversion from T1 to T2, that can be applied automatically everywhere T1 is in positive position. T2 -\> T1 will cover where T1 is in negative position; isomorphism will cover both. + - Want a nice story for discovery of existing types to limit fragmentation. diff --git a/unison-src/transcripts/project-outputs/docs/distributed-api-discussion-v1.output.md b/unison-src/transcripts/project-outputs/docs/distributed-api-discussion-v1.output.md new file mode 100644 index 0000000000..c859ec1752 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/distributed-api-discussion-v1.output.md @@ -0,0 +1,285 @@ +# Distributed programming API v1 discussion + +``` haskell +type Either a b = Left a | Right b +type Status = Running | Finished | Canceled | Error Error +type Error = + Unknown | Unreachable | Unresponsive | AbilityCheckFailure + +ability Remote location where + fork : location {e} -> '{e} a ->{Remote location} Future a + join : Future a ->{Remote location} Either Error a + status : Future a ->{Remote location} Status + cancel : Future a ->{Remote location} Either Error () + +type Future a = Future + ('{Remote loc} (Either Err a) -- join + ,'{Remote loc} () -- cancel + ,'{Remote loc} Status, -- status + , Duration ->{Remote loc} ()) -- keepalive (seconds 10) +``` + +Feb 11 Q\&A: + + - Do we need `Remote.here`? Thinking is: we don’t, we can just get one when starting the Unison Remote server; can then use that value, or restricted derivatives, in applications. + +``` +Unison.server + -> (Location {e} ->{Remote Location} r) -- local computation + -> {e} r -- rrrrresult +``` + +`handle expression with handler` OR +`with handler handle expression` +\* How do you launch anything? +\* Watch expression lol +\* launch + + - What does it mean to `cancel`? + Proposal: Runtime needs to support this. `fork`-ing in Unison likely works by forking a new instance `t` of Haskell runtime; that Haskell thread `t` can be asynchronously interrupted. So, the implementation of `Future.cancel` just throws a Haskell async exception into `t`, terminating that instance of the runtime. + + - How do decide if a received computation is allowed to be run? (and we are capable of running it?) + + 1. Some Unison term comes over the wire. + 2. \-Decide the type (typecheck? maybe slow? some other proof?)- No, we can use runtime exception. + 3. Scan the term for unknown hashes. (Could we do this lazily? Arya says: that’s crazay \[sic\]\! Rúnar adds: Sounds super fragile.) + - Could speculatively send some dependencies with the initial request, especially if protocol has minimum message size, but maybe not easy to anticipate which dependencies will be needed at remote end. + - If doing this lazily, could spare sending definitions for code paths not used during this particular execution. + - Could get started running the computation if there’s any work that can be done before receiving missing dependencies. Background thread works to populate the term cache from remote sources. + 4. If missing some of the dependencies, send list of references back to originator for definitions. Repeat steps 3–4 until the whole application is loaded / cached / whatever. + 5. Just run it and then complain if encountering an unexpected ability request. + + - How do actually run one? + +----- + +Do we need to choose a representation of `Location` now? + + - No, we can use incrementally more sophisticated representations. e.g., loc can initially be `()` or `Nat`, and the handler can maintain pure maps or whatever. (note: need pure maps). + - Yes, because the entire `Remote` ability needs to be defined up front, but some APIs e.g. relating to “keepalives” only make sense in the context of true multi-node Locations. + +Do we need to choose a representation of `Future` now? + + - Yes, because the entire `Remote` ability needs to be defined up front, but we may need additional remote abilities to operate on `Future`s. + - It can just be `'{Remote loc} a` + - No, this representation doesn’t contain enough info to asynchronously identify the computation, e.g. to support `Remote.status` in a multi-node implementation. + - It can be some kind of handle or GUID. + - Can we index typed results by untyped handle? + +Do we need the ability to automatically clean up zombie tasks? This informs the discussion around keepalives. + + - Yes: + +## Locations + +A Location is simply a computing context with access to certain computational resources. The `Remote` ability is parameterized with a Location type `loc`, giving us significant flexibility in defining various `Remote` interpreters. The interpreter can then require a `loc` that describes resources in whatever way it likes, and the interpreter can be paired with an appropriate implementation for obtaining or generating `loc`s. + +For example: + +``` haskell +runLocal : '{Remote () ()} a -> a +runLocal r = + step nid r = case r of + {a} -> a + {Remote.fork t -> k} -> handle (step nid) in k t + {Remote.spawn -> k} -> handle (step (Node.increment nid)) in k nid + {Remote.at _ t -> k} -> handle (step nid) in k !t + handle (step (Node.Node 0)) in !r +``` + +Its runtime representation is essentially a collection of cryptographic tokens authorizing the use of these resources. + +In Unison code, a Location is represented by a `Loc {e}`. A Unison value of type `Loc {}` supports only pure computations, whereas a `Loc {Remote, GPU}` provides the `Remote` and `GPU` abilities. + +### Locations have a composite runtime representation + +A `Loc` is represented by one or more host / port / auth tokens, along with ability use tokens. The `Remote` handler may use any algorithm in selecting a host to submit a task to, and the receiving host will run the computation provided the accompanying tokens are valid. + +``` haskell +-- Haskell runtime representation +-- individual Tokens should be cryptographically unguessable. +-- Tokens may correspond to or contain quota/other data. +data Loc = Loc Hosts Abilities +type Token = TBD +type Hosts = Map (Hostname,Port) Token +type Abilities = Map Reference Token -- Map Reference (PublicKey, RandomDigits, signature(publicKey, randomDigits <> reference)) +``` + +### What's in a Token? + +In this formulation, Token is a possibly-parameterized catch-all that includes whatever information is necessary to securely authorize some use. + +Stateless tokens will include: + + - A description of the authorized resource/activity, sufficient to be understood by the resource servers. + - A signature by entity trusted by the resource server. + - If the token is composite, each separable piece must be individually signed. Signatures are typically the size of the key (4096 bits = 512 bytes), so they can start to add up. + +They will optionally include: + + - An expiration / validity period - or be valid in perpetuity + - An "audience", identity of the target resource server, in cases where the signature key is too broad to identify the resource server. + +Example: + +``` +Token = + abilities e_1, ..., e_n <> expiration + <> signature ku ([e_1 ... e_n] <> expiration) + <> fingerprint ku + +or: + (e_1 <> expiration <> signature ku (e_1 <> expiration) <> fingerprint ku) +<> ... +<>(e_n <> expiration <> signature ku (e_n <> expiration) <> fingerprint ku) +``` + +This is leading up to an exponential number of signatures, just to support `Loc.restrict`. So, let's look at some schemes for delegation. + +### Elastically producing new Locations + +An elastic compute service “front-end” would expose: +1\. a function to `provision` new locations +2\. a Location at which the function could be run + + - Can I have this `provision` function in my namespace, without having its implementation in my codebase? + + + + - \[ \] The implementation of `provision` would need some way to authenticate and validate the request. + - \[ \] It would need some way to construct a Unison `Loc` value (not yet discussed). + - \[ \] It should provide a way for the front-end to monitor utilization and spin up or shut down physical resources as needed. + +*Idea*: Maybe the `Token` value provided by the front-end is structured in a provider-specific way, with whatever data is needed to make these decisions. Having a distinct `Token` type for distinct providers means another type parameter on the `Loc`, which could answer the question about consolidating `Loc`s on the user side. If two Locations share the same provider type, they can be consolidated (hosts, quotas, abilities); otherwise they obviously couldn’t be. + +``` haskell +Remote.forkAt : Loc {e} p -> '({e} a) ->{Remote} Future a +Location.join : Loc {e} p -> Loc {e2} p -> Loc {e,e2} p +``` + +## Futures + +A `Future` represents an asynchronous computation. `Remote.forkAt` takes a computation and returns immediately with a `Future`. To wait for the computation’s output, use `Future.force`. + +``` haskell +Remote.forkAt : Loc {e} ->'({e} a) ->{Remote} Future a +Future.force : Future a ->{Remote} (Either Err a) +type Err = TBD + +-- example: +f1 = forkAt a 'let + x = longRunningComputation 101 + makeHistogram x +y = otherLongComputation +x = Future.force f1 +Database.save (x, y) +``` + + - How many times can a future be successfully forced? Suppose a future is shared with 5,000 machines. The task backing the future eventually completes, and now what? + - The thought: the machines sending keepalives (subscribers?) are retained at the Location performing the computation; when the computation is complete, the Location should send the result back to those subscribers. The subscribers save the result in their caches until they no longer reference the `Future`. + - Random thing - if 5,000 nodes have a reference to a future, the status update / keepalive protocol should come with a response like "send me another keeplive within X time", where X is influenced by the number of other subscribers / density of keepalives. This prevents flooding the network with keepalives. + +### Supervision and garbage-collection of Futures + +Unison Futures can be monitored or terminated using: + +``` haskell +Future.status : Future a ->{Remote} Future.Status +type Future.Status + = Running LastUpdate | Canceled | Finished + | Unreachable | Unresponsive + +Future.cancel : Future a ->{Remote} (Either Err2 ()) +type Err2 = TBD +``` + +To the extent that an async computation should be canceled if there is no other computation interested in its result, we need some way of determining whether or not this is the case. We discussed having a system of keep-alives, absent which a Future might be canceled by its host: + +``` haskell +-- these likely will just be handled by the interpreter +-- of Remote, not by "user" code. +Future.keepalive : Duration -> Future a ->{Remote} Status +Future.remaining : Future a ->{Remote} Duration +``` + +Moreover, there will be cases where we want to transfer or delegate the keep-alive responsibility for a long-running tasks to a more available location. + +``` haskell +Remote.supervise : Loc {e} -> Future a -> {Remote} () +Remote.unsupervise : Loc {e} -> Future a -> {Remote} () +``` + +> We discussed producing a `Heartbeat` identifier along with any `Future`, but decided there was no benefit to separating the two. + +We haven’t discussed how to prevent a delegate supervisor from accumulating and perpetuating many long-running Futures that will never actually be forced. With this in mind, have we gained anything from a GC perspective? + +## Stationary data + +We will need some notion of data that doesn't just move automatically with the computation, even if the computation references it. We identified two reasons you might want to do this: + + - The data is big, and you don't want to copy it around willy-nilly. + - The data is secret, and you don't want to accidentally ship it to another location, you want to be very explicit about when this happens (for instance, secret keys, etc). + +More generally, we want a way of being explicit about when certain data is moved between locations, rather than implicitly relocating anything in lexical scope (this could be an API thing, a type-system thing, a code-analysis tool). + +----- + +## Notes/Desiderata + + - \[ \] Elastic computation - need to be able to talk about spawning new computing resources, and ideally this compute can be garbage collected as soon as you're done using it. + - \[x\] `fork` a task to run on a separate thread or at another "location" + - \[x\] Different locations may have access to different abilities (just pure computation, `IO`, `GPU`, etc) + - \[x\] Need to be able to respond to location failures, with maximal flexibility. Allow different ways of doing failure detection/recovery. + + + + - Locations are first-class, permissions, tasks, are first-class + - \[x\] locations + - \[ \] permissions? + - \[x\] tasks (futures) + + + + - \[ \] Some notion of data that doesn't just move automatically with the computation, even if the computation references it. + + - e.g., The data is big, and you don't want to copy it around willy nilly. + - e.g., The data is secret, and you don't want to accidentally ship it to another location, you want to be very explicit about when this happens (for instance, secret keys, etc). + - Might more generally want a way of being explicit about when data is moved to a location rather than just implicitly relocating anything in lexical scope (could be an API thing, a type system thing, a tool). + + - \[x\] Need to be able to launch a long-running computation and have it outlive the task / location / node that launches it. But then how do you interact with this computation later? (Say, to cancel it? Or to check if it's finished? Or more generally, how do you monitor it?) + + - \[ \] Need to be able to hash and serialize any Unison value, so that storage API(s) can be implemented in pure Unison. + + - Should the hash of a value know the type of the value? (`hash : a -> Hash a`) + + - \[x\] How do you represent `Loc{e}` to be securely verified by the receiving node? The `Loc{e}` must be unguessable and tamper-proof. + + - This is achieved by making the component `Token`s unguessable and tamper-proof. + + - \[ \] Must be safe to say `at loc1 loc2` without allowing nefarious loc1 to abuse loc2. (Needs clarification.) + + - \[x\] The runtime needs an unguessable way (crypto?) to represent Locations and their abilities. + + - \[ \] Not all computations should have access to all data. + + - file system + - individual durables + + - \[x\] Not all Locations should provide unlimited resources to all users (arbitrary computation, time, storage, bandwidth, priority). + + - \[ \] Not all data should be portable to arbitrary locations (think secret keys, top secret clearance, hipaa). + +*Misc?*: + + - Mutable typed (durable if needed) state at each location + - For v1, could not have this, just focus on batch computation + - Dealing with weird networks? (nat-busting) + - Maybe in implementation, but not explicit in v1 API + - Well-defined semantics not just a bunch of implementation-defined gobbledygook + - Do we need globally-addressed mutable state? e.g. node `a` can refer to mutable data on node `b`; or node `c` can mutate data on node `d`. Yes, probably. + +## Choices + + - We decided that automatically cancelling a child computation when its parent terminates or delaying termination of of the parent until its children complete would break associativity in terms of parallelism when chaining computations, therefore `forkAt` doesn’t enforce any such conditions. See more about cancellation & termination below, in “Supervision and garbage-collection of Futures” + +\#unison diff --git a/unison-src/transcripts/project-outputs/docs/distributed-garbage-collection.output.md b/unison-src/transcripts/project-outputs/docs/distributed-garbage-collection.output.md new file mode 100644 index 0000000000..facbfb93cd --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/distributed-garbage-collection.output.md @@ -0,0 +1,94 @@ +## Distributed Garbage Collection + +We use a weak `B` map, to track local boxes (entries are removed by virtue of being a weak map once they are no longer referenced in local heap / boxes): + +``` haskell +B_map :: WeakMap BoxId (MVar Value) +``` + +and a weak `C` set, tracking all remote boxes referenced by local heap / boxes: + +``` haskell +type RemoteBox = (BoxId, Node) +C_set :: WeakMap RemoteBox +``` + +Each local box `b` has an associated value, and associated set of boxes referenced by its contents, `b_subs`. + +``` haskell +let keepaliveDuration = 20.seconds -- or whatever +type Keepalive = Keepalive { b :: BoxId, visited :: Set RemoteBox } +``` + +**Receiving Keepalives** +When node `n` receives a keepalive message for BoxId `b` + +1. If `n` doesn't own `b`, disregard (shouldn't occur) +2. Else if `(b,n)` ∈ `visited`, disregard (normal occurrence) +3. Else + 1. Create a strong reference to `b` for a fixed period of time (`keepaliveDuration`) + 2. Let `b_subs` be the set of all boxes (local and remote) referenced by `b`. + 1. If `b_subs` is not cached, and no existing process is indexing `b`, starting indexing `b` and cache the result when complete. + 2. If indexing does not complete in time, do not interrupt indexing, but use `C_set` as an approximation of `b_subs` for the purposes of processing this particular keepalive message. + 3. For each `b_i` ∈ `b_subs`, + 1. If `b_i` is a remote box, send `(Keepalive b_i (Set.insert (b,n) visited))` to the owner of `b_i`. + 2. If `b_i` is a local box, process `(Keepalive b_i (Set.insert (b,n) visited))` locally. Whether or not you hit the network is up to you, but in this scheme, we do need to recursively propagate keepalives through local boxes. + +To compute `b_subs` (set of boxes referenced by the value inside the `b` box): + +1. Keep mutable cache `Optional [BoxId]` for each runtime value, `v`, tracking boxes referenced transitively by `v`. +2. Do a deep scan of the `v` inside the box to fully populate caches, recursively. +3. Avoid revisiting subtrees that already have a computed cache. + +**Receiving Continuations or Box Updates** +When a continuation `c` is transferred from node `x` to node `y`, or when value `c` is `Box.put` from node `x` to node `y`, node `y` adds non-local boxes referenced by `c` to `C_set`. (This indexing may be done as part of the network deserialization.) + +We must ensure that boxes referenced by `c` are not GCed before `y` can issue keepalives; this means that node `x` must send keep-alives to any boxes referenced by `c` during the transfer (this should already happen without special care) and at least once more after the transfer has completed, to avoid a race condition while `y` takes over the keepalives. This may mean that both nodes `x` and `y` must also index `c` while it is being transferred. + +**FAQ** +Q: Will `C_set` contain all of the remote boxes referenced by local boxes? +A: Yes: to store a value into `b`, the value must be constructed within some continuation. Remote box references can only exist in a continuation transferred from a remote node, or a value `Box.put` from a remote node. In both of these cases, any remote boxes referenced in the transfer are indexed into `C`, per "Receiving Continuations or Box Updates" above. + +Q: Can we say that durable values don't keep boxes alive? That a durable shouldn't expect any particular value to be preserved in a referenced box? +A: ... + +Q: If a remote node has computed the `Optional [BoxId]` for a runtime value, should the remote node transfer that cache to me? +A: ... + +**Optimizations** + + - Avoid allocating boxes to B-map and C-set until first transfer. Until first transfer, boxes are just a regular `MVar` on the stack. + +\*\* Example reference graph\*\* + +``` haskell +type Foo = Ref (Box Foo) | No_Ref + +do Remote + Remote.transfer x + q := Box.make + r := Box.make + Remote.transfer y + s := Box.make + t := Box.make + Remote.fork <| do Remote + sleep-random-duration + Box.take t + Box.put q (Ref s) + Box.put s (Ref r) + Box.put r (Ref t) + Box.put t (Ref q) + Box.put t No_Ref -- maintains cycle until Box.take t, then breaks cycle +``` + +``` text + x y + ┌─┐ ┌─┐ + ┌>│q│──>│s│ + │ ├─┤ /├─┤ + │ │ │ / │ │ + │ ├─┤└ ├─┤ + │ │r│──>│t│ + │ └─┘ └─┘ + └────────┘ +``` diff --git a/unison-src/transcripts/project-outputs/docs/distributed-programming-rfc.output.md b/unison-src/transcripts/project-outputs/docs/distributed-programming-rfc.output.md new file mode 100644 index 0000000000..4ffa4b2108 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/distributed-programming-rfc.output.md @@ -0,0 +1,223 @@ +This document describes a set of core Unison functions for expressing fault-tolerant multi-node systems, including systems that must be dynamically updated and redeployed without downtime. + +Remarks: + + - There's a mixture of old and new stuff here, see the [history section](#history) for background. + - Some version of these APIs will be implemented on the new Unison runtime. We are looking to gather design feedback and possibly iterate the design before starting on the implementation. + - Some of these primitives are rather low-level and imperative; it's expected that people will use them to build nicer APIs in pure Unison. + - Questions are good if you have them; ask away in the comments and we'll curate that into a Q\&A section of the document. + +Lastly, thank you to all who have contributed to this design or worked on earlier iterations\! + +### The API + +Unison computations can hop between nodes, can fail, can be forked to execute asynchronously, and can be supervised: + +``` Haskell +-- Promote a pure value to `Remote` +Remote.pure : ∀ a . a -> Remote a + +-- Sequencing of remote computations +Remote.bind : ∀ a b . (a -> Remote b) -> Remote a -> Remote b + +-- The current node where the computation is executing +Remote.here : Remote Node + +-- Transfer control of remainder of computation to target node +Remote.transfer : Node -> Remote Unit + +-- Explicitly fail a computation for the provided reason +Remote.fail : ∀ a . Text -> Remote a + +-- Sleep the current computation for the given duration +Remote.sleep : Duration -> Remote Unit + +-- Start running a remote computation asynchronously, returning +-- a `Task` value that can be used for supervision +Remote.fork : ∀ a . Remote a -> Remote Task + +-- Halt a running task (and any running subtasks) using the provided `Cause` +Task.stop : Cause -> Task -> Remote Unit + +-- Obtain the `Cause` that caused a running task to complete +Task.supervise : Task -> Remote (Remote Cause) + +-- Create a duration from a number of seconds +Duration.seconds : Number -> Duration + +-- this is TBD +type Cause = Error Text Node | Completed | Cancelled | Unresponsive Node +``` + +Unison computations can provision new nodes: + +``` Haskell +-- Like `Remote.spawn`, but create the node inside a fresh sandbox +Remote.spawn-sandboxed : Sandbox -> Remote Node + +-- Like `Remote.spawn-sandboxed`, but use the provided symmetric key +-- to communicate with the returned `Node` +Remote.spawn-sandboxed' : Key -> Sandbox -> Remote Node + +-- Create a new node 'in the same location' as the current node, sharing +-- current sandbox resources +Remote.spawn : Remote Node + +-- Like `Remote.spawn`, but use the provided symmetric key +-- to communicate with the returned `Node`. +Remote.spawn' : Key -> Remote Node + +-- Statically provision a `personal-info : Node` +node personal-info -- layout block starts here + Sandbox 5% 10MB 3GB accept-from + +-- TBD +type Sandbox = + Sandbox CPU% Memory Storage (∀ a . Node -> Remote a -> Remote a) +``` + +We can encrypt / decrypt any value at all: + +``` Haskell +-- Encrypt a value, requires `Remote` since we use random IV / nonce +encrypt : ∀ a . Key -> a -> Remote (Encrypted a) + +-- Decrypt a value, or return `None` if key is incorrect +decrypt : ∀ a . Key -> Encrypted a -> Either DecryptionFailure a + +-- `Key` is just a symmetric encryption key. We might generate keys via: + +AES256.key : Remote Key +Blowfish.key : Remote Key +-- etc + +-- TBD +type DecryptionFailure = WrongKey | AlgorithmMismatch | IntegrityFailure +``` + +Unison programs have access to mutable variables, which also serve as a concurrency primitive: + +``` Haskell +-- Create an ephemeral `Box` on the current node; just a (GUID, Node) at runtime +Box.empty : ∀ a . Remote (Box a) + +-- Put a value into the box, or if the box is full, +-- wait until a `Box.take` empties the box. +Box.put : ∀ a . a -> Box a -> Remote Unit + +-- Remove and return the value in the box, or if the box is empty, +-- wait until a `Box.put` fills the box. +Box.take : ∀ a . Box a -> Remote a + +-- Like `Box.take`, but leaves the value inside the box +Box.read : ∀ a . Box a -> Remote a + +-- Read the current value inside the box or return `None` immediately. +-- Also returns a setter which returns `True` if the set was successful. +-- The `set` is successful only if the value inside the box has not +-- otherwise changed since the read, so this can be used to implement +-- "optimistic" atomic modifies. +Box.access : ∀ a . Box a -> Remote (Optional a, a -> Remote Bool) +``` + +Unison can resolve references dynamically on a node: + +``` Haskell +-- Create a `Name`, which is a typed reference to a node-local value. +Name.make : ∀ a . Remote (Name a) + +-- Lookup the node-local value associated with the `Name`. +Name.resolve : ∀ a . Name a -> Remote (Box a) + +-- Declare `bob : Name Number` statically. The value bound to +-- the `Name` does not survive node restarting. +ephemeral name bob : Number + +-- Declare `cluster-peers : Name (Vector Node)` statically. The current +-- value of `cluster-peers` survives node restarting. +durable name cluster-peers : Vector Node +``` + +Unison can make any value durable. `Durable` values are immutable: + +``` Haskell +-- Move any value from RAM to local durable storage +Durable.store : ∀ a . a -> Remote (Durable a) + +-- Synchronize any value AND ALL TRANSITIVE DEPENDENCIES +-- to local durable storage, returning `True` if the given `Node` +-- has that `Durable a` locally and the sync was successful. +Durable.sync-from : ∀ a . Node -> Durable a -> Remote Boolean + +-- Load a durable value into RAM, assuming it exists on the given node +Durable.load-from : ∀ a . Node -> Durable a -> Remote (Optional a) + +-- Returns a list of nodes that the Unison runtime believes could +-- successfully `Durable.load-from` or `Durable.sync-from` for the +-- given `Durable`. +Durable.peers : ∀ a . Durable a -> Remote (Vector Node) +``` + +Lastly, we can declare foreign functions: + +``` Haskell +-- Declare `my-fn : Foreign (Number -> Remote Number)` statically +-- Bindings for some of these foreign declarations would be done +-- in some implementation-dependent way on Unison node container startup. +foreign my-fn : Number -> Remote Number + +-- Ask the current node if it has a binding for a `Foreign a` +Foreign.ask : forall a . Foreign a -> Remote (Optional a) +``` + +## Notes on semantics and implementation details + +A basic design principle: the Unison runtime should never contact another Unison node unless the user's program explicitly indicates that node should be contacted. Thus, the runtime cannot run any sort of background task that contacts other nodes (like upkeep for a DHT), nor can it implicitly choose which nodes to contact (like doing some sort of autodiscovery to find "good" peers). The idea here is to make the runtime "as dumb as possible", and move all intelligence to regular Unison libraries. + +The `Task` returned by `Remote.fork` controls the entirety of the computation forked, including any subtasks forked. Stopping that `Task` stops anything that may be running underneath this fork. + +Implementation notes on `Task.supervise`: + + - At runtime, a `Task` value contains a `Node` reference where the `Task` was originally forked. + - To implement `Task.supervise`, the runtime maintains at each node a `Map Task (Timestamp, Status, Optional Node)`, tracking for each task a timestamped last update for that task (when it was running on the current node), and an `Optional Node` if the computation was transferred elsewhere. This `Map` can be pruned using some ad hoc policy (like retain 30s of data or 5000 entries). `Task.supervise` then just chases the computation, following these transfer links until it obtains a "recent enough" status update for the computation. If a node is unresponsive or unreachable, this eventually leads to an `Unresponsive` error being passed to the supervisor. + +On node local storage: + + - The association between a `Name` and a `Box` is *local to the node*. Conceptually, each node has its own durable and ephemeral storage. There is no storage concept exposed by Unison at any granularity beyond nodes (though of course you can write multi-node storage as regular Unison libraries). Nodes are isolated from each other and must communicate explicitly (even if the nodes are all spawned in a single sandbox). + - The `durable name blah : Name Number` is somewhat analogous to a typed file name. It can be resolved on any node to a `Box Number`, and the state of that `Box Number` (whether it is empty or full) will survive node restarts. + - The `node node-name` block declares a node statically, by proving a `Sandbox`. + - The various `Durable` functions give some flexibility to Unison programs in how they resolve `Durable` values and where they load them from. + +On storage and discovery of `Durable` values: + + - It's expected that `Durable.load : Durable a -> Remote a` could be implemented in terms of `Remote.load-from` and `Durable.peers` (with a small chance of failure if all nodes delete durable data stored elsewhere). + - A sketch of how `Durable.peers` map gets updated: + - Any call to `Durable.load-from n1 d` for a `d` not already present on the current node gets an entry in the peers map. + - When receiving a continuation via `Remote.transfer`, entries are added to the peers map for any durables not present on the receiving node. So if the continuation references `d : Durable Number`, and the sender's peer map for `d` was `[alice, bob, carol]`, then `[alice, bob, carol]` would be added to the recipient's peer map for `d`. If the sender's peer map is empty (because the sender has the `Durable` locally), we'd just add the sender to the peer map. + - Successful calls to `Durable.sync-from` clear out peers map entries for that `Durable` and its transitive dependencies, since once it's stored locally, we stop caring where else we could get it from. + - May want to prune the number of peers stored for a given `Durable`, if lots of peers have it. + +### Appendix: History and context + +**Most recently (after discussion in [\#142](https://github.com/unisonweb/unison/issues/142)):** + + - Split `Capability` into `Foreign` (for the foreign function interface) and `Name`, for locally bound names. + - Loading of `Durable` values is more explicit about *where* the values are being loaded from, but runtime provides enough info to implement good heuristics for discovering `Durable` values from peers more implicitly. + - There's now a way to statically declare a `Node`, which is important for bootstrapping a system. + +**V2 (after discussion in [\#141](https://github.com/unisonweb/unison/issues/141)):** + + - Got rid of `Clock` and `Index` in favor of immutable durable storage concept + mutable pointers. + - Got rid of `Channel` in favor of `Box`, also simplified `Capability` API to just build on `Box` directly. + - Got rid of `Heartbeat` arguments to a whole bunch of functions (like `Box.take`, etc), opting for just using the ambient lexically-scoped heartbeat established via `Remote.link`. 99% of the time this is what you want, and you can always push another `Heartbeat` onto the stack via a nested `Remote.link`. + - Clarified behavior around lifetimes of `Remote.fork`-ed computations and `Remote.spawn*` nodes--they always inherit the current ambient heartbeat. I believe this is key for composability, since it makes the interface for shutting down a subcomputation completely uniform. + +**Previously:** + +[This post](http://unisonweb.org/2015-06-02/distributed-evaluation.html) has an early writeup of how Unison's hashing scheme could be used to build a robust multi-node computation story. That eventually got an implementation, and as a demo I put together [a simple multi-node search engine](http://unisonweb.org/2016-10-12/search.html#post-start) in Unison. That raised a couple issues and questions, some discussed in that post, some discussed [in this post about microservices](http://unisonweb.org/2016-10-12/microservices.html#post-start), and some that I have just been ruminating on. 🤔 + +The big questions were around: + + - Lifecycle management of nodes and durable data---when is durable data destroyed, and when are nodes destroyed? This led to the `Heartbeat` design (which was later scrapped). + - Encryption: how are things encrypted, both at rest (in durable storage) and in transit (when moving between nodes). The solution given here is to have 'in transit' encryption handled transparently by the runtime, but to have encryption keys for durable state to be managed explicitly by the programmer. This allows for multiple nodes to use a common storage layer, without all reads needing to go through a common node. + - Dynamic updates and redeployment---how is this done? Solution given is the `Capability` stuff. diff --git a/unison-src/transcripts/project-outputs/docs/github-actions-help.output.md b/unison-src/transcripts/project-outputs/docs/github-actions-help.output.md new file mode 100644 index 0000000000..63eb0c717d --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/github-actions-help.output.md @@ -0,0 +1,92 @@ +## Some things I wish I'd known about Github Actions + +You can't have an `env:` key defined in terms of another `env` key, but you can use `$GITHUB_ENV` to get around this. + +You can't define a `matrix` at the top level, it has to be defined within a `job`'s `strategy`. + +`runs-on:` doesn't allow `env` for some reason. + +Strings don't need quotes, unless you need to force something to be a string. + +A `@ref` is always needed on a remote action. + +Windows doesn't seem to honor the `default: run: shell:` setting, so you need to set the `shell:` on `run:` manually? + +Don't hesitate to do a lot with `run:` blocks aka bash scripts — at least bash is mature and well documented. + +e.g. +echo "bar=whatever" \>\> $GITHUB\_OUTPUT +\# access with `steps..outputs.bar` in yaml strings + +``` +echo "foo=whatever" >> $GITHUB_ENV +# access with `env.foo` in yaml strings, or `$foo` in bash +``` + +`$GITHUB_ENV` updates the `env` context between steps, but not in the middle of a step. Obvious in retrospect. + +It's not clear to me when to use `$GITHUB_OUTPUT` vs `$GITHUB_ENV`, but I have been favoring `$GITHUB_ENV` because it requires fewer characters to access. +However, it seems a little wrong. + +### `hashFiles()` + +`hashFiles()` can only access files inside of and relative to `$GITHUB_WORKSPACE`. + +### `if:` + +Although the type rules don't totally make sense in Github Actions, `if:` takes a Boolean. + +Therefore, I think the String interpolation in `if: ${{runner.os}} != 'Windows'` causes the whole expression to become a String, which is coerced to `true`, when you definitely didn't mean `if: true`. So don't use `${{}}` here. + +### Job names + +Job names will automatically get `(${{matrix.os}})` if you don't use `${{matrix.os}}` somewhere in the name. + +### Windows + +The whole thing with `.exe` is a mess. Unix commands typically drop and add `.exe` correctly as needed, but Github Actions (e.g. `actions/upload-artifact`?) don't. + +### Cache + +When using the `cache` action, getting a cache hit on the primary key means you won't update the cache with any changes. + +When picking a key, you have to ask, "Which key, if exactly matched, would mean that I'm already so done that I don't even want to save anything new from this run." + +Similarly, `save-always: true` only if a key hit means there will be nothing new to save, even if a previous run failed AND a failed result is worth starting with. + +Backup restore keys: "Is there a prior run that would be worth starting out from? With the caveat that any irrelevant garbage it includes will be saved into this run too." + +### Upload Artifact + +I suspect on Windows it can't support paths that select a drive in a Unix-y way, +like `/c/asdf` or `/d/asdf`. It's got to be `C:/asdf` or `C:\asdf` etc. + +Upload will complain if any + +Upload and Download plugin versions have to match. + +### Reusability + +Github supports splitting off "reusable workflows" (`jobs` that can be imported into another workflow), and "composite actions" (multi-step `steps` that can be imported into another `job`). + +#### Composite actions + +Needs to have `shell:` specified on every `run:` + +#### Reusable workflows + +These have to be in `.github/workflows`, you can't organize them deeper, or elsewhere. + +### Reference + +Default Environment Variables: +https://docs.github.com/en/actions/learn-github-actions/variables\#default-environment-variables + +Workflow syntax: +https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions + +Reusable workflows: +https://docs.github.com/en/actions/using-workflows/reusing-workflows + +Composite actions: +https://docs.github.com/en/actions/creating-actions/creating-a-composite-action diff --git a/unison-src/transcripts/project-outputs/docs/language-server.output.md b/unison-src/transcripts/project-outputs/docs/language-server.output.md new file mode 100644 index 0000000000..2e766d2256 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/language-server.output.md @@ -0,0 +1,223 @@ +# Unison Language Server + +[![asciicast](https://asciinema.org/a/Kwa7NscffA3R8KCHxq1OavRm0.svg)](https://asciinema.org/a/Kwa7NscffA3R8KCHxq1OavRm0) + + - [Overview](#overview) + - [Installation and setup](#installation-and-setup) + - [NeoVim](#neovim) + - [VSCode](#vscode) + - [Helix Editor](#helix-editor) + - [Emacs](#emacs) + - [other editors](#other-editors) + - [Configuration](#configuration) + +## Overview + +Supported features: + + - Autocompletion + - Inline type and parser error messages + - Format on save (you can disable this in your editor if you like) + - Show type on hover + +Notes: + + - The LSP listens for changes from the UCM it's linked to, so name resolution is dependent on your current UCM path. + +## Installation and setup + +Currently the only supported configuration is to connect to the LSP via a specified port, not all LSP implementations support this configuration. + +By default the LSP is hosted at `127.0.0.1:5757`, but you can change the port using `UNISON_LSP_PORT=1234`. + +Note for Windows users: Due to an outstanding issue with GHC's IO manager on Windows, the LSP is **disabled by default** on Windows machines. +Enabling the LSP on windows can cause UCM to hang on exit and may require the process to be killed by the operating system or via Ctrl-C. +Note that this doesn't pose any risk of codebase corruption or cause any known issues, it's simply an annoyance. + +If you accept this annoyance, you can enable the LSP server on Windows by exporting the `UNISON_LSP_ENABLED=true` environment variable. + +You can set this persistently in powershell using: + +``` powershell +[System.Environment]::SetEnvironmentVariable('UNISON_LSP_ENABLED','true') +``` + +See [this issue](https://github.com/unisonweb/unison/issues/3487) for more details. + +### NeoVim + +Before configuring the LSP, install the Vim plugin for filetype detection and syntax highlighting. +For [Packer](https://github.com/wbthomason/packer.nvim) you can install the package as follow: + +``` lua +-- You may need to increase the git clone timeout setting in Packer! +use { + "unisonweb/unison", + branch = "trunk", + rtp = "/editor-support/vim" +} +``` + +or [Plug](https://github.com/junegunn/vim-plug): + +``` vim +Plug 'unisonweb/unison', { 'branch': 'trunk', 'rtp': 'editor-support/vim' } +``` + +or [Lazy](https://github.com/folke/lazy.nvim/): + +``` lua +{ + "unisonweb/unison", + branch = "trunk", + config = function(plugin) + vim.opt.rtp:append(plugin.dir .. "/editor-support/vim") + require("lazy.core.loader").packadd(plugin.dir .. "/editor-support/vim") + end, + init = function(plugin) + require("lazy.core.loader").ftdetect(plugin.dir .. "/editor-support/vim") + end, +} +``` + +Configuration for [coc-nvim](https://github.com/neoclide/coc.nvim), enter the following in the relevant place of your CocConfig + +``` + "languageserver": { + "unison": { + "filetypes": ["unison"], + "host": "127.0.0.1", + "port": 5757, + "settings": {} + } + } +``` + +For [lspconfig](https://github.com/neovim/nvim-lspconfig) with optional autocomplete [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) for LSP +[cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp), you can use the following setup function(s): + +``` lua +-- This function is for configuring a buffer when an LSP is attached +local on_attach = function(client, bufnr) + -- Always show the signcolumn, otherwise it would shift the text each time + -- diagnostics appear/become resolved + vim.o.signcolumn = 'yes' + + -- Update the cursor hover location every 1/4 of a second + vim.o.updatetime = 250 + + -- Disable appending of the error text at the offending line + vim.diagnostic.config({virtual_text=false}) + + -- Enable a floating window containing the error text when hovering over an error + vim.api.nvim_create_autocmd("CursorHold", { + buffer = bufnr, + callback = function() + local opts = { + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + border = 'rounded', + source = 'always', + prefix = ' ', + scope = 'cursor', + } + vim.diagnostic.open_float(nil, opts) + end + }) + + -- This setting is to display hover information about the symbol under the cursor + vim.keymap.set('n', 'K', vim.lsp.buf.hover) + +end + +-- Setup the Unison LSP +require('lspconfig')['unison'].setup{ + on_attach = on_attach, +} +``` + +``` lua +-- This is NVim Autocompletion support +local cmp = require 'cmp' + +-- This function sets up autocompletion +cmp.setup { + + -- This mapping affects the autocompletion choices menu + mapping = cmp.mapping.preset.insert(), + + -- This table names the sources for autocompletion + sources = { + { name = 'nvim_lsp' }, + }, +} + +``` + +Note that you'll need to start UCM *before* you try connecting to it in your editor or your editor might give up. + +### VSCode + +Simply install the [Unison Language VSCode extension](https://marketplace.visualstudio.com/items?itemName=unison-lang.unison). + +### Helix Editor + +To `~/.config/helix/languages.toml` append this code: + +``` toml +[language-server.ucm] +command = "nc" # or 'ncat' or 'netcat' +args = ["localhost", "5757"] + +[[language]] +name = "unison" +scope = "source.unison" +injection-regex = "unison" +file-types = ["u"] +shebangs = [] +roots = [] +auto-format = false +comment-token = "--" +indent = { tab-width = 4, unit = " " } +language-servers = [ "ucm" ] + +``` + +or follow the instructions for Unison in "[How to install the default language servers](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#unison)" wiki page. + +### Emacs + +In Emacs 29 (or earlier, if you install the [Eglot](https://elpa.gnu.org/packages/eglot.html) package), add the following to your init file: + +``` elisp +(push '((unison-ts-mode unisonlang-mode) "127.0.0.1" 5757) + eglot-server-programs) +``` + +This requires having either [unison-ts-mode](https://github.com/fmguerreiro/unison-ts-mode) or [unisonlang-mode](https://melpa.org/#/unisonlang-mode) installed. unison-ts-mode is newer, supported, and more complete, but isn’t in [MELPA](https://melpa.org/) yet and requires a couple commands to set up [tree-sitter-unison](https://github.com/kylegoetz/tree-sitter-unison). + +You can then use `M-x eglot` in a Unison scratch file buffer. You can also [configure Eglot to start automatically](https://www.gnu.org/software/emacs/manual/html_node/eglot/Starting-Eglot.html). + +### Other Editors + +If your editor provides a mechanism for connecting to a host and port, provide a host of `127.0.0.1` and port `5757`. + +If your editor requires a command to run, you can provide the command `nc localhost 5757` on Mac, or `netcat localhost 5757` on linux. +Note that some editors require passing the command and arguments as separate parameters. + +## Configuration + +Supported settings and their defaults. See information for your language server client about where to provide these. + + - `formattingWidth`: A suggestion for the formatter about how wide (in columns) to print definitions. + + - `maxCompletions`: The number of completions the server should collect and send based on a single query. Increasing this limit will provide more completion results, but at the cost of being slower to respond. + + If explicitly set to `null` the server will return ALL completions available. + +``` json +{ + "formattingWidth": 80, + "maxCompletions": 100 +} +``` diff --git a/unison-src/transcripts/project-outputs/docs/metadata.output.md b/unison-src/transcripts/project-outputs/docs/metadata.output.md new file mode 100644 index 0000000000..5a69896347 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/metadata.output.md @@ -0,0 +1,34 @@ +The Unison codebase format needs to be able to store metadata about definitions it contains, such as: + + - Author, copyright holder + - Creation date + - License + - API docs + - Boolean indicating whether a definition is a test, needed to support incremental test evaluation + - Comments that annotate subpaths of the definition + - ... + +Some desired features: + + - We probably won't know all the kinds of metadata in advance, so having it be extensible would be good. + - Metadata should probably be versioned. (Example: what if you want to change the license of a definition?) + +A simple proposal is to just add metadata information at each level of the versioned namespace tree: + +``` Haskell +-- Metadata is always just a link to some other term +newtype Metadata = Metadata Reference +newtype MetadataType = MetadataType Text -- "License", "Creation date", etc + +data Branch0 = + Branch0 { _terms :: Relation NameSegment Referent + , _types :: Relation NameSegment Reference + , _edits :: ... + , _metadata :: Relation (MetadataType, Referent) Metadata } +``` + +That's it. Metadata is just a "link", a lightweight reference to some other definition. + +We don't try to make `MetadataType` more strongly typed. It's just a string, its meaning determined by convention. For instance, the default CLI viewer can look for an "API docs" key, and use that in its display. + +Nothing special for the on disk format, it can just be encoded the same way as the other relations in the Branch0. diff --git a/unison-src/transcripts/project-outputs/docs/nix.output.md b/unison-src/transcripts/project-outputs/docs/nix.output.md new file mode 100644 index 0000000000..f325a83384 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/nix.output.md @@ -0,0 +1,65 @@ +(Todo: it might be nice to have a gentle and concise introduction into why Unison does anything with Nix and what cachix is.) + +We can push any nix store path into our cachix cache. This is typically done with `cachix push unison `. + +Some ways to come up with a store path: + +1. If you build something you get a symlink to the store path of the built thing, named `result` by default. +2. With `nix path-info` + +So, you could push the unison executable with the cache with + +``` nix +nix build -o my-little-unison-store-path +cachix push unison my-little-unison-store-path +``` + +or + +``` nix +nix build | cachix push unison +``` + +We want to cache the \[immediate\] build dependencies of our build products, because those are the only ones actually needed to build our build products. + +``` nix +nix-store --query --references $(nix path-info --derivation) | xargs nix-store --realize | cachix push unison +``` + +Breaking down the above: + +``` nix +nix path-info --derivation +``` + +gets the store path of the derivation of the unison executable + +``` nix +nix-store --query --references $(nix path-info --derivation) +``` + +gets the store paths of the derivations of immediate dependencies of the unison executable derivation. + +``` nix +nix-store --query --references $(nix path-info --derivation) | xargs nix-store --realize +``` + +builds the above derivations if necessary and writes the resulting store paths to stdout + +These paths are then fed to cachix with `| cachix push unison`. + +Development environments are defined in the flake under the `devShells` key. There are a number of different development environments, and they can be entered by giving a different argument to `nix develop`. If you want to push a development environment you could do so with something like: + +``` nix +nix build --no-link '.#devShells.x86_64-linux.default' | cachix push unison +``` + +and you could push the build dependencies of the default shell with something like + +``` nix +nix-store --query --references $(nix path-info --derivation '.#devShells.x86_64-linux.default') | xargs nix-store --realize | cachix push unison +``` + +``` nix +nix-store --query --references $(nix path-info --derivation '.#devShells.aarch64-darwin.default') | xargs nix-store --realize | cachix push unison +``` diff --git a/unison-src/transcripts/project-outputs/docs/publishing-library1.output.md b/unison-src/transcripts/project-outputs/docs/publishing-library1.output.md new file mode 100644 index 0000000000..c01a49adbe --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/publishing-library1.output.md @@ -0,0 +1,389 @@ +# Using library code in my application + +## Current status + +We've thought of library code as coming from a different branch, which we incorporate by merging branches. (There's no other way to utilize a branch, except to merge it.) + +Branches come from the `.unison` directory on disk, and `.unison` directories from external sources can be merged externally by recursively merging the directories. When two `.unison` directories each contain a branch with a given name, the two branches are merged by the `unison` tool. + +Each branch consists roughly of a `(Name, Reference)` "namespace" relation, and an `(Reference, Replacement)` "edits" relation. + +### Some problems with this + + - There are a lot of steps: + - Download someone's repo + - Make a new dir and git clone to it? + - Figure out how to recursively merge directories + - Maybe that's not that many steps. + - We incorporate all of the incoming branch's names (including dependency names?), whether you want them or not. + - This by itself isn't necessarily a dealbreaker, but it implies a lot of energy (or tooling) will be needed to provide immaculate namespaces in published libraries. + - We incorporate and activate all of the incoming branch's edits, whether you want them or not. + - Ditto + +### Question about collaborative edit semantics + +If you rename `foo` to `bar`, and I upgrade `foo#a` to `foo#b` and share my work with you, should you end up with `bar#a` and `foo#b`, or just `bar#b`? + +## What might be nicer? + +### A built-in way to get a published branch + +#### Idea: Provide a command to create a local branch from a Github repo + +``` +app> branch.clone gh:/[:ghbranch][/] lib + + Got 17 definitions from gh:user/ghrepo:ghbranch/ubranch + +lib> +``` + +#### Idea: Let existing branch commands support `gh:` scheme + +``` xml +branchspec + := 'gh:' '/' [ ':' ] [ '/' ] + | +``` + +``` +master> branch.checkout gh:aryairani/either + + Synced 23 definitions. -- example output, idk + +gh:aryairani/either> branch.checkout meetup3 + + Ok. + +meetup3> +``` + +Question: Can the "current" branch be remote, or do we need to introduce remote-tracking branches like git does; the former seems simpler IMO. We would need an offline mode for a branch, and it should be as transparent to the user as possible. + +### Use a branch without first merging? + +#### Idea: Reference other branches via qualified imports + +``` +prefix := wordyId [ '.' prefix ] +id := [ prefix '.' ] ( wordyId | '(' symbolyId ')' +ids := id [ ' ' ids ] + +importspec + := 'import ' branchspec [ '/' prefix ] [ '(' ids ')' ] [ ' hiding (' ids ')' ] + | 'import ' branchspec [ '/' prefix ] [ ' as ' prefix ] +``` + +Sample program: + +``` +import experiment2 as e2 -- embed a local branch into the current namespace +import gh:aryairani/either as Either -- embed a git branch into the cur. namespace + +foo = Either1.Either.rightToOptional (e2.runExperiment data) +``` + +##### Redundant qualifiers? + + - Adding another (qualified) prefix to identifiers in a branch without also removing some leads to unnecessary line noise: `Either.Either.rightToOptional`. + + - We could reference deeper into a branch for our qualified imports: + + ``` + import gh:aryairani/either/Either as Either + foo = Either1.rightToOptional + ``` + + Now we've imported only names prefixed with '`Either.`' from `aryairani/either`, and can refer to them by prefixing them with '`Either.`', i.e. `Either.rightToOptional` instead of `Either.Either.rightToOptional` in the previous example. + +#### Idea: Branch-qualified identifiers + +We can add a syntax for branch-qualified identifiers, then proceed with normal branch-management commands, then proceed with normal branch-management commands. + +``` +meetup3> alias gh:aryairani/either/Either.rightToOptional Either.rightMay + ┌ + │ ✅ + │ + │ I aliased the term gh:aryairani/either/Either.rightToOptional to + │ Either.rightMay. + └ + +meetup3> +``` + +This is pretty first-order and terrible. + +#### Idea: Merge libraries not at their roots + +``` +meetup3> merge gh:aryairani/either as Arya + + Copied 17 names. Use `details` to list them. + +meetup3> view Arya. + + Arya.Either.rightToOption : Either a b -> Option b + Arya.Either.leftToOption : Either a b -> Option a + ... + +meetup3> +``` + +#### Idea: `import` statements are 1st class entities + +`import` statements could be first-class things that are added to the namespace on an `add`. + +> Side note: This reminds me, I think there are reasons to reconsider adding support for `add`ing individual definitions from .u to branch. I have a WIP for this, but it doesn't work. 😅 Could probably knock it out quickly by pairing. + +Anyway, if we `>add` on this file, + +``` haskell +import gh:ghuser/ghrepo:treeish/unisonbranch as Foo +import gh:arya/either:either//Either as E -- 🤔 so many "either" +bar x = E.fromJust (Foo.foo x) + 1 +``` + +we also add an entry to the namespace: + +``` haskell +("Foo", QualifiedImport (Github "ghuser" "ghrepo" (Just treeish) "unisonbranch") Nothing) +("E", QualifiedImport + (Github "aryairani" "either" Nothing "default?master?") + (Just "Either") ) +``` + +where + +``` haskell +data BranchSpec + = Local UBranchName + | Github Username Repo (Maybe Treeish) UBranchName + +data QualifiedImport = QualifiedImport + { branchSpec :: BranchSpec + , from :: Maybe Prefix + , as :: Prefix + } +``` + +This could be a Haskell value or a Unison term. `import` could also be a CLI command (syntax tbd). + +We can copy any remote data to a github cache under `.unison/cache/gh/gh-commit-id` or `.unison/cache/gh/ghuser/ghrepo/gh-commit-id` or whatever, and reuse it from there, or refresh it according to some protocol. + +When I reference `E.fromJust` or `Foo.foo` it looks in the branches it downloaded from github. The names of transitive dependents are added to "oldnames", so if the remote name goes away, or the link is deleted, we still have some text to display. If `treeish` is a git hash, it would refer to an immutable thing, so it could be cached permanently. + +#### Idea: First class namespace — move this to publishing section? + +This is basically the previous idea but allowing for more complex structure. Instead of just being a link to a remote namespace in its entirety, we could have a single value that describes many imports; these structures can be imported in the same way within .u files, Github gists, etc. + +``` +prefix := wordyId [ '.' prefix ] +id := [ prefix '.' ] ( wordyId | '(' symbolyId ')' +ids := id [ ' ' ids ] + +importspec + := 'import ' branchspec [ '/' prefix ] [ '(' ids ')' ] [ ' hiding (' ids ')' ] + | 'import ' branchspec [ '/' prefix ] [ ' as ' prefix ] + +namespace := 'namespace ' id ' where' [ imports, defs ] +``` + +Sample program: + +``` haskell +namespace AryaPack where + -- can reference local branch experiment1's `dataset` as `e1.dataset` + import experiment1 as e1 -- embed a local branch into the AryaPack namespace + -- Can reference runar's Multiset.Multiset.empty as Multiset.empty + import gh:runarorama/Multiset (Multiset.fromList) + -- Can reference paul's Simple.Example.Example1 as AryaPack.Example1 + import gh:pchiusano/EasyTest/Simple.Example as Example + + myFunc = Multiset.fromList (Example.summarize e1.dataset) +``` + +The above becomes a term named `AryaPack : Namespace`, which I somehow get into my github aryairani/AryaPack project. + + - Basically this is syntax sugar for defining a special Unison object. We could also define it with normal Unison constructors, although it would probably be uglier. + - The above program includes a definition along with the imports, but that doesn't have to be allowed. + +Then the program below works: + +``` haskell +import experiment2 as e2 -- embed a local branch into the current namespace +import gh:eed3si9n/hello as Hello -- embed a git branch into the cur. namespace +from gh:aryairani/AryaPack/AryaPack import myFunc +-- ^^ repo ^^ branch ^^ term; in this case, a namespace +``` + +## + +#### Question: When do we actually download stuff? + +When do we actually bring those names/definitions into the local codebase, so we can view dependents without being online, or if the import statements are removed from .u file? + +##### Idea: Copy referenced names/defs into the branch + +If we `>add` on this file: + +``` +import gh:aryairani/either/Either as Either +foo = Either1.rightToOptional +``` + +we get a temporary copy of the `gh:aryairani/either` branch (maybe greedily get the whole remote codebase, or maybe stream data as needed), use it to retrieve names and dependencies of any symbols we may try to resolve against it. If `foo` is added to the local branch, then we save the names of those remote dependencies into the local branch as well. + +###### Question: What names do we assign to unreferenced dependencies? + +### What if the codebase were a tree, rather than a list of branches? + +\#\#\#\#Hand-wavy example + +``` +/> clone gh:aryairani/libfoo + Copied gh:aryairani/libfoo blah blah to /libfoo +/> undo +/> clone gh:aryairani/libfoo /libs/DeepLearning/Foo + Copied gh:aryairani/libfoo blah blah to /libs/DeepLearning/Foo +/> +``` + +Sorry that I am using `/` and `.` interchangeably. + +I'm using `.`, because it's the typical code identifier separator we're used to, and I'm using `/` because it looks like directories and also commonly represents a tree root. `.` doesn't feel good as a tree root, because it common represents the "current" node in a tree. There's also the Scala route of `.` separator and `_root_` means the tree root. 😅 + +Anyway, we have some kind of structure like: + +``` +/Builtin +/libs/UJson +/libs/Stream +/libs/DeepLearning/Bar +/libs/DeepLearning/Foo +/projects/BoringCrudApp +/projects/ChordProgressions +/projects/FaceDetector +``` + +``` +/> cd projects +/projects> rename FaceDetector FaceDetector/V1 +/projects> cd FaceDetector +/projects/FaceDetector> cp V1 V2 +-- +/projects/FaceDetector> replace.scoped V2 /libs/DeepLearning/Foo/thing1 mything1 + + Noted replacement of thing1#af2 with mything#i9d within /projects/FaceDetector/V2. + +/projects/FaceDetector> todo + ...7 things... +/projects/FaceDetector> todo / + ...33 things... +/projects/FaceDetector> +``` + +#### How do you reference code in a system like this? + +##### Idea: Absolute imports + +.u: + +``` haskell +import /projects/FaceDetector/V1 as V1 +-- or: import _root_.FaceDetector.V1 as V1 +compareResult = foo V1.result result +``` + +CLI: + +``` +projects/FaceDetector/v2> + Typechecked the following definition: + compareResult : Result +``` + +vs + +``` +projects/FaceDetector> + Typechecked the following definition: + compareResult : V2.Result +``` + +##### Idea: Relative imports + +``` haskell +import ../V1 as V1 +-- or: import _parent_.V1 as V1 +``` + +##### Also: TDNR + +Given: + +``` +/foo/bar/Bar.baz -- #abc +/blah/wah/Bar.baz -- #xyz +``` + +TDNR candidates are `foo.bar.Bar.baz` and `blah.wah.Bar.baz` + +##### Benefit: Organize your shared repo to arbitrary depth + +``` haskell +import gh:aryairani/awesome-unison/alltheparsers/specificparser/submodule as M +``` + +#### What are the units of code sharing and collaboration? + +You can easily imagine exporting a subtree, but what if that subtree references definitions that are outside of it? e.g. you want to share `/Foo/`, but `Foo.bar` references `/Quuz.quuzCount`? + + - Unison could warn you, and help you stage a subtree to publish. "I can collect all these referenced names into a subtree for you to bulk edit" + + - Unison could make up / choose some appropriate names based on the current tree: + + ``` haskell + namespace Dependencies where + static import /libs/Foo as Abc -- this is replaced by a full/static copy of the names + static import /temp/Bar as Xyz -- some other library code in this subtree uses + ``` + + In this next syntax block, I'm tagging subtrees with a publication location, to avoid needing to have separate unison repos on your local machine for each project. e.g. One repo would have all your preferred customizations. + + ``` + /projects/FaceDetector/V2> publish.set-destination.scoped .. gh:aryairani/face-detector + I will publish /projects/FaceDetector to gh:aryairani/face-detector + /projects/FaceDetector/V2> publish + + Syncing /projects/FaceDetector to gh:aryairani/face-detector + Syncing / to gh:aryairani/private-repo + + /projects/FaceDetector/V2> + ``` + + Elsewhere: + + ``` + libs> clone gh:aryairani/face-detector FaceDetector + libs> ls FaceDetector + + Dependencies.Abc.asdf : Blah -> Blah + Dependencies.Abc.ghjk : Blah -> Blah + Dependencies.Xyz.awww : Blah -> Blah + V1.result + ... + V2.result + ... + libs> + ``` + +# Sharing my code as library + +TBD, but it will include: + + - specifying which code + - specifying the publication destination + - juggling some credentials for the destination + +Next: [Updating my library & sharing an updated library](publishing-library2.md) diff --git a/unison-src/transcripts/project-outputs/docs/publishing-library2.output.md b/unison-src/transcripts/project-outputs/docs/publishing-library2.output.md new file mode 100644 index 0000000000..8f7fa1d466 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/publishing-library2.output.md @@ -0,0 +1,179 @@ +previous: [Using library code in my application & sharing my application as a library](publishing-library1.md) + +# Updating my library & sharing the updates + +We can imagine a number of potential classes of structured edits to the codebase, each requiring their own supporting data and DX design. Like the ability to assign of names to references, these aren't fundamental to Unison; but they are critical to usability. + +In designing our codebase representation, we should remember that **the set of edit helpers will likely change over time**. Although the codebase editor will have to change to support new edit classes, **the codebase format may not need to**. i.e. each edit class could have some ID as part of its supporting data, and data for edit classes not supported by a particular codebase editor could be gracefully ignored. + +## Replacement & deprecation of definitions + +The first structured edit we've begun to tackle is: replacement and deprecation of definitions, propagated to dependents within the scope defined by a branch's namespace. + +Currently, we accumulate "edit" directives as part of a branch: + +``` haskell +editedTerms :: Branch0 -> Relation Reference TermEdit +editedTypes :: Branch0 -> Relation Reference TypeEdit +data TypeEdit = Replace Reference | Deprecate +data TermEdit = Replace Reference Typing | Deprecate +data Typing = Same | Subtype | Different +``` + +A relation `(r, edit)` indicates that we are working to remove `r` from the edit scope (currently: the branch `Namespace`). + + - These edits are simply metadata used by the `todo` and (unused/obsolete?) `propagate` commands. + - These edits currently accumulate forever and are applied in perpetuity. + - Edits are meant to be used to help users of a library to upgrade between versions, by describing how to rewrite their usage sites. + +We are going to want to do some or all of the following: + + - Define/use short-term edits + - Define edits within a limited set of code + - Share with others how to upgrade their own dependents of our code, *in a way that allows them to understand what's going to happen and then choose to opt-in*. + +### Short-term edits + +We can quick-fix the "in perpetuity" part by giving the user an `edit.clear` command to "forget" an edit directive in a branch. There are potentially a huge number of edits for the user to select among, but we can help a little with that by utilizing the same numbered-args scheme as `ls` currently uses, and/or by offering different ways of sorting: by name, by recency, other? + +### Making managing edits manageable + +If a human is meant to maintain this list by manually culling edit directives, he will need more context than a list of `Reference` pairs. e.g.: Where did this edit come from? Was it created by the `update` command on a .u file, or the \[likely not yet implemented\] `replace` command in the code editor? Or by auto-propagation? By whom? When? Other? We should add at least a flag to indicate whether the update was manual or auto-propagated. Maybe even a human-readable message: + +``` haskell +data EditSource = ManualUpdate | ManualReplace | AutoPropagate +data EditReason = EditReason EditSource (Optional Text) +``` + +### Managing multiple sets of edits + +Here is a hand-wavy, imagined script for managing multiple sets of edits: + +``` +master> + ┌ + │ ✅ + │ + │ I found and typechecked these definitions in Base.u: + │ + │ Sequence.map : c -> (a -> b) -> [a] -> [b] + │ + │ Now evaluating any watch expressions (lines starting with `>`)... + └ +master> edit.set-reason adding a silly parameter to Sequence.map +master> update + ┌ + │ ✅ + │ + │ I updated these definitions as part of "adding a silly parameter to + │ Sequence". + │ + │ Sequence.map : c -> (a -> b) -> [a] -> [b] + └ +master> edit.list + + "adding a silly parameter to sequence": + Terms: + Sequence.map#31q -> Sequence.map + Sequence.map#aa4 -> Sequence.map#31q + +master> edit.elide Sequence.map#31q + + You still have 6 dependents of Sequence.map#31q in this branch. + + Repeat the same command to proceed anyway. + + Tip: Use `todo` to see what's left to do in the refactor. + + Tip: Use `edit.clear Sequence.map#31q` to cancel refactoring its dependents. + +master> edits.save Sequence.wip20190315 + + 2 edits saved as Sequence.wip20190315 + +master> edit.elide Sequence.map#31q + + You still have 6 dependents repeat the same command to proceed anyway. + +master> edit.elide Sequence.map#31q + + Cleared: + Sequence.map#31q -> Sequence.map + Sequence.map#aa4 -> Sequence.map#31q + + Added: + Sequence.map#aa4 -> Sequence.map + + +master> edits.save Sequence.upgrade20190315 + + 1 edit saved as Sequence.ugprade20190315 + +master> publish gh:aryairani/Sequence:sequence + + Pushed 2 new definitions to gh:aryairani/Sequence/sequence + +master>^C +``` + +Then, elsewhere: + +``` haskell +import gh:aryairani/Sequence:master/Sequence as Sequence +``` + +``` +master> add +``` + +``` +master> edits.activate git:runarorama/Multiset/Multiset.upgrade2_3 + + Activated 6 edit directives. + + Your branch has 37 affected dependents, 35 of which can be upgraded automatically. + + Tip: Use `view git:runarorama/Multiset/Multiset.upgrade2_3` to summarize the changes. + + Tip: Use `todo` to see what's left to complete these edits. + +master> todo +``` + +### First-class edits + +An edit set could be represented by a Unison term. The previous example is meant to be ambiguous as to whether or not that is the case, but it could be, and I suspect + +### How do we manage secondary edits? + +Working through one set of edits/upgrades produces a secondary set of edits. Where, if anywhere should this secondary set be saved long-term? What effect will it have on bookkeeping if a user wants to process more than one first-class edit sets at the same time? i.e. in the course of processing updates from library Foo to library Foo', and library Bar to library Bar', if I update App.func1 to App.func1', to which library update can I attribute that change? Well, we haven't discussed anything about attributing application changes to library changes, but + +## Curating edits + +The user should be able to curate the list of edits that are in the branch, like what we do when auditing an unsubmitted Github PR. The example script in the earlier section explores this a bit, but if the edit lists could be edited in the `.u`, or by Unison code at some point in the future, that will probably be much more convenient than implementing a ton of CLI commands to manipulate the list(s). + +### Curating name changes + +Could the branch/namespace also be a first-class Unison term? How would that ground out? + +## Publishing a set of edits + +If a set of edits is just a Unison term that the CLI knows about, then you can publish it in the same way you publish unison terms; TBD once we confirm the branch/repo format. + +## Using an updated library + +The example above touched on this in the example above, with + +``` +> edits.activate gh:runarorama/Multiset/Multiset.upgrade2_3 +``` + +or, having linked `/libs/Multiset` to `gh:runarorama/Multiset/...`: + +``` +> edits.activate /libs/Multiset/upgrade2_3 +``` + +We can collect additional questions here. + + diff --git a/unison-src/transcripts/project-outputs/docs/publishing.output.md b/unison-src/transcripts/project-outputs/docs/publishing.output.md new file mode 100644 index 0000000000..b961d886d3 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/publishing.output.md @@ -0,0 +1,10 @@ +# Publishing Unison code + +Thinking about a design for publishing Unison code revealed a nest of interrelated concerns: + + - [Using library code in my application & sharing my application as a library](publishing-library1.md) + - [Updating my library & sharing an updated library](publishing-library2.md) + + + +Each of these linked subtopics presents concerns, questions, and ideas, which we can weigh and collect into [our M1 proposal](publishing-M1.md). diff --git a/unison-src/transcripts/project-outputs/docs/release-steps.output.md b/unison-src/transcripts/project-outputs/docs/release-steps.output.md new file mode 100644 index 0000000000..52eb16ab5d --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/release-steps.output.md @@ -0,0 +1,92 @@ +# Release Steps + +## 1\. (Major milestones only) New Base Release + +Cut a release of base. @runarorama does this usually. + +``` +.> pull git(git@github.com:unisonweb/base) basedev.release +.> cd .basedev.release +.basedev.release> delete.namespace releases._latest +.basedev.release> squash trunk releases._ +``` + +Edit `releases._.README` to include `Release: `. + +``` +.basedev.release> fork releases._ releases._latest +.basedev.release> push git(git@github.com:unisonweb/base) +``` + +## 2\. Run Release script + + - **Milestone Release**: Look up the most recent release; bump the number and remove any trailing letters, e.g. `./scripts/make-release release/M5 trunk` + - **Minor Release**: Increment the trailing letter of the previous release, or add an `a` to the previous milestone release, e.g. `./scripts/make-release release/M5a trunk` + +Then, using the new release version, from the root of the `unisonweb/unison` project run: + +``` sh +./scripts/make_release.sh [TARGET (defaults to trunk)] +``` + +This will tag the appropriate versions in all the required projects, and kick off all of the necessary CI jobs to ship a release. + +Including: + + - A release workflow in `unisonweb/unison` to build UCM on multiple platforms, create a release with appropriate release notes from the previous release, and upload the artifacts to that release. + - A release workflow in `unison-local-ui` to build UCM on multiple platforms, create a release with appropriate release notes from the previous release, and upload the artifacts to that release. + - A release workflow in `homebrew-unison` to wait for artifacts to be uploaded, then download those artifacts, get the checksums, and create an up-to-date homebrew formula. + +After successfully executing the script you just have to sit tight and wait for all the jobs to complete. + +## 3 + +Smoke test of the new release. Try `brew upgrade unison-language`, launch it, launch `ui`. + +## 4 + +Write up release notes, template below. + +Preview the markdown in Slack \#general and tag @paul. + +## 5 + +If there are new builtins, redeploy Share. + +## 6 + +Announce on \#general Discord channel. + +----- + +@everyone We've just released a new version of Unison, $RELEASE\_NAME. + +----- + +**macOS or Linux w/ Homebrew:** +Install or upgrade is just `brew upgrade unisonweb/unison/unison-language`. + +**macOS or Linux manual install:** +macOS + +``` +mkdir -p unisonlanguage && cd unisonlanguage +curl -L https://github.com/unisonweb/unison/releases/latest/download/ucm-macos.tar.gz \ + | tar -xz +./ucm +``` + +Linux + +``` +mkdir -p unisonlanguage && cd unisonlanguage +curl -L https://github.com/unisonweb/unison/releases/latest/download/ucm-linux.tar.gz \ + | tar -xz +./ucm +``` + +**Windows manual install:** + + - Recommended: [Set your default Terminal application](https://devblogs.microsoft.com/commandline/windows-terminal-as-your-default-command-line-experience/) to “Windows Terminal”. + - Download [the release](https://github.com/unisonweb/unison/releases/latest/download/ucm-windows.zip) and extract it to a location of your choosing. + - Run `ucm.exe` diff --git a/unison-src/transcripts/project-outputs/docs/runtime-calling-conventions.output.md b/unison-src/transcripts/project-outputs/docs/runtime-calling-conventions.output.md new file mode 100644 index 0000000000..9b1fb09e2a --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/runtime-calling-conventions.output.md @@ -0,0 +1,51 @@ +### Lambda + + - called with arguments in declared order. + - whenever a lambda is called, it takes itself as `rec` + - it evaluates the body passing the bound lambda parameters on the stack + +### Computation + + - bound variables passed on stack with innermost scope closest to index 0 + - "rec" is passed as well (?) + - evaluations in nontail positions need to catch handle TC because their "frame" + has more work and shouldn't be thrown away; evaluations in tail positions can + throw their tailcalls upward and discard their frame + - let1/letrec evaluate the bindings with the existing stack (bound variables in their scope); + body is called with bindings prepended to stack + - compilevar returns rec if its name matches currentRec, + otherwise looks up a value on the bindings stack + - compilelambda returns a computation that will produce a lambda when evaluated + - apply + - if fn name matches currentRec, then staticRecCall + - staticRecTailCall + - throw selfTailCall with evaluated args (seems like this would not do anything) (?) + - staticRecNonTailCall + - call (rec: Lambda) with evaluated args + - a SelfCall exception should never escape the wrapper lambda + - else compile fn + - if compiled fn is Return(Lambda) + - staticTailCall + - throw tailcall with fn + - staticNonTailCall + - call fn with rec = fn + - else compiled fn is not yet a lambda, and needs to be evaluated again (at least once) + - dynamicTailCall + - eval mkFn and assume it produces a lambda (it should) + - throw tailcall with lambda and eval'd args + - dynamicNontailCall + - eval mkFn and assume it produces a lambda (it should\!) + - call lambda with evaluated args + +### Tail calls + +tailcall throws an exception with the target function & args +selfTailCall throws a tailcall with null(implied?) function + +when a tailcall exception is caught, we enter a while loop which calls the +target function and continues to catch tail calls until the target function +is null. + +note that the selftailcall begins with null. (?) don't understand + +### annotated bounds diff --git a/unison-src/transcripts/project-outputs/docs/sharing-code.output.md b/unison-src/transcripts/project-outputs/docs/sharing-code.output.md new file mode 100644 index 0000000000..7ff0619231 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/sharing-code.output.md @@ -0,0 +1,135 @@ +# Sharing code + +``` haskell +data Causal m e + = One { currentHash :: Hash, head :: e } + | Cons { currentHash :: Hash, head :: e, tail :: m (Causal e) } + -- The merge operation `<>` flattens and normalizes for order + | Merge { currentHash :: Hash, head :: e, tails :: Map Hash (m (Causal e)) } + +-- just one level of name, like Foo or Bar, but not Foo.Bar +newtype NameSegment = NameSegment { toText :: Text } +newtype Path = Path { toList :: [NameSegment] } + +data Namespace m = Namespace + { terms :: Relation NameSegment Referent + , types :: Relation NameSegment Reference + , children :: Relation NameSegment (Codetree m) + } + +data Codetree m = Codetree (Causal m Namespace) + +data RemotePath = RemotePath RemoteRef Path +data RemoteRef = GithubRef { username :: Text, repo :: Text, treeish :: Text } + -- | ... +-- "gh:/[/][?ref=] -- treeish defaults to repo's `default_branch` +-- "gh:aryairani/unison/libs?ref=topic/370" becomes +-- RemotePath (GithubRef "aryairani" "unison" "topic/370") (Path ["libs"]) + +newtype EditMap = EditMap { toMap :: Map GUID (Causal Edits) } +data Edits = Edits + { terms :: Relation Reference TermEdit + , types :: Relation Reference TypeEdit + } + +-- maps local paths to remote paths +data RemoteStatus = Map Path RemoteSpec +``` + +A couple of important points: + + - A namespace is "just" part of your preferences for parsing (and to some extent, rendering) code. + - Edits as we know them are just state for edit helper commands, like "todo" and "propagate" + - We should consider making the codebase representation of this data modular, since they really can be separated; they are likely still meaningful even in the presence of unexpected state/preferences that might exist in the future to support other features of future versions of the editor. + - We use `Causal` to represent a shareable data structure — shareable in the sense that which can tell whether a certain change came after another. + +Questions: + + - Do we want to distinguish between `/` paths and `.` separators in names? + + - Should a type `A` be at the same level as + + - On one hand, you probably don't need to separate a type `A` from its constructor `A.A`. You wouldn't be able to export the constructor without the type which resides a level up in the namespace. + + - Maybe the type `A` should organically be organized as `A/A`, and its constructor also as `A/A`. This is reminiscent of having a separate module per type in Haskell, except that a reorganization could be done more easily: + + ``` + /mycode> mv ClassA* ClassA/ + /mycode> mv ClassB* ClassB/ + /mycode> cd ClassA + /mycode/ClassA> ls + ``` + + - ``` + + ``` + +## NameTree representation + +examples: + +``` + + +/A (type) +/A (term) +/A/A (ctor) + + + +``` + +``` haskell +data NameTree a = Causal (Relation Name (NameTree a)) +``` + +or + +``` haskell +data NameTree a + = Leaf a + | Branch (Relation Name (NameTree a)) + | SharePoint (Causal (NameTree a)) +``` + +## Github Notes + +Base: https://api.github.com/repos/unisonweb/unison/ + +Branches: https://api.github.com/repos/unisonweb/unison/branches + +A directory: + +``` +url: +https://api.github.com/repos/unisonweb/unison/contents/unison-src/demo?ref=master + +html_url: +https://github.com/unisonweb/unison/tree/master/unison-src/demo + +git_url +https://api.github.com/repos/unisonweb/unison/git/trees/f8d91c6cc2ee1bc8f2bfc759e328a851d0df3b95 +``` + +A file: + +``` +url: +https://api.github.com/repos/unisonweb/unison/contents/unison-src/Base.u?ref=master + +html_url: +https://github.com/unisonweb/unison/blob/master/unison-src/Base.u + +git_url: https://api.github.com/repos/unisonweb/unison/git/blobs/e617fbad4e32d25380f536179f558f9213cd4bad + +download_url: +https://raw.githubusercontent.com/unisonweb/unison/master/unison-src/Base.u +``` + +Note that `treeish` (in this example, `master`) can contain slashes, such as `topic/370`. This makes parsing a little tricky. Fortunately, if you have a git branch `a/b` then it's not possible to create branches `a` or `a/b/c`. So you can load the list of branches, and then test them against that treeish-prefixed path: + +`https://github.com///<"tree" or "blob">/` + +If any of the branch names + `/` form a prefix of `treeish-prefixed-path`, then the suffix is the path into the causal. Crap, wait. The github HTML UI isn't going to be showing Unison paths at all. + +So, we could use out made up `gh:username/repo[:treeish][/path]` URI scheme; can support others as desired. Maybe our Javascript viewer will create URLs with query params that can indicate the Unison path. diff --git a/unison-src/transcripts/project-outputs/docs/testing.output.md b/unison-src/transcripts/project-outputs/docs/testing.output.md new file mode 100644 index 0000000000..0ac2a53377 --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/testing.output.md @@ -0,0 +1,57 @@ +### Testing and watch expression caching + +First, let's get this out of the way. One uncontroversial, status quo way to do testing in Unison: just use a regular main function. So, by convention, your branch might have a term, `tests : '{IO} Boolean` or perhaps `[Text] ->{IO} Boolean`, if it has an EasyTest-like interface where you can select scopes dynamically. You then do: + +``` +> execute tests +``` + +In your branch and it runs your tests and prints out some nice emojis. If you're running `tests` standalone and care about exit codes, you probably take the `Boolean` you get, where `true` indicates success and `false` indicates a failure, and convert that to an exit code. Assuming `IO` has some way of exiting with an exit code. + +(Note, we don't have a way of launching `unison` to run some commands on a branch then quit yet, but we probably will have something like `unison mybranch execute tests ["math"]`.) + +Easy peasy. Nothing special we need to do to enable this mode of working, and it's going to be how you do any sort of integration tests that need to talk to the outside world. + +### Easy incremental testing for pure tests (the "tests cache") + +But, when tests *aren't* in `IO`, there's no need to rerun them unless one of their dependencies changes (though you can if you want to). A simple proposal which lets us take advantage of this is we allow watch expressions to be marked as tests. They have to be of type `Test.Status`: + +``` +type Test.Status = Failed Text | Passed Text +``` + +> We debated whether to make tests have more structure and came down on "no" - different testing combinator libraries or abilities can handle all that, and this `Test.Status` is more like a final compilation target for different testing APIs: the test passed or failed, and has some human-readable information in it. That's it. + +And to mark a watch expression as a test, you say: + +``` Haskell +test> Test.equal (sort [3,1,2]) [1,2,3] +``` + +> Hmm, what if your test needs a whole bunch of auxiliary definitions and doesn't fit in a single watch expression? Easy, just introduce regular definitions for these, perhaps with some simple naming convention (like I'd prefix these testing helper definition names with `tests.`). + +> Did you consider just keying off the type of the watch, like if it's of type `Test.Status`, assume it's a test? Yes we did, but we decided being explicit was better. Also by communicating your intent up front, you can get better feedback from the tool ("er, looks like this isn't a test, here's how you can make it one") vs silently ignoring the thing the user thought was a test and just not adding it to the branch. + +On `add`, these `test>` watches are added to the codebase. Watch expressions marked as `test>` are also added to the namespace of the branch and given some autogenerated unique name (perhaps just computed from the hash of the test itself), unless the watch expression picks a name as in `test> test.sortEx1 = ...`. The user is told these names on `add`/`update` and can always rename them later if they like. Don't forget that in the event of a test failure, Unison can also show you the full source of the failed watch expression. Also note that the `Passed` and `Failed` cases might include the name of the "scope" of the test or other relevant info. So I'm not sure how important these names will be in practice + +There's a directory, `tests/`, containing files of the form `.ub`. The `hashXYZ` is a reference to the source of the original watch expression (in this case, the `Test.equal (sort [3,1,2]) [1,2,3]`), and the `.ub` file itself is a serialized `Test.Status`. We can ask if a branch is passing just by taking the intersection of the hashes in the branch with the hashes in this directory and seeing if all the `Test.Status` values for the branch are `Passed`. Notice this doesn't involve running any of the tests\! + +Since these test watches are part of the branch, they get refactored just like everything else when their dependencies change. Nothing special there, which is nice. We suggest that `update` rerun any changed tests by default. Here's how that works: + + - On `update`, we check the `tests/` directory and compare the hashes there to the edits list in the branch. If there's a file `.ub`, and the branch has an edit `hashXYZ -> hashPQR`, we lookup the source of `hashPQR` and evaluate it, and store the result in `.ub`. We do this for any affected tests. + +The `tests/` directory will be versioned, so everyone collaborating on the code shares a cache of test results. As the tests are 100% deterministic, this is fine, unless of course someone manually mucks with that directory to doctor some test results, or if like a freak gamma ray corrupts your test as it's running and gives the wrong result. But note that you can always choose to rerun some or all of your tests, ignoring the cache - just lookup the source of the `` and recompute it. (And perhaps there's a command to do that in bulk for a whole branch.) If it doesn't match, you can then hunt down the person who added that bogus test result. :) + +### Caching watch expressions (the "watches cache") + +Same idea, except that the source of a watch expression isn't added to the codebase. We just have a `watches/` directory in the same spot, with files `.ub` in it, which contain the evaluated result of the watch whose source was `hashXYZ`. Optionally, `watches/` directory could be in some other user-configurable location. + +When evaluating a Unison file, we have to hash all its definitions. If one of those hashes matches a hash in the `watches/` directory, we skip its evaluation and return the cached value. + +This caching can be done by default, but I suggest that the `watches` directory *not* be versioned as the values might be quite large. However, I could see people wanting to share their watches cache and sticking it on some shared file system. + +### Implementation notes and remarks + +We will neeed the list of watches in `UnisonFile` to include extra information: what kind of watch expression is it? A test or a regular watch? We'll then need to make use of this information on `add` and `update`. And we might want to expose other commands for rerunning tests anyway. + +Aside: I kinda like the "trust but occasionally reverify" model for this kind of caching. So every once in a while, pick a random test to rerun and make sure it checks out. With statistics, over time, it becomes exceedingly likely that the cache is good and any somehow incorrect results will be caught. Pessimistically rerunning all the tests, all the time, is Right Out. :) diff --git a/unison-src/transcripts/project-outputs/docs/type-declarations.output.md b/unison-src/transcripts/project-outputs/docs/type-declarations.output.md new file mode 100644 index 0000000000..09ff26703a --- /dev/null +++ b/unison-src/transcripts/project-outputs/docs/type-declarations.output.md @@ -0,0 +1,150 @@ +draft draft draft + +# Type Declarations in Unison + +``` haskell +data DataDeclaration' v a = DataDeclaration { + annotation :: a, + bound :: [v], + constructors' :: [(a, v, AnnotatedType v a)] + -- isStructural :: IsStructural + -- isOpaque :: Set (AnnotatedTerm v a) +} deriving (Eq, Show, Functor) + +-- type IsStructural = Structural | Unique GUID +``` + +> There is some discussion history on this doc in the comment threads [here](https://github.com/unisonweb/unison/commit/bc65f460a7b6a6c0dec7f3028680d55f0372123e#comments) and [here](https://github.com/unisonweb/unison/commit/6be8cba7e7fde29cf87af7fb28f2b30185c40c89#commitcomment-33025457). + +## Structural Types + +> 👉 These got implemented - it's the default, so there's no `structural` keyword. + +Structural types are defined uniquely by their structure. Every constructor has a unique signature, which intrinsically defines the meaning of the constructor. For example, the following types are identical and interoperable: + +``` haskell +structural type Maybe a = Nothing | Just a +structural type Optional t = Some t | None +``` + +These definitions would also be identical and interoperable (although they maybe shouldn't be): + +``` haskell +structural type Validation e a = Success a | Failure e +structural type Either a b = Left a | Right b +``` + +It should be an error if two constructors of a structural type have the same signature, indicating that the semantics are defined outside of the structure. + +The identity of a structural type is determined by normalizing the constructor order by \ and then hashing their types. + +## Unique types + +> 👉 This got implemented - see [here](https://www.unison-lang.org/learn/language-reference/unique-types/). + +Unique types have extrinsic semantics, not completely defined by the constructor types. Their representation includes a GUID, along with the constructors. The constructors types need not be unique. The GUID is typically auto-generated, but can be specified as part of the type declaration, in order to use a textual representation to declare an identical type. + +``` haskell +unique type Day = Mon | Tue | Wed | ... + +unique[] +type Day = Mon | Tue | Wed | ... +``` + +Order of constructors having the same type is stable, but the relative constructor order of differently typed constructors is (currently) unspecified. + +## Opaque Types + +How do we support modularity? That is, how do we let people expose a 'public API' to their library, and avoid exposing the internals behind it, so that (a) you can keep your library's internal data invariants intact without having to explain them, (b) you're free to change the internals without breaking client code that uses the API, and (c) you can tame complexity in the overall system by decoupling client code from library code? + +The key thing is to control access to the introduction and elimination of data types: who is allowed to create, and to pattern-match on, a value of your type? Both of those necessarily expose the guts of the representation of the type. + +An opaque type has a structure and a block of terms that can inspect structure. The hash of those terms is part of the type ID. They have a flag in the decl so typechecker can prevent access. + +``` haskell +opaque type Socket = Socket Nat +opaque type Handle = Handle Text +``` + +Q: How do you declare a definition that can inspect two opaque types? +Q: How do *we* create and inspect Sockets? We don't want to create public accessors, but we do want some way for privileged code to construct those values. I guess it's straightforward for types with a single constructor, but we may end up needing some deterministic way of distinguishing the other constructors. + +For reference and comparison: https://docs.scala-lang.org/sips/opaque-types.html +Notes re Scala opaque types: + + - They are a type alias (no boxing) that is only equal for definitions inside a corresponding companion object/module. + - We (Unison) do need to "box" values within a constructor to give them a hash corresponding to their type identity. + +### Alternative take on opaque types + +The thread starting [here](https://unisonlanguage.slack.com/archives/CLKV43YE4/p1565135564409000) makes the case that it's not very 'open world' to force people to change your type's identity in order to add a function which is privileged - i.e. can create and pattern match on values of that type. + +An alternative would be to say that, in terms of type identity, opaque types work exactly like unique types. But that you can annotate terms as being a 'friend' of that type, and so allowed to create / pattern match. So maybe here's what a term looks like that's a friend of types Foo and Bar: + +``` haskell +friend[Foo, Bar] eg : Foo Bar +eg = Foo.Foo 1 "hi" (Bar.Bar 3.1) +-- syntax reminiscent of unique[#af361] +``` + +This annotation would be metadata attached to the term. You can get unison to list all the friends of a given type, in order to work out what the footprint of 'privileged' code is. + +### Private functions + +It's not quite true to say that controlling creation and pattern matching is enough for the three aspects of modularity mentioned above. What about internal library helper functions which could be called in a way that creates data that doesn't respect the invariants? Or that you might want to change or remove later? Or that are not at the same semantic level as your API? So maybe we'd want a `private[Foo]` annotation on terms, which both implies `friend[Foo]`, and can only be referenced from other `friend[Foo]` terms. + +## Combinations? + +*Structural + Unique:* No. + +*Structural + Opaque:* No. + +*Unique + Opaque:* Sure why not. + +(So note that Opaque implies Unique.) + +Example where you want Opaque without Unique: `SortedSet` -- the exposed methods define the semantics. Example where you want Unique + Opaque: `Socket`, `Handle` -- the exposed methods may necessarily dictate that the two types are not the same. + +## Misc scenarios / questions: + +I was just editing some Haskell code. + +``` haskell +-- InputPatterns accept some fixed number of Required arguments of various +-- types, followed by a variable number of a single type of argument. +data IsOptional + = Optional -- 0 or 1, at the end + | Required -- 1, at the start + | ZeroPlus -- 0 or more, at the end + | OnePlus -- 1 or more, at the end + deriving Show +``` + +I decided to move `Required` to the top for clarity since, as the comments state, InputPattern arg lists start with some number of `Required` arguments. + +``` haskell +data IsOptional + = Optional -- 0 or 1, at the end + | Required -- 1, at the start + | ZeroPlus -- 0 or more, at the end + | OnePlus -- 1 or more, at the end + deriving Show +``` + +I still want this to be the same type. None of the semantics have changed, I just reordered the constructors for readability. I don't think this would be possible with any of our current proposed type implementations. Yes, I could create a new unique type, and refactor everything to use that, but that strikes me as unappealing, especially from a code-sharing perspective. + +Thoughts? + + - @pchiusano - I'd say that "constructor display order" should be a bit of metadata that can be attached to a data declaration, and you should be able to edit this metadata somehow (perhaps by default, the `add` / `update` command can suggest "metadata edits" in reponse to this sort of thing). + +## Old stuff: Algebraic Types? + +Algebraic types are defined by their structure and a set of laws relating their fields. Note that the laws may involve more than one type. + +``` +algebraic Monoid a = Monoid { mempty : a, mappend : a -> a -> a } +where m a -> (mappend m) (mempty m) a == a + m a -> (mappend m) a (mempty m) == a + m a b c -> (mappend m) a ((mappend m) b c) == + (mappend m) ((mappend m) a b) c +``` From bff98d37ea6fa4330e247ceb24ed257a030e4d4f Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 11 Nov 2024 11:16:47 -0700 Subject: [PATCH 12/15] Fix typo in bug_report template This is caught by a test introduced in the previous commit. --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index db744e89db..f57cddbd1d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,7 +10,7 @@ assignees: '' **Describe and demonstrate the bug** This should be written as a [ucm transcript](https://www.unison-lang.org/docs/tooling/transcripts/) if possible, calling out the unexpected behavior in the text. e.g. -``` unison :hidec +``` unison :hide a = 1 ``` From 2673620c1b0decabac9ac521493804ebe7cc6e40 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 11 Nov 2024 15:33:11 -0700 Subject: [PATCH 13/15] Update interpreter test output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also makes a couple minor changes re: running the script: - removes the “belt and suspenders” `echo`ing that resulted in things being printed in triplicate - added `gettext` to the Nix environment, so `envsubst` is available - changed the #!, to not get stuck with Bash 3.2 on macOS. --- nix/haskell-nix-flake.nix | 1 + unison-src/builtin-tests/interpreter-tests.output.md | 12 ++++++++++-- unison-src/builtin-tests/interpreter-tests.sh | 4 +--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/nix/haskell-nix-flake.nix b/nix/haskell-nix-flake.nix index ac4764c781..f63ffee53f 100644 --- a/nix/haskell-nix-flake.nix +++ b/nix/haskell-nix-flake.nix @@ -32,6 +32,7 @@ (args.nativeBuildInputs or []) ++ [ pkgs.cachix + pkgs.gettext # for envsubst, used by unison-src/builtin-tests/interpreter-tests.sh pkgs.hpack pkgs.pkg-config pkgs.stack-wrapped diff --git a/unison-src/builtin-tests/interpreter-tests.output.md b/unison-src/builtin-tests/interpreter-tests.output.md index 7ba9ed8bb7..0883bb1c2c 100644 --- a/unison-src/builtin-tests/interpreter-tests.output.md +++ b/unison-src/builtin-tests/interpreter-tests.output.md @@ -4,13 +4,21 @@ 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 +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 +scratch/main> clone @unison/runtime-tests/releases/0.0.1 runtime-tests/selected +``` + ``` ucm runtime-tests/selected> run tests () - runtime-tests/selected> run tests.interpreter.only () - ``` diff --git a/unison-src/builtin-tests/interpreter-tests.sh b/unison-src/builtin-tests/interpreter-tests.sh index 04c07ead18..f792b5a2fd 100755 --- a/unison-src/builtin-tests/interpreter-tests.sh +++ b/unison-src/builtin-tests/interpreter-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex if [ -z "$1" ]; then @@ -8,7 +8,6 @@ else fi runtime_tests_version="@unison/runtime-tests/releases/0.0.1" -echo $runtime_tests_version codebase=${XDG_CACHE_HOME:-"$HOME/.cache"}/unisonlanguage/runtime-tests.unison @@ -16,5 +15,4 @@ runtime_tests_version="$runtime_tests_version" \ envsubst '$runtime_tests_version' \ < unison-src/builtin-tests/interpreter-tests.tpl.md \ > unison-src/builtin-tests/interpreter-tests.md -echo "$ucm" transcript.fork -C $codebase -S $codebase unison-src/builtin-tests/interpreter-tests.md time "$ucm" transcript.fork -C $codebase -S $codebase unison-src/builtin-tests/interpreter-tests.md From 911c7993d413047a4e53daae59d682afbdd19482 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Mon, 11 Nov 2024 17:57:47 -0700 Subject: [PATCH 14/15] Validate pull_request_template as transcript --- unison-cli/transcripts/Transcripts.hs | 5 ++- .../.github/pull_request_template.output.md | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 unison-src/transcripts/project-outputs/.github/pull_request_template.output.md diff --git a/unison-cli/transcripts/Transcripts.hs b/unison-cli/transcripts/Transcripts.hs index 8f76d379fd..9b54be7a20 100644 --- a/unison-cli/transcripts/Transcripts.hs +++ b/unison-cli/transcripts/Transcripts.hs @@ -180,7 +180,10 @@ test config = do buildTests config (testBuilder True False recordFailure) ("unison-src" "transcripts" "errors") Nothing buildTests config (testBuilder False False recordFailure) "docs" . Just $ "unison-src" "transcripts" "project-outputs" "docs" - enumerateTests config (testBuilder False False recordFailure) [".github/ISSUE_TEMPLATE/bug_report.md"] + enumerateTests config (testBuilder False False recordFailure) $ + [ ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/pull_request_template.md" + ] failures <- io $ STM.readTVarIO failuresVar -- Print all aggregated failures when (not $ null failures) . io $ Text.putStrLn $ "Failures:" diff --git a/unison-src/transcripts/project-outputs/.github/pull_request_template.output.md b/unison-src/transcripts/project-outputs/.github/pull_request_template.output.md new file mode 100644 index 0000000000..4a02905b24 --- /dev/null +++ b/unison-src/transcripts/project-outputs/.github/pull_request_template.output.md @@ -0,0 +1,32 @@ +**Choose your PR title well:** Your pull request title is what's used to create release notes, so please make it descriptive of the change itself, which may be different from the initial motivation to make the change. + +## Overview + +What does this change accomplish and why? +i.e. How does it change the user experience? +i.e. What was the old behavior/API and what is the new behavior/API? + +Feel free to include "before and after" examples if appropriate. (You can copy/paste screenshots directly into this editor.) + +If relevant, which Github issues does it close? (See [closing-issues-using-keywords](https://help.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords).) + +## Implementation notes + +How does it accomplish it, in broad strokes? i.e. How does it change the Haskell codebase? + +## Interesting/controversial decisions + +Include anything that you thought twice about, debated, chose arbitrarily, etc. +What could have been done differently, but wasn't? And why? + +## Test coverage + +Have you included tests (which could be a transcript) for this change, or is it somehow covered by existing tests? + +Would you recommend improving the test coverage (either as part of this PR or as a separate issue) or do you think it’s adequate? + +If you only tested by hand, because that's all that's practical to do for this change, mention that. + +## Loose ends + +Link to related issues that address things you didn't get to. Stuff you encountered on the way and decided not to include in this PR. From b7edcd6a4e01cdb9d7373a614f4002b83740a1ee Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 26 Nov 2024 02:05:32 -0700 Subject: [PATCH 15/15] More precise blank lines in transcript UCM blocks This avoids leading and trailing blanks, while ensuring they exist between commands & outputs. --- .../IntegrationTests/transcript.output.md | 4 +- .../src/Unison/Codebase/Transcript/Runner.hs | 27 +++-- .../builtin-tests/interpreter-tests.output.md | 3 + .../transcripts-manual/docs.to-html.output.md | 2 +- .../transcripts-manual/rewrites.output.md | 9 ++ .../transcripts-round-trip/main.output.md | 13 ++- .../transcripts-using-base/_base.output.md | 4 +- .../binary-encoding-nats.output.md | 2 +- .../transcripts-using-base/codeops.output.md | 8 +- .../transcripts-using-base/doc.output.md | 15 ++- .../failure-tests.output.md | 1 - .../fix2158-1.output.md | 1 - .../transcripts-using-base/fix2297.output.md | 1 - .../transcripts-using-base/fix2358.output.md | 1 - .../transcripts-using-base/fix3166.output.md | 3 - .../transcripts-using-base/fix3542.output.md | 1 - .../transcripts-using-base/fix3939.output.md | 3 +- .../transcripts-using-base/fix4746.output.md | 1 - .../transcripts-using-base/fix5129.output.md | 2 - .../transcripts-using-base/hashing.output.md | 4 - .../transcripts-using-base/mvar.output.md | 2 +- .../nat-coersion.output.md | 2 +- .../transcripts-using-base/net.output.md | 4 +- .../random-deserial.output.md | 2 +- .../ref-promise.output.md | 9 +- .../serial-test-00.output.md | 2 +- .../serial-test-01.output.md | 2 +- .../serial-test-02.output.md | 2 +- .../serial-test-03.output.md | 2 +- .../serial-test-04.output.md | 2 +- .../transcripts-using-base/stm.output.md | 3 +- .../test-watch-dependencies.output.md | 2 - .../transcripts-using-base/thread.output.md | 6 +- .../transcripts-using-base/tls.output.md | 6 +- .../transcripts-using-base/utf8.output.md | 4 - unison-src/transcripts/alias-many.output.md | 1 + .../dont-hide-unexpected-ucm-errors.output.md | 2 + ...nt-hide-unexpected-unison-errors.output.md | 1 - unison-src/transcripts/fix-5402.output.md | 2 - unison-src/transcripts/hello.output.md | 3 +- .../ability-order-doesnt-affect-hash.md | 1 + .../ability-term-conflicts-on-update.md | 7 +- unison-src/transcripts/idempotent/add-run.md | 10 +- .../idempotent/add-test-watch-roundtrip.md | 1 + .../idempotent/addupdatemessages.md | 4 - .../transcripts/idempotent/alias-term.md | 2 + .../transcripts/idempotent/alias-type.md | 2 + .../transcripts/idempotent/anf-tests.md | 1 - .../transcripts/idempotent/any-extract.md | 3 +- unison-src/transcripts/idempotent/api-find.md | 1 - .../idempotent/api-list-projects-branches.md | 5 + .../idempotent/api-namespace-details.md | 1 - .../idempotent/api-namespace-list.md | 1 - .../transcripts/idempotent/api-summaries.md | 2 + .../idempotent/block-on-required-update.md | 2 - unison-src/transcripts/idempotent/blocks.md | 13 --- .../boolean-op-pretty-print-2819.md | 2 +- .../transcripts/idempotent/branch-command.md | 23 ++++ .../idempotent/branch-relative-path.md | 10 +- .../transcripts/idempotent/bug-fix-4354.md | 1 - .../idempotent/bug-strange-closure.md | 8 +- .../transcripts/idempotent/builtins-merge.md | 1 + unison-src/transcripts/idempotent/builtins.md | 7 +- .../transcripts/idempotent/bytesFromList.md | 1 - unison-src/transcripts/idempotent/check763.md | 3 +- unison-src/transcripts/idempotent/check873.md | 2 - .../idempotent/constructor-applied-to-unit.md | 2 +- .../transcripts/idempotent/contrabilities.md | 1 - .../transcripts/idempotent/create-author.md | 1 + .../transcripts/idempotent/cycle-update-1.md | 3 +- .../transcripts/idempotent/cycle-update-2.md | 3 +- .../transcripts/idempotent/cycle-update-3.md | 3 +- .../transcripts/idempotent/cycle-update-4.md | 3 +- .../idempotent/debug-definitions.md | 7 ++ .../idempotent/debug-name-diffs.md | 6 +- .../transcripts/idempotent/deep-names.md | 15 +++ .../idempotent/definition-diff-api.md | 5 +- .../delete-namespace-dependents-check.md | 4 +- .../idempotent/delete-namespace.md | 5 + .../idempotent/delete-project-branch.md | 6 + .../transcripts/idempotent/delete-project.md | 14 +++ .../transcripts/idempotent/delete-silent.md | 3 + unison-src/transcripts/idempotent/delete.md | 19 ++++ .../dependents-dependencies-debugfile.md | 5 + .../idempotent/destructuring-binds.md | 7 +- .../transcripts/idempotent/diff-namespace.md | 37 +++++- .../transcripts/idempotent/doc-formatting.md | 13 --- .../idempotent/doc-type-link-keywords.md | 3 + unison-src/transcripts/idempotent/doc1.md | 3 - .../transcripts/idempotent/doc2markdown.md | 1 - .../dont-upgrade-refs-that-exist-in-old.md | 3 +- .../transcripts/idempotent/duplicate-names.md | 6 +- .../idempotent/duplicate-term-detection.md | 4 - unison-src/transcripts/idempotent/ed25519.md | 1 - .../transcripts/idempotent/edit-command.md | 5 +- .../transcripts/idempotent/edit-namespace.md | 1 - .../idempotent/empty-namespaces.md | 6 + .../transcripts/idempotent/emptyCodebase.md | 2 + .../transcripts/idempotent/error-messages.md | 21 ---- .../idempotent/escape-sequences.md | 1 - .../transcripts/idempotent/find-by-type.md | 3 + .../transcripts/idempotent/find-command.md | 8 ++ unison-src/transcripts/idempotent/fix-5267.md | 4 +- unison-src/transcripts/idempotent/fix-5301.md | 2 - unison-src/transcripts/idempotent/fix-5312.md | 2 - unison-src/transcripts/idempotent/fix-5320.md | 1 - unison-src/transcripts/idempotent/fix-5323.md | 1 - unison-src/transcripts/idempotent/fix-5326.md | 7 +- unison-src/transcripts/idempotent/fix-5340.md | 3 - unison-src/transcripts/idempotent/fix-5357.md | 4 +- unison-src/transcripts/idempotent/fix-5369.md | 2 - unison-src/transcripts/idempotent/fix-5374.md | 3 +- unison-src/transcripts/idempotent/fix-5380.md | 3 +- unison-src/transcripts/idempotent/fix-5433.md | 2 - .../idempotent/fix-big-list-crash.md | 1 - unison-src/transcripts/idempotent/fix-ls.md | 3 +- unison-src/transcripts/idempotent/fix1063.md | 2 +- unison-src/transcripts/idempotent/fix1327.md | 3 +- unison-src/transcripts/idempotent/fix1334.md | 1 + unison-src/transcripts/idempotent/fix1390.md | 3 +- unison-src/transcripts/idempotent/fix1421.md | 2 +- unison-src/transcripts/idempotent/fix1532.md | 2 +- unison-src/transcripts/idempotent/fix1696.md | 1 - unison-src/transcripts/idempotent/fix1709.md | 2 - unison-src/transcripts/idempotent/fix1731.md | 1 - unison-src/transcripts/idempotent/fix1800.md | 8 ++ unison-src/transcripts/idempotent/fix1844.md | 1 - unison-src/transcripts/idempotent/fix1926.md | 2 - unison-src/transcripts/idempotent/fix2026.md | 1 - unison-src/transcripts/idempotent/fix2027.md | 1 - unison-src/transcripts/idempotent/fix2049.md | 3 +- unison-src/transcripts/idempotent/fix2156.md | 1 - unison-src/transcripts/idempotent/fix2167.md | 1 - unison-src/transcripts/idempotent/fix2187.md | 1 - unison-src/transcripts/idempotent/fix2231.md | 1 - unison-src/transcripts/idempotent/fix2238.md | 2 - unison-src/transcripts/idempotent/fix2244.md | 1 - unison-src/transcripts/idempotent/fix2254.md | 7 +- unison-src/transcripts/idempotent/fix2268.md | 1 - unison-src/transcripts/idempotent/fix2334.md | 1 - unison-src/transcripts/idempotent/fix2344.md | 1 - unison-src/transcripts/idempotent/fix2350.md | 1 - unison-src/transcripts/idempotent/fix2353.md | 1 - unison-src/transcripts/idempotent/fix2354.md | 1 - unison-src/transcripts/idempotent/fix2355.md | 1 - unison-src/transcripts/idempotent/fix2378.md | 1 - unison-src/transcripts/idempotent/fix2423.md | 1 - unison-src/transcripts/idempotent/fix2474.md | 1 - unison-src/transcripts/idempotent/fix2628.md | 1 + unison-src/transcripts/idempotent/fix2663.md | 1 - unison-src/transcripts/idempotent/fix2693.md | 3 - unison-src/transcripts/idempotent/fix2712.md | 2 - unison-src/transcripts/idempotent/fix2795.md | 1 - unison-src/transcripts/idempotent/fix2822.md | 6 - unison-src/transcripts/idempotent/fix2826.md | 3 +- unison-src/transcripts/idempotent/fix2970.md | 1 - unison-src/transcripts/idempotent/fix3037.md | 2 - unison-src/transcripts/idempotent/fix3171.md | 1 - unison-src/transcripts/idempotent/fix3196.md | 1 - unison-src/transcripts/idempotent/fix3215.md | 1 - unison-src/transcripts/idempotent/fix3244.md | 1 - unison-src/transcripts/idempotent/fix3265.md | 2 - unison-src/transcripts/idempotent/fix3424.md | 2 + unison-src/transcripts/idempotent/fix3634.md | 2 +- unison-src/transcripts/idempotent/fix3678.md | 1 - unison-src/transcripts/idempotent/fix3752.md | 1 - unison-src/transcripts/idempotent/fix3773.md | 1 - unison-src/transcripts/idempotent/fix3977.md | 2 + unison-src/transcripts/idempotent/fix4172.md | 4 +- unison-src/transcripts/idempotent/fix4280.md | 1 - unison-src/transcripts/idempotent/fix4397.md | 1 - unison-src/transcripts/idempotent/fix4415.md | 1 - unison-src/transcripts/idempotent/fix4482.md | 2 +- unison-src/transcripts/idempotent/fix4498.md | 2 +- unison-src/transcripts/idempotent/fix4515.md | 2 - unison-src/transcripts/idempotent/fix4528.md | 2 +- unison-src/transcripts/idempotent/fix4556.md | 2 - unison-src/transcripts/idempotent/fix4592.md | 1 - unison-src/transcripts/idempotent/fix4618.md | 2 - unison-src/transcripts/idempotent/fix4711.md | 3 +- unison-src/transcripts/idempotent/fix4722.md | 1 - unison-src/transcripts/idempotent/fix4731.md | 5 - unison-src/transcripts/idempotent/fix4780.md | 1 - unison-src/transcripts/idempotent/fix4898.md | 3 +- unison-src/transcripts/idempotent/fix5055.md | 3 +- unison-src/transcripts/idempotent/fix5076.md | 1 - unison-src/transcripts/idempotent/fix5080.md | 3 +- unison-src/transcripts/idempotent/fix5168.md | 1 - unison-src/transcripts/idempotent/fix5349.md | 3 - unison-src/transcripts/idempotent/fix5419.md | 2 - unison-src/transcripts/idempotent/fix614.md | 5 - unison-src/transcripts/idempotent/fix689.md | 1 - unison-src/transcripts/idempotent/fix693.md | 5 - unison-src/transcripts/idempotent/fix845.md | 5 - unison-src/transcripts/idempotent/fix849.md | 1 - unison-src/transcripts/idempotent/fix942.md | 5 +- unison-src/transcripts/idempotent/fix987.md | 2 - .../transcripts/idempotent/formatter.md | 1 - .../transcripts/idempotent/fuzzy-options.md | 4 + .../idempotent/generic-parse-errors.md | 6 - unison-src/transcripts/idempotent/help.md | 7 ++ .../transcripts/idempotent/higher-rank.md | 7 +- .../idempotent/input-parse-errors.md | 4 + .../transcripts/idempotent/io-test-command.md | 1 + unison-src/transcripts/idempotent/io.md | 23 +++- .../transcripts/idempotent/kind-inference.md | 18 --- .../transcripts/idempotent/lambdacase.md | 7 +- unison-src/transcripts/idempotent/move-all.md | 14 ++- .../transcripts/idempotent/move-namespace.md | 26 ++++- .../transcripts/idempotent/name-resolution.md | 17 +-- .../idempotent/name-segment-escape.md | 2 + .../transcripts/idempotent/name-selection.md | 13 ++- unison-src/transcripts/idempotent/names.md | 11 +- .../namespace-deletion-regression.md | 4 + .../idempotent/namespace-dependencies.md | 1 + .../idempotent/namespace-directive.md | 7 +- .../transcripts/idempotent/numbered-args.md | 5 +- .../transcripts/idempotent/old-fold-right.md | 1 - .../idempotent/pattern-match-coverage.md | 53 --------- .../idempotent/pattern-pretty-print-2345.md | 15 ++- .../transcripts/idempotent/patternMatchTls.md | 2 +- unison-src/transcripts/idempotent/patterns.md | 1 - .../transcripts/idempotent/propagate.md | 7 +- .../transcripts/idempotent/pull-errors.md | 3 + unison-src/transcripts/idempotent/records.md | 2 +- unison-src/transcripts/idempotent/reflog.md | 6 +- .../idempotent/release-draft-command.md | 1 - unison-src/transcripts/idempotent/reset.md | 14 ++- .../idempotent/resolution-failures.md | 3 - unison-src/transcripts/idempotent/rsa.md | 1 - .../transcripts/idempotent/scope-ref.md | 1 - unison-src/transcripts/idempotent/suffixes.md | 7 +- .../idempotent/sum-type-update-conflicts.md | 2 - .../transcripts/idempotent/switch-command.md | 8 +- .../transcripts/idempotent/tab-completion.md | 27 ++++- unison-src/transcripts/idempotent/tdnr.md | 41 ------- .../transcripts/idempotent/test-command.md | 3 +- .../transcripts/idempotent/text-literals.md | 2 +- unison-src/transcripts/idempotent/textfind.md | 12 +- .../idempotent/todo-bug-builtins.md | 4 - unison-src/transcripts/idempotent/todo.md | 21 ++-- .../idempotent/top-level-exceptions.md | 4 +- .../idempotent/transcript-parser-commands.md | 1 - .../transcripts/idempotent/type-deps.md | 3 +- .../idempotent/type-modifier-are-optional.md | 1 - unison-src/transcripts/idempotent/undo.md | 20 ++++ .../idempotent/unique-type-churn.md | 6 +- .../transcripts/idempotent/unitnamespace.md | 4 +- .../transcripts/idempotent/universal-cmp.md | 3 +- .../transcripts/idempotent/unsafe-coerce.md | 3 +- .../update-ignores-lib-namespace.md | 3 +- .../idempotent/update-on-conflict.md | 4 +- .../idempotent/update-suffixifies-properly.md | 2 - .../update-term-aliases-in-different-ways.md | 3 +- .../update-term-to-different-type.md | 3 +- .../idempotent/update-term-with-alias.md | 3 +- ...e-term-with-dependent-to-different-type.md | 2 - .../idempotent/update-term-with-dependent.md | 3 +- .../transcripts/idempotent/update-term.md | 3 +- .../idempotent/update-test-to-non-test.md | 4 +- .../idempotent/update-test-watch-roundtrip.md | 1 - .../idempotent/update-type-add-constructor.md | 4 +- .../idempotent/update-type-add-field.md | 4 +- .../idempotent/update-type-add-new-record.md | 2 +- .../update-type-add-record-field.md | 4 +- .../update-type-constructor-alias.md | 3 +- ...-type-delete-constructor-with-dependent.md | 2 - .../update-type-delete-constructor.md | 4 +- .../update-type-delete-record-field.md | 4 +- .../update-type-missing-constructor.md | 4 +- .../update-type-nested-decl-aliases.md | 2 - .../idempotent/update-type-no-op-record.md | 1 - .../update-type-stray-constructor-alias.md | 3 +- .../update-type-stray-constructor.md | 4 +- ...turn-constructor-into-smart-constructor.md | 4 +- ...update-type-turn-non-record-into-record.md | 4 +- .../update-type-with-dependent-term.md | 2 - ...e-with-dependent-type-to-different-kind.md | 2 - .../update-type-with-dependent-type.md | 5 +- .../transcripts/idempotent/update-watch.md | 1 - .../idempotent/upgrade-happy-path.md | 5 +- .../idempotent/upgrade-sad-path.md | 6 +- .../upgrade-suffixifies-properly.md | 1 - .../idempotent/upgrade-with-old-alias.md | 4 +- unison-src/transcripts/idempotent/view.md | 3 + .../idempotent/watch-expressions.md | 4 +- unison-src/transcripts/merge.output.md | 106 +++++++++++++----- 287 files changed, 740 insertions(+), 647 deletions(-) diff --git a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md index 3e9f360894..5ba2e787e8 100644 --- a/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md +++ b/unison-cli-integration/integration-tests/IntegrationTests/transcript.output.md @@ -2,7 +2,9 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/main> load ./unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -34,7 +36,6 @@ main = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,5 +59,6 @@ scratch/main> add type MyBool main : '{IO, Exception} () resume : Request {g, Break} x -> x + scratch/main> compile main ./unison-cli-integration/integration-tests/IntegrationTests/main ``` diff --git a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs index 523bc88c4a..54173d45be 100644 --- a/unison-cli/src/Unison/Codebase/Transcript/Runner.hs +++ b/unison-cli/src/Unison/Codebase/Transcript/Runner.hs @@ -176,30 +176,33 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL let patternMap = Map.fromList $ (\p -> (patternName p, p) : ((,p) <$> aliases p)) =<< validInputs let output' :: Bool -> Stanza -> IO () output' inputEcho msg = do - hide <- readIORef isHidden - unless (hideOutput inputEcho hide) $ modifyIORef' out (<> pure msg) + hide <- hideOutput inputEcho + unless hide $ modifyIORef' out (<> pure msg) - hideOutput :: Bool -> Hidden -> Bool - hideOutput inputEcho = \case + hideOutput' :: Bool -> Hidden -> Bool + hideOutput' inputEcho = \case Shown -> False HideOutput -> not inputEcho HideAll -> True + hideOutput :: Bool -> IO Bool + hideOutput inputEcho = hideOutput' inputEcho <$> readIORef isHidden + output, outputEcho :: Stanza -> IO () output = output' False outputEcho = output' True outputUcmLine :: UcmLine -> IO () - outputUcmLine line = modifyIORef' ucmOutput (<> pure line) + outputUcmLine line = do + prev <- readIORef ucmOutput + modifyIORef' ucmOutput (<> ((if not (null prev) then pure (UcmOutputLine "\n") else mempty) <> pure line)) outputUcmResult :: Pretty.Pretty Pretty.ColorText -> IO () outputUcmResult line = do - hide <- readIORef isHidden - unless (hideOutput False hide) $ + hide <- hideOutput False + unless hide $ -- We shorten the terminal width, because "Transcript" manages a 2-space indent for output lines. - modifyIORef' - ucmOutput - (<> pure (UcmOutputLine . Text.pack $ Pretty.toPlain (terminalWidth - 2) $ "\n" <> line)) + outputUcmLine . UcmOutputLine . Text.pack $ Pretty.toPlain (terminalWidth - 2) line maybeDieWithMsg :: String -> IO () maybeDieWithMsg msg = do @@ -210,7 +213,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL apiRequest :: APIRequest -> IO [APIRequest] apiRequest req = do - hide <- readIORef isHidden + hide <- hideOutput False case req of -- We just discard this, because the runner will produce new output lines. APIResponseLine {} -> pure [] @@ -222,7 +225,7 @@ run isTest verbosity dir codebase runtime sbRuntime nRuntime ucmVersion baseURL (([] <$) . maybeDieWithMsg . (("Error decoding response from " <> Text.unpack path <> ": ") <>)) ( \(v :: Aeson.Value) -> pure $ - if hide == HideOutput + if hide then [req] else [ req, diff --git a/unison-src/builtin-tests/interpreter-tests.output.md b/unison-src/builtin-tests/interpreter-tests.output.md index 0883bb1c2c..8f313d114f 100644 --- a/unison-src/builtin-tests/interpreter-tests.output.md +++ b/unison-src/builtin-tests/interpreter-tests.output.md @@ -6,7 +6,9 @@ Before merging the PR on Github, we'll merge your branch on Share and restore `r ``` ucm :hide:error 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 ``` @@ -18,6 +20,7 @@ scratch/main> clone @unison/runtime-tests/releases/0.0.1 runtime-tests/selected runtime-tests/selected> run tests () + runtime-tests/selected> run tests.interpreter.only () diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index 6da8205455..45528703fa 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -16,7 +16,6 @@ some.outside = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,5 +43,6 @@ test-html-docs/main> add some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat some.outside.doc : Doc2 + test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html ``` diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 55aeec3932..3f0a21e692 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -1,6 +1,8 @@ ``` ucm :hide scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -43,6 +45,7 @@ scratch/main> rewrite rule1 I found and replaced matches in these definitions: ex1 The rewritten file has been added to the top of scratch.u + scratch/main> rewrite eitherToOptional ☝️ @@ -115,6 +118,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 ``` ucm :hide scratch/main> load + scratch/main> add ``` @@ -202,6 +206,7 @@ blah2 = 456 ``` ucm :hide scratch/main> load + scratch/main> add ``` @@ -239,7 +244,9 @@ sameFileEx = ``` ucm :hide scratch/main> rewrite rule + scratch/main> load + scratch/main> add ``` @@ -421,6 +428,7 @@ scratch/main> sfind findEitherEx 1. eitherEx Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> sfind findEitherFailure 🔎 @@ -435,6 +443,7 @@ scratch/main> sfind findEitherFailure Tip: Try `edit 1` or `edit 1-5` to bring these into your scratch file. + scratch/main> find 1-5 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a diff --git a/unison-src/transcripts-round-trip/main.output.md b/unison-src/transcripts-round-trip/main.output.md index 3e2572416e..967044686b 100644 --- a/unison-src/transcripts-round-trip/main.output.md +++ b/unison-src/transcripts-round-trip/main.output.md @@ -2,12 +2,15 @@ This transcript verifies that the pretty-printer produces code that can be succe ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/a1> builtins.mergeio lib.builtins + scratch/a2> builtins.mergeio lib.builtins ``` ``` ucm :hide scratch/a1> load unison-src/transcripts-round-trip/reparses-with-same-hash.u + scratch/a1> add ``` @@ -16,7 +19,6 @@ x = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -833,6 +835,7 @@ scratch/a2> load ``` ucm :hide scratch/a2> add + scratch/a2> delete.namespace.force lib.builtins ``` @@ -848,7 +851,9 @@ Now check that definitions in 'reparses.u' at least parse on round trip: ``` ucm :hide scratch/a3> builtins.mergeio lib.builtins + scratch/a3> load unison-src/transcripts-round-trip/reparses.u + scratch/a3> add ``` @@ -897,9 +902,13 @@ sloppyDocEval = ``` ucm :hide scratch/a3_new> builtins.mergeio lib.builtins + scratch/a3_new> load + scratch/a3_new> add + scratch/a3> delete.namespace.force lib.builtins + scratch/a3_new> delete.namespace.force lib.builtins ``` @@ -925,6 +934,7 @@ Regression test for https://github.com/unisonweb/unison/pull/3548 scratch/regressions> alias.term ##Nat.+ plus Done. + scratch/regressions> edit.new plus ☝️ @@ -933,6 +943,7 @@ scratch/regressions> edit.new plus You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/regressions> load Loading changes detected in scratch.u. diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index c096ef5d74..52910967b2 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -11,7 +11,9 @@ transcripts which contain less boilerplate. ``` ucm :hide scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -50,7 +52,6 @@ testAutoClean _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,6 +69,7 @@ scratch/main> add ⍟ I've added these definitions: testAutoClean : '{IO} [Result] + scratch/main> io.test testAutoClean New test results: 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 265a56474b..e9c27c3b8f 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -54,7 +54,6 @@ testABunchOfNats _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -90,6 +89,7 @@ scratch/main> add testABunchOfNats : ∀ _. _ ->{IO} [Result] testNat : Nat -> '{IO, Stream Result} () testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () + scratch/main> io.test testABunchOfNats New test results: diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index 16753f75ae..fa807df00f 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -152,7 +152,6 @@ swapped name link = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -316,7 +315,6 @@ badLoad _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -358,6 +356,7 @@ scratch/main> add rotate : Three Nat Nat Nat -> Three Nat Nat Nat tests : '{IO} [Result] zapper : Three Nat Nat Nat -> Request {Zap} r -> r + scratch/main> io.test tests New test results: @@ -379,6 +378,7 @@ scratch/main> io.test tests ✅ 13 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test badLoad New test results: @@ -427,7 +427,6 @@ codeTests = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -445,6 +444,7 @@ scratch/main> add ⍟ I've added these definitions: codeTests : '{IO} [Result] + scratch/main> io.test codeTests New test results: @@ -512,7 +512,6 @@ vtests _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -532,6 +531,7 @@ scratch/main> add validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] + scratch/main> io.test vtests New test results: diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index 420cbd8875..aca445303c 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -29,7 +29,6 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,9 +53,11 @@ You can preview what docs will look like when rendered to the console using the scratch/main> display d1 Hello there Alice! + scratch/main> docs ImportantConstant An important constant, equal to `42` + scratch/main> docs DayOfWeek The 7 days of the week, defined as: @@ -131,6 +132,7 @@ scratch/main> view basicFormatting __Next up:__ {lists} }} + scratch/main> display basicFormatting # Basic formatting @@ -155,6 +157,7 @@ scratch/main> display basicFormatting documents. *Next up:* lists + scratch/main> view lists lists : Doc2 @@ -197,6 +200,7 @@ scratch/main> view lists 2. Take shower. 3. Get dressed. }} + scratch/main> display lists # Lists @@ -235,6 +239,7 @@ scratch/main> display lists * In this nested list. 2. Take shower. 3. Get dressed. + scratch/main> view evaluation evaluation : Doc2 @@ -269,6 +274,7 @@ scratch/main> view evaluation cube x = x * x * x ``` }} + scratch/main> display evaluation # Evaluation @@ -296,6 +302,7 @@ scratch/main> display evaluation use Nat * cube : Nat -> Nat cube x = x * x * x + scratch/main> view includingSource includingSource : Doc2 @@ -336,6 +343,7 @@ scratch/main> view includingSource so: ``sqr x``. This is equivalent to {{ docExample 1 do x -> sqr x }}. }} + scratch/main> display includingSource # Including Unison source code @@ -381,6 +389,7 @@ scratch/main> display includingSource * If your snippet expression is just a single function application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. + scratch/main> view nonUnisonCodeBlocks nonUnisonCodeBlocks : Doc2 @@ -413,6 +422,7 @@ scratch/main> view nonUnisonCodeBlocks xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` }} + scratch/main> display nonUnisonCodeBlocks # Non-Unison code blocks @@ -441,6 +451,7 @@ scratch/main> display nonUnisonCodeBlocks def reverse[A](xs: List[A]) = xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` + scratch/main> view otherElements otherElements : Doc2 @@ -497,6 +508,7 @@ scratch/main> view otherElements , [{{ Some text }}, {{ More text }}, {{ Zounds! }}] ] }} }} + scratch/main> display otherElements There are also asides, callouts, tables, tooltips, and more. @@ -559,6 +571,7 @@ scratch/main> view doc.guide {{ otherElements }} }} + scratch/main> display doc.guide # Unison computable documentation diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index f60045f67d..5087b2d934 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -19,7 +19,6 @@ test2 = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix2158-1.output.md b/unison-src/transcripts-using-base/fix2158-1.output.md index 28aa5997fd..d3d4ce972e 100644 --- a/unison-src/transcripts-using-base/fix2158-1.output.md +++ b/unison-src/transcripts-using-base/fix2158-1.output.md @@ -12,7 +12,6 @@ Async.parMap f as = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index f4225a9109..69dae77fac 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -25,7 +25,6 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red needs the {IO} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index cd119e6da0..73f94c3761 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -9,7 +9,6 @@ timingApp2 _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3166.output.md b/unison-src/transcripts-using-base/fix3166.output.md index 1408f6c690..a370eeb8e4 100644 --- a/unison-src/transcripts-using-base/fix3166.output.md +++ b/unison-src/transcripts-using-base/fix3166.output.md @@ -32,7 +32,6 @@ increment n = 1 + n ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,7 +82,6 @@ foo _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -127,7 +125,6 @@ hmm = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3542.output.md b/unison-src/transcripts-using-base/fix3542.output.md index 38018f78f3..df71ed5a37 100644 --- a/unison-src/transcripts-using-base/fix3542.output.md +++ b/unison-src/transcripts-using-base/fix3542.output.md @@ -14,7 +14,6 @@ arrayList v n = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index c28c8b089e..c9e6d16bc6 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -6,7 +6,6 @@ meh = 9 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,10 +25,12 @@ scratch/main> add meh : Nat meh.doc : Doc2 + scratch/main> find meh 1. meh : Nat 2. meh.doc : Doc2 + scratch/main> docs 1 A simple doc. diff --git a/unison-src/transcripts-using-base/fix4746.output.md b/unison-src/transcripts-using-base/fix4746.output.md index 36719b8539..8a93ee1c0b 100644 --- a/unison-src/transcripts-using-base/fix4746.output.md +++ b/unison-src/transcripts-using-base/fix4746.output.md @@ -36,7 +36,6 @@ run s = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/fix5129.output.md b/unison-src/transcripts-using-base/fix5129.output.md index 8510d11ec7..ce5c89a5de 100644 --- a/unison-src/transcripts-using-base/fix5129.output.md +++ b/unison-src/transcripts-using-base/fix5129.output.md @@ -27,7 +27,6 @@ go = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the application @@ -60,7 +59,6 @@ fancyTryEval = reraise << catchAll.impl ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index 33119da0d8..4bf5506a8b 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -75,7 +75,6 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -159,7 +158,6 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -382,7 +380,6 @@ test> hmac_sha2_512.tests.ex2 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -445,7 +442,6 @@ test> md5.tests.ex3 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index e4ffde23d5..7e18b62f4b 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -51,7 +51,6 @@ testMvars _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -71,6 +70,7 @@ scratch/main> add eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] + scratch/main> io.test testMvars New test results: diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index dcc38b1778..1fe0ce8e34 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -33,7 +33,6 @@ test = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,6 +58,7 @@ scratch/main> add -> Optional Int -> Optional Float ->{Stream Result} () + scratch/main> io.test test New test results: diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 78d568ad0d..7d6e6ba63c 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -97,7 +97,6 @@ testDefaultPort _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -119,6 +118,7 @@ scratch/main> add testDefaultHost : '{IO} [Result] testDefaultPort : '{IO} [Result] testExplicitHost : '{IO} [Result] + scratch/main> io.test testDefaultPort New test results: @@ -184,7 +184,6 @@ testTcpConnect = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -206,6 +205,7 @@ scratch/main> add clientThread : MVar Nat -> MVar Text -> '{IO} () serverThread : MVar Nat -> Text -> '{IO} () testTcpConnect : '{IO} [Result] + scratch/main> io.test testTcpConnect New test results: diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 32d52e2181..9b02b35804 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -56,7 +56,6 @@ serialTests = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -84,6 +83,7 @@ scratch/main> add runTestCase : Text ->{IO, Exception} (Text, Result) serialTests : '{IO, Exception} [Result] shuffle : Nat -> [a] -> [a] + scratch/main> io.test serialTests New test results: diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index 8cc4d2faa8..6ee80cacd3 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -19,7 +19,6 @@ casTest = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,6 +36,7 @@ scratch/main> add ⍟ I've added these definitions: casTest : '{IO} [Result] + scratch/main> io.test casTest New test results: @@ -80,7 +80,6 @@ promiseConcurrentTest = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -100,6 +99,7 @@ scratch/main> add promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] + scratch/main> io.test promiseSequentialTest New test results: @@ -110,6 +110,7 @@ scratch/main> io.test promiseSequentialTest ✅ 2 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test promiseConcurrentTest New test results: @@ -132,7 +133,6 @@ atomicUpdate ref f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -171,7 +171,6 @@ spawnN n fa = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -220,7 +219,6 @@ fullTest = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -238,6 +236,7 @@ scratch/main> add ⍟ I've added these definitions: fullTest : '{IO} [Result] + scratch/main> io.test fullTest New test results: 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 42c5b1ef6c..a116fcc248 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -68,7 +68,6 @@ mkTestCase = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -114,6 +113,7 @@ scratch/main> add tree1 : Tree Nat tree2 : Tree Nat tree3 : Tree Text + 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 78374f38ba..d7deff53f2 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -16,7 +16,6 @@ mkTestCase = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,6 +41,7 @@ scratch/main> add l2 : [Int] l3 : [Char] mkTestCase : '{IO, Exception} () + 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 0a5df2b091..9b91fe1aac 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -30,7 +30,6 @@ mkTestCase = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +59,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () prod : [Nat] -> Nat products : ([Nat], [Nat], [Nat]) -> Text + 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 d57b485bf6..72c15ebbdf 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -44,7 +44,6 @@ mkTestCase = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,6 +82,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () reset : '{DC r} r -> r suspSum : [Nat] -> Delayed Nat + 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 53bc5d8d14..9e45041b57 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -14,7 +14,6 @@ mkTestCase = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +35,7 @@ scratch/main> add mkTestCase : '{IO, Exception} () mutual0 : Nat -> Text mutual1 : Nat -> Text + scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index 0180e654c8..3edffadcf8 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -29,7 +29,6 @@ body k out v = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -91,7 +90,6 @@ tests = '(map spawn nats) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -115,6 +113,7 @@ scratch/main> add nats : [Nat] spawn : Nat ->{IO} Result tests : '{IO} [Result] + scratch/main> io.test tests New test results: 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 06592ae138..c4f43b9263 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -20,7 +20,6 @@ test> mytest = checks [x + 1 == 1001] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,7 +65,6 @@ test> useY = checks [y + 1 == 43] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index c98eb4dbc1..8f4924e69d 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -17,7 +17,6 @@ testBasicFork = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ See if we can get another thread to stuff a value into a MVar ``` ucm :hide scratch/main> add + scratch/main> io.test testBasicFork ``` @@ -62,7 +62,6 @@ testBasicMultiThreadMVar = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,6 +81,7 @@ scratch/main> add testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () + scratch/main> io.test testBasicMultiThreadMVar New test results: @@ -132,7 +132,6 @@ testTwoThreads = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -156,6 +155,7 @@ scratch/main> add sendingThread : Nat -> MVar Nat -> '{IO} () (also named thread1) testTwoThreads : '{IO} [Result] + scratch/main> io.test testTwoThreads New test results: diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 0877987a09..a475223453 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -32,7 +32,6 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,6 +53,7 @@ scratch/main> add this_should_not_work : [Result] this_should_work : [Result] what_should_work : ∀ _. _ -> [Result] + scratch/main> io.test what_should_work New test results: @@ -221,7 +221,6 @@ testCNReject _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -253,6 +252,7 @@ scratch/main> add -> MVar Nat -> '{IO, Exception} Text testConnectSelfSigned : '{IO} [Result] + scratch/main> io.test testConnectSelfSigned New test results: @@ -262,6 +262,7 @@ scratch/main> io.test testConnectSelfSigned ✅ 1 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test testCAReject New test results: @@ -271,6 +272,7 @@ scratch/main> io.test testCAReject ✅ 1 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test testCNReject New test results: diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index 5f67d71f69..75404e1eb4 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -21,7 +21,6 @@ ascii = "ABCDE" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,7 +50,6 @@ greek = "ΑΒΓΔΕ" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -86,7 +84,6 @@ test> greekTest = checkRoundTrip greek ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -121,7 +118,6 @@ greek_bytes = Bytes.fromList [206, 145, 206, 146, 206, 147, 206, 148, 206] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index 118f196a68..a4cf25a46b 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -49,6 +49,7 @@ scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.ch Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> find-in mylib 1. List.adjacentPairs : [a] -> [(a, a)] diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md index f2ed9f0446..218f5288a2 100644 --- a/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md +++ b/unison-src/transcripts/errors/dont-hide-unexpected-ucm-errors.output.md @@ -2,6 +2,7 @@ Since this code block is expecting an error, we still hide it. It seems unusual ``` ucm :hide:error scratch/main> help pull + scratch/main> not.a.command ``` @@ -32,6 +33,7 @@ scratch/main> help pull Project Branch `@unison/base/feature` Contributor Branch `@unison/base/@johnsmith/feature` Project Release `@unison/base/releases/1.0.0` + scratch/main> not.a.command ⚠️ diff --git a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md index 8069556a7a..b0874d13e7 100644 --- a/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md +++ b/unison-src/transcripts/errors/dont-hide-unexpected-unison-errors.output.md @@ -11,7 +11,6 @@ x + x + ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/fix-5402.output.md b/unison-src/transcripts/fix-5402.output.md index b220a92a86..a52e697869 100644 --- a/unison-src/transcripts/fix-5402.output.md +++ b/unison-src/transcripts/fix-5402.output.md @@ -7,7 +7,6 @@ x = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -26,7 +25,6 @@ x = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index a8e3cf478b..c7564924b7 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -30,7 +30,6 @@ x = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in myfile.u. I found and typechecked these definitions in myfile.u. If you @@ -50,6 +49,7 @@ scratch/main> add ⍟ I've added these definitions: x : Nat + scratch/main> view x x : Nat @@ -84,7 +84,6 @@ hmm = "Not, in fact, a number" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a value of type: Text diff --git a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md index d0cbce1e96..3656daaba2 100644 --- a/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md +++ b/unison-src/transcripts/idempotent/ability-order-doesnt-affect-hash.md @@ -23,6 +23,7 @@ scratch/main> add ability Foo term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () + scratch/main> names term1 Term diff --git a/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md b/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md index 0945af447a..83ecb5c59d 100644 --- a/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md +++ b/unison-src/transcripts/idempotent/ability-term-conflicts-on-update.md @@ -15,7 +15,6 @@ unique ability Channels where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,7 +50,6 @@ thing _ = send 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -80,6 +78,7 @@ scratch/main> update.old patch Channels.send term/ctor collision Channels.send : a -> () Tip: Use `help filestatus` to learn more. + scratch/main> update.old patch thing ⍟ I've added these definitions: @@ -106,7 +105,6 @@ thing _ = send 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -137,6 +135,7 @@ scratch/main> update.old.preview patch Channels.send new definition: Channels.send : a ->{Channels} () + scratch/main> update.old.preview patch thing I found and typechecked these definitions in scratch.u. If you @@ -176,7 +175,6 @@ X.x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -202,7 +200,6 @@ structural ability X where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/add-run.md b/unison-src/transcripts/idempotent/add-run.md index 8181861e7c..46e1ffccfc 100644 --- a/unison-src/transcripts/idempotent/add-run.md +++ b/unison-src/transcripts/idempotent/add-run.md @@ -77,7 +77,6 @@ main _ = y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -95,6 +94,7 @@ main _ = y scratch/main> run main a b -> a Nat.+ b Nat.+ z 10 + scratch/main> add.run result ⍟ I've added these definitions: @@ -111,7 +111,6 @@ inc x = x + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -140,11 +139,13 @@ main _ x = inc x scratch/main> run main inc + scratch/main> add.run natfoo ⍟ I've added these definitions: natfoo : Nat -> Nat + scratch/main> view natfoo natfoo : Nat -> Nat @@ -160,7 +161,6 @@ main = 'y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -192,6 +192,7 @@ scratch/main> add.run xres ⍟ I've added these definitions: xres : Nat + scratch/main> view xres xres : Nat @@ -208,6 +209,7 @@ main = '5 scratch/main> run main 5 + scratch/main> add.run xres x These definitions failed: @@ -228,11 +230,13 @@ main = '5 scratch/main> run main 5 + scratch/main> add.run .an.absolute.name ⍟ I've added these definitions: .an.absolute.name : Nat + scratch/main> view .an.absolute.name .an.absolute.name : Nat diff --git a/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md index c2ce7b7fb3..846cd1537d 100644 --- a/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md +++ b/unison-src/transcripts/idempotent/add-test-watch-roundtrip.md @@ -15,6 +15,7 @@ scratch/main> add ⍟ I've added these definitions: foo : [Result] + scratch/main> view foo foo : [Result] diff --git a/unison-src/transcripts/idempotent/addupdatemessages.md b/unison-src/transcripts/idempotent/addupdatemessages.md index 3cf4b245f2..a91b32bfa3 100644 --- a/unison-src/transcripts/idempotent/addupdatemessages.md +++ b/unison-src/transcripts/idempotent/addupdatemessages.md @@ -15,7 +15,6 @@ structural type Y = Two Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,7 +51,6 @@ structural type Z = One Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -89,7 +87,6 @@ structural type X = Three Nat Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -128,7 +125,6 @@ structural type X = Two Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/alias-term.md b/unison-src/transcripts/idempotent/alias-term.md index 5fde538677..553afa52b3 100644 --- a/unison-src/transcripts/idempotent/alias-term.md +++ b/unison-src/transcripts/idempotent/alias-term.md @@ -8,6 +8,7 @@ project/main> builtins.mergeio lib.builtins project/main> alias.term lib.builtins.bug foo Done. + project/main> ls 1. foo (a -> b) @@ -37,6 +38,7 @@ You can use `debug.alias.term.force` for that. project/main> debug.alias.term.force lib.builtins.todo foo Done. + project/main> ls 1. foo (a -> b) diff --git a/unison-src/transcripts/idempotent/alias-type.md b/unison-src/transcripts/idempotent/alias-type.md index 2740753e46..98a7de829b 100644 --- a/unison-src/transcripts/idempotent/alias-type.md +++ b/unison-src/transcripts/idempotent/alias-type.md @@ -8,6 +8,7 @@ project/main> builtins.mergeio lib.builtins project/main> alias.type lib.builtins.Nat Foo Done. + project/main> ls 1. Foo (builtin type) @@ -37,6 +38,7 @@ You can use `debug.alias.type.force` for that. project/main> debug.alias.type.force lib.builtins.Int Foo Done. + project/main> ls 1. Foo (builtin type) diff --git a/unison-src/transcripts/idempotent/anf-tests.md b/unison-src/transcripts/idempotent/anf-tests.md index 9bd5080fe3..18cca0ade1 100644 --- a/unison-src/transcripts/idempotent/anf-tests.md +++ b/unison-src/transcripts/idempotent/anf-tests.md @@ -30,7 +30,6 @@ foo _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/any-extract.md b/unison-src/transcripts/idempotent/any-extract.md index b17ca9b6f1..a6621b64ba 100644 --- a/unison-src/transcripts/idempotent/any-extract.md +++ b/unison-src/transcripts/idempotent/any-extract.md @@ -2,7 +2,9 @@ ``` ucm :hide scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -19,7 +21,6 @@ test> Any.unsafeExtract.works = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/api-find.md b/unison-src/transcripts/idempotent/api-find.md index d08334aa0a..33fab9d0bb 100644 --- a/unison-src/transcripts/idempotent/api-find.md +++ b/unison-src/transcripts/idempotent/api-find.md @@ -8,7 +8,6 @@ joey.yaml.zz = 45 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/api-list-projects-branches.md b/unison-src/transcripts/idempotent/api-list-projects-branches.md index 9d5952766b..02d2d2541f 100644 --- a/unison-src/transcripts/idempotent/api-list-projects-branches.md +++ b/unison-src/transcripts/idempotent/api-list-projects-branches.md @@ -2,10 +2,15 @@ ``` ucm :hide 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/idempotent/api-namespace-details.md b/unison-src/transcripts/idempotent/api-namespace-details.md index 5e2db50a07..4cbbd01c51 100644 --- a/unison-src/transcripts/idempotent/api-namespace-details.md +++ b/unison-src/transcripts/idempotent/api-namespace-details.md @@ -14,7 +14,6 @@ Here's a *README*! ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/api-namespace-list.md b/unison-src/transcripts/idempotent/api-namespace-list.md index 5139f87319..7287cec514 100644 --- a/unison-src/transcripts/idempotent/api-namespace-list.md +++ b/unison-src/transcripts/idempotent/api-namespace-list.md @@ -12,7 +12,6 @@ nested.names.readme = {{ I'm a readme! }} ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/api-summaries.md b/unison-src/transcripts/idempotent/api-summaries.md index 039efb04b9..d10db43d61 100644 --- a/unison-src/transcripts/idempotent/api-summaries.md +++ b/unison-src/transcripts/idempotent/api-summaries.md @@ -25,7 +25,9 @@ structural ability Stream s where ``` ucm :hide scratch/main> add + scratch/main> alias.type ##Nat Nat + scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl ``` diff --git a/unison-src/transcripts/idempotent/block-on-required-update.md b/unison-src/transcripts/idempotent/block-on-required-update.md index be0e05764d..4f69704692 100644 --- a/unison-src/transcripts/idempotent/block-on-required-update.md +++ b/unison-src/transcripts/idempotent/block-on-required-update.md @@ -11,7 +11,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,7 +38,6 @@ y = x + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/blocks.md b/unison-src/transcripts/idempotent/blocks.md index 9645fffd9b..167c580bb3 100644 --- a/unison-src/transcripts/idempotent/blocks.md +++ b/unison-src/transcripts/idempotent/blocks.md @@ -20,7 +20,6 @@ ex thing = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -53,7 +52,6 @@ ex thing = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -88,7 +86,6 @@ ex thing = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -120,7 +117,6 @@ ex thing = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -159,7 +155,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -186,7 +181,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -210,7 +204,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: pong8 @@ -227,7 +220,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. These definitions depend on each other cyclically but aren't guarded by a lambda: loop8 @@ -243,7 +235,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -272,7 +263,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red needs the {SpaceAttack} ability, but this location does not have access to any abilities. @@ -295,7 +285,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -324,7 +313,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -351,7 +339,6 @@ ex n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md b/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md index 4af3c7d061..420466b531 100644 --- a/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md +++ b/unison-src/transcripts/idempotent/boolean-op-pretty-print-2819.md @@ -12,7 +12,6 @@ hangExample = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +29,7 @@ scratch/main> add ⍟ I've added these definitions: hangExample : Boolean + scratch/main> view hangExample hangExample : Boolean diff --git a/unison-src/transcripts/idempotent/branch-command.md b/unison-src/transcripts/idempotent/branch-command.md index 00ad35f4e5..67e97a1b4c 100644 --- a/unison-src/transcripts/idempotent/branch-command.md +++ b/unison-src/transcripts/idempotent/branch-command.md @@ -2,6 +2,7 @@ The `branch` command creates a new branch. ``` ucm :hide scratch/main> project.create-empty foo + scratch/main> project.create-empty bar ``` @@ -15,6 +16,7 @@ someterm = 18 scratch/main> builtins.merge lib.builtins Done. + scratch/main> add ⍟ I've added these definitions: @@ -34,99 +36,118 @@ foo/main> branch topic1 Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic1`. + foo/main> branch /topic2 Done. I've created the topic2 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic2`. + foo/main> branch foo/topic3 Done. I've created the topic3 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic3`. + foo/main> branch main topic4 Done. I've created the topic4 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic4`. + foo/main> branch main /topic5 Done. I've created the topic5 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic5`. + foo/main> branch main foo/topic6 Done. I've created the topic6 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic6`. + foo/main> branch /main topic7 Done. I've created the topic7 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic7`. + foo/main> branch /main /topic8 Done. I've created the topic8 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic8`. + foo/main> branch /main foo/topic9 Done. I've created the topic9 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic9`. + foo/main> branch foo/main topic10 Done. I've created the topic10 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic10`. + foo/main> branch foo/main /topic11 Done. I've created the topic11 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. + scratch/main> branch foo/main foo/topic12 Done. I've created the topic12 branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic12`. + foo/main> branch bar/topic Done. I've created the bar/topic branch based off foo/main. + bar/main> branch foo/main topic2 Done. I've created the bar/topic2 branch based off foo/main. + bar/main> branch foo/main /topic3 Done. I've created the bar/topic3 branch based off foo/main. + scratch/main> branch foo/main bar/topic4 Done. I've created the bar/topic4 branch based off foo/main. + foo/main> branch.empty empty1 Done. I've created an empty branch foo/empty1. Tip: Use `merge /somebranch` to initialize this branch. + foo/main> branch.empty /empty2 Done. I've created an empty branch foo/empty2. Tip: Use `merge /somebranch` to initialize this branch. + foo/main> branch.empty foo/empty3 Done. I've created an empty branch foo/empty3. Tip: Use `merge /somebranch` to initialize this branch. + scratch/main> branch.empty foo/empty4 Done. I've created an empty branch foo/empty4. @@ -144,6 +165,7 @@ foo/main> branch releases/drafts/1.2.3 Tip: To merge your work back into the main branch, first `switch /main` then `merge /releases/drafts/1.2.3`. + foo/main> switch /releases/drafts/1.2.3 ``` @@ -158,6 +180,7 @@ foo/main> branch releases/1.2.3 `clone /releases/1.2.3`. Tip: to draft a new release, try `release.draft 1.2.3`. + foo/main> switch /releases/1.2.3 foo/releases/1.2.3 does not exist. diff --git a/unison-src/transcripts/idempotent/branch-relative-path.md b/unison-src/transcripts/idempotent/branch-relative-path.md index 336d4c232b..67775adbb8 100644 --- a/unison-src/transcripts/idempotent/branch-relative-path.md +++ b/unison-src/transcripts/idempotent/branch-relative-path.md @@ -4,7 +4,6 @@ foo.bar = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,7 +31,6 @@ donk.bonk = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,32 +52,40 @@ p1/main> add bonk : ##Nat donk.bonk : ##Nat + p1/main> fork p0/main: zzz Done. + p1/main> find zzz 1. zzz.foo : ##Nat 2. zzz.foo.bar : ##Nat + p1/main> fork p0/main:foo yyy Done. + p1/main> find yyy 1. yyy.bar : ##Nat + p0/main> fork p1/main: p0/main:p1 Done. + p0/main> ls p1 1. bonk (##Nat) 2. donk/ (1 term) 3. yyy/ (1 term) 4. zzz/ (2 terms) + p0/main> ls p1.zzz 1. foo (##Nat) 2. foo/ (1 term) + p0/main> ls p1.yyy 1. bar (##Nat) diff --git a/unison-src/transcripts/idempotent/bug-fix-4354.md b/unison-src/transcripts/idempotent/bug-fix-4354.md index d662783099..878dfce1f7 100644 --- a/unison-src/transcripts/idempotent/bug-fix-4354.md +++ b/unison-src/transcripts/idempotent/bug-fix-4354.md @@ -13,7 +13,6 @@ bonk x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/bug-strange-closure.md b/unison-src/transcripts/idempotent/bug-strange-closure.md index 23a5fc90db..15c5aace2d 100644 --- a/unison-src/transcripts/idempotent/bug-strange-closure.md +++ b/unison-src/transcripts/idempotent/bug-strange-closure.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/main> load unison-src/transcripts-using-base/doc.md.files/syntax.u ``` @@ -203,6 +204,7 @@ scratch/main> display doc.guide row occupies multiple lines in the rendered table. Some text More text Zounds! + scratch/main> add ⍟ I've added these definitions: @@ -215,6 +217,7 @@ scratch/main> add nonUnisonCodeBlocks : Doc2 otherElements : Doc2 sqr : Nat -> Nat + scratch/main> display doc.guide # Unison computable documentation @@ -421,7 +424,6 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -631,11 +633,13 @@ scratch/main> display rendered row occupies multiple lines in the rendered table. Some text More text Zounds! + scratch/main> add ⍟ I've added these definitions: rendered : Annotated () (Either SpecialForm ConsoleText) + scratch/main> display rendered # Unison computable documentation @@ -833,6 +837,7 @@ scratch/main> display rendered row occupies multiple lines in the rendered table. Some text More text Zounds! + scratch/main> undo Here are the changes I undid @@ -851,7 +856,6 @@ rendered = Pretty.get (docFormatConsole doc.guide) ``` ```` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/builtins-merge.md b/unison-src/transcripts/idempotent/builtins-merge.md index 0c709fe1d3..27da76caaa 100644 --- a/unison-src/transcripts/idempotent/builtins-merge.md +++ b/unison-src/transcripts/idempotent/builtins-merge.md @@ -4,6 +4,7 @@ The `builtins.merge` command adds the known builtins to the specified subnamespa scratch/main> builtins.merge builtins Done. + scratch/main> ls builtins 1. Any (builtin type) diff --git a/unison-src/transcripts/idempotent/builtins.md b/unison-src/transcripts/idempotent/builtins.md index 298ac7816e..e36c81246d 100644 --- a/unison-src/transcripts/idempotent/builtins.md +++ b/unison-src/transcripts/idempotent/builtins.md @@ -2,7 +2,9 @@ ``` ucm :hide scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -394,7 +396,6 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -450,7 +451,6 @@ openFile] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -507,7 +507,6 @@ openFilesIO = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -525,6 +524,7 @@ scratch/main> add ⍟ I've added these definitions: openFilesIO : '{IO} [Result] + scratch/main> io.test openFilesIO New test results: @@ -546,7 +546,6 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/bytesFromList.md b/unison-src/transcripts/idempotent/bytesFromList.md index 664c9dff1b..4640272396 100644 --- a/unison-src/transcripts/idempotent/bytesFromList.md +++ b/unison-src/transcripts/idempotent/bytesFromList.md @@ -9,7 +9,6 @@ This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/check763.md b/unison-src/transcripts/idempotent/check763.md index e7943b6b20..1582be2ea7 100644 --- a/unison-src/transcripts/idempotent/check763.md +++ b/unison-src/transcripts/idempotent/check763.md @@ -10,7 +10,6 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,9 +27,11 @@ scratch/main> add ⍟ I've added these definitions: +-+ : Nat -> Nat -> Nat + scratch/main> move.term +-+ boppitybeep Done. + scratch/main> move.term boppitybeep +-+ Done. diff --git a/unison-src/transcripts/idempotent/check873.md b/unison-src/transcripts/idempotent/check873.md index 64b5b383be..713767620f 100644 --- a/unison-src/transcripts/idempotent/check873.md +++ b/unison-src/transcripts/idempotent/check873.md @@ -9,7 +9,6 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +33,6 @@ baz x = x - 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/constructor-applied-to-unit.md b/unison-src/transcripts/idempotent/constructor-applied-to-unit.md index 875b92c07f..a0839b594f 100644 --- a/unison-src/transcripts/idempotent/constructor-applied-to-unit.md +++ b/unison-src/transcripts/idempotent/constructor-applied-to-unit.md @@ -1,5 +1,6 @@ ``` ucm :hide scratch/main> alias.type ##Nat Nat + scratch/main> alias.term ##Any.Any Any ``` @@ -11,7 +12,6 @@ structural type Zoink a b c = Zoink a b c ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/contrabilities.md b/unison-src/transcripts/idempotent/contrabilities.md index 0694f0e14a..717fb877c4 100644 --- a/unison-src/transcripts/idempotent/contrabilities.md +++ b/unison-src/transcripts/idempotent/contrabilities.md @@ -8,7 +8,6 @@ f x = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/create-author.md b/unison-src/transcripts/idempotent/create-author.md index c440dad44a..fa8c9adaa1 100644 --- a/unison-src/transcripts/idempotent/create-author.md +++ b/unison-src/transcripts/idempotent/create-author.md @@ -14,6 +14,7 @@ scratch/main> create.author alicecoder "Alice McGee" 3. metadata.authors.alicecoder.guid : GUID Tip: Add License values for alicecoder under metadata. + scratch/main> find alicecoder 1. metadata.authors.alicecoder : Author diff --git a/unison-src/transcripts/idempotent/cycle-update-1.md b/unison-src/transcripts/idempotent/cycle-update-1.md index 84ecc32e3d..90cb99c8b3 100644 --- a/unison-src/transcripts/idempotent/cycle-update-1.md +++ b/unison-src/transcripts/idempotent/cycle-update-1.md @@ -13,7 +13,6 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ ping _ = !pong + 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +63,7 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view ping pong ping : 'Nat diff --git a/unison-src/transcripts/idempotent/cycle-update-2.md b/unison-src/transcripts/idempotent/cycle-update-2.md index 9e35071030..30c05de9f2 100644 --- a/unison-src/transcripts/idempotent/cycle-update-2.md +++ b/unison-src/transcripts/idempotent/cycle-update-2.md @@ -13,7 +13,6 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ ping _ = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +63,7 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view ping pong ping : 'Nat diff --git a/unison-src/transcripts/idempotent/cycle-update-3.md b/unison-src/transcripts/idempotent/cycle-update-3.md index 3047e61a1e..f9821b96b1 100644 --- a/unison-src/transcripts/idempotent/cycle-update-3.md +++ b/unison-src/transcripts/idempotent/cycle-update-3.md @@ -13,7 +13,6 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ ping = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +58,7 @@ scratch/main> update.old ⍟ I've updated these names to your new definition: ping : Nat + scratch/main> view ping pong ping : Nat diff --git a/unison-src/transcripts/idempotent/cycle-update-4.md b/unison-src/transcripts/idempotent/cycle-update-4.md index 77b977c934..8bfc423b3c 100644 --- a/unison-src/transcripts/idempotent/cycle-update-4.md +++ b/unison-src/transcripts/idempotent/cycle-update-4.md @@ -13,7 +13,6 @@ pong _ = !ping + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +43,6 @@ clang _ = !pong + 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -72,6 +70,7 @@ scratch/main> update.old ping ping : 'Nat pong : 'Nat + scratch/main> view ping pong clang clang : 'Nat diff --git a/unison-src/transcripts/idempotent/debug-definitions.md b/unison-src/transcripts/idempotent/debug-definitions.md index f6aa5a0228..5bba3af74f 100644 --- a/unison-src/transcripts/idempotent/debug-definitions.md +++ b/unison-src/transcripts/idempotent/debug-definitions.md @@ -26,12 +26,15 @@ scratch/main> add (also named builtin.Optional) x : Nat y : Nat + scratch/main> debug.term.abt Nat.+ Builtin term: ##Nat.+ + 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" + scratch/main> debug.term.abt Some Constructor #0 of the following type: @@ -61,6 +64,7 @@ scratch/main> debug.term.abt Some ) ] } + scratch/main> debug.term.abt ask Constructor #0 of the following type: @@ -89,9 +93,11 @@ scratch/main> debug.term.abt ask ] } } + scratch/main> debug.type.abt Nat Builtin type: ##Nat + scratch/main> debug.type.abt Optional DataDeclaration @@ -120,6 +126,7 @@ scratch/main> debug.type.abt Optional ) ] } + scratch/main> debug.type.abt Ask EffectDeclaration diff --git a/unison-src/transcripts/idempotent/debug-name-diffs.md b/unison-src/transcripts/idempotent/debug-name-diffs.md index 6a452995f4..8790c7db5e 100644 --- a/unison-src/transcripts/idempotent/debug-name-diffs.md +++ b/unison-src/transcripts/idempotent/debug-name-diffs.md @@ -10,7 +10,6 @@ structural type a.b.Baz = Boo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,6 +37,7 @@ scratch/main> add a.two : ##Nat a.x.four : ##Nat a.x.three : ##Nat + scratch/main> delete.term.verbose a.b.one Removed definitions: @@ -46,12 +46,15 @@ scratch/main> delete.term.verbose a.b.one Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> alias.term a.two a.newtwo Done. + scratch/main> move.namespace a.x a.y Done. + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -86,6 +89,7 @@ scratch/main> history a.b.one □ 4. #gss5s88mo3 (start of history) + scratch/main> debug.name-diff 4 1 Kind Name Change Ref diff --git a/unison-src/transcripts/idempotent/deep-names.md b/unison-src/transcripts/idempotent/deep-names.md index e40dda1c04..34d842859d 100644 --- a/unison-src/transcripts/idempotent/deep-names.md +++ b/unison-src/transcripts/idempotent/deep-names.md @@ -14,7 +14,9 @@ http.z = 8 ``` ucm :hide scratch/main> add + scratch/main> branch /app1 + scratch/main> branch /app2 ``` @@ -24,18 +26,23 @@ Our `app1` project includes the text library twice and the http library twice as scratch/app1> fork text lib.text_v1 Done. + 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. @@ -49,6 +56,7 @@ scratch/app1> names a Term Hash: #gjmq673r1v Names: lib.text_v1.a lib.text_v2.a + scratch/app1> names x Term @@ -63,21 +71,27 @@ It also includes the `text` library twice as indirect dependencies via `webutil` 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 Done. + scratch/app2> delete.namespace text Done. @@ -92,6 +106,7 @@ scratch/app2> names a Term Hash: #gjmq673r1v Names: lib.webutil.lib.text_v1.a + scratch/app2> names x Term diff --git a/unison-src/transcripts/idempotent/definition-diff-api.md b/unison-src/transcripts/idempotent/definition-diff-api.md index d8ecc6fb35..a73ed6caa4 100644 --- a/unison-src/transcripts/idempotent/definition-diff-api.md +++ b/unison-src/transcripts/idempotent/definition-diff-api.md @@ -2,9 +2,11 @@ diffs/main> builtins.mergeio lib.builtins Done. + diffs/main> alias.term lib.builtins.Nat.gt lib.builtins.Nat.> Done. + diffs/main> alias.term lib.builtins.Nat.drop lib.builtins.Nat.- Done. @@ -33,7 +35,6 @@ take n s = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -57,6 +58,7 @@ diffs/main> add type Type take : Nat -> '{g} t ->{g, Stream a} Optional t term : Nat + diffs/main> branch.create new Done. I've created the new branch based off of main. @@ -90,7 +92,6 @@ take n s = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md b/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md index 55bbbc526c..0ded266003 100644 --- a/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md +++ b/unison-src/transcripts/idempotent/delete-namespace-dependents-check.md @@ -15,7 +15,6 @@ dependent = dependency + 99 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,12 +34,14 @@ myproject/main> add dependent : Nat sub.dependency : Nat + myproject/main> branch /new Done. I've created the new branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /new`. + myproject/new> delete.namespace sub ⚠️ @@ -53,6 +54,7 @@ myproject/new> delete.namespace sub If you want to proceed anyways and leave those definitions without names, use delete.namespace.force + myproject/new> view dependent dependent : Nat diff --git a/unison-src/transcripts/idempotent/delete-namespace.md b/unison-src/transcripts/idempotent/delete-namespace.md index 3360102d47..c3afeb7cb8 100644 --- a/unison-src/transcripts/idempotent/delete-namespace.md +++ b/unison-src/transcripts/idempotent/delete-namespace.md @@ -88,12 +88,15 @@ 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, or delete the current branch with `delete.branch` + 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 + scratch/main> history . Note: The most recent namespace hash is immediately below this @@ -112,7 +115,9 @@ 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 + scratch/main> history . Note: The most recent namespace hash is immediately below this diff --git a/unison-src/transcripts/idempotent/delete-project-branch.md b/unison-src/transcripts/idempotent/delete-project-branch.md index 9ed4a06a7e..62f93b38b0 100644 --- a/unison-src/transcripts/idempotent/delete-project-branch.md +++ b/unison-src/transcripts/idempotent/delete-project-branch.md @@ -8,6 +8,7 @@ foo/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. + foo/topic> delete.branch /topic ``` @@ -20,6 +21,7 @@ foo/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. + foo/topic> delete.branch topic ``` @@ -32,6 +34,7 @@ foo/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. + scratch/main> delete.branch foo/topic ``` @@ -45,6 +48,7 @@ You can delete the last branch in the project, a new one will be created. ``` ucm scratch/main> delete.branch scratch/main + scratch/main> branches Branch Remote branch @@ -56,7 +60,9 @@ If the the last branch isn't /main, then /main will be created. ``` ucm scratch/main2> delete.branch /main + scratch/main2> delete.branch /main2 + scratch/other> branches Branch Remote branch diff --git a/unison-src/transcripts/idempotent/delete-project.md b/unison-src/transcripts/idempotent/delete-project.md index 3830718958..3a9a3b90c6 100644 --- a/unison-src/transcripts/idempotent/delete-project.md +++ b/unison-src/transcripts/idempotent/delete-project.md @@ -16,6 +16,7 @@ scratch/main> project.create-empty foo 3. In UCM, type `add` to save it to your new project. 🎉 🥳 Happy coding! + scratch/main> project.create-empty bar 🎉 I've created the project bar. @@ -31,26 +32,39 @@ scratch/main> project.create-empty bar 3. In UCM, type `add` to save it to your new project. 🎉 🥳 Happy coding! + -- I can delete the project I'm currently on + scratch/main> delete.project scratch + foo/main> projects 1. bar 2. foo + -- I can delete a different project + foo/main> delete.project bar + foo/main> projects 1. foo + -- I can delete the last project, a new scratch project will be created + foo/main> delete.project foo + project/main> projects 1. project 2. scratch + -- If the last project is scratch, a scratch2 project will be created. + scratch/main> delete.project project + scratch/main> delete.project scratch + project/main> projects 1. project diff --git a/unison-src/transcripts/idempotent/delete-silent.md b/unison-src/transcripts/idempotent/delete-silent.md index a12f718915..0afc953732 100644 --- a/unison-src/transcripts/idempotent/delete-silent.md +++ b/unison-src/transcripts/idempotent/delete-silent.md @@ -19,12 +19,15 @@ scratch/main> add structural type Foo foo : ##Nat + scratch/main> delete foo Done. + scratch/main> delete.type Foo Done. + scratch/main> delete.term Foo.Foo Done. diff --git a/unison-src/transcripts/idempotent/delete.md b/unison-src/transcripts/idempotent/delete.md index 89e8019007..45ed52aba8 100644 --- a/unison-src/transcripts/idempotent/delete.md +++ b/unison-src/transcripts/idempotent/delete.md @@ -33,6 +33,7 @@ scratch/main> add structural type Foo foo : Nat + scratch/main> delete.verbose foo Removed definitions: @@ -41,6 +42,7 @@ scratch/main> delete.verbose foo Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> delete.verbose Foo Removed definitions: @@ -49,6 +51,7 @@ scratch/main> delete.verbose Foo Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> delete.verbose Foo.Foo Removed definitions: @@ -73,6 +76,7 @@ scratch/main> add a.bar : Nat a.foo : Nat + scratch/main> debug.alias.term.force a.bar a.foo Done. @@ -95,6 +99,7 @@ scratch/main> delete.verbose a.foo Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> ls a 1. bar (Nat) @@ -115,9 +120,11 @@ scratch/main> add structural type a.Bar (also named lib.builtins.Unit) structural type a.Foo + scratch/main> debug.alias.type.force a.Bar a.Foo Done. + scratch/main> delete.verbose a.Foo Removed definitions: @@ -133,6 +140,7 @@ scratch/main> delete.verbose a.Foo Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> delete.verbose a.Foo.Foo Removed definitions: @@ -157,6 +165,7 @@ scratch/main> add structural type foo foo : Nat + scratch/main> delete.verbose foo Removed definitions: @@ -184,6 +193,7 @@ scratch/main> add a : Text b : Text c : Text + scratch/main> delete.verbose a b c Removed definitions: @@ -214,6 +224,7 @@ scratch/main> add a : Text b : Text c : Text + scratch/main> delete.verbose a b c Foo Removed definitions: @@ -225,6 +236,7 @@ scratch/main> delete.verbose a b c Foo Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> delete.verbose Foo.Foo Name changes: @@ -249,6 +261,7 @@ scratch/main> add ⍟ I've added these definitions: structural type Foo + scratch/main> delete.verbose Foo Foo.Foo Removed definitions: @@ -284,6 +297,7 @@ scratch/main> add (also named a.bar) c : Nat d : Nat + scratch/main> delete.verbose a b c ⚠️ @@ -315,6 +329,7 @@ scratch/main> add f : Nat g : Nat h : Nat + scratch/main> delete.verbose e f g h Removed definitions: @@ -345,6 +360,7 @@ scratch/main> add structural type Foo incrementFoo : Foo -> Nat + scratch/main> delete.verbose Foo Foo.Foo incrementFoo Removed definitions: @@ -375,6 +391,7 @@ scratch/main> add f : Nat g : Nat h : Nat + scratch/main> delete.verbose e f gg ⚠️ @@ -397,6 +414,7 @@ scratch/main> add ping : 'Nat pong : 'Nat + scratch/main> delete.verbose ping Removed definitions: @@ -405,6 +423,7 @@ scratch/main> delete.verbose ping Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> view pong pong : 'Nat diff --git a/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md b/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md index b41edea0f1..715aefd5b9 100644 --- a/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md +++ b/unison-src/transcripts/idempotent/dependents-dependencies-debugfile.md @@ -52,9 +52,11 @@ scratch/main> add inside.r : Boolean outside.c : Nat outside.d : Boolean + scratch/main> dependents q q has no dependents. + scratch/main> dependencies q Dependencies of: q @@ -71,6 +73,7 @@ scratch/main> dependencies q Tip: Try `view 4` to see the source of any numbered item in the above list. + scratch/main> dependencies B Dependencies of: type B, B @@ -82,6 +85,7 @@ scratch/main> dependencies B Tip: Try `view 2` to see the source of any numbered item in the above list. + scratch/main> dependencies d Dependencies of: d @@ -100,6 +104,7 @@ scratch/main> dependencies d Tip: Try `view 6` to see the source of any numbered item in the above list. + scratch/main> dependents d Dependents of: d diff --git a/unison-src/transcripts/idempotent/destructuring-binds.md b/unison-src/transcripts/idempotent/destructuring-binds.md index fcaa949d26..e18e80649a 100644 --- a/unison-src/transcripts/idempotent/destructuring-binds.md +++ b/unison-src/transcripts/idempotent/destructuring-binds.md @@ -19,7 +19,6 @@ ex1 tup = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,6 +38,7 @@ scratch/main> add ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat + scratch/main> view ex0 ex1 ex0 : Nat -> Nat @@ -62,7 +62,6 @@ ex2 tup = match tup with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -86,7 +85,6 @@ ex4 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what a refers to here: @@ -120,7 +118,6 @@ ex5a _ = match (99 + 1, "hi") with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -140,6 +137,7 @@ scratch/main> add ex5 : 'Text ex5a : 'Text + scratch/main> view ex5 ex5a ex5 : 'Text @@ -170,6 +168,7 @@ scratch/main> add ⍟ I've added these definitions: ex6 : (Nat, Nat) -> Nat + scratch/main> view ex6 ex6 : (Nat, Nat) -> Nat diff --git a/unison-src/transcripts/idempotent/diff-namespace.md b/unison-src/transcripts/idempotent/diff-namespace.md index 08f325a6d6..64063922aa 100644 --- a/unison-src/transcripts/idempotent/diff-namespace.md +++ b/unison-src/transcripts/idempotent/diff-namespace.md @@ -1,8 +1,12 @@ ``` ucm :hide scratch/b1> builtins.merge lib.builtins + scratch/b2> builtins.merge lib.builtins + scratch/nsx> builtins.merge lib.builtins + scratch/main> builtins.merge lib.builtins + scratch/ns1> builtins.merge lib.builtins ``` @@ -34,6 +38,7 @@ scratch/b2> add abc : Nat fslkdjflskdjflksjdf : Nat x : Nat + scratch/b1> debug.alias.term.force .x .fslkdjflskdjflksjdf Done. @@ -91,12 +96,15 @@ scratch/ns1> add c : Nat fromJust : Nat helloWorld : Text + scratch/ns1> alias.term fromJust fromJust' Done. + scratch/ns1> alias.term helloWorld helloWorld2 Done. + scratch/ns1> branch /ns2 Done. I've created the ns2 branch based off of ns1. @@ -131,9 +139,11 @@ scratch/ns1> add ⍟ I've added these definitions: junk : Text + scratch/ns1> debug.alias.term.force junk fromJust Done. + scratch/ns1> delete.term junk Done. @@ -159,6 +169,7 @@ scratch/ns2> update Everything typechecks, so I'm saving the results... Done. + scratch/main> diff.namespace /ns1: /ns2: Resolved name conflicts: @@ -191,21 +202,27 @@ scratch/main> diff.namespace /ns1: /ns2: Original Changes 13. fromJust' ┐ 14. fromJust#gjmq673r1v (removed) 15. fromJust#gjmq673r1v ┘ + scratch/ns2> alias.term d d' Done. + scratch/ns2> alias.type A A' Done. + scratch/ns2> alias.term A.A A'.A Done. + scratch/ns2> alias.type X X' Done. + scratch/ns2> alias.term X.x X'.x Done. + scratch/main> diff.namespace /ns1: /ns2: Resolved name conflicts: @@ -247,27 +264,34 @@ scratch/main> diff.namespace /ns1: /ns2: 22. fromJust#gjmq673r1v ┘ 23. X.x 24. X'.x (added) + scratch/ns1> alias.type X X2 Done. + scratch/ns1> alias.term X.x X2.x Done. + scratch/ns2> alias.type A' A'' Done. + scratch/ns2> alias.term A'.A A''.A Done. + scratch/ns2> branch /ns3 Done. I've created the ns3 branch based off of ns2. Tip: To merge your work back into the ns2 branch, first `switch /ns2` then `merge /ns3`. + scratch/ns2> alias.term fromJust' yoohoo Done. + scratch/ns2> delete.term.verbose fromJust' Name changes: @@ -278,6 +302,7 @@ scratch/ns2> delete.term.verbose fromJust' Tip: You can use `undo` or use a hash from `reflog` to undo this change. + scratch/main> diff.namespace /ns3: /ns2: Name changes: @@ -298,6 +323,7 @@ scratch/ns3> update updated... Done. + scratch/main> diff.namespace /ns2: /ns3: Updates: @@ -333,12 +359,14 @@ scratch/nsx> add a : Nat b : Nat forconflicts : Nat + scratch/nsx> branch /nsy Done. I've created the nsy branch based off of nsx. Tip: To merge your work back into the nsx branch, first `switch /nsx` then `merge /nsy`. + scratch/nsx> branch /nsz Done. I've created the nsz branch based off of nsx. @@ -379,15 +407,18 @@ scratch/nsz> update Everything typechecks, so I'm saving the results... Done. + scratch/nsy> branch /nsw Done. I've created the nsw branch based off of nsy. Tip: To merge your work back into the nsy branch, first `switch /nsy` then `merge /nsw`. + scratch/nsw> debug.alias.term.force .forconflicts .a Done. + scratch/nsw> debug.alias.term.force .forconflicts .b Done. @@ -413,6 +444,7 @@ scratch/main> diff.namespace /nsx: /nsw: Original Changes 7. forconflicts 8. a#r3msrbpp1v (added) 9. b#r3msrbpp1v (added) + scratch/nsw> view a a#mdl4vqtu00 : Nat @@ -420,6 +452,7 @@ scratch/nsw> view a a#r3msrbpp1v : Nat a#r3msrbpp1v = 777 + scratch/nsw> view b b#r3msrbpp1v : Nat @@ -438,7 +471,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -463,7 +495,6 @@ y = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -481,6 +512,7 @@ scratch/hashdiff> add ⍟ I've added these definitions: y : ##Nat + scratch/hashdiff> history Note: The most recent namespace hash is immediately below this @@ -493,6 +525,7 @@ scratch/hashdiff> history y □ 2. #i52j9fd57b (start of history) + scratch/hashdiff> diff.namespace 2 1 Added definitions: diff --git a/unison-src/transcripts/idempotent/doc-formatting.md b/unison-src/transcripts/idempotent/doc-formatting.md index f6404dee11..079b3d5af8 100644 --- a/unison-src/transcripts/idempotent/doc-formatting.md +++ b/unison-src/transcripts/idempotent/doc-formatting.md @@ -14,7 +14,6 @@ foo n = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +46,6 @@ escaping = [: Docs look [: like \@this \:] :] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,7 +81,6 @@ commented = [: ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,7 +119,6 @@ doc1 = [: hi :] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -158,7 +154,6 @@ doc2 = [: hello ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -201,7 +196,6 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -252,7 +246,6 @@ doc4 = [: Here's another example of some paragraphs. ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -291,7 +284,6 @@ doc5 = [: - foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -327,7 +319,6 @@ doc6 = [: ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -364,7 +355,6 @@ expr = foo 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -429,7 +419,6 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -515,7 +504,6 @@ reg1363 = [: `@List.take foo` bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -549,7 +537,6 @@ test2 = [: ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/doc-type-link-keywords.md b/unison-src/transcripts/idempotent/doc-type-link-keywords.md index 8e9fdb7c99..f44cb26737 100644 --- a/unison-src/transcripts/idempotent/doc-type-link-keywords.md +++ b/unison-src/transcripts/idempotent/doc-type-link-keywords.md @@ -37,12 +37,15 @@ Now we check that each doc links to the object of the correct name: scratch/main> display docs.example1 A doc that links to the abilityPatterns term + scratch/main> display docs.example2 A doc that links to the Patterns ability + scratch/main> display docs.example3 A doc that links to the typeLabels term + scratch/main> display docs.example4 A doc that links to the Labels type diff --git a/unison-src/transcripts/idempotent/doc1.md b/unison-src/transcripts/idempotent/doc1.md index 1c95c14626..85e23d20f6 100644 --- a/unison-src/transcripts/idempotent/doc1.md +++ b/unison-src/transcripts/idempotent/doc1.md @@ -31,7 +31,6 @@ Can link to definitions like @List.drop or @List ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -63,7 +62,6 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -105,7 +103,6 @@ List.take.doc = [: ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/doc2markdown.md b/unison-src/transcripts/idempotent/doc2markdown.md index 9f8a946c0f..a27711ec6a 100644 --- a/unison-src/transcripts/idempotent/doc2markdown.md +++ b/unison-src/transcripts/idempotent/doc2markdown.md @@ -182,7 +182,6 @@ structural type MyStructuralType = MyStructuralType ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md b/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md index 6672495a0b..69f9032168 100644 --- a/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md +++ b/unison-src/transcripts/idempotent/dont-upgrade-refs-that-exist-in-old.md @@ -13,7 +13,6 @@ mything = lib.old.foo + lib.old.foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,9 +36,11 @@ foo/main> add lib.new.other : Nat lib.old.foo : Nat mything : Nat + foo/main> upgrade old new I upgraded old to new, and removed old. + foo/main> view mything mything : Nat diff --git a/unison-src/transcripts/idempotent/duplicate-names.md b/unison-src/transcripts/idempotent/duplicate-names.md index c1834160e3..7f67014c75 100644 --- a/unison-src/transcripts/idempotent/duplicate-names.md +++ b/unison-src/transcripts/idempotent/duplicate-names.md @@ -15,7 +15,6 @@ Stream.send _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -37,7 +36,6 @@ X.x _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -58,7 +56,6 @@ structural ability X where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found two types called X: @@ -78,7 +75,6 @@ X.x = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -110,7 +106,6 @@ X = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -132,6 +127,7 @@ scratch/main> add structural type X (also named builtin.Unit) X : () + scratch/main> view X structural type X = Z diff --git a/unison-src/transcripts/idempotent/duplicate-term-detection.md b/unison-src/transcripts/idempotent/duplicate-term-detection.md index 0e3eeebe0f..0115bf71a1 100644 --- a/unison-src/transcripts/idempotent/duplicate-term-detection.md +++ b/unison-src/transcripts/idempotent/duplicate-term-detection.md @@ -12,7 +12,6 @@ x = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -30,7 +29,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -50,7 +48,6 @@ Record.x.modify = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ @@ -87,7 +84,6 @@ AnAbility.thing = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ❗️ diff --git a/unison-src/transcripts/idempotent/ed25519.md b/unison-src/transcripts/idempotent/ed25519.md index 11bfafdd77..31311d9132 100644 --- a/unison-src/transcripts/idempotent/ed25519.md +++ b/unison-src/transcripts/idempotent/ed25519.md @@ -25,7 +25,6 @@ sigOkay = match signature with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/edit-command.md b/unison-src/transcripts/idempotent/edit-command.md index e64c2eec4c..1017033416 100644 --- a/unison-src/transcripts/idempotent/edit-command.md +++ b/unison-src/transcripts/idempotent/edit-command.md @@ -11,7 +11,6 @@ mytest = [Ok "ok"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,6 +32,7 @@ scratch/main> add bar : Nat foo : Nat mytest : [Result] + scratch/main> edit.new foo bar ☝️ @@ -41,6 +41,7 @@ scratch/main> edit.new foo bar You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/main> edit.new mytest ☝️ @@ -99,7 +100,6 @@ baz = 19 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -129,7 +129,6 @@ bar = 18 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This diff --git a/unison-src/transcripts/idempotent/edit-namespace.md b/unison-src/transcripts/idempotent/edit-namespace.md index 78e8f6aa2f..3e540bb147 100644 --- a/unison-src/transcripts/idempotent/edit-namespace.md +++ b/unison-src/transcripts/idempotent/edit-namespace.md @@ -22,7 +22,6 @@ unique type Foo = { bar : Nat, baz : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/empty-namespaces.md b/unison-src/transcripts/idempotent/empty-namespaces.md index 51807308a4..680629e332 100644 --- a/unison-src/transcripts/idempotent/empty-namespaces.md +++ b/unison-src/transcripts/idempotent/empty-namespaces.md @@ -6,6 +6,7 @@ mynamespace.x = 1 ``` ucm :hide scratch/main> add + scratch/main> delete.namespace mynamespace ``` @@ -75,6 +76,7 @@ stuff.thing = 2 ``` ucm :hide scratch/main> add + scratch/main> delete.namespace deleted ``` @@ -99,6 +101,7 @@ scratch/main> history stuff □ 1. #q2dq4tsno1 (start of history) + scratch/main> history deleted Note: The most recent namespace hash is immediately below this @@ -127,6 +130,7 @@ The history should be that of the moved namespace. scratch/main> delete.namespace moveoverme Done. + scratch/main> history moveme Note: The most recent namespace hash is immediately below this @@ -135,9 +139,11 @@ scratch/main> history moveme □ 1. #c5uisu4kll (start of history) + scratch/main> move.namespace moveme moveoverme Done. + scratch/main> history moveoverme Note: The most recent namespace hash is immediately below this diff --git a/unison-src/transcripts/idempotent/emptyCodebase.md b/unison-src/transcripts/idempotent/emptyCodebase.md index 6492740f26..3b2c7090e1 100644 --- a/unison-src/transcripts/idempotent/emptyCodebase.md +++ b/unison-src/transcripts/idempotent/emptyCodebase.md @@ -18,6 +18,7 @@ Technically, the definitions all exist, but they have no names. `builtins.merge` scratch/main> builtins.merge lib.builtins Done. + scratch/main> ls lib 1. builtins/ (469 terms, 74 types) @@ -29,6 +30,7 @@ And for a limited time, you can get even more builtin goodies: scratch/main> builtins.mergeio lib.builtinsio Done. + scratch/main> ls lib 1. builtins/ (469 terms, 74 types) diff --git a/unison-src/transcripts/idempotent/error-messages.md b/unison-src/transcripts/idempotent/error-messages.md index 1496829a52..27d45287c1 100644 --- a/unison-src/transcripts/idempotent/error-messages.md +++ b/unison-src/transcripts/idempotent/error-messages.md @@ -15,7 +15,6 @@ x = 1. -- missing some digits after the decimal ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -31,7 +30,6 @@ x = 1e -- missing an exponent ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -47,7 +45,6 @@ x = 1e- -- missing an exponent ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -63,7 +60,6 @@ x = 1E+ -- missing an exponent ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -81,7 +77,6 @@ x = 0xoogabooga -- invalid hex chars ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -97,7 +92,6 @@ x = 0o987654321 -- 9 and 8 are not valid octal char ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -113,7 +107,6 @@ x = 0b3201 -- 3 and 2 are not valid binary chars ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This number isn't valid syntax: @@ -129,7 +122,6 @@ x = 0xsf -- odd number of hex chars in a bytes literal ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsf @@ -145,7 +137,6 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This bytes literal isn't valid syntax: 0xsnotvalidhexchars @@ -163,7 +154,6 @@ foo = else -- not matching if ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a closing 'else' here without a matching 'then'. @@ -176,7 +166,6 @@ foo = then -- unclosed ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a closing 'then' here without a matching 'if'. @@ -189,7 +178,6 @@ foo = with -- unclosed ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a closing 'with' here without a matching 'handle' or 'match'. @@ -205,7 +193,6 @@ foo = match 1 with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -222,7 +209,6 @@ foo = match 1 with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -245,7 +231,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. 😶 @@ -268,7 +253,6 @@ x = match Some a with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -295,7 +279,6 @@ x = match Some a with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -318,7 +301,6 @@ x = match Some a with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -341,7 +323,6 @@ x = match Some a with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I expected a non-empty watch expression and not just ">" @@ -356,7 +337,6 @@ use.keyword.in.namespace = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The identifier `namespace` used here is a reserved keyword: @@ -373,7 +353,6 @@ a ! b = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This looks like the start of an expression here diff --git a/unison-src/transcripts/idempotent/escape-sequences.md b/unison-src/transcripts/idempotent/escape-sequences.md index fdc05a5045..463d97e117 100644 --- a/unison-src/transcripts/idempotent/escape-sequences.md +++ b/unison-src/transcripts/idempotent/escape-sequences.md @@ -5,7 +5,6 @@ ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/find-by-type.md b/unison-src/transcripts/idempotent/find-by-type.md index d4a8f1a26f..156b3a7f72 100644 --- a/unison-src/transcripts/idempotent/find-by-type.md +++ b/unison-src/transcripts/idempotent/find-by-type.md @@ -25,13 +25,16 @@ scratch/main> add bar : Text -> A baz : A -> Text foo : A + scratch/main> find : Text -> A 1. bar : Text -> A 2. A.A : Text -> A + scratch/main> find : A -> Text 1. baz : A -> Text + scratch/main> find : A 1. foo : A diff --git a/unison-src/transcripts/idempotent/find-command.md b/unison-src/transcripts/idempotent/find-command.md index ad1cb6727f..efe319c58a 100644 --- a/unison-src/transcripts/idempotent/find-command.md +++ b/unison-src/transcripts/idempotent/find-command.md @@ -21,16 +21,19 @@ scratch/main> find foo 1. cat.foo : Nat 2. foo : Nat + scratch/main> view 1 cat.foo : Nat cat.foo = 4 + scratch/main> find.all foo 1. cat.foo : Nat 2. cat.lib.foo : Nat 3. lib.foo : Nat 4. foo : Nat + scratch/main> view 1 cat.foo : Nat @@ -41,14 +44,17 @@ scratch/main> view 1 scratch/main> find-in cat foo 1. foo : Nat + scratch/main> view 1 cat.foo : Nat cat.foo = 4 + scratch/main> find-in.all cat foo 1. lib.foo : Nat 2. foo : Nat + scratch/main> view 1 cat.lib.foo : Nat @@ -61,6 +67,7 @@ Finding within a namespace scratch/main> find bar 1. somewhere.bar : Nat + scratch/other> debug.find.global bar Found results in scratch/main @@ -68,6 +75,7 @@ scratch/other> debug.find.global bar 1. .cat.lib.bar : Nat 2. .lib.bar : Nat 3. .somewhere.bar : Nat + scratch/main> find-in somewhere bar 1. bar : Nat diff --git a/unison-src/transcripts/idempotent/fix-5267.md b/unison-src/transcripts/idempotent/fix-5267.md index 475180d672..22cfd2bd71 100644 --- a/unison-src/transcripts/idempotent/fix-5267.md +++ b/unison-src/transcripts/idempotent/fix-5267.md @@ -11,7 +11,6 @@ bar = direct.foo + direct.foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +35,7 @@ scratch/main> add bar : Nat lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat + scratch/main> view bar bar : Nat @@ -54,7 +54,6 @@ type Bar = MkBar direct.Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -76,6 +75,7 @@ scratch/main> add type Bar type lib.direct.Foo type lib.direct.lib.indirect.Foo + scratch/main> view Bar type Bar = MkBar Foo diff --git a/unison-src/transcripts/idempotent/fix-5301.md b/unison-src/transcripts/idempotent/fix-5301.md index be2a126470..4e6621cb46 100644 --- a/unison-src/transcripts/idempotent/fix-5301.md +++ b/unison-src/transcripts/idempotent/fix-5301.md @@ -16,7 +16,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. @@ -43,7 +42,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix-5312.md b/unison-src/transcripts/idempotent/fix-5312.md index 710cf258c2..870083dcad 100644 --- a/unison-src/transcripts/idempotent/fix-5312.md +++ b/unison-src/transcripts/idempotent/fix-5312.md @@ -17,7 +17,6 @@ c = b.y + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +47,6 @@ x = 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-5320.md b/unison-src/transcripts/idempotent/fix-5320.md index a4142f5c3a..229cab0c43 100644 --- a/unison-src/transcripts/idempotent/fix-5320.md +++ b/unison-src/transcripts/idempotent/fix-5320.md @@ -10,7 +10,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix-5323.md b/unison-src/transcripts/idempotent/fix-5323.md index 873797fadc..7c658afc5a 100644 --- a/unison-src/transcripts/idempotent/fix-5323.md +++ b/unison-src/transcripts/idempotent/fix-5323.md @@ -18,7 +18,6 @@ c = b.y + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-5326.md b/unison-src/transcripts/idempotent/fix-5326.md index 71e7894ed9..cc5d8a12e2 100644 --- a/unison-src/transcripts/idempotent/fix-5326.md +++ b/unison-src/transcripts/idempotent/fix-5326.md @@ -9,7 +9,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -28,6 +27,7 @@ scratch/main> update updated... Done. + scratch/main> branch foo Done. I've created the foo branch based off of main. @@ -47,7 +47,6 @@ x = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +66,7 @@ scratch/main> update updated... Done. + scratch/main> branch bar Done. I've created the bar branch based off of main. @@ -88,7 +88,6 @@ x = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -123,7 +122,6 @@ x = 4 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -158,7 +156,6 @@ y = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-5340.md b/unison-src/transcripts/idempotent/fix-5340.md index f4825dcdbc..1e13d6c1c0 100644 --- a/unison-src/transcripts/idempotent/fix-5340.md +++ b/unison-src/transcripts/idempotent/fix-5340.md @@ -11,7 +11,6 @@ lib.dep.lib.dep.foo = 18 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,7 +45,6 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,7 +64,6 @@ bar = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-5357.md b/unison-src/transcripts/idempotent/fix-5357.md index ad9c45ca93..08bbb58500 100644 --- a/unison-src/transcripts/idempotent/fix-5357.md +++ b/unison-src/transcripts/idempotent/fix-5357.md @@ -9,7 +9,6 @@ foo = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,7 +36,6 @@ lib.base.ignore _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -57,6 +55,7 @@ scratch/main> add lib.base.ignore : a -> () (also named util.ignore) + scratch/main> edit.namespace ☝️ @@ -65,6 +64,7 @@ scratch/main> edit.namespace You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/main> load Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix-5369.md b/unison-src/transcripts/idempotent/fix-5369.md index 6559b94f26..d947810f51 100644 --- a/unison-src/transcripts/idempotent/fix-5369.md +++ b/unison-src/transcripts/idempotent/fix-5369.md @@ -13,7 +13,6 @@ two.foo = "blah" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +43,6 @@ bar = foo + foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-5374.md b/unison-src/transcripts/idempotent/fix-5374.md index 4b60ad1775..6cd2957351 100644 --- a/unison-src/transcripts/idempotent/fix-5374.md +++ b/unison-src/transcripts/idempotent/fix-5374.md @@ -10,7 +10,6 @@ thing = indirect.foo + indirect.foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +31,7 @@ scratch/main> add lib.direct.foo : Nat lib.direct.lib.indirect.foo : Nat thing : Nat + scratch/main> view thing thing : Nat @@ -39,6 +39,7 @@ scratch/main> view thing use Nat + use indirect foo foo + foo + scratch/main> edit.new thing ☝️ diff --git a/unison-src/transcripts/idempotent/fix-5380.md b/unison-src/transcripts/idempotent/fix-5380.md index f24dcaa513..b9d1329db3 100644 --- a/unison-src/transcripts/idempotent/fix-5380.md +++ b/unison-src/transcripts/idempotent/fix-5380.md @@ -16,7 +16,6 @@ bar = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,9 +35,11 @@ scratch/main> add bar : Nat foo : Nat + scratch/main> move.term foo qux Done. + scratch/main> view bar bar : Nat diff --git a/unison-src/transcripts/idempotent/fix-5433.md b/unison-src/transcripts/idempotent/fix-5433.md index 2e8715129c..0151405618 100644 --- a/unison-src/transcripts/idempotent/fix-5433.md +++ b/unison-src/transcripts/idempotent/fix-5433.md @@ -10,7 +10,6 @@ ability foo.Bar where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ hello = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-big-list-crash.md b/unison-src/transcripts/idempotent/fix-big-list-crash.md index 1ab91c73a7..2f0134bd47 100644 --- a/unison-src/transcripts/idempotent/fix-big-list-crash.md +++ b/unison-src/transcripts/idempotent/fix-big-list-crash.md @@ -13,7 +13,6 @@ x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix-ls.md b/unison-src/transcripts/idempotent/fix-ls.md index a6b134972c..e1ccc5862f 100644 --- a/unison-src/transcripts/idempotent/fix-ls.md +++ b/unison-src/transcripts/idempotent/fix-ls.md @@ -11,7 +11,6 @@ foo.bar.subtract x y = x Int.- y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,9 +30,11 @@ test-ls/main> add foo.bar.add : Int -> Int -> Int foo.bar.subtract : Int -> Int -> Int + test-ls/main> ls foo 1. bar/ (2 terms) + test-ls/main> ls 1 1. add (Int -> Int -> Int) diff --git a/unison-src/transcripts/idempotent/fix1063.md b/unison-src/transcripts/idempotent/fix1063.md index 03399ce4a0..1ac4910678 100644 --- a/unison-src/transcripts/idempotent/fix1063.md +++ b/unison-src/transcripts/idempotent/fix1063.md @@ -13,7 +13,6 @@ noop = not `.` not ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,6 +32,7 @@ scratch/main> add `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean + scratch/main> view noop noop : Boolean -> Boolean diff --git a/unison-src/transcripts/idempotent/fix1327.md b/unison-src/transcripts/idempotent/fix1327.md index f93ab84b4c..a6f700bc83 100644 --- a/unison-src/transcripts/idempotent/fix1327.md +++ b/unison-src/transcripts/idempotent/fix1327.md @@ -5,7 +5,6 @@ bar = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,10 +28,12 @@ scratch/main> add bar : ##Nat foo : ##Nat + scratch/main> ls 1. bar (##Nat) 2. foo (##Nat) + scratch/main> alias.many 1-2 .ns1_nohistory Here's what changed in .ns1_nohistory : diff --git a/unison-src/transcripts/idempotent/fix1334.md b/unison-src/transcripts/idempotent/fix1334.md index f0475b4de6..7d8a03e930 100644 --- a/unison-src/transcripts/idempotent/fix1334.md +++ b/unison-src/transcripts/idempotent/fix1334.md @@ -8,6 +8,7 @@ Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: scratch/main> alias.type ##Nat Cat Done. + scratch/main> alias.term ##Nat.+ please_fix_763.+ Done. diff --git a/unison-src/transcripts/idempotent/fix1390.md b/unison-src/transcripts/idempotent/fix1390.md index 40ae203bca..f597292177 100644 --- a/unison-src/transcripts/idempotent/fix1390.md +++ b/unison-src/transcripts/idempotent/fix1390.md @@ -14,7 +14,6 @@ List.map f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,6 +31,7 @@ scratch/main> add ⍟ I've added these definitions: List.map : (i ->{g} o) -> [i] ->{g} [o] + scratch/main> view List.map List.map : (i ->{g} o) -> [i] ->{g} [o] @@ -53,7 +53,6 @@ List.map2 f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix1421.md b/unison-src/transcripts/idempotent/fix1421.md index d372af4910..56b592a2db 100644 --- a/unison-src/transcripts/idempotent/fix1421.md +++ b/unison-src/transcripts/idempotent/fix1421.md @@ -2,6 +2,7 @@ scratch/main> alias.type ##Nat Nat Done. + scratch/main> alias.term ##Nat.+ Nat.+ Done. @@ -13,7 +14,6 @@ unique type B = B Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix1532.md b/unison-src/transcripts/idempotent/fix1532.md index 6d44d627e5..8a7f4dd1e8 100644 --- a/unison-src/transcripts/idempotent/fix1532.md +++ b/unison-src/transcripts/idempotent/fix1532.md @@ -13,7 +13,6 @@ bar.z = x + y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -81,6 +80,7 @@ We can then delete the dependent term, and then delete `foo`. scratch/main> delete.term 1 Done. + scratch/main> delete.namespace foo Done. diff --git a/unison-src/transcripts/idempotent/fix1696.md b/unison-src/transcripts/idempotent/fix1696.md index 4461c47c64..44c796315f 100644 --- a/unison-src/transcripts/idempotent/fix1696.md +++ b/unison-src/transcripts/idempotent/fix1696.md @@ -21,7 +21,6 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/idempotent/fix1709.md b/unison-src/transcripts/idempotent/fix1709.md index 5b73cc3a96..324e2564c5 100644 --- a/unison-src/transcripts/idempotent/fix1709.md +++ b/unison-src/transcripts/idempotent/fix1709.md @@ -7,7 +7,6 @@ id2 x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +33,6 @@ scratch/main> add ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/fix1731.md b/unison-src/transcripts/idempotent/fix1731.md index 45341bc675..b64f221eeb 100644 --- a/unison-src/transcripts/idempotent/fix1731.md +++ b/unison-src/transcripts/idempotent/fix1731.md @@ -21,7 +21,6 @@ repro = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix1800.md b/unison-src/transcripts/idempotent/fix1800.md index ee969c0eed..f47a148448 100644 --- a/unison-src/transcripts/idempotent/fix1800.md +++ b/unison-src/transcripts/idempotent/fix1800.md @@ -28,12 +28,15 @@ Testing a few variations here: scratch/main> run main1 () + scratch/main> run main2 () + scratch/main> run main3 () + scratch/main> add ⍟ I've added these definitions: @@ -42,12 +45,15 @@ scratch/main> add main2 : ∀ _. _ ->{IO} () main3 : '{IO} () printLine : Text ->{IO} () + scratch/main> rename.term main1 code.main1 Done. + scratch/main> rename.term main2 code.main2 Done. + scratch/main> rename.term main3 code.main3 Done. @@ -59,9 +65,11 @@ The renaming just ensures that when running `code.main1`, it has to get that mai scratch/main> run code.main1 () + scratch/main> run code.main2 () + scratch/main> run code.main3 () diff --git a/unison-src/transcripts/idempotent/fix1844.md b/unison-src/transcripts/idempotent/fix1844.md index 60a97a6e2f..0188dd0c8a 100644 --- a/unison-src/transcripts/idempotent/fix1844.md +++ b/unison-src/transcripts/idempotent/fix1844.md @@ -10,7 +10,6 @@ snoc k aN = match k with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix1926.md b/unison-src/transcripts/idempotent/fix1926.md index 0363045c97..001e7f7ba7 100644 --- a/unison-src/transcripts/idempotent/fix1926.md +++ b/unison-src/transcripts/idempotent/fix1926.md @@ -11,7 +11,6 @@ sq = 2934892384 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,7 +36,6 @@ sq = 2934892384 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2026.md b/unison-src/transcripts/idempotent/fix2026.md index eb9ec090e5..5aa3edabf4 100644 --- a/unison-src/transcripts/idempotent/fix2026.md +++ b/unison-src/transcripts/idempotent/fix2026.md @@ -40,7 +40,6 @@ Exception.unsafeRun! e _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2027.md b/unison-src/transcripts/idempotent/fix2027.md index fe4095adbf..3a4088f2a0 100644 --- a/unison-src/transcripts/idempotent/fix2027.md +++ b/unison-src/transcripts/idempotent/fix2027.md @@ -49,7 +49,6 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2049.md b/unison-src/transcripts/idempotent/fix2049.md index 21686574b7..4c13479448 100644 --- a/unison-src/transcripts/idempotent/fix2049.md +++ b/unison-src/transcripts/idempotent/fix2049.md @@ -53,7 +53,6 @@ Fold.Stream.fold = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -111,7 +110,6 @@ tests _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -131,6 +129,7 @@ scratch/main> add catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] + scratch/main> io.test tests New test results: diff --git a/unison-src/transcripts/idempotent/fix2156.md b/unison-src/transcripts/idempotent/fix2156.md index e0823b9652..b90eebc481 100644 --- a/unison-src/transcripts/idempotent/fix2156.md +++ b/unison-src/transcripts/idempotent/fix2156.md @@ -13,7 +13,6 @@ sqr n = n * n ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2167.md b/unison-src/transcripts/idempotent/fix2167.md index 58613b9685..04b01deb66 100644 --- a/unison-src/transcripts/idempotent/fix2167.md +++ b/unison-src/transcripts/idempotent/fix2167.md @@ -20,7 +20,6 @@ R.near1 region loc = match R.near 42 with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2187.md b/unison-src/transcripts/idempotent/fix2187.md index 9357219032..16d3275dc5 100644 --- a/unison-src/transcripts/idempotent/fix2187.md +++ b/unison-src/transcripts/idempotent/fix2187.md @@ -19,7 +19,6 @@ lexicalScopeEx = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2231.md b/unison-src/transcripts/idempotent/fix2231.md index c6230bfa08..871f5e2b89 100644 --- a/unison-src/transcripts/idempotent/fix2231.md +++ b/unison-src/transcripts/idempotent/fix2231.md @@ -25,7 +25,6 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2238.md b/unison-src/transcripts/idempotent/fix2238.md index 2e8c2f3a98..623cbdf3f2 100644 --- a/unison-src/transcripts/idempotent/fix2238.md +++ b/unison-src/transcripts/idempotent/fix2238.md @@ -11,7 +11,6 @@ ex = {{ @eval{abort} }} ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. @@ -33,7 +32,6 @@ abort + 1 ```` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The expression in red needs the {Abort} ability, but this location does not have access to any abilities. diff --git a/unison-src/transcripts/idempotent/fix2244.md b/unison-src/transcripts/idempotent/fix2244.md index 6a223fb14e..ba3c1077fc 100644 --- a/unison-src/transcripts/idempotent/fix2244.md +++ b/unison-src/transcripts/idempotent/fix2244.md @@ -18,7 +18,6 @@ let ```` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2254.md b/unison-src/transcripts/idempotent/fix2254.md index dcb8e9668d..694c90acb4 100644 --- a/unison-src/transcripts/idempotent/fix2254.md +++ b/unison-src/transcripts/idempotent/fix2254.md @@ -47,6 +47,7 @@ scratch/a> add f2 : A Nat Nat Nat Nat -> Nat f3 : NeedsA Nat Nat -> Nat g : A Nat Nat Nat Nat -> Nat + scratch/a> branch /a2 Done. I've created the a2 branch based off of a. @@ -79,6 +80,7 @@ scratch/a2> update Everything typechecks, so I'm saving the results... Done. + scratch/a2> view A NeedsA f f2 f3 g type A a b c d @@ -112,6 +114,7 @@ scratch/a2> view A NeedsA f f2 f3 g g = cases D n -> n _ -> 43 + scratch/a2> todo You have no pending todo items. Good work! ✅ @@ -132,7 +135,6 @@ combine r = uno r + dos r ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -164,6 +166,7 @@ scratch/r1> add 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. @@ -177,7 +180,6 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -215,6 +217,7 @@ scratch/r2> update Everything typechecks, so I'm saving the results... Done. + scratch/r2> todo You have no pending todo items. Good work! ✅ diff --git a/unison-src/transcripts/idempotent/fix2268.md b/unison-src/transcripts/idempotent/fix2268.md index b75a1ac3c4..afe51a4072 100644 --- a/unison-src/transcripts/idempotent/fix2268.md +++ b/unison-src/transcripts/idempotent/fix2268.md @@ -20,7 +20,6 @@ test _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2334.md b/unison-src/transcripts/idempotent/fix2334.md index 7235d10d6b..c5e126d113 100644 --- a/unison-src/transcripts/idempotent/fix2334.md +++ b/unison-src/transcripts/idempotent/fix2334.md @@ -19,7 +19,6 @@ f = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2344.md b/unison-src/transcripts/idempotent/fix2344.md index ebf6ec6399..47c0c09d67 100644 --- a/unison-src/transcripts/idempotent/fix2344.md +++ b/unison-src/transcripts/idempotent/fix2344.md @@ -21,7 +21,6 @@ sneezy dee _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2350.md b/unison-src/transcripts/idempotent/fix2350.md index 4eda0fee4f..8a741ff4bf 100644 --- a/unison-src/transcripts/idempotent/fix2350.md +++ b/unison-src/transcripts/idempotent/fix2350.md @@ -29,7 +29,6 @@ save a = !(save.impl a) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2353.md b/unison-src/transcripts/idempotent/fix2353.md index 5d404425c2..2c68391d65 100644 --- a/unison-src/transcripts/idempotent/fix2353.md +++ b/unison-src/transcripts/idempotent/fix2353.md @@ -16,7 +16,6 @@ pure.run a0 a = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2354.md b/unison-src/transcripts/idempotent/fix2354.md index 7a0eeea719..abdbbbde67 100644 --- a/unison-src/transcripts/idempotent/fix2354.md +++ b/unison-src/transcripts/idempotent/fix2354.md @@ -13,7 +13,6 @@ x = 'f ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a value of type: (a1 ->{𝕖} a1) ->{𝕖} Nat diff --git a/unison-src/transcripts/idempotent/fix2355.md b/unison-src/transcripts/idempotent/fix2355.md index e04b76fa87..c0d7eb8cbf 100644 --- a/unison-src/transcripts/idempotent/fix2355.md +++ b/unison-src/transcripts/idempotent/fix2355.md @@ -24,7 +24,6 @@ example = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I tried to infer a cyclic ability. diff --git a/unison-src/transcripts/idempotent/fix2378.md b/unison-src/transcripts/idempotent/fix2378.md index e8003d95c4..b9e8b28575 100644 --- a/unison-src/transcripts/idempotent/fix2378.md +++ b/unison-src/transcripts/idempotent/fix2378.md @@ -43,7 +43,6 @@ x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2423.md b/unison-src/transcripts/idempotent/fix2423.md index 4d80a93472..6dd068d1f2 100644 --- a/unison-src/transcripts/idempotent/fix2423.md +++ b/unison-src/transcripts/idempotent/fix2423.md @@ -31,7 +31,6 @@ Split.zipSame sa sb _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2474.md b/unison-src/transcripts/idempotent/fix2474.md index 6ddb859310..b2c4ba25c4 100644 --- a/unison-src/transcripts/idempotent/fix2474.md +++ b/unison-src/transcripts/idempotent/fix2474.md @@ -38,7 +38,6 @@ Stream.uncons s = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2628.md b/unison-src/transcripts/idempotent/fix2628.md index 02a9894f11..f7c62a4826 100644 --- a/unison-src/transcripts/idempotent/fix2628.md +++ b/unison-src/transcripts/idempotent/fix2628.md @@ -21,6 +21,7 @@ scratch/main> add foo.bar.baz.MyRecord.value.set : Nat -> MyRecord -> MyRecord + scratch/main> find : Nat -> MyRecord 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord diff --git a/unison-src/transcripts/idempotent/fix2663.md b/unison-src/transcripts/idempotent/fix2663.md index 59667660af..7412c7a8ca 100644 --- a/unison-src/transcripts/idempotent/fix2663.md +++ b/unison-src/transcripts/idempotent/fix2663.md @@ -25,7 +25,6 @@ bad x = match Some (Some x) with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2693.md b/unison-src/transcripts/idempotent/fix2693.md index 31ca467e57..c095fe7447 100644 --- a/unison-src/transcripts/idempotent/fix2693.md +++ b/unison-src/transcripts/idempotent/fix2693.md @@ -13,7 +13,6 @@ range = loop [] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,7 +39,6 @@ scratch/main> add ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -2062,7 +2060,6 @@ Should be cached: ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/fix2712.md b/unison-src/transcripts/idempotent/fix2712.md index 2787499d1a..88e111877a 100644 --- a/unison-src/transcripts/idempotent/fix2712.md +++ b/unison-src/transcripts/idempotent/fix2712.md @@ -10,7 +10,6 @@ mapWithKey f m = Tip ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,7 +45,6 @@ naiomi = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2795.md b/unison-src/transcripts/idempotent/fix2795.md index 6dcde3bad3..ff161f91d7 100644 --- a/unison-src/transcripts/idempotent/fix2795.md +++ b/unison-src/transcripts/idempotent/fix2795.md @@ -20,7 +20,6 @@ t1 = "hi" ```` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2822.md b/unison-src/transcripts/idempotent/fix2822.md index 8dadc1c54c..95e396946a 100644 --- a/unison-src/transcripts/idempotent/fix2822.md +++ b/unison-src/transcripts/idempotent/fix2822.md @@ -13,7 +13,6 @@ b = _a.blah + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ x = _b + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,7 +56,6 @@ c = A ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -80,7 +77,6 @@ doStuff = _value.modify ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -105,7 +101,6 @@ dontMap f = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what _used refers to here: @@ -131,7 +126,6 @@ dontMap f = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix2826.md b/unison-src/transcripts/idempotent/fix2826.md index 4605a38467..29ab08d8c3 100644 --- a/unison-src/transcripts/idempotent/fix2826.md +++ b/unison-src/transcripts/idempotent/fix2826.md @@ -15,7 +15,6 @@ doc = {{ ```` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,6 +34,7 @@ scratch/main> add ⍟ I've added these definitions: doc : Doc2 + scratch/main> edit.new doc ☝️ @@ -43,6 +43,7 @@ scratch/main> edit.new doc You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/main> load scratch.u Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix2970.md b/unison-src/transcripts/idempotent/fix2970.md index bcbbf93c4f..fbae0cdc4b 100644 --- a/unison-src/transcripts/idempotent/fix2970.md +++ b/unison-src/transcripts/idempotent/fix2970.md @@ -12,7 +12,6 @@ foo.+.doc = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3037.md b/unison-src/transcripts/idempotent/fix3037.md index b3bd705af6..d709d8984c 100644 --- a/unison-src/transcripts/idempotent/fix3037.md +++ b/unison-src/transcripts/idempotent/fix3037.md @@ -18,7 +18,6 @@ runner = pureRunner ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the expression in red @@ -51,7 +50,6 @@ h _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found an ability mismatch when checking the application diff --git a/unison-src/transcripts/idempotent/fix3171.md b/unison-src/transcripts/idempotent/fix3171.md index e15ba83254..b01d751fee 100644 --- a/unison-src/transcripts/idempotent/fix3171.md +++ b/unison-src/transcripts/idempotent/fix3171.md @@ -14,7 +14,6 @@ f x y z _ = x + y * z ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3196.md b/unison-src/transcripts/idempotent/fix3196.md index 02f78449f7..a64b3d79f0 100644 --- a/unison-src/transcripts/idempotent/fix3196.md +++ b/unison-src/transcripts/idempotent/fix3196.md @@ -34,7 +34,6 @@ w2 = cases W -> W ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3215.md b/unison-src/transcripts/idempotent/fix3215.md index 43f652eb67..714b93434c 100644 --- a/unison-src/transcripts/idempotent/fix3215.md +++ b/unison-src/transcripts/idempotent/fix3215.md @@ -21,7 +21,6 @@ f = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3244.md b/unison-src/transcripts/idempotent/fix3244.md index 8159eb8b28..6f0f947f4a 100644 --- a/unison-src/transcripts/idempotent/fix3244.md +++ b/unison-src/transcripts/idempotent/fix3244.md @@ -21,7 +21,6 @@ foo t = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3265.md b/unison-src/transcripts/idempotent/fix3265.md index 11547b8bf3..f900a74015 100644 --- a/unison-src/transcripts/idempotent/fix3265.md +++ b/unison-src/transcripts/idempotent/fix3265.md @@ -26,7 +26,6 @@ are three cases that need to be 'fixed up.' ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -71,7 +70,6 @@ discard its arguments, where `f` also occurs. ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/fix3424.md b/unison-src/transcripts/idempotent/fix3424.md index 95a1b880ea..dbd2e089f6 100644 --- a/unison-src/transcripts/idempotent/fix3424.md +++ b/unison-src/transcripts/idempotent/fix3424.md @@ -18,6 +18,7 @@ scratch/main> add a : 'Text b : Text c : Text + scratch/main> run a "Hello, World!" @@ -39,6 +40,7 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> run a "Hello, Unison!" diff --git a/unison-src/transcripts/idempotent/fix3634.md b/unison-src/transcripts/idempotent/fix3634.md index fcd46aade7..57c398d09d 100644 --- a/unison-src/transcripts/idempotent/fix3634.md +++ b/unison-src/transcripts/idempotent/fix3634.md @@ -15,7 +15,6 @@ d = {{ ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,6 +36,7 @@ scratch/main> add structural type M a (also named builtin.Optional) d : Doc2 + scratch/main> display d `x -> J x` diff --git a/unison-src/transcripts/idempotent/fix3678.md b/unison-src/transcripts/idempotent/fix3678.md index f8c1dff0fb..d2eb422079 100644 --- a/unison-src/transcripts/idempotent/fix3678.md +++ b/unison-src/transcripts/idempotent/fix3678.md @@ -13,7 +13,6 @@ arr = Scope.run do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3752.md b/unison-src/transcripts/idempotent/fix3752.md index 25d17717ba..c017e69933 100644 --- a/unison-src/transcripts/idempotent/fix3752.md +++ b/unison-src/transcripts/idempotent/fix3752.md @@ -21,7 +21,6 @@ bar = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3773.md b/unison-src/transcripts/idempotent/fix3773.md index b781453bb3..52258f5ff9 100644 --- a/unison-src/transcripts/idempotent/fix3773.md +++ b/unison-src/transcripts/idempotent/fix3773.md @@ -12,7 +12,6 @@ foo = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix3977.md b/unison-src/transcripts/idempotent/fix3977.md index a5fa87d3e2..f779785cf4 100644 --- a/unison-src/transcripts/idempotent/fix3977.md +++ b/unison-src/transcripts/idempotent/fix3977.md @@ -17,6 +17,7 @@ scratch/main> add failure : Text -> context -> Failure foo : Either Failure b + scratch/main> edit.new foo ☝️ @@ -25,6 +26,7 @@ scratch/main> edit.new foo You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/main> load scratch.u Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix4172.md b/unison-src/transcripts/idempotent/fix4172.md index e87835951c..8a4009a499 100644 --- a/unison-src/transcripts/idempotent/fix4172.md +++ b/unison-src/transcripts/idempotent/fix4172.md @@ -16,7 +16,6 @@ allowDebug = debug [1,2,3] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,6 +46,7 @@ scratch/main> add bool : Boolean debug : a -> Text t1 : [Result] + scratch/main> test Cached test results (`help testcache` to learn more) @@ -63,7 +63,6 @@ bool = false ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -82,6 +81,7 @@ scratch/main> update.old ⍟ I've updated these names to your new definition: bool : Boolean + scratch/main> test ✅ diff --git a/unison-src/transcripts/idempotent/fix4280.md b/unison-src/transcripts/idempotent/fix4280.md index 8d7ff2c2d0..5f5d6d2a9a 100644 --- a/unison-src/transcripts/idempotent/fix4280.md +++ b/unison-src/transcripts/idempotent/fix4280.md @@ -12,7 +12,6 @@ bonk = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4397.md b/unison-src/transcripts/idempotent/fix4397.md index fa95e4a577..6757d22342 100644 --- a/unison-src/transcripts/idempotent/fix4397.md +++ b/unison-src/transcripts/idempotent/fix4397.md @@ -8,7 +8,6 @@ unique type Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from diff --git a/unison-src/transcripts/idempotent/fix4415.md b/unison-src/transcripts/idempotent/fix4415.md index 541d736413..2f6087477e 100644 --- a/unison-src/transcripts/idempotent/fix4415.md +++ b/unison-src/transcripts/idempotent/fix4415.md @@ -4,7 +4,6 @@ unique type sub.Foo = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4482.md b/unison-src/transcripts/idempotent/fix4482.md index 8cabe342e1..ef8705ba8d 100644 --- a/unison-src/transcripts/idempotent/fix4482.md +++ b/unison-src/transcripts/idempotent/fix4482.md @@ -11,7 +11,6 @@ mybar = bar + bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,6 +36,7 @@ myproj/main> add lib.foo1.lib.bonk2.qux : Nat lib.foo1.zonk : Nat mybar : Nat + myproj/main> upgrade foo0 foo1 I couldn't automatically upgrade foo0 to foo1. However, I've diff --git a/unison-src/transcripts/idempotent/fix4498.md b/unison-src/transcripts/idempotent/fix4498.md index 00614c6a9e..350fa8cdf1 100644 --- a/unison-src/transcripts/idempotent/fix4498.md +++ b/unison-src/transcripts/idempotent/fix4498.md @@ -10,7 +10,6 @@ myterm = foo + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ scratch/main> add lib.dep0.lib.dep1.foo : Nat lib.dep0.zonk.foo : Text myterm : Nat + scratch/main> view myterm myterm : Nat diff --git a/unison-src/transcripts/idempotent/fix4515.md b/unison-src/transcripts/idempotent/fix4515.md index 87e3c19cea..534be7e156 100644 --- a/unison-src/transcripts/idempotent/fix4515.md +++ b/unison-src/transcripts/idempotent/fix4515.md @@ -13,7 +13,6 @@ useBar = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +43,6 @@ unique type Foo = Foo1 | Foo2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4528.md b/unison-src/transcripts/idempotent/fix4528.md index 6c7f76915f..d91b7f016e 100644 --- a/unison-src/transcripts/idempotent/fix4528.md +++ b/unison-src/transcripts/idempotent/fix4528.md @@ -10,7 +10,6 @@ main _ = MkFoo 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,6 +29,7 @@ foo/main> add structural type Foo main : 'Foo + foo/main> run main MkFoo 5 diff --git a/unison-src/transcripts/idempotent/fix4556.md b/unison-src/transcripts/idempotent/fix4556.md index 30048e4bb3..6b991bddb9 100644 --- a/unison-src/transcripts/idempotent/fix4556.md +++ b/unison-src/transcripts/idempotent/fix4556.md @@ -10,7 +10,6 @@ hey = foo.hello ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ thing = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4592.md b/unison-src/transcripts/idempotent/fix4592.md index 4379da14a5..f3e903cfdd 100644 --- a/unison-src/transcripts/idempotent/fix4592.md +++ b/unison-src/transcripts/idempotent/fix4592.md @@ -8,7 +8,6 @@ doc = {{ {{ bug "bug" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4618.md b/unison-src/transcripts/idempotent/fix4618.md index b8e775dc2a..5e1f55a800 100644 --- a/unison-src/transcripts/idempotent/fix4618.md +++ b/unison-src/transcripts/idempotent/fix4618.md @@ -8,7 +8,6 @@ unique type Bugs.Zonk = Bugs ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,7 +35,6 @@ unique type Bugs = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4711.md b/unison-src/transcripts/idempotent/fix4711.md index 60898eb914..9365bf01aa 100644 --- a/unison-src/transcripts/idempotent/fix4711.md +++ b/unison-src/transcripts/idempotent/fix4711.md @@ -11,7 +11,6 @@ thisDoesNotWork = ['(+1)] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,6 +32,7 @@ scratch/main> add thisDoesNotWork : ['{g} Int] thisWorks : 'Int + scratch/main> edit.new thisWorks thisDoesNotWork ☝️ @@ -41,6 +41,7 @@ scratch/main> edit.new thisWorks thisDoesNotWork You can edit them there, then run `update` to replace the definitions currently in this namespace. + scratch/main> load Loading changes detected in scratch.u. diff --git a/unison-src/transcripts/idempotent/fix4722.md b/unison-src/transcripts/idempotent/fix4722.md index b7568064f7..cf5cbc7545 100644 --- a/unison-src/transcripts/idempotent/fix4722.md +++ b/unison-src/transcripts/idempotent/fix4722.md @@ -39,7 +39,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix4731.md b/unison-src/transcripts/idempotent/fix4731.md index 23b743a42e..3c259c5973 100644 --- a/unison-src/transcripts/idempotent/fix4731.md +++ b/unison-src/transcripts/idempotent/fix4731.md @@ -3,7 +3,6 @@ structural type Void = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,7 +30,6 @@ Void.absurdly v = match !v with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,7 +47,6 @@ Void.absurdly v = match v with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -69,7 +66,6 @@ Void.absurdly = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -89,7 +85,6 @@ Void.absurd x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: diff --git a/unison-src/transcripts/idempotent/fix4780.md b/unison-src/transcripts/idempotent/fix4780.md index 266ac610d6..bec569e265 100644 --- a/unison-src/transcripts/idempotent/fix4780.md +++ b/unison-src/transcripts/idempotent/fix4780.md @@ -10,7 +10,6 @@ builtins decompile properly. ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/fix4898.md b/unison-src/transcripts/idempotent/fix4898.md index f8c1948545..f414695494 100644 --- a/unison-src/transcripts/idempotent/fix4898.md +++ b/unison-src/transcripts/idempotent/fix4898.md @@ -13,7 +13,6 @@ redouble x = double x + double x ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -33,6 +32,7 @@ scratch/main> add double : Int -> Int redouble : Int -> Int + scratch/main> dependents double Dependents of: double @@ -43,6 +43,7 @@ scratch/main> dependents double Tip: Try `view 1` to see the source of any numbered item in the above list. + scratch/main> delete.term 1 Done. diff --git a/unison-src/transcripts/idempotent/fix5055.md b/unison-src/transcripts/idempotent/fix5055.md index a19493dce8..55a3fc4d5d 100644 --- a/unison-src/transcripts/idempotent/fix5055.md +++ b/unison-src/transcripts/idempotent/fix5055.md @@ -11,7 +11,6 @@ foo.subtract x y = x Int.- y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -31,10 +30,12 @@ test-5055/main> add foo.add : Int -> Int -> Int foo.subtract : Int -> Int -> Int + test-5055/main> ls foo 1. add (Int -> Int -> Int) 2. subtract (Int -> Int -> Int) + test-5055/main> view 1 foo.add : Int -> Int -> Int diff --git a/unison-src/transcripts/idempotent/fix5076.md b/unison-src/transcripts/idempotent/fix5076.md index 4fadef5b75..0eebc63a89 100644 --- a/unison-src/transcripts/idempotent/fix5076.md +++ b/unison-src/transcripts/idempotent/fix5076.md @@ -12,7 +12,6 @@ x = {{ ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix5080.md b/unison-src/transcripts/idempotent/fix5080.md index 97accafa83..b71516e10d 100644 --- a/unison-src/transcripts/idempotent/fix5080.md +++ b/unison-src/transcripts/idempotent/fix5080.md @@ -8,7 +8,6 @@ test> fix5080.tests.failure = [Fail "fail"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,6 +38,7 @@ scratch/main> add fix5080.tests.failure : [Result] fix5080.tests.success : [Result] + scratch/main> test Cached test results (`help testcache` to learn more) @@ -56,6 +56,7 @@ scratch/main> test scratch/main> delete.term 2 Done. + scratch/main> test Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts/idempotent/fix5168.md b/unison-src/transcripts/idempotent/fix5168.md index b5ece8dc7a..f6b197aadc 100644 --- a/unison-src/transcripts/idempotent/fix5168.md +++ b/unison-src/transcripts/idempotent/fix5168.md @@ -5,7 +5,6 @@ b = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix5349.md b/unison-src/transcripts/idempotent/fix5349.md index 6d9b0d4b99..48e16991e4 100644 --- a/unison-src/transcripts/idempotent/fix5349.md +++ b/unison-src/transcripts/idempotent/fix5349.md @@ -12,7 +12,6 @@ README = {{ ```` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I expected a block after this (in red), but there wasn't one. Maybe check your indentation: @@ -24,7 +23,6 @@ README = {{ {{ }} }} ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -54,7 +52,6 @@ README = {{ `` `` }} ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/idempotent/fix5419.md b/unison-src/transcripts/idempotent/fix5419.md index 93fb03ef7b..b59561855f 100644 --- a/unison-src/transcripts/idempotent/fix5419.md +++ b/unison-src/transcripts/idempotent/fix5419.md @@ -17,7 +17,6 @@ foo w = match (5, w) with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,7 +55,6 @@ bar x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix614.md b/unison-src/transcripts/idempotent/fix614.md index ebd58ef50c..121ae4df94 100644 --- a/unison-src/transcripts/idempotent/fix614.md +++ b/unison-src/transcripts/idempotent/fix614.md @@ -16,7 +16,6 @@ ex1 = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,7 +41,6 @@ ex2 = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a value of type: a ->{Stream a} Unit @@ -64,7 +62,6 @@ ex3 = do ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,7 +84,6 @@ ex4 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -109,7 +105,6 @@ ex4 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a value of type: [Nat] diff --git a/unison-src/transcripts/idempotent/fix689.md b/unison-src/transcripts/idempotent/fix689.md index c3ff7cdc80..c6afe171c4 100644 --- a/unison-src/transcripts/idempotent/fix689.md +++ b/unison-src/transcripts/idempotent/fix689.md @@ -12,7 +12,6 @@ tomorrow = '(SystemTime.systemTime + 24 * 60 * 60) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix693.md b/unison-src/transcripts/idempotent/fix693.md index 1680e443ca..7f28372497 100644 --- a/unison-src/transcripts/idempotent/fix693.md +++ b/unison-src/transcripts/idempotent/fix693.md @@ -11,7 +11,6 @@ structural ability Abort where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,7 +45,6 @@ h0 req = match req with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -73,7 +71,6 @@ h1 req = match req with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Each case of a match / with expression need to have the same @@ -101,7 +98,6 @@ h2 req = match req with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. The 1st argument to `k` @@ -123,7 +119,6 @@ h3 = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix845.md b/unison-src/transcripts/idempotent/fix845.md index d837030803..57c5dc7fcd 100644 --- a/unison-src/transcripts/idempotent/fix845.md +++ b/unison-src/transcripts/idempotent/fix845.md @@ -13,7 +13,6 @@ Text.zonk txt = txt ++ "!! " ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +37,6 @@ Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in th ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what Blah.zonk refers to here: @@ -70,7 +68,6 @@ ex = baz ++ ", world!" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -100,7 +97,6 @@ ex = zonk "hi" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -132,7 +128,6 @@ ex = zonk "hi" -- should resolve to Text.zonk, from the codebase ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix849.md b/unison-src/transcripts/idempotent/fix849.md index 12321025e4..1f799f68e1 100644 --- a/unison-src/transcripts/idempotent/fix849.md +++ b/unison-src/transcripts/idempotent/fix849.md @@ -11,7 +11,6 @@ x = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/fix942.md b/unison-src/transcripts/idempotent/fix942.md index fc2522afef..af26d19d25 100644 --- a/unison-src/transcripts/idempotent/fix942.md +++ b/unison-src/transcripts/idempotent/fix942.md @@ -11,7 +11,6 @@ z = y + 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,7 +41,6 @@ x = 7 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,6 +64,7 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view x y z x : Nat @@ -89,7 +88,6 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -114,6 +112,7 @@ scratch/main> add ⍟ I've added these definitions: t1 : [Result] + scratch/main> test Cached test results (`help testcache` to learn more) diff --git a/unison-src/transcripts/idempotent/fix987.md b/unison-src/transcripts/idempotent/fix987.md index 524ade93ae..e17e1d1974 100644 --- a/unison-src/transcripts/idempotent/fix987.md +++ b/unison-src/transcripts/idempotent/fix987.md @@ -15,7 +15,6 @@ spaceAttack1 x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -49,7 +48,6 @@ spaceAttack2 x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/formatter.md b/unison-src/transcripts/idempotent/formatter.md index 186695e07e..ac170b1b5e 100644 --- a/unison-src/transcripts/idempotent/formatter.md +++ b/unison-src/transcripts/idempotent/formatter.md @@ -176,7 +176,6 @@ brokenDoc = {{ hello }} + 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what + refers to here: diff --git a/unison-src/transcripts/idempotent/fuzzy-options.md b/unison-src/transcripts/idempotent/fuzzy-options.md index 544cadeb34..0e6ae51d30 100644 --- a/unison-src/transcripts/idempotent/fuzzy-options.md +++ b/unison-src/transcripts/idempotent/fuzzy-options.md @@ -4,6 +4,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 + scratch/main> move.term `move.term foo bar` renames `foo` to `bar`. @@ -35,6 +36,7 @@ scratch/main> add nested.optionTwo : ##Nat optionOne : ##Nat + scratch/main> debug.fuzzy-options view _ Select a definition to view: @@ -49,6 +51,7 @@ scratch/main> add ⊡ Ignored previously added definitions: nested.optionTwo optionOne + scratch/main> debug.fuzzy-options find-in _ Select a namespace: @@ -64,6 +67,7 @@ myproject/main> branch mybranch Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. + scratch/main> debug.fuzzy-options switch _ Select a project or branch to switch to: diff --git a/unison-src/transcripts/idempotent/generic-parse-errors.md b/unison-src/transcripts/idempotent/generic-parse-errors.md index 38da7ff587..e68aeaa8ff 100644 --- a/unison-src/transcripts/idempotent/generic-parse-errors.md +++ b/unison-src/transcripts/idempotent/generic-parse-errors.md @@ -6,7 +6,6 @@ x = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -27,7 +26,6 @@ namespace.blah = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -63,7 +61,6 @@ x = 1 ] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found a closing ']' here without a matching '['. @@ -76,7 +73,6 @@ x = a.#abc ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -110,7 +106,6 @@ x = "hi ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: @@ -130,7 +125,6 @@ y : a ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I got confused here: diff --git a/unison-src/transcripts/idempotent/help.md b/unison-src/transcripts/idempotent/help.md index b9750065d2..ce432238f8 100644 --- a/unison-src/transcripts/idempotent/help.md +++ b/unison-src/transcripts/idempotent/help.md @@ -882,6 +882,7 @@ scratch/main> help view.global `view.global foo` prints definitions of `foo` within your codebase. `view.global` without arguments invokes a search to select definitions to view, which requires that `fzf` can be found within your PATH. + scratch/main> help-topics 🌻 @@ -896,6 +897,7 @@ scratch/main> help-topics testcache Example: use `help-topics filestatus` to learn more about that topic. + scratch/main> help-topic filestatus 📓 @@ -926,6 +928,7 @@ scratch/main> help-topic filestatus extra dependency This definition was added because it was a dependency of a definition explicitly selected. + scratch/main> help-topic messages.disallowedAbsolute 🤖 @@ -937,6 +940,7 @@ scratch/main> help-topic messages.disallowedAbsolute As a workaround, you can give definitions with a relative name temporarily (like `exports.blah.foo`) and then use `move.*`. + scratch/main> help-topic namespaces 🧐 @@ -962,6 +966,7 @@ scratch/main> help-topic namespaces elsewhere in your code. For instance: answerToLifeTheUniverseAndEverything = .foo.bar.x + 1 + scratch/main> help-topic projects A project is a versioned collection of code that can be @@ -982,6 +987,7 @@ scratch/main> help-topic projects For full documentation, see https://unison-lang.org/learn/projects + scratch/main> help-topic remotes 🤖 @@ -996,6 +1002,7 @@ scratch/main> help-topic remotes This association is created automatically on when a project is created by `clone`. If the project was created locally then the relationship will be established on the first `push`. + scratch/main> help-topic testcache 🎈 diff --git a/unison-src/transcripts/idempotent/higher-rank.md b/unison-src/transcripts/idempotent/higher-rank.md index cedbd148dc..5ac44083de 100644 --- a/unison-src/transcripts/idempotent/higher-rank.md +++ b/unison-src/transcripts/idempotent/higher-rank.md @@ -2,7 +2,9 @@ This transcript does some testing of higher-rank types. Regression tests related ``` ucm :hide scratch/main> alias.type ##Nat Nat + scratch/main> alias.type ##Text Text + scratch/main> alias.type ##IO IO ``` @@ -16,7 +18,6 @@ f id = (id 1, id "hi") ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,7 +46,6 @@ f id _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -73,7 +73,6 @@ Functor.blah = cases Functor f -> ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -117,7 +116,6 @@ Loc.transform2 nt = cases Loc f -> ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -151,6 +149,7 @@ scratch/main> add ⍟ I've added these definitions: structural type HigherRanked + scratch/main> view HigherRanked structural type HigherRanked = HigherRanked (∀ a. a -> a) diff --git a/unison-src/transcripts/idempotent/input-parse-errors.md b/unison-src/transcripts/idempotent/input-parse-errors.md index 73f99779a3..2b497f5372 100644 --- a/unison-src/transcripts/idempotent/input-parse-errors.md +++ b/unison-src/transcripts/idempotent/input-parse-errors.md @@ -30,16 +30,20 @@ scratch/main> add . You can run `help add` for more information on using `add`. + scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/main> add 1 + scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/main> add 2 ⊡ Ignored previously added definitions: x diff --git a/unison-src/transcripts/idempotent/io-test-command.md b/unison-src/transcripts/idempotent/io-test-command.md index a2012915ba..395ac149b3 100644 --- a/unison-src/transcripts/idempotent/io-test-command.md +++ b/unison-src/transcripts/idempotent/io-test-command.md @@ -35,6 +35,7 @@ scratch/main> io.test ioAndExceptionTest ✅ 1 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test ioTest New test results: diff --git a/unison-src/transcripts/idempotent/io.md b/unison-src/transcripts/idempotent/io.md index 4d0be24599..314a76e1b4 100644 --- a/unison-src/transcripts/idempotent/io.md +++ b/unison-src/transcripts/idempotent/io.md @@ -2,8 +2,11 @@ ``` ucm :hide scratch/main> builtins.merge + scratch/main> builtins.mergeio + scratch/main> load unison-src/transcripts-using-base/base.u + scratch/main> add ``` @@ -59,7 +62,6 @@ testCreateRename _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -77,6 +79,7 @@ scratch/main> add ⍟ I've added these definitions: testCreateRename : '{IO} [Result] + scratch/main> io.test testCreateRename New test results: @@ -142,7 +145,6 @@ testOpenClose _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -160,6 +162,7 @@ scratch/main> add ⍟ I've added these definitions: testOpenClose : '{IO} [Result] + scratch/main> io.test testOpenClose New test results: @@ -233,7 +236,6 @@ testGetSomeBytes _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -251,6 +253,7 @@ scratch/main> add ⍟ I've added these definitions: testGetSomeBytes : '{IO} [Result] + scratch/main> io.test testGetSomeBytes New test results: @@ -341,7 +344,6 @@ testAppend _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -361,6 +363,7 @@ scratch/main> add testAppend : '{IO} [Result] testSeek : '{IO} [Result] + scratch/main> io.test testSeek New test results: @@ -376,6 +379,7 @@ scratch/main> io.test testSeek ✅ 7 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> io.test testAppend New test results: @@ -400,7 +404,6 @@ testSystemTime _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -418,6 +421,7 @@ scratch/main> add ⍟ I've added these definitions: testSystemTime : '{IO} [Result] + scratch/main> io.test testSystemTime New test results: @@ -447,6 +451,7 @@ scratch/main> add ⍟ I've added these definitions: testGetTempDirectory : '{IO} [Result] + scratch/main> io.test testGetTempDirectory New test results: @@ -477,6 +482,7 @@ scratch/main> add ⍟ I've added these definitions: testGetCurrentDirectory : '{IO} [Result] + scratch/main> io.test testGetCurrentDirectory New test results: @@ -509,6 +515,7 @@ scratch/main> add ⍟ I've added these definitions: testDirContents : '{IO} [Result] + scratch/main> io.test testDirContents New test results: @@ -541,6 +548,7 @@ scratch/main> add ⍟ I've added these definitions: testGetEnv : '{IO} [Result] + scratch/main> io.test testGetEnv New test results: @@ -598,12 +606,15 @@ scratch/main> add testGetArgs.runMeWithNoArgs : '{IO, Exception} () testGetArgs.runMeWithOneArg : '{IO, Exception} () testGetArgs.runMeWithTwoArgs : '{IO, Exception} () + scratch/main> run runMeWithNoArgs () + scratch/main> run runMeWithOneArg foo () + scratch/main> run runMeWithTwoArgs foo bar () @@ -679,6 +690,7 @@ scratch/main> add ⍟ I've added these definitions: testTimeZone : '{IO} () + scratch/main> run testTimeZone () @@ -701,6 +713,7 @@ scratch/main> add ⍟ I've added these definitions: testRandom : '{IO} [Result] + scratch/main> io.test testGetEnv New test results: diff --git a/unison-src/transcripts/idempotent/kind-inference.md b/unison-src/transcripts/idempotent/kind-inference.md index eb80e6a616..cc12acd30d 100644 --- a/unison-src/transcripts/idempotent/kind-inference.md +++ b/unison-src/transcripts/idempotent/kind-inference.md @@ -11,7 +11,6 @@ unique type T a = T a (a Nat) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -29,7 +28,6 @@ unique type T a ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -49,7 +47,6 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -71,7 +68,6 @@ unique type Pong = Pong (Ping Optional) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -90,7 +86,6 @@ unique ability Pong a where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -112,7 +107,6 @@ unique ability Pong a where ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -131,7 +125,6 @@ unique type S = S (T Nat) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -155,7 +148,6 @@ unique type S = S (T Optional) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -177,7 +169,6 @@ unique type S = S (T Optional) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -197,7 +188,6 @@ test = 0 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -215,7 +205,6 @@ test _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -235,7 +224,6 @@ test _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -259,7 +247,6 @@ test _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -282,7 +269,6 @@ test _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -300,7 +286,6 @@ test _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Kind mismatch arising from @@ -318,7 +303,6 @@ unique type T a = T (a a) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Cannot construct infinite kind @@ -334,7 +318,6 @@ unique type T a b = T (a b) (b a) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Cannot construct infinite kind @@ -351,7 +334,6 @@ unique type Pong a = Pong (a Ping) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Cannot construct infinite kind diff --git a/unison-src/transcripts/idempotent/lambdacase.md b/unison-src/transcripts/idempotent/lambdacase.md index 28f46ed248..c85050e2ec 100644 --- a/unison-src/transcripts/idempotent/lambdacase.md +++ b/unison-src/transcripts/idempotent/lambdacase.md @@ -13,7 +13,6 @@ isEmpty x = match x with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +37,6 @@ isEmpty2 = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -99,7 +97,6 @@ merge2 = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -148,7 +145,6 @@ blorf = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -189,7 +185,6 @@ merge3 = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -207,6 +202,7 @@ scratch/main> add ⍟ I've added these definitions: merge3 : [a] -> [a] -> [a] + scratch/main> view merge3 merge3 : [a] -> [a] -> [a] @@ -230,7 +226,6 @@ merge4 a b = match (a,b) with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/move-all.md b/unison-src/transcripts/idempotent/move-all.md index 927fadf5e0..5601aafa68 100644 --- a/unison-src/transcripts/idempotent/move-all.md +++ b/unison-src/transcripts/idempotent/move-all.md @@ -16,7 +16,6 @@ unique type Foo.T = T ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +47,6 @@ unique type Foo.T = T1 | T2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -78,18 +76,21 @@ Should be able to move the term, type, and namespace, including its types, terms scratch/main> move Foo Bar Done. + scratch/main> ls 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) + scratch/main> ls Bar 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) + scratch/main> history Bar Note: The most recent namespace hash is immediately below this @@ -115,7 +116,6 @@ bonk = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -131,14 +131,17 @@ bonk = 5 z/main> builtins.merge Done. + z/main> add ⍟ I've added these definitions: bonk : Nat + z/main> move bonk zonk Done. + z/main> ls 1. builtin/ (469 terms, 74 types) @@ -152,7 +155,6 @@ bonk.zonk = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,18 +171,22 @@ bonk.zonk = 5 a/main> builtins.merge Done. + a/main> add ⍟ I've added these definitions: bonk.zonk : Nat + a/main> move bonk zonk Done. + a/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) + a/main> view zonk.zonk zonk.zonk : Nat diff --git a/unison-src/transcripts/idempotent/move-namespace.md b/unison-src/transcripts/idempotent/move-namespace.md index 4a2fcd117e..59a1e7ae71 100644 --- a/unison-src/transcripts/idempotent/move-namespace.md +++ b/unison-src/transcripts/idempotent/move-namespace.md @@ -14,19 +14,24 @@ scratch/main> add ⍟ I've added these definitions: foo : ##Nat + -- 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 1. root/ (1 term) + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -41,6 +46,7 @@ scratch/main> history scratch/main> ls .root.at.path 1. foo (##Nat) + scratch/main> history .root.at.path Note: The most recent namespace hash is immediately below this @@ -55,18 +61,22 @@ I should be able to move a sub namespace *over* the root. ``` 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 1. foo (##Nat) + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -79,9 +89,11 @@ scratch/main> history ``` ucm :error -- should be empty + scratch/main> ls .root.at.path nothing to show + scratch/main> history .root.at.path Note: The most recent namespace hash is immediately below this @@ -106,7 +118,6 @@ unique type a.T = T ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -134,7 +145,6 @@ unique type a.T = T1 | T2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -163,11 +173,13 @@ Should be able to move the namespace, including its types, terms, and sub-namesp scratch/happy> move.namespace a b Done. + scratch/happy> ls b 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) + scratch/happy> history b Note: The most recent namespace hash is immediately below this @@ -200,7 +212,6 @@ b.termInB = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -228,7 +239,6 @@ b.termInB = 11 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -259,10 +269,13 @@ of the moved namespace. scratch/history> delete.namespace b Done. + scratch/history> move.namespace a b Done. + -- Should be the history from 'a' + scratch/history> history b Note: The most recent namespace hash is immediately below this @@ -275,7 +288,9 @@ scratch/history> history b termInA □ 2. #m8smmmgjso (start of history) + -- Should be empty + scratch/history> history a Note: The most recent namespace hash is immediately below this @@ -300,7 +315,6 @@ b.termInB = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -328,7 +342,6 @@ b.termInB = 11 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -349,6 +362,7 @@ scratch/existing> update updated... Done. + scratch/existing> move.namespace a b ⚠️ diff --git a/unison-src/transcripts/idempotent/name-resolution.md b/unison-src/transcripts/idempotent/name-resolution.md index 59a40fdcc3..2354c16dce 100644 --- a/unison-src/transcripts/idempotent/name-resolution.md +++ b/unison-src/transcripts/idempotent/name-resolution.md @@ -14,7 +14,6 @@ type Namespace.Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,7 +39,6 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. @@ -63,7 +61,6 @@ type UsesFoo = UsesFoo Namespace.Foo File.Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -96,7 +93,6 @@ type Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -122,7 +118,6 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -142,6 +137,7 @@ scratch/main> add type File.Foo type UsesFoo + scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo @@ -167,7 +163,6 @@ type Namespace.Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -193,7 +188,6 @@ type UsesFoo = UsesFoo Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -213,6 +207,7 @@ scratch/main> add type Foo type UsesFoo + scratch/main> view UsesFoo type UsesFoo = UsesFoo Foo @@ -239,7 +234,6 @@ ns.foo = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -268,7 +262,6 @@ bar = foo ++ "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -302,7 +295,6 @@ ns.foo = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -331,7 +323,6 @@ bar = foo + 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -365,7 +356,6 @@ ns.foo = 42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -394,7 +384,6 @@ bar = foo + 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what foo refers to here: @@ -419,7 +408,6 @@ bar = file.foo + ns.foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -439,6 +427,7 @@ scratch/main> add bar : Nat file.foo : Nat + scratch/main> view bar bar : Nat diff --git a/unison-src/transcripts/idempotent/name-segment-escape.md b/unison-src/transcripts/idempotent/name-segment-escape.md index da62438c48..4df8f773a9 100644 --- a/unison-src/transcripts/idempotent/name-segment-escape.md +++ b/unison-src/transcripts/idempotent/name-segment-escape.md @@ -7,6 +7,7 @@ scratch/main> view `match` The following names were not found in the codebase. Check your spelling. `match` + scratch/main> view `=` ⚠️ @@ -26,6 +27,7 @@ scratch/main> view `.` The following names were not found in the codebase. Check your spelling. `.` + scratch/main> view `()` ⚠️ diff --git a/unison-src/transcripts/idempotent/name-selection.md b/unison-src/transcripts/idempotent/name-selection.md index 34690c9855..bc89c80b6b 100644 --- a/unison-src/transcripts/idempotent/name-selection.md +++ b/unison-src/transcripts/idempotent/name-selection.md @@ -6,6 +6,7 @@ This transcript shows how the pretty-printer picks names for a hash when multipl ``` ucm :hide scratch/main> builtins.merge lib.builtins + scratch/biasing> builtins.merge lib.builtins ``` @@ -25,6 +26,7 @@ scratch/main> add a.a : Nat a.aaa.but.more.segments : Nat a.b : Nat + scratch/main> view a.a a.a : Nat @@ -74,9 +76,11 @@ scratch/main> add a3.c : Nat a3.d : Nat a3.long.name.but.shortest.suffixification : Nat + scratch/main> debug.alias.term.force a2.c a3.c Done. + scratch/main> debug.alias.term.force a2.d a3.d Done. @@ -128,7 +132,6 @@ a = 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -150,9 +153,13 @@ scratch/biasing> add 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. + scratch/biasing> view deeply.nested.term deeply.nested.term : Nat @@ -168,7 +175,6 @@ other.num = 20 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -186,8 +192,11 @@ scratch/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. + scratch/biasing> view deeply.nested.term deeply.nested.term : Nat diff --git a/unison-src/transcripts/idempotent/names.md b/unison-src/transcripts/idempotent/names.md index 254a1cd2c8..ca74561ba8 100644 --- a/unison-src/transcripts/idempotent/names.md +++ b/unison-src/transcripts/idempotent/names.md @@ -19,7 +19,6 @@ somewhere.y = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -51,6 +50,7 @@ scratch/main> add ``` ucm -- We can search by suffix and find all definitions named 'x', and each of their aliases respectively. + scratch/main> names x Terms @@ -59,13 +59,17 @@ scratch/main> names x Hash: #pi25gcdv0o Names: some.otherplace.x + -- We can search by hash, and see all aliases of that hash + scratch/main> names #gjmq673r1v Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z + -- Works with absolute names too + scratch/main> names .some.place.x Term @@ -77,6 +81,7 @@ scratch/main> names .some.place.x ``` ucm -- We can search from a different branch and find all names in the codebase named 'x', and each of their aliases respectively. + scratch/other> debug.names.global x Found results in scratch/main @@ -87,7 +92,9 @@ scratch/other> debug.names.global x Hash: #pi25gcdv0o Names: some.otherplace.x + -- We can search by hash, and see all aliases of that hash in the codebase + scratch/other> debug.names.global #gjmq673r1v Found results in scratch/main @@ -95,7 +102,9 @@ scratch/other> debug.names.global #gjmq673r1v Term Hash: #gjmq673r1v Names: some.otherplace.y some.place.x somewhere.z + -- We can search using an absolute name + scratch/other> debug.names.global .some.place.x Found results in scratch/main diff --git a/unison-src/transcripts/idempotent/namespace-deletion-regression.md b/unison-src/transcripts/idempotent/namespace-deletion-regression.md index fa3adfbe0b..86e07b4d48 100644 --- a/unison-src/transcripts/idempotent/namespace-deletion-regression.md +++ b/unison-src/transcripts/idempotent/namespace-deletion-regression.md @@ -11,15 +11,19 @@ unexpectedly 😬. scratch/main> alias.term ##Nat.+ Nat.+ Done. + scratch/main> ls Nat 1. + (##Nat -> ##Nat -> ##Nat) + scratch/main> move.namespace Nat Nat.operators Done. + scratch/main> ls Nat 1. operators/ (1 term) + scratch/main> ls Nat.operators 1. + (##Nat -> ##Nat -> ##Nat) diff --git a/unison-src/transcripts/idempotent/namespace-dependencies.md b/unison-src/transcripts/idempotent/namespace-dependencies.md index c803a2009a..672c0b76f6 100644 --- a/unison-src/transcripts/idempotent/namespace-dependencies.md +++ b/unison-src/transcripts/idempotent/namespace-dependencies.md @@ -20,6 +20,7 @@ scratch/main> add const : a -> b -> a external.mynat : Nat mynamespace.dependsOnText : Nat + scratch/main> namespace.dependencies mynamespace External dependency Dependents in scratch/main:.mynamespace diff --git a/unison-src/transcripts/idempotent/namespace-directive.md b/unison-src/transcripts/idempotent/namespace-directive.md index fa3c5f67b7..f9eabb86c0 100644 --- a/unison-src/transcripts/idempotent/namespace-directive.md +++ b/unison-src/transcripts/idempotent/namespace-directive.md @@ -19,7 +19,6 @@ baz = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +46,6 @@ longer.evil.factorial n = n ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +65,7 @@ scratch/main> add foo.factorial : Int -> Int foo.longer.evil.factorial : Int -> Int + scratch/main> view factorial foo.factorial : Int -> Int @@ -92,7 +91,6 @@ type longer.foo.Baz = { qux : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -141,7 +139,6 @@ hasTypeLink = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -179,6 +176,7 @@ scratch/main> add foo.hasTypeLink : Doc2 foo.refersToBar : foo.Foo -> Nat foo.refersToQux : foo.Baz -> Nat + scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink type foo.RefersToFoo = RefersToFoo foo.Foo @@ -194,6 +192,7 @@ scratch/main> view RefersToFoo refersToBar refersToQux hasTypeLink use Nat + use foo.Baz qux qux baz + qux baz + scratch/main> todo You have no pending todo items. Good work! ✅ diff --git a/unison-src/transcripts/idempotent/numbered-args.md b/unison-src/transcripts/idempotent/numbered-args.md index 27f26ebfa2..1b6166f0d4 100644 --- a/unison-src/transcripts/idempotent/numbered-args.md +++ b/unison-src/transcripts/idempotent/numbered-args.md @@ -16,7 +16,6 @@ corge = "corge" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -73,6 +72,7 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text + scratch/main> view 2 baz : Text @@ -91,6 +91,7 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text + scratch/main> view 2 3 5 baz : Text @@ -115,6 +116,7 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text + scratch/main> view 2-4 baz : Text @@ -139,6 +141,7 @@ scratch/main> find 5. quux : Text 6. qux : Text 7. builtin type Text + scratch/main> view 1-3 4 5-6 bar : Text diff --git a/unison-src/transcripts/idempotent/old-fold-right.md b/unison-src/transcripts/idempotent/old-fold-right.md index a73bcebd0e..fe321cb955 100644 --- a/unison-src/transcripts/idempotent/old-fold-right.md +++ b/unison-src/transcripts/idempotent/old-fold-right.md @@ -16,7 +16,6 @@ pecan = 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/pattern-match-coverage.md b/unison-src/transcripts/idempotent/pattern-match-coverage.md index 75c628b11e..90bf569876 100644 --- a/unison-src/transcripts/idempotent/pattern-match-coverage.md +++ b/unison-src/transcripts/idempotent/pattern-match-coverage.md @@ -15,7 +15,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -41,7 +40,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -70,7 +68,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -91,7 +88,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -113,7 +109,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -137,7 +132,6 @@ test0 = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -156,7 +150,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -175,7 +168,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -196,7 +188,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -222,7 +213,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -249,7 +239,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -273,7 +262,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -302,7 +290,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -323,7 +310,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -347,7 +333,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -369,7 +354,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -394,7 +378,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -413,7 +396,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -433,7 +415,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -454,7 +435,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -473,7 +453,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -492,7 +471,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -512,7 +490,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -533,7 +510,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -559,7 +535,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -591,7 +566,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -616,7 +590,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -641,7 +614,6 @@ test = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -660,7 +632,6 @@ unit2t = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -697,7 +668,6 @@ witht = match unit2t () with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -717,7 +687,6 @@ evil = bug "" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -746,7 +715,6 @@ withV = match evil () with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -759,7 +727,6 @@ unique type SomeType = A ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -787,7 +754,6 @@ get x = match x with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -805,7 +771,6 @@ unique type R = { someType : SomeType } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -836,7 +801,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -863,7 +827,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -894,7 +857,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -924,7 +886,6 @@ handleMulti c = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -952,7 +913,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -979,7 +939,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1005,7 +964,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1035,7 +993,6 @@ handleMulti c = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1064,7 +1021,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1088,7 +1044,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1116,7 +1071,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1144,7 +1098,6 @@ result f = handle !f with cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1184,7 +1137,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. Pattern match doesn't cover all possible cases: @@ -1213,7 +1165,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1241,7 +1192,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1270,7 +1220,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1300,7 +1249,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. This case would be ignored because it's already covered by the preceding case(s): @@ -1328,7 +1276,6 @@ result f = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md b/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md index c09675c9c1..860329390d 100644 --- a/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md +++ b/unison-src/transcripts/idempotent/pattern-pretty-print-2345.md @@ -64,7 +64,6 @@ doc = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -110,80 +109,94 @@ scratch/main> add sneezy : Int -> () throaty : Request {g, Ab} x -> () tremulous : (Nat, Nat) -> () + scratch/main> view dopey dopey : Char -> () dopey = cases ?0 -> () _ -> () + scratch/main> view grumpy grumpy : ff284oqf651 -> () grumpy = cases d -> () + scratch/main> view happy happy : Boolean -> () happy = cases true -> () false -> () + scratch/main> view sneezy sneezy : Int -> () sneezy = cases +1 -> () _ -> () + scratch/main> view bashful bashful : Optional a -> () bashful = cases Some a -> () _ -> () + scratch/main> view mouthy mouthy : [t] -> () mouthy = cases [] -> () _ -> () + scratch/main> view pokey pokey : [t] -> () pokey = cases h +: t -> () _ -> () + scratch/main> view sleepy sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () + scratch/main> view demure demure : [Nat] -> () demure = cases [0] -> () _ -> () + scratch/main> view angry angry : [t] -> () angry = cases a ++ [] -> () + scratch/main> view tremulous tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () + scratch/main> view throaty throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () + scratch/main> view agitated agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () + scratch/main> view doc doc : Nat -> () diff --git a/unison-src/transcripts/idempotent/patternMatchTls.md b/unison-src/transcripts/idempotent/patternMatchTls.md index 88b34574b2..fc6517f872 100644 --- a/unison-src/transcripts/idempotent/patternMatchTls.md +++ b/unison-src/transcripts/idempotent/patternMatchTls.md @@ -25,7 +25,6 @@ assertRight = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,6 +44,7 @@ scratch/main> add assertRight : Either a b -> b frank : '{IO} () + scratch/main> run frank () diff --git a/unison-src/transcripts/idempotent/patterns.md b/unison-src/transcripts/idempotent/patterns.md index 56b0474376..1baa09fdda 100644 --- a/unison-src/transcripts/idempotent/patterns.md +++ b/unison-src/transcripts/idempotent/patterns.md @@ -12,7 +12,6 @@ p1 = join [literal "blue", literal "frog"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/propagate.md b/unison-src/transcripts/idempotent/propagate.md index dd5838bedf..c2861e3bb0 100644 --- a/unison-src/transcripts/idempotent/propagate.md +++ b/unison-src/transcripts/idempotent/propagate.md @@ -14,7 +14,6 @@ fooToInt _ = +42 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +35,7 @@ scratch/main> add type Foo fooToInt : Foo -> Int + scratch/main> find.verbose 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo @@ -47,6 +47,7 @@ scratch/main> find.verbose 3. -- #j6hbm1gc2ak4f46b6705q90ld4bmhoi8etq2q45j081i9jgn95fvk3p6tjg67e7sm0021035i8qikmk4p6k845l5d00u26cos5731to fooToInt : Foo -> Int + scratch/main> view fooToInt fooToInt : Foo -> Int @@ -60,7 +61,6 @@ unique type Foo = Foo | Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -106,7 +106,6 @@ preserve.otherTerm y = someTerm y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -138,7 +137,6 @@ preserve.someTerm _ = None ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -169,6 +167,7 @@ scratch/main> view preserve.someTerm preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None + scratch/main> view preserve.otherTerm preserve.otherTerm : Optional baz -> Optional baz diff --git a/unison-src/transcripts/idempotent/pull-errors.md b/unison-src/transcripts/idempotent/pull-errors.md index 9a1b0e4cdf..bb1746e231 100644 --- a/unison-src/transcripts/idempotent/pull-errors.md +++ b/unison-src/transcripts/idempotent/pull-errors.md @@ -9,6 +9,7 @@ test/main> pull @aryairani/test-almost-empty/main lib.base_latest I installed @aryairani/test-almost-empty/main as aryairani_test_almost_empty_main. + test/main> pull @aryairani/test-almost-empty/main a.b ⚠️ @@ -20,11 +21,13 @@ test/main> pull @aryairani/test-almost-empty/main a.b merging into the top level of a local project branch. You can run `help pull` for more information on using `pull`. + test/main> pull @aryairani/test-almost-empty/main a I think you want to merge @aryairani/test-almost-empty/main into the a branch, but it doesn't exist. If you want, you can create it with `branch.empty a`, and then `pull` again. + test/main> pull @aryairani/test-almost-empty/main .a ⚠️ diff --git a/unison-src/transcripts/idempotent/records.md b/unison-src/transcripts/idempotent/records.md index 26548ab236..40ab77e278 100644 --- a/unison-src/transcripts/idempotent/records.md +++ b/unison-src/transcripts/idempotent/records.md @@ -2,6 +2,7 @@ Ensure that Records keep their syntax after being added to the codebase ``` ucm :hide scratch/main> builtins.merge + scratch/main> load unison-src/transcripts-using-base/base.u ``` @@ -178,7 +179,6 @@ unique type Record5 = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/reflog.md b/unison-src/transcripts/idempotent/reflog.md index 75a5c5d7b5..357ffb6200 100644 --- a/unison-src/transcripts/idempotent/reflog.md +++ b/unison-src/transcripts/idempotent/reflog.md @@ -9,7 +9,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,7 +33,6 @@ y = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,18 +50,22 @@ scratch/main> add ⍟ I've added these definitions: y : Nat + scratch/main> branch /other Done. I've created the other branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /other`. + scratch/other> alias.term y z Done. + newproject/main> builtins.merge lib.builtins Done. + newproject/main> alias.type lib.builtins.Nat MyNat Done. diff --git a/unison-src/transcripts/idempotent/release-draft-command.md b/unison-src/transcripts/idempotent/release-draft-command.md index a1136ec464..db40f0a607 100644 --- a/unison-src/transcripts/idempotent/release-draft-command.md +++ b/unison-src/transcripts/idempotent/release-draft-command.md @@ -11,7 +11,6 @@ someterm = 18 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/reset.md b/unison-src/transcripts/idempotent/reset.md index 54e23fb64c..2cd116f87c 100644 --- a/unison-src/transcripts/idempotent/reset.md +++ b/unison-src/transcripts/idempotent/reset.md @@ -7,7 +7,6 @@ def = "first value" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,6 +35,7 @@ scratch/main> update updated... Done. + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -54,13 +54,16 @@ scratch/main> history def □ 3. #4bigcpnl7t (start of history) + scratch/main> reset 2 Done. + scratch/main> view def def : Text def = "first value" + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -93,14 +96,18 @@ scratch/main> reflog 3. scratch/main #ujvq6e87kp update 4. scratch/main #4bigcpnl7t builtins.merge 5. scratch/main #sg60bvjo91 Project Created + -- Reset the current branch to the first history element + scratch/main> reset 2 Done. + scratch/main> view def def : Text def = "second value" + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -145,13 +152,16 @@ foo/main> update updated... Done. + foo/empty> reset /main: Done. + foo/empty> view a a : ##Nat a = 5 + foo/empty> history Note: The most recent namespace hash is immediately below this @@ -175,6 +185,7 @@ foo/main> update updated... Done. + foo/main> history Note: The most recent namespace hash is immediately below this @@ -187,6 +198,7 @@ foo/main> history main.a □ 2. #5l94rduvel (start of history) + foo/main> reset 2 main Done. diff --git a/unison-src/transcripts/idempotent/resolution-failures.md b/unison-src/transcripts/idempotent/resolution-failures.md index 863ce848b2..0dfba8378c 100644 --- a/unison-src/transcripts/idempotent/resolution-failures.md +++ b/unison-src/transcripts/idempotent/resolution-failures.md @@ -21,7 +21,6 @@ two.ambiguousTerm = "term two" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -72,7 +71,6 @@ separateAmbiguousTypeUsage _ = () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. @@ -106,7 +104,6 @@ useAmbiguousTerm = ambiguousTerm ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what ambiguousTerm refers to here: diff --git a/unison-src/transcripts/idempotent/rsa.md b/unison-src/transcripts/idempotent/rsa.md index cd07c425a3..900838394f 100644 --- a/unison-src/transcripts/idempotent/rsa.md +++ b/unison-src/transcripts/idempotent/rsa.md @@ -36,7 +36,6 @@ sigKo = match signature with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/scope-ref.md b/unison-src/transcripts/idempotent/scope-ref.md index ac1972098d..5d723e9ddc 100644 --- a/unison-src/transcripts/idempotent/scope-ref.md +++ b/unison-src/transcripts/idempotent/scope-ref.md @@ -18,7 +18,6 @@ test = Scope.run 'let ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/suffixes.md b/unison-src/transcripts/idempotent/suffixes.md index ad8d1d3e69..762ffe5448 100644 --- a/unison-src/transcripts/idempotent/suffixes.md +++ b/unison-src/transcripts/idempotent/suffixes.md @@ -26,6 +26,7 @@ scratch/main> add foo.bar.a : Int optional.isNone : Optional a -> Boolean + scratch/main> find take 1. builtin.Bytes.take : Nat -> Bytes -> Bytes @@ -41,6 +42,7 @@ The `view` and `display` commands also benefit from this: scratch/main> view List.drop builtin builtin.List.drop : builtin.Nat -> [a] -> [a] + scratch/main> display bar.a +99 @@ -69,7 +71,6 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -100,7 +101,6 @@ scratch/main> add ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I couldn't figure out what abra.cadabra refers to here: @@ -122,7 +122,6 @@ scratch/main> add ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -145,6 +144,7 @@ scratch/main> view abra.cadabra lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" + scratch/main> view baz.qux lib.distributed.baz.qux : Text @@ -158,6 +158,7 @@ scratch/main> view distributed.abra.cadabra lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" + scratch/main> names distributed.lib.baz.qux Term diff --git a/unison-src/transcripts/idempotent/sum-type-update-conflicts.md b/unison-src/transcripts/idempotent/sum-type-update-conflicts.md index ec032c8949..467ad27b61 100644 --- a/unison-src/transcripts/idempotent/sum-type-update-conflicts.md +++ b/unison-src/transcripts/idempotent/sum-type-update-conflicts.md @@ -13,7 +13,6 @@ structural type X = x ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -48,7 +47,6 @@ dependsOnX = Text.size X.x ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/switch-command.md b/unison-src/transcripts/idempotent/switch-command.md index 4c8b6e1377..2361485802 100644 --- a/unison-src/transcripts/idempotent/switch-command.md +++ b/unison-src/transcripts/idempotent/switch-command.md @@ -2,6 +2,7 @@ The `switch` command switches to an existing project or branch. ``` ucm :hide foo/main> builtins.merge + bar/main> builtins.merge ``` @@ -12,7 +13,6 @@ someterm = 18 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -30,12 +30,14 @@ foo/main> add ⍟ I've added these definitions: someterm : Nat + foo/main> branch bar Done. I've created the bar branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bar`. + foo/main> branch topic Done. I've created the topic branch based off of main. @@ -50,9 +52,13 @@ forward slash (which makes it unambiguous). ``` ucm scratch/main> switch foo + scratch/main> switch foo/topic + foo/main> switch topic + foo/main> switch /topic + foo/main> switch bar/ ``` diff --git a/unison-src/transcripts/idempotent/tab-completion.md b/unison-src/transcripts/idempotent/tab-completion.md index 0a6336d99a..83aa787539 100644 --- a/unison-src/transcripts/idempotent/tab-completion.md +++ b/unison-src/transcripts/idempotent/tab-completion.md @@ -9,6 +9,7 @@ scratch/main> debug.tab-complete vi view view.global + scratch/main> debug.tab-complete delete. delete.branch @@ -34,7 +35,6 @@ unique type subnamespace.AType = A | B ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,32 +56,42 @@ scratch/main> add ``` ucm -- Should tab complete namespaces since they may contain terms/types + 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 + scratch/main> debug.tab-complete view subnamespace subnamespace. subnamespace2. + -- Should complete things from child namespaces of the current query if it's dot-suffixed + scratch/main> debug.tab-complete view subnamespace. * subnamespace.AType subnamespace.AType. * subnamespace.someName * subnamespace.someOtherName + -- Should complete things from child namespaces of the current query if there are no more completions at this level. + scratch/main> debug.tab-complete view subnamespace2 subnamespace2. * subnamespace2.thing + -- Should prefix-filter by query suffix + scratch/main> debug.tab-complete view subnamespace.some * subnamespace.someName * subnamespace.someOtherName + scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName @@ -97,7 +107,9 @@ scratch/main> add ⍟ I've added these definitions: absolute.term : ##Text + -- Should tab complete absolute names + scratch/main> debug.tab-complete view .absolute.te * .absolute.term @@ -107,25 +119,31 @@ scratch/main> debug.tab-complete view .absolute.te ``` ucm -- Should tab complete namespaces + scratch/main> debug.tab-complete find-in sub subnamespace subnamespace2 + scratch/main> debug.tab-complete find-in subnamespace subnamespace subnamespace2 + scratch/main> debug.tab-complete find-in subnamespace. subnamespace.AType + scratch/main> debug.tab-complete io.test sub subnamespace. subnamespace2. + scratch/main> debug.tab-complete io.test subnamespace subnamespace. subnamespace2. + scratch/main> debug.tab-complete io.test subnamespace. subnamespace.AType. @@ -142,7 +160,6 @@ add b = b ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -162,10 +179,12 @@ scratch/main> update.old type Foo add : a -> a + scratch/main> debug.tab-complete delete.type Foo * Foo Foo. + scratch/main> debug.tab-complete delete.term add * add @@ -180,9 +199,11 @@ myproject/main> branch mybranch Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. + myproject/main> debug.tab-complete branch.delete /mybr /mybranch + myproject/main> debug.tab-complete project.rename my myproject @@ -195,7 +216,6 @@ mybranchsubnamespace.term = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -213,6 +233,7 @@ myproject/main> add ⍟ I've added these definitions: mybranchsubnamespace.term : ##Nat + myproject/main> debug.tab-complete merge mybr /mybranch diff --git a/unison-src/transcripts/idempotent/tdnr.md b/unison-src/transcripts/idempotent/tdnr.md index cbb138389b..1a4f8214b8 100644 --- a/unison-src/transcripts/idempotent/tdnr.md +++ b/unison-src/transcripts/idempotent/tdnr.md @@ -11,7 +11,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,7 +39,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -66,7 +64,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -94,7 +91,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -121,7 +117,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -154,7 +149,6 @@ good.foo = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -180,7 +174,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -209,7 +202,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -236,7 +228,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -264,7 +255,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -292,7 +282,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -324,7 +313,6 @@ good.foo = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -351,7 +339,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -385,7 +372,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -413,7 +399,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -446,7 +431,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -475,7 +459,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -510,7 +493,6 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -536,7 +518,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -565,7 +546,6 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -592,7 +572,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -620,7 +599,6 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -648,7 +626,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -680,7 +657,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -706,7 +682,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -735,7 +710,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -762,7 +736,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -790,7 +763,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -818,7 +790,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -850,7 +821,6 @@ lib.good.foo = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -876,7 +846,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -905,7 +874,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -932,7 +900,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -960,7 +927,6 @@ bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -988,7 +954,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1021,7 +986,6 @@ lib.bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1048,7 +1012,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1076,7 +1039,6 @@ lib.dep.lib.dep.foo = 217 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1103,7 +1065,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1131,7 +1092,6 @@ lib.dep.lib.bad.foo = "bar" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1158,7 +1118,6 @@ thing = foo Nat.+ foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/test-command.md b/unison-src/transcripts/idempotent/test-command.md index 202c8b4525..3f3c6df0ec 100644 --- a/unison-src/transcripts/idempotent/test-command.md +++ b/unison-src/transcripts/idempotent/test-command.md @@ -15,7 +15,6 @@ foo.test2 = [Ok "test2"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -74,7 +73,6 @@ lib.dep.testInLib = [Ok "testInLib"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -101,6 +99,7 @@ scratch/main> test ✅ 2 test(s) passing Tip: Use view 1 to view the source of a test. + scratch/main> test.all diff --git a/unison-src/transcripts/idempotent/text-literals.md b/unison-src/transcripts/idempotent/text-literals.md index 1ecc7b517a..de87b7daf4 100644 --- a/unison-src/transcripts/idempotent/text-literals.md +++ b/unison-src/transcripts/idempotent/text-literals.md @@ -36,7 +36,6 @@ lit2 = """" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -96,6 +95,7 @@ scratch/main> add lit1 : Text lit2 : Text + scratch/main> view lit1 lit2 lit1 : Text diff --git a/unison-src/transcripts/idempotent/textfind.md b/unison-src/transcripts/idempotent/textfind.md index 41c0d8ac54..96bda8abba 100644 --- a/unison-src/transcripts/idempotent/textfind.md +++ b/unison-src/transcripts/idempotent/textfind.md @@ -52,7 +52,6 @@ lib.bar = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -83,6 +82,7 @@ scratch/main> grep hi 1. bar Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> view 1 bar : Nat @@ -90,6 +90,7 @@ scratch/main> view 1 "ooga" -> 99 "booga" -> 23 _ -> 0 + scratch/main> grep "hi" 🔎 @@ -99,6 +100,7 @@ scratch/main> grep "hi" 1. bar Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> text.find.all hi 🔎 @@ -110,6 +112,7 @@ scratch/main> text.find.all hi Tip: Try `edit 1` or `edit 1-2` to bring these into your scratch file. + scratch/main> view 1-5 bar : Nat @@ -120,6 +123,7 @@ scratch/main> view 1-5 lib.foo : [Any] lib.foo = [Any 46, Any "hi", Any "zoink"] + scratch/main> grep oog 🔎 @@ -129,6 +133,7 @@ scratch/main> grep oog 1. bar Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> view 1 bar : Nat @@ -148,10 +153,12 @@ scratch/main> grep quaffle 1. baz Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> view 1-5 baz : [Text] baz = ["an", "quaffle", "tres"] + scratch/main> text.find "interesting const" 🔎 @@ -161,12 +168,14 @@ scratch/main> text.find "interesting const" 1. foo Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> view 1-5 foo : Nat foo = _ = "an interesting constant" 1 + scratch/main> text.find "99" "23" 🔎 @@ -176,6 +185,7 @@ scratch/main> text.find "99" "23" 1. bar Tip: Try `edit 1` to bring this into your scratch file. + scratch/main> view 1 bar : Nat diff --git a/unison-src/transcripts/idempotent/todo-bug-builtins.md b/unison-src/transcripts/idempotent/todo-bug-builtins.md index b1db33c768..31b375e8fe 100644 --- a/unison-src/transcripts/idempotent/todo-bug-builtins.md +++ b/unison-src/transcripts/idempotent/todo-bug-builtins.md @@ -11,7 +11,6 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -38,7 +37,6 @@ scratch/main> builtins.merge ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ @@ -69,7 +67,6 @@ complicatedMathStuff x = todo "Come back and to something with x here" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -92,7 +89,6 @@ test = match true with ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/todo.md b/unison-src/transcripts/idempotent/todo.md index a985d1177b..b230464cdf 100644 --- a/unison-src/transcripts/idempotent/todo.md +++ b/unison-src/transcripts/idempotent/todo.md @@ -25,7 +25,6 @@ bar = foo + foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -45,6 +44,7 @@ scratch/main> add bar : Nat foo : Nat + scratch/main> todo These terms call `todo`: @@ -71,7 +71,6 @@ baz = foo.bar + foo.bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -91,6 +90,7 @@ scratch/main> add baz : Nat foo.bar : Nat + scratch/main> delete.namespace.force foo Done. @@ -102,6 +102,7 @@ scratch/main> delete.namespace.force foo Dependency Referenced In bar 1. baz + scratch/main> todo These terms do not have any names in the current namespace: @@ -127,7 +128,6 @@ bar = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -147,9 +147,11 @@ scratch/main> add bar : Nat foo : Nat + scratch/main> debug.alias.term.force foo bar Done. + scratch/main> todo ❓ @@ -180,7 +182,6 @@ lib.foo = 16 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -198,6 +199,7 @@ scratch/main> add ⍟ I've added these definitions: lib.foo : Nat + scratch/main> todo There's a type or term at the top level of the `lib` @@ -222,7 +224,6 @@ type Foo = One ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -240,9 +241,11 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> alias.term Foo.One Foo.Two Done. + scratch/main> todo The type Foo has a constructor with multiple names. @@ -270,7 +273,6 @@ type Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -288,9 +290,11 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> delete.term Foo.Bar Done. + scratch/main> todo These types have some constructors with missing names. @@ -320,7 +324,6 @@ structural type Foo.inner.Bar a = Uno a | Dos a a ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -340,6 +343,7 @@ scratch/main> add structural type Foo a structural type Foo.inner.Bar a + scratch/main> todo These types are aliases, but one is nested under the other. @@ -366,7 +370,6 @@ type Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -384,9 +387,11 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> alias.term Foo.Bar Baz Done. + scratch/main> todo These constructors are not nested beneath their corresponding diff --git a/unison-src/transcripts/idempotent/top-level-exceptions.md b/unison-src/transcripts/idempotent/top-level-exceptions.md index 9e7b49520d..81c18f8349 100644 --- a/unison-src/transcripts/idempotent/top-level-exceptions.md +++ b/unison-src/transcripts/idempotent/top-level-exceptions.md @@ -29,7 +29,6 @@ mytest _ = [Ok "Great"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -46,12 +45,14 @@ mytest _ = [Ok "Great"] scratch/main> run main () + scratch/main> add ⍟ I've added these definitions: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] + scratch/main> io.test mytest New test results: @@ -76,7 +77,6 @@ unique type RuntimeError = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/transcript-parser-commands.md b/unison-src/transcripts/idempotent/transcript-parser-commands.md index 147db1caf7..5782588136 100644 --- a/unison-src/transcripts/idempotent/transcript-parser-commands.md +++ b/unison-src/transcripts/idempotent/transcript-parser-commands.md @@ -11,7 +11,6 @@ x = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/type-deps.md b/unison-src/transcripts/idempotent/type-deps.md index f30039d736..57b2cf602a 100644 --- a/unison-src/transcripts/idempotent/type-deps.md +++ b/unison-src/transcripts/idempotent/type-deps.md @@ -24,7 +24,6 @@ structural type Y = Y Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,7 +53,9 @@ scratch/main> add blocked structural type Z Tip: Use `help filestatus` to learn more. + -- This shouldn't exist, because it should've been blocked. + scratch/main> view Z ⚠️ diff --git a/unison-src/transcripts/idempotent/type-modifier-are-optional.md b/unison-src/transcripts/idempotent/type-modifier-are-optional.md index 4d2459a147..1af19c052b 100644 --- a/unison-src/transcripts/idempotent/type-modifier-are-optional.md +++ b/unison-src/transcripts/idempotent/type-modifier-are-optional.md @@ -17,7 +17,6 @@ structural ability MyAbilityS where const : a ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/undo.md b/unison-src/transcripts/idempotent/undo.md index 42d5854e74..fd250b350c 100644 --- a/unison-src/transcripts/idempotent/undo.md +++ b/unison-src/transcripts/idempotent/undo.md @@ -10,23 +10,28 @@ x = 1 scratch/main> builtins.merge lib.builtins Done. + scratch/main> add ⍟ I've added these definitions: x : Nat + scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/main> alias.term x y Done. + scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -50,6 +55,7 @@ scratch/main> history x □ 3. #ms9lggs2rg (start of history) + scratch/main> undo Here are the changes I undid @@ -58,10 +64,12 @@ scratch/main> undo Original Changes 1. x 2. y (added) + scratch/main> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/main> history Note: The most recent namespace hash is immediately below this @@ -88,23 +96,28 @@ x = 1 scratch/branch1> builtins.merge lib.builtins Done. + scratch/branch1> add ⍟ I've added these definitions: x : Nat + scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/branch1> alias.term x y Done. + scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) 3. y (Nat) + scratch/branch1> history Note: The most recent namespace hash is immediately below this @@ -128,13 +141,17 @@ scratch/branch1> history x □ 3. #ms9lggs2rg (start of history) + -- Make some changes on an unrelated branch + scratch/branch2> builtins.merge lib.builtins Done. + scratch/branch2> delete.namespace lib Done. + scratch/branch1> undo Here are the changes I undid @@ -143,10 +160,12 @@ scratch/branch1> undo Original Changes 1. x 2. y (added) + scratch/branch1> ls 1. lib/ (469 terms, 74 types) 2. x (Nat) + scratch/branch1> history Note: The most recent namespace hash is immediately below this @@ -171,6 +190,7 @@ scratch/main> branch.create-empty new Done. I've created an empty branch scratch/new. Tip: Use `merge /somebranch` to initialize this branch. + scratch/new> undo ⚠️ diff --git a/unison-src/transcripts/idempotent/unique-type-churn.md b/unison-src/transcripts/idempotent/unique-type-churn.md index c1014c5546..25c06ea7d2 100644 --- a/unison-src/transcripts/idempotent/unique-type-churn.md +++ b/unison-src/transcripts/idempotent/unique-type-churn.md @@ -9,7 +9,6 @@ unique type C = C B ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ unique type C = C B ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -67,7 +65,6 @@ unique type A = A () ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,6 +84,7 @@ scratch/main> update updated... Done. + scratch/main> names A Type @@ -103,7 +101,6 @@ unique type A = A ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -125,6 +122,7 @@ scratch/main> update updated... Done. + scratch/main> names A Type diff --git a/unison-src/transcripts/idempotent/unitnamespace.md b/unison-src/transcripts/idempotent/unitnamespace.md index 287736fb2a..271da4e84f 100644 --- a/unison-src/transcripts/idempotent/unitnamespace.md +++ b/unison-src/transcripts/idempotent/unitnamespace.md @@ -3,7 +3,6 @@ ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -21,12 +20,15 @@ scratch/main> add ⍟ I've added these definitions: `()`.foo : ##Text + scratch/main> find 1. `()`.foo : ##Text + scratch/main> find-in `()` 1. foo : ##Text + scratch/main> delete.namespace `()` Done. diff --git a/unison-src/transcripts/idempotent/universal-cmp.md b/unison-src/transcripts/idempotent/universal-cmp.md index 23c1c618bc..23b14dd6ed 100644 --- a/unison-src/transcripts/idempotent/universal-cmp.md +++ b/unison-src/transcripts/idempotent/universal-cmp.md @@ -15,7 +15,6 @@ threadEyeDeez _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,6 +34,7 @@ scratch/main> add type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) + scratch/main> run threadEyeDeez (false, true) @@ -48,7 +48,6 @@ scratch/main> run threadEyeDeez ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/unsafe-coerce.md b/unison-src/transcripts/idempotent/unsafe-coerce.md index db2aaa7460..16fe412eb5 100644 --- a/unison-src/transcripts/idempotent/unsafe-coerce.md +++ b/unison-src/transcripts/idempotent/unsafe-coerce.md @@ -16,7 +16,6 @@ main _ = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -34,6 +33,7 @@ main _ = scratch/main> find unsafe.coerceAbilities 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b + scratch/main> add ⍟ I've added these definitions: @@ -41,6 +41,7 @@ scratch/main> add f : 'Nat fc : '{IO, Exception} Nat main : '{IO, Exception} [Result] + scratch/main> io.test main New test results: diff --git a/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md b/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md index 31032b48c7..946fe14ceb 100644 --- a/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md +++ b/unison-src/transcripts/idempotent/update-ignores-lib-namespace.md @@ -12,7 +12,6 @@ lib.foo = 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,7 +38,6 @@ foo = 200 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -60,6 +58,7 @@ scratch/main> update updated... Done. + scratch/main> names foo Term diff --git a/unison-src/transcripts/idempotent/update-on-conflict.md b/unison-src/transcripts/idempotent/update-on-conflict.md index 078f2cfdda..3e2392be9f 100644 --- a/unison-src/transcripts/idempotent/update-on-conflict.md +++ b/unison-src/transcripts/idempotent/update-on-conflict.md @@ -12,7 +12,6 @@ temp = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,9 +31,11 @@ scratch/main> add temp : Nat x : Nat + scratch/main> debug.alias.term.force temp x Done. + scratch/main> delete.term temp Done. @@ -45,7 +46,6 @@ x = 3 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-suffixifies-properly.md b/unison-src/transcripts/idempotent/update-suffixifies-properly.md index 8edef4df26..f0076b6ac8 100644 --- a/unison-src/transcripts/idempotent/update-suffixifies-properly.md +++ b/unison-src/transcripts/idempotent/update-suffixifies-properly.md @@ -12,7 +12,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -47,7 +46,6 @@ foo = +30 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md b/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md index e8b3d4ef9f..edb264cb96 100644 --- a/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md +++ b/unison-src/transcripts/idempotent/update-term-aliases-in-different-ways.md @@ -13,7 +13,6 @@ bar = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +43,6 @@ bar = 7 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,6 +65,7 @@ scratch/main> update updated... Done. + scratch/main> view foo bar bar : Nat diff --git a/unison-src/transcripts/idempotent/update-term-to-different-type.md b/unison-src/transcripts/idempotent/update-term-to-different-type.md index ee2d0d88af..668492cc63 100644 --- a/unison-src/transcripts/idempotent/update-term-to-different-type.md +++ b/unison-src/transcripts/idempotent/update-term-to-different-type.md @@ -10,7 +10,6 @@ foo = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,7 +35,6 @@ foo = +5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +54,7 @@ scratch/main> update updated... Done. + scratch/main> view foo foo : Int diff --git a/unison-src/transcripts/idempotent/update-term-with-alias.md b/unison-src/transcripts/idempotent/update-term-with-alias.md index a13bfd8150..53a7e0b426 100644 --- a/unison-src/transcripts/idempotent/update-term-with-alias.md +++ b/unison-src/transcripts/idempotent/update-term-with-alias.md @@ -13,7 +13,6 @@ bar = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ foo = 6 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -62,6 +60,7 @@ scratch/main> update updated... Done. + scratch/main> view foo bar bar : Nat diff --git a/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md b/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md index e590bc1b04..46f4430d0c 100644 --- a/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md +++ b/unison-src/transcripts/idempotent/update-term-with-dependent-to-different-type.md @@ -13,7 +13,6 @@ bar = foo + 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ foo = +5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-term-with-dependent.md b/unison-src/transcripts/idempotent/update-term-with-dependent.md index aba7ad6b70..0fb5cba6d6 100644 --- a/unison-src/transcripts/idempotent/update-term-with-dependent.md +++ b/unison-src/transcripts/idempotent/update-term-with-dependent.md @@ -13,7 +13,6 @@ bar = foo + 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ foo = 6 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,6 +63,7 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view bar bar : Nat diff --git a/unison-src/transcripts/idempotent/update-term.md b/unison-src/transcripts/idempotent/update-term.md index 753eab2cf0..05ed53fd95 100644 --- a/unison-src/transcripts/idempotent/update-term.md +++ b/unison-src/transcripts/idempotent/update-term.md @@ -10,7 +10,6 @@ foo = 5 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -36,7 +35,6 @@ foo = 6 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +54,7 @@ scratch/main> update updated... Done. + scratch/main> view foo foo : Nat diff --git a/unison-src/transcripts/idempotent/update-test-to-non-test.md b/unison-src/transcripts/idempotent/update-test-to-non-test.md index 21965f8a19..6735428e6a 100644 --- a/unison-src/transcripts/idempotent/update-test-to-non-test.md +++ b/unison-src/transcripts/idempotent/update-test-to-non-test.md @@ -9,7 +9,6 @@ test> foo = [] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,6 +34,7 @@ scratch/main> add ⍟ I've added these definitions: foo : [Result] + scratch/main> view foo foo : [Result] @@ -46,7 +46,6 @@ foo = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -68,6 +67,7 @@ scratch/main> update updated... Done. + scratch/main> view foo foo : Nat diff --git a/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md b/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md index 0c3cac7aaa..93eb6e5d47 100644 --- a/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md +++ b/unison-src/transcripts/idempotent/update-test-watch-roundtrip.md @@ -28,7 +28,6 @@ foo n = "hello, world!" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-add-constructor.md b/unison-src/transcripts/idempotent/update-type-add-constructor.md index 6ca215cd51..743bf42c9b 100644 --- a/unison-src/transcripts/idempotent/update-type-add-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-add-constructor.md @@ -8,7 +8,6 @@ unique type Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ unique type Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -55,9 +53,11 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = Bar Nat | Baz Nat Nat + scratch/main> find.verbose 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog diff --git a/unison-src/transcripts/idempotent/update-type-add-field.md b/unison-src/transcripts/idempotent/update-type-add-field.md index 6cfe366468..b59d840ea0 100644 --- a/unison-src/transcripts/idempotent/update-type-add-field.md +++ b/unison-src/transcripts/idempotent/update-type-add-field.md @@ -7,7 +7,6 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,7 +31,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -52,9 +50,11 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = Bar Nat Nat + scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g diff --git a/unison-src/transcripts/idempotent/update-type-add-new-record.md b/unison-src/transcripts/idempotent/update-type-add-new-record.md index 4527bc19bb..b6373bd0d9 100644 --- a/unison-src/transcripts/idempotent/update-type-add-new-record.md +++ b/unison-src/transcripts/idempotent/update-type-add-new-record.md @@ -7,7 +7,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -29,6 +28,7 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = { bar : Nat } diff --git a/unison-src/transcripts/idempotent/update-type-add-record-field.md b/unison-src/transcripts/idempotent/update-type-add-record-field.md index bef52e1367..46f48385a3 100644 --- a/unison-src/transcripts/idempotent/update-type-add-record-field.md +++ b/unison-src/transcripts/idempotent/update-type-add-record-field.md @@ -7,7 +7,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -38,7 +37,6 @@ unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,9 +65,11 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = { bar : Nat, baz : Int } + scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 diff --git a/unison-src/transcripts/idempotent/update-type-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-constructor-alias.md index 564977360d..044772b2db 100644 --- a/unison-src/transcripts/idempotent/update-type-constructor-alias.md +++ b/unison-src/transcripts/idempotent/update-type-constructor-alias.md @@ -7,7 +7,6 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> alias.term Foo.Bar Foo.BarAlias Done. @@ -35,7 +35,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md b/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md index d267239d61..8c11024b9c 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md +++ b/unison-src/transcripts/idempotent/update-type-delete-constructor-with-dependent.md @@ -14,7 +14,6 @@ foo = cases ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -42,7 +41,6 @@ unique type Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-delete-constructor.md b/unison-src/transcripts/idempotent/update-type-delete-constructor.md index 1d3f8ab182..1f6b205ce5 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-delete-constructor.md @@ -9,7 +9,6 @@ unique type Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ unique type Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -55,9 +53,11 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = Bar Nat + scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 diff --git a/unison-src/transcripts/idempotent/update-type-delete-record-field.md b/unison-src/transcripts/idempotent/update-type-delete-record-field.md index 418d886e24..ec2417d02b 100644 --- a/unison-src/transcripts/idempotent/update-type-delete-record-field.md +++ b/unison-src/transcripts/idempotent/update-type-delete-record-field.md @@ -7,7 +7,6 @@ unique type Foo = { bar : Nat, baz : Int } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -44,7 +43,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -73,9 +71,11 @@ scratch/main> update Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try `update` again. + scratch/main> view Foo type Foo = { bar : Nat, baz : Int } + scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 diff --git a/unison-src/transcripts/idempotent/update-type-missing-constructor.md b/unison-src/transcripts/idempotent/update-type-missing-constructor.md index 20f9b77371..f88af7b953 100644 --- a/unison-src/transcripts/idempotent/update-type-missing-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-missing-constructor.md @@ -7,7 +7,6 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> delete.term Foo.Bar Done. @@ -37,7 +37,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -54,6 +53,7 @@ unique type Foo = Bar Nat Nat scratch/main> view Foo type Foo = #b509v3eg4k#0 Nat + scratch/main> update Sorry, I wasn't able to perform the update: diff --git a/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md b/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md index b6cdaacd02..5ce5ee0fea 100644 --- a/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md +++ b/unison-src/transcripts/idempotent/update-type-nested-decl-aliases.md @@ -10,7 +10,6 @@ structural type A = B.TheOtherAlias Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,7 +38,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-no-op-record.md b/unison-src/transcripts/idempotent/update-type-no-op-record.md index c810b32965..0b8888835c 100644 --- a/unison-src/transcripts/idempotent/update-type-no-op-record.md +++ b/unison-src/transcripts/idempotent/update-type-no-op-record.md @@ -7,7 +7,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md b/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md index dc9e4bf2f8..8e29e089ba 100644 --- a/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md +++ b/unison-src/transcripts/idempotent/update-type-stray-constructor-alias.md @@ -7,7 +7,6 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> alias.term Foo.Bar Stray.BarAlias Done. @@ -35,7 +35,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-stray-constructor.md b/unison-src/transcripts/idempotent/update-type-stray-constructor.md index 9af0c8065d..8e5aaa91cb 100644 --- a/unison-src/transcripts/idempotent/update-type-stray-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-stray-constructor.md @@ -7,7 +7,6 @@ unique type Foo = Bar Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -25,6 +24,7 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> move.term Foo.Bar Stray.Bar Done. @@ -37,7 +37,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -56,6 +55,7 @@ Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) scratch/main> view Foo type Foo = Stray.Bar Nat + scratch/main> update Sorry, I wasn't able to perform the update: diff --git a/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md b/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md index 0808ba0660..baf5d34cd9 100644 --- a/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md +++ b/unison-src/transcripts/idempotent/update-type-turn-constructor-into-smart-constructor.md @@ -10,7 +10,6 @@ makeFoo n = Bar (n+10) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -40,7 +39,6 @@ Foo.Bar n = internal.Bar n ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -65,9 +63,11 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view Foo type Foo = internal.Bar Nat + scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 diff --git a/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md b/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md index 7c4574a088..ed6fd0aa95 100644 --- a/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md +++ b/unison-src/transcripts/idempotent/update-type-turn-non-record-into-record.md @@ -7,7 +7,6 @@ unique type Foo = Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,7 +31,6 @@ unique type Foo = { bar : Nat } ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -58,9 +56,11 @@ scratch/main> update updated... Done. + scratch/main> view Foo type Foo = { bar : Nat } + scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-term.md b/unison-src/transcripts/idempotent/update-type-with-dependent-term.md index c56e884d6c..c59e3bef59 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-term.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-term.md @@ -10,7 +10,6 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -37,7 +36,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md index c8d569aa01..e1b257cf7c 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-type-to-different-kind.md @@ -8,7 +8,6 @@ unique type Baz = Qux Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ unique type Foo a = Bar Nat a ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/update-type-with-dependent-type.md b/unison-src/transcripts/idempotent/update-type-with-dependent-type.md index 9fe59c9183..dea13297d2 100644 --- a/unison-src/transcripts/idempotent/update-type-with-dependent-type.md +++ b/unison-src/transcripts/idempotent/update-type-with-dependent-type.md @@ -8,7 +8,6 @@ unique type Baz = Qux Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -35,7 +34,6 @@ unique type Foo = Bar Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -59,12 +57,15 @@ scratch/main> update Everything typechecks, so I'm saving the results... Done. + scratch/main> view Foo type Foo = Bar Nat Nat + scratch/main> view Baz type Baz = Qux Foo + scratch/main> find.verbose 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 diff --git a/unison-src/transcripts/idempotent/update-watch.md b/unison-src/transcripts/idempotent/update-watch.md index 9024cc741a..6772cf521b 100644 --- a/unison-src/transcripts/idempotent/update-watch.md +++ b/unison-src/transcripts/idempotent/update-watch.md @@ -3,7 +3,6 @@ ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/idempotent/upgrade-happy-path.md b/unison-src/transcripts/idempotent/upgrade-happy-path.md index 7d92085582..dcc674be5a 100644 --- a/unison-src/transcripts/idempotent/upgrade-happy-path.md +++ b/unison-src/transcripts/idempotent/upgrade-happy-path.md @@ -9,7 +9,6 @@ thingy = lib.old.foo + 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -39,12 +38,14 @@ Test tab completion and fzf options of upgrade command. proj/main> debug.tab-complete upgrade ol old + proj/main> debug.fuzzy-options upgrade _ Select a dependency to upgrade: * builtin * new * old + proj/main> debug.fuzzy-options upgrade old _ Select a dependency to upgrade to: @@ -57,10 +58,12 @@ proj/main> debug.fuzzy-options upgrade old _ proj/main> upgrade old new I upgraded old to new, and removed old. + proj/main> ls lib 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) + proj/main> view thingy thingy : Nat diff --git a/unison-src/transcripts/idempotent/upgrade-sad-path.md b/unison-src/transcripts/idempotent/upgrade-sad-path.md index 128079cdb4..2c56bf72d8 100644 --- a/unison-src/transcripts/idempotent/upgrade-sad-path.md +++ b/unison-src/transcripts/idempotent/upgrade-sad-path.md @@ -9,7 +9,6 @@ thingy = lib.old.foo + 10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -67,7 +66,6 @@ thingy = foo + +10 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -87,19 +85,23 @@ proj/upgrade-old-to-new> update updated... Done. + proj/upgrade-old-to-new> upgrade.commit I fast-forward merged proj/upgrade-old-to-new into proj/main. + proj/main> view thingy thingy : Int thingy = use Int + foo + +10 + proj/main> ls lib 1. builtin/ (469 terms, 74 types) 2. new/ (1 term) + proj/main> branches Branch Remote branch diff --git a/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md b/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md index 17272a8510..96bee848b0 100644 --- a/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md +++ b/unison-src/transcripts/idempotent/upgrade-suffixifies-properly.md @@ -13,7 +13,6 @@ bar = a.x.x.x.x + c.y.y.y.y ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you diff --git a/unison-src/transcripts/idempotent/upgrade-with-old-alias.md b/unison-src/transcripts/idempotent/upgrade-with-old-alias.md index d635a912f0..4038b3df88 100644 --- a/unison-src/transcripts/idempotent/upgrade-with-old-alias.md +++ b/unison-src/transcripts/idempotent/upgrade-with-old-alias.md @@ -10,7 +10,6 @@ mything = lib.old.foo + 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -32,15 +31,18 @@ myproject/main> update updated... Done. + myproject/main> upgrade old new I upgraded old to new, and removed old. + myproject/main> view mything mything : Nat mything = use Nat + foo + 100 + myproject/main> view bar bar : Nat diff --git a/unison-src/transcripts/idempotent/view.md b/unison-src/transcripts/idempotent/view.md index b84c8c9427..05ed7f006e 100644 --- a/unison-src/transcripts/idempotent/view.md +++ b/unison-src/transcripts/idempotent/view.md @@ -15,6 +15,7 @@ scratch/main> add ``` ucm -- Should suffix-search and find values in sub-namespaces + scratch/main> view thing a.thing : Text @@ -22,7 +23,9 @@ scratch/main> view thing b.thing : Text b.thing = "b" + -- Should support absolute paths + scratch/main> view .b.thing .b.thing : Text diff --git a/unison-src/transcripts/idempotent/watch-expressions.md b/unison-src/transcripts/idempotent/watch-expressions.md index b1f9869ccf..dffa25f89f 100644 --- a/unison-src/transcripts/idempotent/watch-expressions.md +++ b/unison-src/transcripts/idempotent/watch-expressions.md @@ -9,7 +9,6 @@ test> pass = [Ok "Passed"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -41,7 +40,6 @@ test> pass = [Ok "Passed"] ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -59,6 +57,7 @@ test> pass = [Ok "Passed"] scratch/main> add ⊡ Ignored previously added definitions: pass + scratch/main> test Cached test results (`help testcache` to learn more) @@ -76,7 +75,6 @@ scratch/main> test ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. ✅ diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 02acea340c..8051f25281 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -8,6 +8,7 @@ scratch/main> help merge merge `merge /branch` merges `branch` into the current branch + scratch/main> help merge.commit merge.commit (or commit.merge) @@ -45,6 +46,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -65,6 +67,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar bar : Text @@ -84,6 +87,7 @@ If Alice and Bob also happen to add the same definition, that's not a conflict. ``` ucm :hide scratch/main> builtins.mergeio lib.builtins + scratch/main> branch alice ``` @@ -96,6 +100,7 @@ foo = "alice and bobs foo" ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -119,6 +124,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar bar : Text @@ -149,6 +155,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -161,6 +168,7 @@ foo = "new foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -187,6 +195,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar bar : Text @@ -196,6 +205,7 @@ scratch/alice> view foo bar foo : Text foo = "new foo" + scratch/alice> display bar "old foo - old foo" @@ -230,6 +240,7 @@ baz = "old baz" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -277,6 +288,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar baz bar : Text @@ -289,6 +301,7 @@ scratch/alice> view foo bar baz foo = use Text ++ "foo" ++ " - " ++ bar ++ " - " ++ baz + scratch/alice> display foo "foo - alices bar - bobs baz" @@ -377,6 +390,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar baz bar : Text @@ -391,6 +405,7 @@ scratch/alice> view foo bar baz foo = use Text ++ "old foo" ++ " - " ++ bar + scratch/alice> display foo "old foo - bobs bar - alices baz" @@ -417,6 +432,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -429,6 +445,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -446,6 +463,7 @@ Merge result: scratch/alice> merge /bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo foo : Text @@ -485,6 +503,7 @@ lib.bothDifferent.baz = 19 ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -511,6 +530,7 @@ Merge result: scratch/alice> merge bob I merged scratch/bob into scratch/alice. + scratch/alice> view foo bar baz lib.alice.foo : Nat @@ -548,12 +568,14 @@ scratch/main> branch alice Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/main> branch bob Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. + scratch/alice> merge /bob 😶 @@ -580,6 +602,7 @@ scratch/main> branch alice Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/main> branch bob Done. I've created the bob branch based off of main. @@ -601,6 +624,7 @@ scratch/alice> add ⍟ I've added these definitions: foo : Text + scratch/alice> merge /bob 😶 @@ -627,6 +651,7 @@ scratch/main> branch alice Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/main> branch bob Done. I've created the bob branch based off of main. @@ -648,6 +673,7 @@ scratch/bob> add ⍟ I've added these definitions: foo : Text + scratch/alice> merge /bob I fast-forward merged scratch/bob into scratch/alice. @@ -666,6 +692,7 @@ scratch/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. + scratch/main> merge /topic 😶 @@ -698,6 +725,7 @@ foo = "foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -726,6 +754,7 @@ scratch/bob> add ⍟ I've added these definitions: bar : Text + scratch/alice> merge /bob I couldn't automatically merge scratch/bob into scratch/alice. @@ -776,6 +805,7 @@ foo = "foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -788,6 +818,7 @@ foo = 100 ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -855,6 +886,7 @@ bar = "old bar" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -873,6 +905,7 @@ qux = "alices qux depends on alices foo" ++ foo ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -959,6 +992,7 @@ unique type Foo = MkFoo Nat ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -970,6 +1004,7 @@ unique type Foo = MkFoo Nat Nat ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -1032,6 +1067,7 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1043,6 +1079,7 @@ unique type Foo = Baz Nat Nat | Qux Text ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -1103,6 +1140,7 @@ unique type Foo = Baz Nat | Qux Text ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1180,6 +1218,7 @@ my.cool.thing = 17 ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -1245,6 +1284,7 @@ Foo.Bar = 17 ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1256,6 +1296,7 @@ unique type Foo = Alice Nat ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -1333,6 +1374,7 @@ Foo.Bar.Hello = 17 ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1340,7 +1382,9 @@ Alice deletes this type entirely, and repurposes its constructor names for other ``` ucm :hide scratch/alice> delete.type Foo + scratch/alice> delete.term Foo.Bar.Baz + scratch/alice> delete.term Foo.Bar.Qux ``` @@ -1365,8 +1409,11 @@ Bob, meanwhile, first deletes the term, then sort of deletes the type and re-add ``` ucm :hide scratch/main> branch bob + scratch/bob> delete.term Foo.Bar.Hello + scratch/bob> move.type Foo Foo.Bar + scratch/bob> move.term Foo.Bar.Qux Foo.Bar.Hello ``` @@ -1445,6 +1492,7 @@ alice _ = 18 ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -1523,6 +1571,7 @@ foo = "old foo" ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1535,6 +1584,7 @@ foo = "alices foo" ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -1590,7 +1640,6 @@ foo = "alice and bobs foo" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -1610,14 +1659,17 @@ scratch/merge-bob-into-alice> update updated... Done. + scratch/merge-bob-into-alice> merge.commit I fast-forward merged scratch/merge-bob-into-alice into scratch/alice. + scratch/alice> view foo foo : Text foo = "alice and bobs foo" + scratch/alice> branches Branch Remote branch @@ -1681,6 +1733,7 @@ bar = 100 ``` ucm :hide scratch/main> add + scratch/main> branch alice ``` @@ -1696,6 +1749,7 @@ bar = 300 ``` ucm :hide scratch/alice> update + scratch/main> branch bob ``` @@ -1991,6 +2045,7 @@ scratch/alice> add ⍟ I've added these definitions: type Foo + scratch/alice> alias.term Foo.Bar AliasOutsideFooNamespace Done. @@ -2048,6 +2103,7 @@ lib.foo = 1 ``` ucm :hide scratch/alice> add + scratch/main> branch bob ``` @@ -2096,7 +2152,6 @@ structural type Foo = Bar Nat | Baz Nat Nat ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2114,6 +2169,7 @@ scratch/main> add ⍟ I've added these definitions: structural type Foo + scratch/main> delete.term Foo.Baz Done. @@ -2128,9 +2184,11 @@ scratch/main> branch alice Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/alice> delete.type Foo Done. + scratch/alice> delete.term Foo.Bar Done. @@ -2142,7 +2200,6 @@ alice = 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2171,9 +2228,11 @@ scratch/main> branch bob Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. + scratch/bob> delete.type Foo Done. + scratch/bob> delete.term Foo.Bar Done. @@ -2185,7 +2244,6 @@ bob = 101 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2231,7 +2289,6 @@ bar = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2251,12 +2308,14 @@ scratch/main> add bar : Nat foo : Nat + scratch/main> branch alice Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/alice> delete.term bar Done. @@ -2267,7 +2326,6 @@ foo = 18 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2287,6 +2345,7 @@ scratch/alice> update updated... Done. + scratch/main> branch bob Done. I've created the bob branch based off of main. @@ -2300,7 +2359,6 @@ bob = 101 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2341,7 +2399,6 @@ type Foo = Bar | Baz ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2359,6 +2416,7 @@ scratch/main> add ⍟ I've added these definitions: type Foo + scratch/main> branch topic Done. I've created the topic branch based off of main. @@ -2372,7 +2430,6 @@ boop = "boop" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2397,7 +2454,6 @@ type Foo = Bar ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2423,6 +2479,7 @@ scratch/main> update scratch/main> merge topic I merged scratch/topic into scratch/main. + scratch/main> view Foo type Foo = Bar @@ -2454,7 +2511,6 @@ baz = "lca" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2476,6 +2532,7 @@ scratch/alice> add bar : Nat baz : Text foo : Nat + scratch/alice> branch bob Done. I've created the bob branch based off of alice. @@ -2492,7 +2549,6 @@ baz = "bob" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2525,7 +2581,6 @@ baz = "alice" ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2612,7 +2667,6 @@ a = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2637,7 +2691,6 @@ b = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2662,7 +2715,6 @@ b = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2682,7 +2734,6 @@ a = 1 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2708,7 +2759,6 @@ b = 2 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2722,12 +2772,15 @@ scratch/carol> add a : ##Nat b : ##Nat + scratch/bob> merge /alice I merged scratch/alice into scratch/bob. + scratch/carol> merge /bob I merged scratch/bob into scratch/carol. + scratch/carol> history Note: The most recent namespace hash is immediately below this @@ -2772,7 +2825,6 @@ bar = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2794,6 +2846,7 @@ scratch/alice> add bar : Nat foo : Nat ignore : a -> () + scratch/alice> branch bob Done. I've created the bob branch based off of alice. @@ -2810,7 +2863,6 @@ bar = ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2841,7 +2893,6 @@ foo = 19 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2892,7 +2943,6 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -2912,21 +2962,25 @@ scratch/main> add type Bar type Foo + scratch/main> branch alice Done. I've created the alice branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /alice`. + scratch/alice> move.term Foo.Lca Foo.Alice Done. + scratch/main> branch bob Done. I've created the bob branch based off of main. Tip: To merge your work back into the main branch, first `switch /main` then `merge /bob`. + scratch/bob> move.term Foo.Lca Foo.Bob Done. @@ -2978,7 +3032,6 @@ type Bar = MkBar Foo ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked the definitions in scratch.u. This @@ -2992,11 +3045,13 @@ scratch/merge-bob-into-alice> update updated... Done. + scratch/merge-bob-into-alice> names Bar Type Hash: #h3af39sae7 Names: Bar + scratch/alice> names Bar Type @@ -3023,7 +3078,6 @@ hello = 17 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -3041,6 +3095,7 @@ scratch/main> add ⍟ I've added these definitions: hello : Nat + scratch/main> branch alice Done. I've created the alice branch based off of main. @@ -3055,7 +3110,6 @@ foo = 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you @@ -3079,6 +3133,7 @@ scratch/alice> update updated... Done. + scratch/main> branch bob Done. I've created the bob branch based off of main. @@ -3093,7 +3148,6 @@ bar = 100 ``` ``` ucm :added-by-ucm - Loading changes detected in scratch.u. I found and typechecked these definitions in scratch.u. If you