diff --git a/.github/workflows/ci.md b/.github/workflows/ci.md index 4f0de29bf..e23874d7a 100644 --- a/.github/workflows/ci.md +++ b/.github/workflows/ci.md @@ -9,7 +9,7 @@ At a high level, the CI process is: Some version numbers that are used during CI: - `ormolu_version: "0.5.0.1"` - `racket_version: "8.7"` -- `jit_version: "@unison/internal/releases/0.0.17"` +- `jit_version: "@unison/internal/releases/0.0.18"` Some cached directories: - `ucm_local_bin` a temp path for caching a built `ucm` diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a5e089ce..51f1f720f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ on: env: ormolu_version: 0.5.2.0 ucm_local_bin: ucm-local-bin - jit_version: "@unison/internal/releases/0.0.17" + jit_version: "@unison/internal/releases/0.0.18" jit_src_scheme: unison-jit-src/scheme-libs/racket jit_dist: unison-jit-dist jit_generator_os: ubuntu-20.04 diff --git a/codebase2/codebase-sqlite/package.yaml b/codebase2/codebase-sqlite/package.yaml index bf0bed4ee..3f6006ff0 100644 --- a/codebase2/codebase-sqlite/package.yaml +++ b/codebase2/codebase-sqlite/package.yaml @@ -31,6 +31,7 @@ dependencies: - unison-codebase - unison-codebase-sync - unison-core + - unison-core1 - unison-core-orphans-sqlite - unison-hash - unison-hash-orphans-sqlite @@ -39,7 +40,6 @@ dependencies: - unison-util-base32hex - unison-util-cache - unison-util-file-embed - - unison-util-nametree - unison-util-serialization - unison-util-term - unliftio diff --git a/codebase2/codebase-sqlite/unison-codebase-sqlite.cabal b/codebase2/codebase-sqlite/unison-codebase-sqlite.cabal index b91e2a51a..886a47a51 100644 --- a/codebase2/codebase-sqlite/unison-codebase-sqlite.cabal +++ b/codebase2/codebase-sqlite/unison-codebase-sqlite.cabal @@ -126,6 +126,7 @@ library , unison-codebase-sync , unison-core , unison-core-orphans-sqlite + , unison-core1 , unison-hash , unison-hash-orphans-sqlite , unison-prelude @@ -133,7 +134,6 @@ library , unison-util-base32hex , unison-util-cache , unison-util-file-embed - , unison-util-nametree , unison-util-serialization , unison-util-term , unliftio diff --git a/contrib/cabal.project b/contrib/cabal.project index abab30e92..246669424 100644 --- a/contrib/cabal.project +++ b/contrib/cabal.project @@ -24,7 +24,6 @@ packages: lib/unison-util-relation lib/unison-util-rope lib/unison-util-file-embed - lib/unison-util-nametree parser-typechecker unison-core diff --git a/lib/unison-prelude/src/Unison/Debug.hs b/lib/unison-prelude/src/Unison/Debug.hs index 47fdb2ee7..7881045c6 100644 --- a/lib/unison-prelude/src/Unison/Debug.hs +++ b/lib/unison-prelude/src/Unison/Debug.hs @@ -13,13 +13,12 @@ module Unison.Debug ) where -import Control.Applicative (empty) -import Control.Monad (when) -import Data.Set (Set) import Data.Set qualified as Set import Data.Text qualified as Text -import Debug.Pretty.Simple (pTrace, pTraceM, pTraceShowId, pTraceShowM) +import Debug.Pretty.Simple (pTrace, pTraceM) import System.IO.Unsafe (unsafePerformIO) +import Text.Pretty.Simple (pShow) +import Unison.Prelude import UnliftIO.Environment (lookupEnv) data DebugFlag @@ -148,7 +147,7 @@ debugPatternCoverageConstraintSolver = PatternCoverageConstraintSolver `Set.memb debug :: (Show a) => DebugFlag -> String -> a -> a debug flag msg a = if shouldDebug flag - then pTraceShowId (pTrace (msg <> ":\n") a) + then (pTrace (msg <> ":\n" <> into @String (pShow a)) a) else a -- | Use for selective debug logging in monadic contexts. @@ -159,8 +158,7 @@ debug flag msg a = debugM :: (Show a, Monad m) => DebugFlag -> String -> a -> m () debugM flag msg a = whenDebug flag do - pTraceM (msg <> ":\n") - pTraceShowM a + traceM (msg <> ":\n" <> into @String (pShow a)) debugLog :: DebugFlag -> String -> a -> a debugLog flag msg = diff --git a/lib/unison-pretty-printer/src/Unison/Util/Pretty.hs b/lib/unison-pretty-printer/src/Unison/Util/Pretty.hs index c19c03014..6f04fc197 100644 --- a/lib/unison-pretty-printer/src/Unison/Util/Pretty.hs +++ b/lib/unison-pretty-printer/src/Unison/Util/Pretty.hs @@ -78,7 +78,7 @@ module Unison.Util.Pretty lineSkip, nonEmpty, numbered, - numberedColumn2, + numberedColumn2ListFrom, numberedColumn2Header, numberedColumnNHeader, numberedList, @@ -544,12 +544,12 @@ numberedHeader num ps = column2 (fmap num (Nothing : fmap Just [1 ..]) `zip` toL -- 1. one thing : this is a thing -- 2. another thing : this is another thing -- 3. and another : yet one more thing -numberedColumn2 :: - (Foldable f, LL.ListLike s Char, IsString s) => - (Int -> Pretty s) -> - f (Pretty s, Pretty s) -> - Pretty s -numberedColumn2 num ps = numbered num (align $ toList ps) +numberedColumn2ListFrom :: + (Foldable f) => + Int -> + f (Pretty ColorText, Pretty ColorText) -> + Pretty ColorText +numberedColumn2ListFrom num ps = numberedListFrom num (align $ toList ps) numberedColumn2Header :: (Foldable f, LL.ListLike s Char, IsString s) => diff --git a/lib/unison-util-nametree/package.yaml b/lib/unison-util-nametree/package.yaml deleted file mode 100644 index fdac7c576..000000000 --- a/lib/unison-util-nametree/package.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: unison-util-nametree -github: unisonweb/unison -copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors - -ghc-options: -Wall - -dependencies: - - base - - containers - - lens - - semialign - - semigroups - - these - - unison-core - - unison-core1 - - unison-prelude - - unison-util-relation - -library: - source-dirs: src - when: - - condition: false - other-modules: Paths_unison_util_nametree - -default-extensions: - - BangPatterns - - BlockArguments - - DeriveAnyClass - - DeriveFoldable - - DeriveFunctor - - DeriveGeneric - - DeriveTraversable - - DerivingStrategies - - DerivingVia - - DoAndIfThenElse - - DuplicateRecordFields - - FlexibleContexts - - FlexibleInstances - - GADTs - - GeneralizedNewtypeDeriving - - ImportQualifiedPost - - InstanceSigs - - LambdaCase - - MultiParamTypeClasses - - MultiWayIf - - NamedFieldPuns - - NumericUnderscores - - OverloadedLabels - - OverloadedRecordDot - - OverloadedStrings - - PatternSynonyms - - RankNTypes - - ScopedTypeVariables - - TupleSections - - TypeApplications - - ViewPatterns diff --git a/lib/unison-util-nametree/unison-util-nametree.cabal b/lib/unison-util-nametree/unison-util-nametree.cabal deleted file mode 100644 index 80d3157ee..000000000 --- a/lib/unison-util-nametree/unison-util-nametree.cabal +++ /dev/null @@ -1,68 +0,0 @@ -cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.36.0. --- --- see: https://github.com/sol/hpack - -name: unison-util-nametree -version: 0.0.0 -homepage: https://github.com/unisonweb/unison#readme -bug-reports: https://github.com/unisonweb/unison/issues -copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors -build-type: Simple - -source-repository head - type: git - location: https://github.com/unisonweb/unison - -library - exposed-modules: - Unison.Util.Defns - Unison.Util.Nametree - hs-source-dirs: - src - default-extensions: - BangPatterns - BlockArguments - DeriveAnyClass - DeriveFoldable - DeriveFunctor - DeriveGeneric - DeriveTraversable - DerivingStrategies - DerivingVia - DoAndIfThenElse - DuplicateRecordFields - FlexibleContexts - FlexibleInstances - GADTs - GeneralizedNewtypeDeriving - ImportQualifiedPost - InstanceSigs - LambdaCase - MultiParamTypeClasses - MultiWayIf - NamedFieldPuns - NumericUnderscores - OverloadedLabels - OverloadedRecordDot - OverloadedStrings - PatternSynonyms - RankNTypes - ScopedTypeVariables - TupleSections - TypeApplications - ViewPatterns - ghc-options: -Wall - build-depends: - base - , containers - , lens - , semialign - , semigroups - , these - , unison-core - , unison-core1 - , unison-prelude - , unison-util-relation - default-language: Haskell2010 diff --git a/parser-typechecker/package.yaml b/parser-typechecker/package.yaml index 8bb50c518..c9de6f37d 100644 --- a/parser-typechecker/package.yaml +++ b/parser-typechecker/package.yaml @@ -127,7 +127,6 @@ dependencies: - unison-util-base32hex - unison-util-bytes - unison-util-cache - - unison-util-nametree - unison-util-relation - unison-util-rope - unison-util-serialization diff --git a/parser-typechecker/src/Unison/Codebase/Path.hs b/parser-typechecker/src/Unison/Codebase/Path.hs index 3c20dcd85..e97a93ce8 100644 --- a/parser-typechecker/src/Unison/Codebase/Path.hs +++ b/parser-typechecker/src/Unison/Codebase/Path.hs @@ -56,15 +56,13 @@ module Unison.Codebase.Path toList, toName, toName', - unsafeToName, - unsafeToName', toText, toText', unsplit, unsplit', unsplitAbsolute, - unsplitHQ, - unsplitHQ', + nameFromHQSplit, + nameFromHQSplit', nameFromSplit', splitFromName, splitFromName', @@ -171,11 +169,11 @@ unsplitAbsolute :: (Absolute, NameSegment) -> Absolute unsplitAbsolute = coerce unsplit -unsplitHQ :: HQSplit -> HQ'.HashQualified Path -unsplitHQ (p, a) = fmap (snoc p) a +nameFromHQSplit :: HQSplit -> HQ'.HashQualified Name +nameFromHQSplit = nameFromHQSplit' . first (RelativePath' . Relative) -unsplitHQ' :: HQSplit' -> HQ'.HashQualified Path' -unsplitHQ' (p, a) = fmap (snoc' p) a +nameFromHQSplit' :: HQSplit' -> HQ'.HashQualified Name +nameFromHQSplit' (p, a) = fmap (nameFromSplit' . (p,)) a type Split = (Path, NameSegment) @@ -316,9 +314,6 @@ cons = Lens.cons snoc :: Path -> NameSegment -> Path snoc = Lens.snoc -snoc' :: Path' -> NameSegment -> Path' -snoc' = Lens.snoc - unsnoc :: Path -> Maybe (Path, NameSegment) unsnoc = Lens.unsnoc @@ -344,15 +339,6 @@ fromName' n where path = fromName n -unsafeToName :: Path -> Name -unsafeToName = - fromMaybe (error "empty path") . toName - --- | Convert a Path' to a Name -unsafeToName' :: Path' -> Name -unsafeToName' = - fromMaybe (error "empty path") . toName' - toName :: Path -> Maybe Name toName = \case Path Seq.Empty -> Nothing diff --git a/parser-typechecker/unison-parser-typechecker.cabal b/parser-typechecker/unison-parser-typechecker.cabal index 7a9a46709..61b4ad037 100644 --- a/parser-typechecker/unison-parser-typechecker.cabal +++ b/parser-typechecker/unison-parser-typechecker.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack @@ -330,7 +330,6 @@ library , unison-util-base32hex , unison-util-bytes , unison-util-cache - , unison-util-nametree , unison-util-relation , unison-util-rope , unison-util-serialization @@ -532,7 +531,6 @@ test-suite parser-typechecker-tests , unison-util-base32hex , unison-util-bytes , unison-util-cache - , unison-util-nametree , unison-util-relation , unison-util-rope , unison-util-serialization diff --git a/scheme-libs/racket/unison/arithmetic.rkt b/scheme-libs/racket/unison/arithmetic.rkt index d9a63d9eb..a50364eb5 100644 --- a/scheme-libs/racket/unison/arithmetic.rkt +++ b/scheme-libs/racket/unison/arithmetic.rkt @@ -1,70 +1,103 @@ #!racket/base (provide - (prefix-out - builtin- - (combine-out - Nat.toFloat - Nat.increment - Nat.+ - Nat.drop - Float.* - Float.fromRepresentation - Float.toRepresentation - Float.ceiling - Int.+ - Int.- - Int./ - Int.increment - Int.negate - Int.fromRepresentation - Int.toRepresentation - Int.signum - ))) + builtin-Nat.+ + builtin-Nat.+:termlink + builtin-Nat.toFloat + builtin-Nat.toFloat:termlink + builtin-Nat.increment + builtin-Nat.increment:termlink + builtin-Nat.drop + builtin-Nat.drop:termlink + builtin-Float.* + builtin-Float.*:termlink + builtin-Float.fromRepresentation + builtin-Float.fromRepresentation:termlink + builtin-Float.toRepresentation + builtin-Float.toRepresentation:termlink + builtin-Float.ceiling + builtin-Float.ceiling:termlink + builtin-Int.+ + builtin-Int.+:termlink + builtin-Int.- + builtin-Int.-:termlink + builtin-Int./ + builtin-Int./:termlink + builtin-Int.increment + builtin-Int.increment:termlink + builtin-Int.negate + builtin-Int.negate:termlink + builtin-Int.fromRepresentation + builtin-Int.fromRepresentation:termlink + builtin-Int.toRepresentation + builtin-Int.toRepresentation:termlink + builtin-Int.signum + builtin-Int.signum:termlink) (require racket racket/fixnum racket/flonum racket/performance-hint + unison/data unison/boot) (begin-encourage-inline - (define-unison (Nat.+ m n) (clamp-natural (+ m n))) - (define-unison (Nat.drop m n) (max 0 (- m n))) + (define-unison-builtin + (builtin-Nat.+ m n) + (clamp-natural (+ m n))) - (define-unison (Nat.increment n) (clamp-natural (add1 n))) - (define-unison (Int.increment i) (clamp-integer (add1 i))) - (define-unison (Int.negate i) (if (> i nbit63) (- i) i)) - (define-unison (Int.+ i j) (clamp-integer (+ i j))) - (define-unison (Int.- i j) (clamp-integer (- i j))) - (define-unison (Int./ i j) (floor (/ i j))) - (define-unison (Int.signum i) (sgn i)) - (define-unison (Float.* x y) (fl* x y)) + (define-unison-builtin + (builtin-Nat.drop m n) + (max 0 (- m n))) - (define-unison (Nat.toFloat n) (->fl n)) + (define-unison-builtin + (builtin-Nat.increment n) + (clamp-natural (add1 n))) + (define-unison-builtin + (builtin-Int.increment i) (clamp-integer (add1 i))) + (define-unison-builtin + (builtin-Int.negate i) (if (> i nbit63) (- i) i)) + (define-unison-builtin + (builtin-Int.+ i j) (clamp-integer (+ i j))) + (define-unison-builtin + (builtin-Int.- i j) (clamp-integer (- i j))) + (define-unison-builtin + (builtin-Int./ i j) (floor (/ i j))) + (define-unison-builtin + (builtin-Int.signum i) (sgn i)) + (define-unison-builtin + (builtin-Float.* x y) (fl* x y)) - (define-unison (Float.ceiling f) + (define-unison-builtin + (builtin-Nat.toFloat n) (->fl n)) + + (define-unison-builtin + (builtin-Float.ceiling f) (clamp-integer (fl->exact-integer (ceiling f)))) ; If someone can suggest a better mechanism for these, ; that would be appreciated. - (define-unison (Float.toRepresentation fl) + (define-unison-builtin + (builtin-Float.toRepresentation fl) (integer-bytes->integer (real->floating-point-bytes fl 8 #t) ; big endian #f ; unsigned #t)) ; big endian - (define-unison (Float.fromRepresentation n) + (define-unison-builtin + (builtin-Float.fromRepresentation n) (floating-point-bytes->real (integer->integer-bytes n 8 #f #t) ; unsigned, big endian #t)) ; big endian - (define-unison (Int.toRepresentation i) + (define-unison-builtin + (builtin-Int.toRepresentation i) (integer-bytes->integer (integer->integer-bytes i 8 #t #t) ; signed, big endian #f #t)) ; unsigned, big endian - (define-unison (Int.fromRepresentation n) + (define-unison-builtin + (builtin-Int.fromRepresentation n) (integer-bytes->integer (integer->integer-bytes n 8 #f #t) ; unsigned, big endian #t #t)) ; signed, big endian diff --git a/scheme-libs/racket/unison/boot.ss b/scheme-libs/racket/unison/boot.ss index 67d390f9c..ed8b0f7d3 100644 --- a/scheme-libs/racket/unison/boot.ss +++ b/scheme-libs/racket/unison/boot.ss @@ -55,6 +55,7 @@ bytes control define-unison + define-unison-builtin handle name data @@ -116,14 +117,16 @@ (require (for-syntax racket/set - (only-in racket partition flatten)) + (only-in racket partition flatten split-at) + (only-in racket/string string-prefix?) + (only-in racket/syntax format-id)) (rename-in (except-in racket false true unit any) [make-continuation-prompt-tag make-prompt]) ; (for (only (compatibility mlist) mlist->list list->mlist) expand) ; (for (only (racket base) quasisyntax/loc) expand) ; (for-syntax (only-in unison/core syntax->list)) - (only-in racket/control prompt0-at control0-at) + (only-in racket/control control0-at) racket/performance-hint unison/core unison/data @@ -151,115 +154,301 @@ (syntax-rules () [(with-name name e) (let ([name e]) name)])) -; function definition with slow/fast path. Slow path allows for -; under/overapplication. Fast path is exact application. +; Our definition macro needs to generate multiple entry points for the +; defined procedures, so this is a function for making up names for +; those based on the original. +(define-for-syntax (adjust-symbol name post) + (string->symbol + (string-append + (symbol->string name) + ":" + post))) + +(define-for-syntax (adjust-name name post) + (datum->syntax name (adjust-symbol (syntax->datum name) post) name)) + +; Helper function. Turns a list of syntax objects into a +; list-syntax object. +(define-for-syntax (list->syntax l) #`(#,@l)) + +; These are auxiliary functions for manipulating a unison definition +; into a form amenable for the right runtime behavior. This involves +; multiple separate definitions: ; -; The intent is for the scheme compiler to be able to recognize and -; optimize static, fast path calls itself, while still supporting -; unison-like automatic partial application and such. -(define-syntax (define-unison x) - (define (fast-path-symbol name) - (string->symbol - (string-append - (symbol->string name) - ":fast-path"))) +; 1. an :impl definition is generated containing the actual code body +; 2. a :fast definition, which takes exactly the number of arguments +; as the original, but checks if stack information needs to be +; stored for continuation serialization. +; 3. a :slow path which implements under/over application to unison +; definitions, so they act like curried functions, not scheme +; procedures +; 4. a macro that implements the actual occurrences, and directly +; calls the fast path for static calls with exactly the right +; number of arguments +; +; Additionally, arguments are threaded through the internal +; definitions that indicate whether an ability handler is in place +; that could potentially result in the continuation being serialized. +; If so, then calls write additional information to the continuation +; for that serialization. This isn't cheap for tight loops, so we +; attempt to avoid this as much as possible (conditioning the +; annotation on a flag checkseems to cause no performance loss). - (define (fast-path-name name) - (datum->syntax name (fast-path-symbol (syntax->datum name)))) - ; Helper function. Turns a list of syntax objects into a - ; list-syntax object. - (define (list->syntax l) #`(#,@l)) - ; Builds partial application cases for unison functions. - ; It seems most efficient to have a case for each posible - ; under-application. - (define (build-partials name formals) - (let rec ([us formals] [acc '()]) - (syntax-case us () - [() (list->syntax (cons #`[() #,name] acc))] - [(a ... z) - (rec #'(a ...) - (cons - #`[(a ... z) - (with-name - #,(datum->syntax name (syntax->datum name)) - (partial-app #,name a ... z))] - acc))]))) +; This builds the core definition for a unison definition. It is just +; a lambda expression with the original code, but with an additional +; keyword argument for threading purity information. +(define-for-syntax (make-impl name:impl:stx arg:stx body:stx) + (with-syntax ([name:impl name:impl:stx] + [args arg:stx] + [body body:stx]) + (syntax/loc body:stx + (define (name:impl #:pure pure? . args) . body)))) - ; Given an overall function name, a fast path name, and a list of - ; arguments, builds the case-lambda body of a unison function that - ; enables applying to arbitrary numbers of arguments. - (define (func-cases name name:fast args) - (syntax-case args () - [() (quasisyntax/loc x - (case-lambda - [() (#,name:fast)] - [r (apply (#,name:fast) r)]))] - [(a ... z) - (quasisyntax/loc x - (case-lambda - #,@(build-partials name #'(a ...)) - [(a ... z) (#,name:fast a ... z)] - [(a ... z . r) (apply (#,name:fast a ... z) r)]))])) +(define frame-contents (gensym)) - (syntax-case x () - [(define-unison (name a ...) e ...) - (let ([fname (fast-path-name #'name)]) - (with-syntax ([name:fast fname] - [fast (syntax/loc x (lambda (a ...) e ...))] - [slow (func-cases #'name fname #'(a ...))]) - (syntax/loc x - (define-values (name:fast name) (values fast slow)))))])) +; Builds the wrapper definition, 'fast path,' which just tests the +; purity, writes the stack information if necessary, and calls the +; implementation. If #:force-pure is specified, the fast path just +; directly calls the implementation procedure. This should allow +; tight loops to still perform well if we can detect that they +; (hereditarily) cannot make ability requests, even in contexts +; where a handler is present. +(define-for-syntax + (make-fast-path + #:force-pure force-pure? + loc ; original location + name:fast:stx name:impl:stx + arg:stx) + + (with-syntax ([name:impl name:impl:stx] + [name:fast name:fast:stx] + [args arg:stx]) + (if force-pure? + (syntax/loc loc + (define name:fast name:impl)) + + (syntax/loc loc + (define (name:fast #:pure pure? . args) + (if pure? + (name:impl #:pure pure? . args) + (with-continuation-mark + frame-contents + (vector . args) + (name:impl #:pure pure? . args)))))))) + +; Slow path -- unnecessary +; (define-for-syntax (make-slow-path loc name argstx) +; (with-syntax ([name:slow (adjust-symbol name "slow")] +; [n (length (syntax->list argstx))]) +; (syntax/loc loc +; (define (name:slow #:pure pure? . as) +; (define k (length as)) +; (cond +; [(< k n) (unison-closure n name:slow as)] +; [(= k n) (apply name:fast #:pure pure? as)] +; [(> k n) +; (define-values (h t) (split-at as n)) +; (apply +; (apply name:fast #:pure pure? h) +; #:pure pure? +; t)]))))) + +; This definition builds a macro that defines the behavior of actual +; occurences of the definition names. It has the following behavior: +; +; 1. Exactly saturated occurences directly call the fast path +; 2. Undersaturated or unapplied occurrences become closure +; construction +; 3. Oversaturated occurrences become an appropriate nested +; application +; +; Because of point 2, all function values end up represented as +; unison-closure objects, so a slow path procedure is no longer +; necessary; it is handled by the prop:procedure of the closure +; structure. This should also make various universal operations easier +; to handle, because we can just test for unison-closures, instead of +; having to deal with raw procedures. +(define-for-syntax + (make-callsite-macro + #:internal internal? + loc ; original location + name:stx name:fast:stx + arity:val) + (with-syntax ([name name:stx] + [name:fast name:fast:stx] + [arity arity:val]) + (cond + [internal? + (syntax/loc loc + (define-syntax (name stx) + (syntax-case stx () + [(_ #:by-name _ . bs) + (syntax/loc stx + (unison-closure arity name:fast (list . bs)))] + [(_ . bs) + (let ([k (length (syntax->list #'bs))]) + (cond + [(= arity k) ; saturated + (syntax/loc stx + (name:fast #:pure #t . bs))] + [(> arity k) ; undersaturated + (syntax/loc stx + (unison-closure arity name:fast (list . bs)))] + [(< arity k) ; oversaturated + (define-values (h t) + (split-at (syntax->list #'bs) arity)) + + (quasisyntax/loc stx + ((name:fast #:pure #t #,@h) #,@t))]))] + [_ (syntax/loc stx + (unison-closure arity name:fast (list)))])))] + [else + (syntax/loc loc + (define-syntax (name stx) + (syntax-case stx () + [(_ #:by-name _ . bs) + (syntax/loc stx + (unison-closure arity name:fast (list . bs)))] + [(_ . bs) + (let ([k (length (syntax->list #'bs))]) + + ; todo: purity + + ; capture local pure? + (with-syntax ([pure? (format-id stx "pure?")]) + (cond + [(= arity k) ; saturated + (syntax/loc stx + (name:fast #:pure pure? . bs))] + [(> arity k) + (syntax/loc stx + (unison-closure n name:fast (list . bs)))] + [(< arity k) ; oversaturated + (define-values (h t) + (split-at (syntax->list #'bs) arity)) + + ; TODO: pending argument frame + (quasisyntax/loc stx + ((name:fast #:pure pure? #,@h) + #:pure pure? + #,@t))])))] + ; non-applied occurrence; partial ap immediately + [_ (syntax/loc stx + (unison-closure arity name:fast (list)))])))]))) + +(define-for-syntax + (link-decl no-link-decl? loc name:stx name:fast:stx name:impl:stx) + (if no-link-decl? + #'() + (let ([name:link:stx (adjust-name name:stx "termlink")]) + (with-syntax + ([name:fast name:fast:stx] + [name:impl name:impl:stx] + [name:link name:link:stx]) + (syntax/loc loc + ((declare-function-link name:fast name:link) + (declare-function-link name:impl name:link))))))) + +(define-for-syntax (process-hints hs) + (for/fold ([internal? #f] + [force-pure? #t] + [gen-link? #f] + [no-link-decl? #f]) + ([h hs]) + (values + (or internal? (eq? h 'internal)) + (or force-pure? (eq? h 'force-pure) (eq? h 'internal)) + (or gen-link? (eq? h 'gen-link)) + (or no-link-decl? (eq? h 'no-link-decl))))) + +(define-for-syntax + (make-link-def gen-link? loc name:stx name:link:stx) + + (define (chop s) + (if (string-prefix? s "builtin-") + (substring s 8) + s)) + + (define name:txt + (chop + (symbol->string + (syntax->datum name:stx)))) + + (cond + [gen-link? + (with-syntax ([name:link name:link:stx]) + (quasisyntax/loc loc + ((define name:link + (unison-termlink-builtin #,name:txt)))))] + [else #'()])) + +(define-for-syntax + (expand-define-unison + #:hints hints + loc name:stx arg:stx expr:stx) + + (define-values + (internal? force-pure? gen-link? no-link-decl?) + (process-hints hints)) + + (let ([name:fast:stx (adjust-name name:stx "fast")] + [name:impl:stx (adjust-name name:stx "impl")] + [name:link:stx (adjust-name name:stx "termlink")] + [arity (length (syntax->list arg:stx))]) + (with-syntax + ([(link ...) (make-link-def gen-link? loc name:stx name:link:stx)] + [fast (make-fast-path + #:force-pure force-pure? + loc name:fast:stx name:impl:stx arg:stx)] + [impl (make-impl name:impl:stx arg:stx expr:stx)] + [call (make-callsite-macro + #:internal internal? + loc name:stx name:fast:stx arity)] + [(decls ...) + (link-decl no-link-decl? loc name:stx name:fast:stx name:impl:stx)]) + (syntax/loc loc + (begin link ... impl fast call decls ...))))) + +; Function definition supporting various unison features, like +; partial application and continuation serialization. See above for +; details. +; +; `#:internal #t` indicates that the definition is for builtin +; functions. These should always be built in a way that does not +; annotate the stack, because they don't make relevant ability +; requests. This is important for performance and some correct +; behavior (i.e. they may occur in non-unison contexts where a +; `pure?` indicator is not being threaded). +(define-syntax (define-unison stx) + (syntax-case stx () + [(define-unison #:hints hs (name . args) . exprs) + (expand-define-unison + #:hints (syntax->datum #'hs) + stx #'name #'args #'exprs)] + [(define-unison (name . args) . exprs) + (expand-define-unison + #:hints '[internal] + stx #'name #'args #'exprs)])) + +(define-syntax (define-unison-builtin stx) + (syntax-case stx () + [(define-unison-builtin . rest) + (syntax/loc stx + (define-unison #:hints [internal gen-link] . rest))])) ; call-by-name bindings -(define-syntax name - (lambda (stx) - (syntax-case stx () - ((name ([v (f . args)] ...) body ...) - (with-syntax ([(lam ...) - (map (lambda (body) - (quasisyntax/loc stx - (lambda r #,body))) - (syntax->list #'[(apply f (append (list . args) r)) ...]))]) - #`(let ([v lam] ...) - body ...)))))) +(define-syntax (name stx) + (syntax-case stx () + [(name ([v (f . args)] ...) body ...) + (syntax/loc stx + (let ([v (f #:by-name #t . args)] ...) body ...))])) ; Wrapper that more closely matches `handle` constructs -; -; Note: this uses the prompt _twice_ to achieve the sort of dynamic -; scoping we want. First we push an outer delimiter, then install -; the continuation marks corresponding to the handled abilities -; (which tells which propt to use for that ability and which -; functions to use for each request). Then we re-delimit by the same -; prompt. -; -; If we just used one delimiter, we'd have a problem. If we pushed -; the marks _after_ the delimiter, then the continuation captured -; when handling would contain those marks, and would effectively -; retain the handler for requests within the continuation. If the -; marks were outside the prompt, we'd be in a similar situation, -; except where the handler would be automatically handling requests -; within its own implementation (although, in both these cases we'd -; get control errors, because we would be using the _function_ part -; of the handler without the necessary delimiters existing on the -; continuation). Both of these situations are wrong for _shallow_ -; handlers. -; -; Instead, what we need to be able to do is capture the continuation -; _up to_ the marks, then _discard_ the marks, and this is what the -; multiple delimiters accomplish. There might be more efficient ways -; to accomplish this with some specialized mark functions, but I'm -; uncertain of what pitfalls there are with regard to that (whehter -; they work might depend on exact frame structure of the -; metacontinuation). (define-syntax handle (syntax-rules () [(handle [r ...] h e ...) - (let ([p (make-prompt)]) - (prompt0-at p - (let ([v (let-marks (list r ...) (cons p h) - (prompt0-at p e ...))]) - (h (make-pure v)))))])) + (call-with-handler (list r ...) h (lambda () e ...))])) ; wrapper that more closely matches ability requests (define-syntax request diff --git a/scheme-libs/racket/unison/concurrent.ss b/scheme-libs/racket/unison/concurrent.ss index 2049e23b3..a929ad77c 100644 --- a/scheme-libs/racket/unison/concurrent.ss +++ b/scheme-libs/racket/unison/concurrent.ss @@ -66,17 +66,17 @@ [cas! (lambda () (unsafe-struct*-cas! promise 2 value (some new-value)))] [awake-readers (lambda () (semaphore-post (promise-semaphore promise)))]) (cond - [(some? value) false] + [(some? value) sum-false] [else - (let ([ok (parameterize-break #f (if (cas!) (awake-readers) false))]) - (if ok true (loop)))])))) + (let ([ok (parameterize-break #f (if (cas!) (awake-readers) sum-false))]) + (if ok sum-true (loop)))])))) (define (ref-cas ref ticket value) - (if (box-cas! ref ticket value) true false)) + (if (box-cas! ref ticket value) sum-true sum-false)) (define (sleep n) (sleep-secs (/ n 1000000)) - (right unit)) + (right sum-unit)) ;; Swallows uncaught breaks/thread kills rather than logging them to ;; match the behaviour of the Haskell runtime @@ -88,5 +88,5 @@ (define (kill threadId) (break-thread threadId) - (right unit)) + (right sum-unit)) ) diff --git a/scheme-libs/racket/unison/core.ss b/scheme-libs/racket/unison/core.ss index a27393815..0985c2046 100644 --- a/scheme-libs/racket/unison/core.ss +++ b/scheme-libs/racket/unison/core.ss @@ -23,6 +23,7 @@ (struct-out exn:bug) let-marks + call-with-marks ref-mark chunked-string-foldMap-chunks @@ -192,7 +193,9 @@ (string-append "{Value " (describe-value v) "}")] [(unison-code v) (string-append "{Code " (describe-value v) "}")] - [(unison-closure code env) + [(unison-cont-reflected fs) "{Continuation}"] + [(unison-cont-wrapped _) "{Continuation}"] + [(unison-closure _ code env) (define dc (termlink->string (lookup-function-link code) #t)) (define (f v) @@ -437,13 +440,6 @@ ; [() '()] ; [(x . xs) (cons #'x (syntax->list #'xs))])) -(define (call-with-marks rs v f) - (cond - [(null? rs) (f)] - [else - (with-continuation-mark (car rs) v - (call-with-marks (cdr rs) v f))])) - (define-syntax let-marks (syntax-rules () [(let-marks ks bn e ...) diff --git a/scheme-libs/racket/unison/data.ss b/scheme-libs/racket/unison/data.ss index 7ab75d6d5..a110be41f 100644 --- a/scheme-libs/racket/unison/data.ss +++ b/scheme-libs/racket/unison/data.ss @@ -12,6 +12,12 @@ have-code? (struct-out unison-data) + (struct-out unison-continuation) + (struct-out unison-cont-wrapped) + (struct-out unison-cont-reflected) + (struct-out unison-frame) + (struct-out unison-frame-push) + (struct-out unison-frame-mark) (struct-out unison-sum) (struct-out unison-pure) (struct-out unison-request) @@ -27,6 +33,9 @@ (struct-out unison-quote) (struct-out unison-timespec) + call-with-handler + call-with-marks + define-builtin-link declare-builtin-link @@ -45,9 +54,9 @@ left? either-get either-get - unit - false - true + sum-unit + sum-false + sum-true bool char ord @@ -100,12 +109,15 @@ builtin-tls.version:typelink unison-tuple->list + unison-pair->cons typelink->string termlink->string) (require - racket + (rename-in racket + [make-continuation-prompt-tag make-prompt]) + (only-in racket/control prompt0-at control0-at) racket/fixnum (only-in "vector-trie.rkt" ->fx/wraparound) unison/bytevector) @@ -290,13 +302,10 @@ (write-string ")" port)) (struct unison-closure - (code env) + (arity code env) #:transparent #:methods gen:custom-write [(define (write-proc clo port mode) - (define code-tl - (lookup-function-link (unison-closure-code clo))) - (define rec (case mode [(#t) write] @@ -308,12 +317,31 @@ (write-string " " port) (write-sequence (unison-closure-env clo) port mode) (write-string ")" port))] + + ; This has essentially becomes the slow path for unison function + ; application. The definition macro immediately creates a closure + ; for any statically under-saturated call or unapplied occurrence. + ; This means that there is never a bare unison function being passed + ; as a value. So, we can define the slow path here once and for all. #:property prop:procedure - (case-lambda - [(clo) clo] - [(clo . rest) - (apply (unison-closure-code clo) - (append (unison-closure-env clo) rest))])) + (lambda (clo #:pure [pure? #f] #:by-name [by-name? #f] . rest) + (define arity (unison-closure-arity clo)) + (define old-env (unison-closure-env clo)) + (define code (unison-closure-code clo)) + + (define new-env (append old-env rest)) + (define k (length rest)) + (define l (length new-env)) + (cond + [(or by-name? (> arity l)) + (struct-copy unison-closure clo [env new-env])] + [(= arity l) ; saturated + (apply code #:pure pure? new-env)] + [(= k 0) clo] ; special case, 0-applying undersaturated + [(< arity l) + ; TODO: pending arg annotation if no pure? + (define-values (now pending) (split-at new-env arity)) + (apply (apply code #:pure pure? now) #:pure pure? pending)]))) (struct unison-timespec (sec nsec) #:transparent @@ -335,6 +363,115 @@ (list equal-proc (hash-proc 3) (hash-proc 5)))) +; This is the base struct for continuation representations. It has +; two possibilities seen below. +(struct unison-continuation () #:transparent) + +; This is a wrapper that allows for a struct representation of all +; continuations involved in unison. I.E. instead of just passing +; around a raw racket continuation, we wrap it in a box for easier +; identification. +(struct unison-cont-wrapped unison-continuation (cont) + ; Use the wrapped continuation for procedure calls. Continuations + ; will always be called via the jumpCont wrapper which exactly + ; applies them to one argument. + #:property prop:procedure 0) + +; Basic mechanism for installing handlers, defined here so that it +; can be used in the implementation of reflected continuations. +; +; Note: this uses the prompt _twice_ to achieve the sort of dynamic +; scoping we want. First we push an outer delimiter, then install +; the continuation marks corresponding to the handled abilities +; (which tells which propt to use for that ability and which +; functions to use for each request). Then we re-delimit by the same +; prompt. +; +; If we just used one delimiter, we'd have a problem. If we pushed +; the marks _after_ the delimiter, then the continuation captured +; when handling would contain those marks, and would effectively +; retain the handler for requests within the continuation. If the +; marks were outside the prompt, we'd be in a similar situation, +; except where the handler would be automatically handling requests +; within its own implementation (although, in both these cases we'd +; get control errors, because we would be using the _function_ part +; of the handler without the necessary delimiters existing on the +; continuation). Both of these situations are wrong for _shallow_ +; handlers. +; +; Instead, what we need to be able to do is capture the continuation +; _up to_ the marks, then _discard_ the marks, and this is what the +; multiple delimiters accomplish. There might be more efficient ways +; to accomplish this with some specialized mark functions, but I'm +; uncertain of what pitfalls there are with regard to that (whehter +; they work might depend on exact frame structure of the +; metacontinuation). +(define (call-with-handler rs h f) + (let ([p (make-prompt)]) + (prompt0-at p + (let ([v (call-with-marks rs (cons p h) + (lambda () (prompt0-at p (f))))]) + (h (make-pure v)))))) + +(define (call-with-marks rs v f) + (cond + [(null? rs) (f)] + [else + (with-continuation-mark (car rs) v + (call-with-marks (cdr rs) v f))])) + +; Version of the above for re-installing a handlers in the serialized +; format. In that case, there is an association list of links and +; handlers, rather than a single handler (although the separate +; handlers are likely duplicates). +(define (call-with-assoc-marks p hs f) + (match hs + ['() (f)] + [(cons (cons r h) rest) + (with-continuation-mark r (cons p h) + (call-with-assoc-marks rest f))])) + +(define (call-with-handler-assocs hs f) + (let ([p (make-prompt)]) + (prompt0-at p + (call-with-assoc-marks p hs + (lambda () (prompt0-at p (f))))))) + +(define (repush frames v) + (match frames + ['() v] + [(cons (unison-frame-mark as tls hs) frames) + ; handler frame; as are pending arguments, tls are typelinks + ; for handled abilities; hs are associations from links to + ; handler values. + ; + ; todo: args + (call-with-handler-assocs hs + (lambda () (repush frames v)))] + [(cons (unison-frame-push ls as rt) rest) + (displayln (list ls as rt)) + (raise "repush push: not implemented yet")])) + +; This is a *reflected* representation of continuations amenable +; to serialization. Most continuations won't be in this format, +; because it's foolish to eagerly parse the racket continuation if +; it's just going to be applied. But, a continuation that we've +; gotten from serialization will be in this format. +; +; `frames` should be a list of the below `unison-frame` structs. +(struct unison-cont-reflected unison-continuation (frames) + #:property prop:procedure + (lambda (cont v) (repush (unison-cont-reflected-frames cont) v))) + +; Stack frames for reflected continuations +(struct unison-frame () #:transparent) + +(struct unison-frame-push unison-frame + (locals args return-to)) + +(struct unison-frame-mark unison-frame + (args abilities handlers)) + (define-syntax (define-builtin-link stx) (syntax-case stx () [(_ name) @@ -344,9 +481,11 @@ [dname (datum->syntax stx (string->symbol (string-append - "builtin-" txt ":termlink")))]) - #`(define #,dname - (unison-termlink-builtin #,(datum->syntax stx txt))))])) + "builtin-" txt ":termlink")) + #'name)]) + (quasisyntax/loc stx + (define #,dname + (unison-termlink-builtin #,(datum->syntax stx txt)))))])) (define-syntax (declare-builtin-link stx) (syntax-case stx () @@ -357,7 +496,8 @@ [dname (datum->syntax stx (string->symbol (string-append txt ":termlink")))]) - #`(declare-function-link name #,dname))])) + (quasisyntax/loc stx + (declare-function-link name #,dname)))])) (define (partial-app f . args) (unison-closure f args)) @@ -382,11 +522,11 @@ ; # works as well ; Unit -(define unit (sum 0)) +(define sum-unit (sum 0)) ; Booleans are represented as numbers -(define false 0) -(define true 1) +(define sum-false 0) +(define sum-true 1) (define (bool b) (if b 1 0)) @@ -542,6 +682,13 @@ [else (raise "unison-tuple->list: unexpected value")]))) +(define (unison-pair->cons t) + (match t + [(unison-data _ _ (list x (unison-data _ _ (list y _)))) + (cons x y)] + [else + (raise "unison-pair->cons: unexpected value")])) + (define (hash-string hs) (string-append "#" diff --git a/scheme-libs/racket/unison/io-handles.rkt b/scheme-libs/racket/unison/io-handles.rkt index 9f5c1bdc6..575d24716 100644 --- a/scheme-libs/racket/unison/io-handles.rkt +++ b/scheme-libs/racket/unison/io-handles.rkt @@ -3,7 +3,7 @@ rnrs/io/ports-6 (only-in rnrs standard-error-port standard-input-port standard-output-port vector-map) (only-in racket empty? with-output-to-string system/exit-code system false?) - (only-in unison/boot data-case define-unison) + (only-in unison/boot data-case define-unison-builtin) unison/data unison/chunked-seq unison/data @@ -15,26 +15,39 @@ (provide unison-FOp-IO.stdHandle unison-FOp-IO.openFile.impl.v3 - (prefix-out - builtin-IO. - (combine-out - seekHandle.impl.v3 - getLine.impl.v1 - getSomeBytes.impl.v1 - getBuffering.impl.v3 - setBuffering.impl.v3 - getEcho.impl.v1 - setEcho.impl.v1 - getArgs.impl.v1 - getEnv.impl.v1 - getChar.impl.v1 - isFileOpen.impl.v3 - isSeekable.impl.v3 - handlePosition.impl.v3 - process.call - getCurrentDirectory.impl.v3 - ready.impl.v1 - )) + + builtin-IO.seekHandle.impl.v3 + builtin-IO.seekHandle.impl.v3:termlink + builtin-IO.getLine.impl.v1 + builtin-IO.getLine.impl.v1:termlink + builtin-IO.getSomeBytes.impl.v1 + builtin-IO.getSomeBytes.impl.v1:termlink + builtin-IO.getBuffering.impl.v3 + builtin-IO.getBuffering.impl.v3:termlink + builtin-IO.setBuffering.impl.v3 + builtin-IO.setBuffering.impl.v3:termlink + builtin-IO.getEcho.impl.v1 + builtin-IO.getEcho.impl.v1:termlink + builtin-IO.setEcho.impl.v1 + builtin-IO.setEcho.impl.v1:termlink + builtin-IO.getArgs.impl.v1 + builtin-IO.getArgs.impl.v1:termlink + builtin-IO.getEnv.impl.v1 + builtin-IO.getEnv.impl.v1:termlink + builtin-IO.getChar.impl.v1 + builtin-IO.getChar.impl.v1:termlink + builtin-IO.isFileOpen.impl.v3 + builtin-IO.isFileOpen.impl.v3:termlink + builtin-IO.isSeekable.impl.v3 + builtin-IO.isSeekable.impl.v3:termlink + builtin-IO.handlePosition.impl.v3 + builtin-IO.handlePosition.impl.v3:termlink + builtin-IO.process.call + builtin-IO.process.call:termlink + builtin-IO.getCurrentDirectory.impl.v3 + builtin-IO.getCurrentDirectory.impl.v3:termlink + builtin-IO.ready.impl.v1 + builtin-IO.ready.impl.v1:termlink ; Still to implement: ; handlePosition.impl.v3 @@ -49,28 +62,34 @@ [f (ref-failure-failure typeLink msg a)]) (ref-either-left f))) -(define-unison (isFileOpen.impl.v3 port) +(define-unison-builtin + (builtin-IO.isFileOpen.impl.v3 port) (ref-either-right (not (port-closed? port)))) -(define-unison (ready.impl.v1 port) +(define-unison-builtin + (builtin-IO.ready.impl.v1 port) (if (byte-ready? port) (ref-either-right #t) (if (port-eof? port) (Exception ref-iofailure:typelink "EOF" port) (ref-either-right #f)))) -(define-unison (getCurrentDirectory.impl.v3 unit) +(define-unison-builtin + (builtin-IO.getCurrentDirectory.impl.v3 unit) (ref-either-right (string->chunked-string (path->string (current-directory))))) -(define-unison (isSeekable.impl.v3 handle) +(define-unison-builtin + (builtin-IO.isSeekable.impl.v3 handle) (ref-either-right (port-has-set-port-position!? handle))) -(define-unison (handlePosition.impl.v3 handle) +(define-unison-builtin + (builtin-IO.handlePosition.impl.v3 handle) (ref-either-right (port-position handle))) -(define-unison (seekHandle.impl.v3 handle mode amount) +(define-unison-builtin + (builtin-IO.seekHandle.impl.v3 handle mode amount) (data-case mode (0 () (set-port-position! handle amount) @@ -85,14 +104,16 @@ "SeekFromEnd not supported" 0)))) -(define-unison (getLine.impl.v1 handle) +(define-unison-builtin + (builtin-IO.getLine.impl.v1 handle) (let* ([line (read-line handle)]) (if (eof-object? line) (ref-either-right (string->chunked-string "")) (ref-either-right (string->chunked-string line)) ))) -(define-unison (getChar.impl.v1 handle) +(define-unison-builtin + (builtin-IO.getChar.impl.v1 handle) (let* ([char (read-char handle)]) (if (eof-object? char) (Exception @@ -101,7 +122,8 @@ ref-unit-unit) (ref-either-right char)))) -(define-unison (getSomeBytes.impl.v1 handle nbytes) +(define-unison-builtin + (builtin-IO.getSomeBytes.impl.v1 handle nbytes) (let* ([buffer (make-bytes nbytes)] [line (read-bytes-avail! buffer handle)]) (cond @@ -119,7 +141,8 @@ (subbytes buffer 0 line) buffer)))]))) -(define-unison (getBuffering.impl.v3 handle) +(define-unison-builtin + (builtin-IO.getBuffering.impl.v3 handle) (case (file-stream-buffer-mode handle) [(none) (ref-either-right ref-buffermode-no-buffering)] [(line) (ref-either-right @@ -135,7 +158,8 @@ "Unexpected response from file-stream-buffer-mode" ref-unit-unit)])) -(define-unison (setBuffering.impl.v3 handle mode) +(define-unison-builtin + (builtin-IO.setBuffering.impl.v3 handle mode) (data-case mode (0 () (file-stream-buffer-mode handle 'none) @@ -166,7 +190,8 @@ [(1) stdout] [(2) stderr])) -(define-unison (getEcho.impl.v1 handle) +(define-unison-builtin + (builtin-IO.getEcho.impl.v1 handle) (if (eq? handle stdin) (ref-either-right (get-stdin-echo)) (Exception @@ -174,7 +199,8 @@ "getEcho only supported on stdin" ref-unit-unit))) -(define-unison (setEcho.impl.v1 handle echo) +(define-unison-builtin + (builtin-IO.setEcho.impl.v1 handle echo) (if (eq? handle stdin) (begin (if echo @@ -190,12 +216,14 @@ (let ([current (with-output-to-string (lambda () (system "stty -a")))]) (string-contains? current " echo "))) -(define-unison (getArgs.impl.v1 unit) +(define-unison-builtin + (builtin-IO.getArgs.impl.v1 unit) (ref-either-right (vector->chunked-list (vector-map string->chunked-string (current-command-line-arguments))))) -(define-unison (getEnv.impl.v1 key) +(define-unison-builtin + (builtin-IO.getEnv.impl.v1 key) (let ([value (environment-variables-ref (current-environment-variables) (string->bytes/utf-8 (chunked-string->string key)))]) (if (false? value) (Exception @@ -224,7 +252,8 @@ s) "''")) -(define-unison (process.call command arguments) +(define-unison-builtin + (builtin-IO.process.call command arguments) (system/exit-code (string-join (cons (chunked-string->string command) diff --git a/scheme-libs/racket/unison/io.rkt b/scheme-libs/racket/unison/io.rkt index bc94c5314..ae99bd197 100644 --- a/scheme-libs/racket/unison/io.rkt +++ b/scheme-libs/racket/unison/io.rkt @@ -9,7 +9,7 @@ date-dst? date-time-zone-offset date*-time-zone-name) - (only-in unison/boot data-case define-unison) + (only-in unison/boot data-case define-unison-builtin) (only-in rnrs/arithmetic/flonums-6 flmod)) @@ -33,20 +33,29 @@ getTempDirectory.impl.v3 removeFile.impl.v3 getFileSize.impl.v3)) - (prefix-out - builtin-IO. - (combine-out - fileExists.impl.v3 - renameFile.impl.v3 - createDirectory.impl.v3 - removeDirectory.impl.v3 - directoryContents.impl.v3 - setCurrentDirectory.impl.v3 - renameDirectory.impl.v3 - isDirectory.impl.v3 - systemTime.impl.v3 - systemTimeMicroseconds.impl.v3 - createTempDirectory.impl.v3))) + + builtin-IO.fileExists.impl.v3 + builtin-IO.fileExists.impl.v3:termlink + builtin-IO.renameFile.impl.v3 + builtin-IO.renameFile.impl.v3:termlink + builtin-IO.createDirectory.impl.v3 + builtin-IO.createDirectory.impl.v3:termlink + builtin-IO.removeDirectory.impl.v3 + builtin-IO.removeDirectory.impl.v3:termlink + builtin-IO.directoryContents.impl.v3 + builtin-IO.directoryContents.impl.v3:termlink + builtin-IO.setCurrentDirectory.impl.v3 + builtin-IO.setCurrentDirectory.impl.v3:termlink + builtin-IO.renameDirectory.impl.v3 + builtin-IO.renameDirectory.impl.v3:termlink + builtin-IO.isDirectory.impl.v3 + builtin-IO.isDirectory.impl.v3:termlink + builtin-IO.systemTime.impl.v3 + builtin-IO.systemTime.impl.v3:termlink + builtin-IO.systemTimeMicroseconds.impl.v3 + builtin-IO.systemTimeMicroseconds.impl.v3:termlink + builtin-IO.createTempDirectory.impl.v3 + builtin-IO.createTempDirectory.impl.v3:termlink) (define (failure-result ty msg vl) (ref-either-left @@ -76,7 +85,8 @@ (right (file-or-directory-modify-seconds (chunked-string->string path))))) ; in haskell, it's not just file but also directory -(define-unison (fileExists.impl.v3 path) +(define-unison-builtin + (builtin-IO.fileExists.impl.v3 path) (let ([path-string (chunked-string->string path)]) (ref-either-right (or @@ -90,11 +100,13 @@ (define (getTempDirectory.impl.v3) (right (string->chunked-string (path->string (find-system-path 'temp-dir))))) -(define-unison (setCurrentDirectory.impl.v3 path) +(define-unison-builtin + (builtin-IO.setCurrentDirectory.impl.v3 path) (current-directory (chunked-string->string path)) (ref-either-right none)) -(define-unison (directoryContents.impl.v3 path) +(define-unison-builtin + (builtin-IO.directoryContents.impl.v3 path) (with-handlers [[exn:fail:filesystem? (lambda (e) @@ -112,7 +124,8 @@ (list* "." ".." dirss)))))))) -(define-unison (createTempDirectory.impl.v3 prefix) +(define-unison-builtin + (builtin-IO.createTempDirectory.impl.v3 prefix) (ref-either-right (string->chunked-string (path->string @@ -120,35 +133,43 @@ (string->bytes/utf-8 (chunked-string->string prefix)) #""))))) -(define-unison (createDirectory.impl.v3 file) +(define-unison-builtin + (builtin-IO.createDirectory.impl.v3 file) (make-directory (chunked-string->string file)) (ref-either-right none)) -(define-unison (removeDirectory.impl.v3 file) +(define-unison-builtin + (builtin-IO.removeDirectory.impl.v3 file) (delete-directory/files (chunked-string->string file)) (ref-either-right none)) -(define-unison (isDirectory.impl.v3 path) +(define-unison-builtin + (builtin-IO.isDirectory.impl.v3 path) (ref-either-right (directory-exists? (chunked-string->string path)))) -(define-unison (renameDirectory.impl.v3 old new) +(define-unison-builtin + (builtin-IO.renameDirectory.impl.v3 old new) (rename-file-or-directory (chunked-string->string old) (chunked-string->string new)) (ref-either-right none)) -(define-unison (renameFile.impl.v3 old new) +(define-unison-builtin + (builtin-IO.renameFile.impl.v3 old new) (rename-file-or-directory (chunked-string->string old) (chunked-string->string new)) (ref-either-right none)) -(define-unison (systemTime.impl.v3 unit) +(define-unison-builtin + (builtin-IO.systemTime.impl.v3 unit) (ref-either-right (current-seconds))) -(define-unison (systemTimeMicroseconds.impl.v3 unit) +(define-unison-builtin + (builtin-IO.systemTimeMicroseconds.impl.v3 unit) (ref-either-right (inexact->exact (* 1000 (current-inexact-milliseconds))))) -(define-unison (builtin-Clock.internals.systemTimeZone.v1 secs) +(define-unison-builtin + (builtin-Clock.internals.systemTimeZone.v1 secs) (let* ([d (seconds->date secs)]) (list->unison-tuple (list diff --git a/scheme-libs/racket/unison/math.rkt b/scheme-libs/racket/unison/math.rkt index 2e34a4998..654ac6944 100644 --- a/scheme-libs/racket/unison/math.rkt +++ b/scheme-libs/racket/unison/math.rkt @@ -7,24 +7,39 @@ clamp-integer clamp-natural data-case - define-unison + define-unison-builtin nbit63)) (provide - builtin-Float.exp - builtin-Float.log - builtin-Float.max - builtin-Float.min - builtin-Float.tan - builtin-Float.tanh - builtin-Float.logBase - builtin-Int.* - builtin-Int.pow - builtin-Int.trailingZeros - builtin-Nat.trailingZeros - builtin-Int.popCount - builtin-Nat.popCount - builtin-Float.pow + builtin-Float.exp + builtin-Float.exp:termlink + builtin-Float.log + builtin-Float.log:termlink + builtin-Float.max + builtin-Float.max:termlink + builtin-Float.min + builtin-Float.min:termlink + builtin-Float.tan + builtin-Float.tan:termlink + builtin-Float.tanh + builtin-Float.tanh:termlink + builtin-Float.logBase + builtin-Float.logBase:termlink + builtin-Int.* + builtin-Int.*:termlink + builtin-Int.pow + builtin-Int.pow:termlink + builtin-Int.trailingZeros + builtin-Int.trailingZeros:termlink + builtin-Nat.trailingZeros + builtin-Nat.trailingZeros:termlink + builtin-Int.popCount + builtin-Int.popCount:termlink + builtin-Nat.popCount + builtin-Nat.popCount:termlink + builtin-Float.pow + builtin-Float.pow:termlink + (prefix-out unison-POp- (combine-out ABSF @@ -71,21 +86,50 @@ SINF ITOF))) -(define-unison (builtin-Float.logBase base num) (log num base)) +(define-unison-builtin + (builtin-Float.logBase base num) + (log num base)) (define (LOGB base num) (log num base)) -(define-unison (builtin-Float.exp n) (exp n)) -(define-unison (builtin-Float.log n) (log n)) -(define-unison (builtin-Float.max n m) (max n m)) -(define-unison (builtin-Float.min n m) (min n m)) -(define-unison (builtin-Float.tan n) (tan n)) -(define-unison (builtin-Float.tanh n) (tanh n)) -(define-unison (builtin-Int.* n m) (clamp-integer (* n m))) -(define-unison (builtin-Int.pow n m) (clamp-integer (expt n m))) -(define-unison (builtin-Int.trailingZeros n) (TZRO n)) -(define-unison (builtin-Nat.trailingZeros n) (TZRO n)) -(define-unison (builtin-Nat.popCount n) (POPC n)) -(define-unison (builtin-Int.popCount n) (POPC n)) -(define-unison (builtin-Float.pow n m) (expt n m)) + +(define-unison-builtin + (builtin-Float.exp n) (exp n)) + +(define-unison-builtin + (builtin-Float.log n) (log n)) + +(define-unison-builtin + (builtin-Float.max n m) (max n m)) + +(define-unison-builtin + (builtin-Float.min n m) (min n m)) + +(define-unison-builtin + (builtin-Float.tan n) (tan n)) + +(define-unison-builtin + (builtin-Float.tanh n) (tanh n)) + +(define-unison-builtin + (builtin-Int.* n m) (clamp-integer (* n m))) + +(define-unison-builtin + (builtin-Int.pow n m) (clamp-integer (expt n m))) + +(define-unison-builtin + (builtin-Int.trailingZeros n) (TZRO n)) + +(define-unison-builtin + (builtin-Nat.trailingZeros n) (TZRO n)) + +(define-unison-builtin + (builtin-Nat.popCount n) (POPC n)) + +(define-unison-builtin + (builtin-Int.popCount n) (POPC n)) + +(define-unison-builtin + (builtin-Float.pow n m) (expt n m)) + (define (EXPF n) (exp n)) (define ABSF abs) (define ACOS acos) diff --git a/scheme-libs/racket/unison/primops-generated.rkt b/scheme-libs/racket/unison/primops-generated.rkt index 0e9b462ff..105d3ec20 100644 --- a/scheme-libs/racket/unison/primops-generated.rkt +++ b/scheme-libs/racket/unison/primops-generated.rkt @@ -31,9 +31,11 @@ builtin-sandboxLinks builtin-sandboxLinks:termlink + builtin-Code.dependencies:termlink builtin-Code.deserialize:termlink builtin-Code.serialize:termlink builtin-Code.validateLinks:termlink + builtin-Value.dependencies:termlink builtin-Value.deserialize:termlink builtin-Value.serialize:termlink builtin-crypto.hash:termlink @@ -54,21 +56,15 @@ build-runtime-module termlink->proc) -(define-builtin-link Value.value) -(define-builtin-link Value.reflect) -(define-builtin-link Code.isMissing) -(define-builtin-link Code.lookup) - +(define-builtin-link Code.dependencies) (define-builtin-link Code.deserialize) (define-builtin-link Code.serialize) (define-builtin-link Code.validateLinks) +(define-builtin-link Value.dependencies) (define-builtin-link Value.deserialize) (define-builtin-link Value.serialize) (define-builtin-link crypto.hash) (define-builtin-link crypto.hmac) -(define-builtin-link validateSandboxed) -(define-builtin-link Value.validateSandboxed) -(define-builtin-link sandboxLinks) (define (chunked-list->list cl) (vector->list (chunked-list->vector cl))) @@ -129,14 +125,33 @@ (raise (format "decode-binding: unimplemented case: ~a" bn))])) +(define (decode-hints hs) + (define (hint->sym t) + (cond + [(= t ref-defnhint-internal:tag) 'internal] + [(= t ref-defnhint-genlink:tag) 'gen-link] + [(= t ref-defnhint-nolinkdecl:tag) 'no-link-decl])) + + (for/fold ([def 'define-unison] [out '()]) ([h hs]) + (match h + [(unison-data _ t (list)) + #:when (= t ref-defnhint-builtin:tag) + (values 'define-unison-builtin out)] + [(unison-data _ t (list)) + (values def (cons (hint->sym t) out))]))) + (define (decode-syntax dfn) (match dfn - [(unison-data _ t (list nm vs bd)) + [(unison-data _ t (list nm hs vs bd)) #:when (= t ref-schemedefn-define:tag) - (let ([head (map text->ident - (cons nm (chunked-list->list vs)))] - [body (decode-term bd)]) - (list 'define-unison head body))] + (let-values + ([(head) (map text->ident + (cons nm (chunked-list->list vs)))] + [(def hints) (decode-hints (chunked-list->list hs))] + [(body) (decode-term bd)]) + (if (null? hints) + (list def head body) + (list def '#:hints hints head body)))] [(unison-data _ t (list nm bd)) #:when (= t ref-schemedefn-alias:tag) (list 'define (text->ident nm) (decode-term bd))] @@ -195,20 +210,17 @@ (describe-value tl)))] [1 (rf) rf])) -(define-syntax make-group-ref-decoder - (lambda (stx) - (syntax-case stx () - [(_) - #`(lambda (gr) - (data-case (group-ref-ident gr) - [#,ref-schemeterm-ident:tag (name) name] - [else - (raise - (format - "decode-group-ref: unimplemented data case: ~a" - (describe-value gr)))]))]))) +(define (decode-group-ref gr0) + (match (group-ref-ident gr0) + [(unison-data _ t (list name)) + #:when (= t ref-schemeterm-ident:tag) + name] + [else + (raise + (format + "decode-group-ref: unimplemented data case: ~a" + (describe-value gr0)))])) -(define decode-group-ref (make-group-ref-decoder)) (define (group-ref-sym gr) (string->symbol (chunked-string->string @@ -301,6 +313,70 @@ [else (raise (format "decode-vlit: unimplemented case: !a" vl))])])) +(define (reify-handlers hs) + (for/list ([h (chunked-list->list hs)]) + (match (unison-pair->cons h) + [(cons r h) + (cons (reference->typelink r) + (reify-value h))]))) + +(define (reflect-handlers hs) + (list->chunked-list + (for/list ([h hs]) + (match h + [(cons r h) + (unison-tuple + (typelink->reference r) + (reflect-value h))])))) + +(define (reify-groupref gr0) + (match gr0 + [(unison-data _ t (list r i)) + #:when (= t ref-groupref-group:tag) + (cons (reference->typelink r) i)])) + +(define (reflect-groupref rt) + (match rt + [(cons l i) + (ref-groupref-group (typelink->reference l) i)])) + +(define (parse-continuation orig k0 vs0) + (let rec ([k k0] [vs vs0] [frames '()]) + (match k + [(unison-data _ t (list)) + #:when (= t ref-cont-empty:tag) + (unison-cont-reflected (reverse frames))] + [(unison-data _ t (list l a gr0 k)) + #:when (= t ref-cont-push:tag) + (cond + [(>= (length vs) (+ l a)) + (let*-values + ([(locals int) (split-at vs l)] + [(args rest) (split-at int a)] + [(gr) (reify-groupref gr0)] + [(fm) (unison-frame-push locals args gr)]) + (rec k rest (cons fm frames)))] + [else + (raise + (make-exn:bug + "reify-value: malformed continuation" + orig))])] + [(unison-data _ t (list a rs0 de0 k)) + #:when (= t ref-cont-mark:tag) + (cond + [(>= (length vs) a) + (let*-values + ([(args rest) (split-at vs a)] + [(rs) (map reference->termlink (chunked-list->list rs0))] + [(hs) (reify-handlers de0)] + [(fm) (unison-frame-mark args rs hs)]) + (rec k rest (cons fm frames)))] + [else + (raise + (make-exn:bug + "reify-value: malformed continuation" + orig))])]))) + (define (reify-value v) (match v [(unison-data _ t (list rf rt bs0)) @@ -327,16 +403,14 @@ #:when (= t ref-value-partial:tag) (let ([bs (map reify-value (chunked-list->list bs0))] [proc (resolve-proc gr)]) - (apply proc bs))] + (struct-copy unison-closure proc [env bs]))] [(unison-data _ t (list vl)) #:when (= t ref-value-vlit:tag) (reify-vlit vl)] - [(unison-data _ t (list bs0 k)) + [(unison-data _ t (list vs0 k)) #:when (= t ref-value-cont:tag) - (raise - (make-exn:bug - "reify-value: unimplemented cont case" - ref-unit-unit))] + (parse-continuation v k + (map reify-value (chunked-list->list vs0)))] [(unison-data r t fs) (raise (make-exn:bug @@ -413,14 +487,34 @@ (ref-value-vlit (ref-vlit-typelink (reflect-typelink v)))] [(unison-code sg) (ref-value-vlit (ref-vlit-code sg))] [(unison-quote q) (ref-value-vlit (ref-vlit-quote q))] - [(unison-closure f as) + [(unison-cont-reflected frames0) + (for/foldr ([k ref-cont-empty] + [vs '()] + #:result + (ref-value-cont + (list->chunked-list (map reflect-value vs)) + k)) + ([frame frames0]) + (match frame + [(unison-frame-push locals args return-to) + (values + (ref-cont-push + (length locals) + (length args) + (reflect-groupref return-to) + k) + (append locals args vs))] + [(unison-frame-mark args refs hs) + (values + (ref-cont-mark + (length args) + (map typelink->reference refs) + (reflect-handlers hs)) + (append args vs))]))] + [(unison-closure arity f as) (ref-value-partial (function->groupref f) (list->chunked-list (map reflect-value as)))] - [(? procedure?) - (ref-value-partial - (function->groupref v) - empty-chunked-list)] [(unison-data rf t fs) (ref-value-data (reflect-typelink rf) @@ -438,7 +532,7 @@ [(? chunked-list?) (for/fold ([acc '()]) ([e (in-chunked-list v)]) (append (sandbox-value ok e) acc))] - [(unison-closure f as) + [(unison-closure arity f as) (for/fold ([acc (sandbox-proc ok f)]) ([a (in-list as)]) (append (sandbox-scheme-value ok a) acc))] [(? procedure?) (sandbox-proc ok v)] @@ -474,11 +568,11 @@ [(unison-quote v) (sandbox-value ok v)])) ; replacment for Value.unsafeValue : a -> Value -(define-unison +(define-unison-builtin (builtin-Value.reflect v) (reflect-value v)) -(define-unison +(define-unison-builtin (builtin-Value.value v) (let ([rv (reflect-value v)]) (unison-quote rv))) @@ -706,23 +800,23 @@ (define (unison-POp-LKUP tl) (lookup-code tl)) -(define-unison (builtin-Code.lookup tl) +(define-unison-builtin (builtin-Code.lookup tl) (match (lookup-code tl) [(unison-sum 0 (list)) ref-optional-none] [(unison-sum 1 (list co)) (ref-optional-some co)])) -(define-unison (builtin-validateSandboxed ok v) +(define-unison-builtin (builtin-validateSandboxed ok v) (let ([l (sandbox-scheme-value (chunked-list->list ok) v)]) (null? l))) -(define-unison (builtin-sandboxLinks tl) (check-sandbox tl)) +(define-unison-builtin (builtin-sandboxLinks tl) (check-sandbox tl)) -(define-unison (builtin-Code.isMissing tl) +(define-unison-builtin (builtin-Code.isMissing tl) (cond [(unison-termlink-builtin? tl) #f] [(unison-termlink-con? tl) #f] [(have-code? tl) #t] [else #f])) -(define-unison (builtin-Value.validateSandboxed ok v) +(define-unison-builtin (builtin-Value.validateSandboxed ok v) (sandbox-quoted (chunked-list->list ok) v)) diff --git a/scheme-libs/racket/unison/primops.ss b/scheme-libs/racket/unison/primops.ss index 225b68acd..712727499 100644 --- a/scheme-libs/racket/unison/primops.ss +++ b/scheme-libs/racket/unison/primops.ss @@ -21,1499 +21,1476 @@ ; Unison.Runtime.Builtin, so the POp/FOp implementation must ; take/return arguments that match what is expected in those wrappers. -#!r6rs -(library (unison primops) - (export - builtin-Float.* - builtin-Float.*:termlink - builtin-Float.>= - builtin-Float.>=:termlink - builtin-Float.<= - builtin-Float.<=:termlink - builtin-Float.> - builtin-Float.>:termlink - builtin-Float.< - builtin-Float.<:termlink - builtin-Float.== - builtin-Float.==:termlink - builtin-Float.fromRepresentation - builtin-Float.fromRepresentation:termlink - builtin-Float.toRepresentation - builtin-Float.toRepresentation:termlink - builtin-Float.ceiling - builtin-Float.ceiling:termlink - builtin-Float.exp - builtin-Float.exp:termlink - builtin-Float.log - builtin-Float.log:termlink - builtin-Float.max - builtin-Float.max:termlink - builtin-Float.min - builtin-Float.min:termlink - builtin-Float.tan - builtin-Float.tan:termlink - builtin-Float.tanh - builtin-Float.tanh:termlink - builtin-Float.logBase - builtin-Float.logBase:termlink - builtin-Float.pow - builtin-Float.pow:termlink - builtin-Int.pow - builtin-Int.pow:termlink - builtin-Int.* - builtin-Int.*:termlink - builtin-Int.+ - builtin-Int.+:termlink - builtin-Int.- - builtin-Int.-:termlink - builtin-Int./ - builtin-Int./:termlink - builtin-Int.increment - builtin-Int.increment:termlink - builtin-Int.negate - builtin-Int.negate:termlink - builtin-Int.fromRepresentation - builtin-Int.fromRepresentation:termlink - builtin-Int.toRepresentation - builtin-Int.toRepresentation:termlink - builtin-Int.signum - builtin-Int.signum:termlink - builtin-Int.trailingZeros - builtin-Int.trailingZeros:termlink - builtin-Int.popCount - builtin-Int.popCount:termlink - builtin-Int.isEven - builtin-Int.isEven:termlink - builtin-Int.isOdd - builtin-Int.isOdd:termlink - builtin-Int.== - builtin-Int.==:termlink - builtin-Int.< - builtin-Int.<:termlink - builtin-Int.<= - builtin-Int.<=:termlink - builtin-Int.> - builtin-Int.>:termlink - builtin-Int.>= - builtin-Int.>=:termlink - builtin-Nat.+ - builtin-Nat.+:termlink - builtin-Nat.drop - builtin-Nat.drop:termlink - builtin-Nat.== - builtin-Nat.==:termlink - builtin-Nat.< - builtin-Nat.<:termlink - builtin-Nat.<= - builtin-Nat.<=:termlink - builtin-Nat.> - builtin-Nat.>:termlink - builtin-Nat.>= - builtin-Nat.>=:termlink - builtin-Nat.isEven - builtin-Nat.isEven:termlink - builtin-Nat.isOdd - builtin-Nat.isOdd:termlink - builtin-Nat.increment - builtin-Nat.increment:termlink - builtin-Nat.popCount - builtin-Nat.popCount:termlink - builtin-Nat.toFloat - builtin-Nat.toFloat:termlink - builtin-Nat.trailingZeros - builtin-Nat.trailingZeros:termlink - builtin-Text.indexOf - builtin-Text.indexOf:termlink - builtin-Text.== - builtin-Text.==:termlink - builtin-Text.!= - builtin-Text.!=:termlink - builtin-Text.<= - builtin-Text.<=:termlink - builtin-Text.>= - builtin-Text.>=:termlink - builtin-Text.< - builtin-Text.<:termlink - builtin-Text.> - builtin-Text.>:termlink - builtin-Bytes.indexOf - builtin-Bytes.indexOf:termlink - builtin-IO.randomBytes - builtin-IO.randomBytes:termlink - builtin-IO.tryEval - builtin-IO.tryEval:termlink +#lang racket/base +(provide + builtin-Float.* + builtin-Float.*:termlink + builtin-Float.>= + builtin-Float.>=:termlink + builtin-Float.<= + builtin-Float.<=:termlink + builtin-Float.> + builtin-Float.>:termlink + builtin-Float.< + builtin-Float.<:termlink + builtin-Float.== + builtin-Float.==:termlink + builtin-Float.fromRepresentation + builtin-Float.fromRepresentation:termlink + builtin-Float.toRepresentation + builtin-Float.toRepresentation:termlink + builtin-Float.ceiling + builtin-Float.ceiling:termlink + builtin-Float.exp + builtin-Float.exp:termlink + builtin-Float.log + builtin-Float.log:termlink + builtin-Float.max + builtin-Float.max:termlink + builtin-Float.min + builtin-Float.min:termlink + builtin-Float.tan + builtin-Float.tan:termlink + builtin-Float.tanh + builtin-Float.tanh:termlink + builtin-Float.logBase + builtin-Float.logBase:termlink + builtin-Float.pow + builtin-Float.pow:termlink + builtin-Int.pow + builtin-Int.pow:termlink + builtin-Int.* + builtin-Int.*:termlink + builtin-Int.+ + builtin-Int.+:termlink + builtin-Int.- + builtin-Int.-:termlink + builtin-Int./ + builtin-Int./:termlink + builtin-Int.increment + builtin-Int.increment:termlink + builtin-Int.negate + builtin-Int.negate:termlink + builtin-Int.fromRepresentation + builtin-Int.fromRepresentation:termlink + builtin-Int.toRepresentation + builtin-Int.toRepresentation:termlink + builtin-Int.signum + builtin-Int.signum:termlink + builtin-Int.trailingZeros + builtin-Int.trailingZeros:termlink + builtin-Int.popCount + builtin-Int.popCount:termlink + builtin-Int.isEven + builtin-Int.isEven:termlink + builtin-Int.isOdd + builtin-Int.isOdd:termlink + builtin-Int.== + builtin-Int.==:termlink + builtin-Int.< + builtin-Int.<:termlink + builtin-Int.<= + builtin-Int.<=:termlink + builtin-Int.> + builtin-Int.>:termlink + builtin-Int.>= + builtin-Int.>=:termlink + builtin-Nat.+ + builtin-Nat.+:termlink + builtin-Nat.drop + builtin-Nat.drop:termlink + builtin-Nat.== + builtin-Nat.==:termlink + builtin-Nat.< + builtin-Nat.<:termlink + builtin-Nat.<= + builtin-Nat.<=:termlink + builtin-Nat.> + builtin-Nat.>:termlink + builtin-Nat.>= + builtin-Nat.>=:termlink + builtin-Nat.isEven + builtin-Nat.isEven:termlink + builtin-Nat.isOdd + builtin-Nat.isOdd:termlink + builtin-Nat.increment + builtin-Nat.increment:termlink + builtin-Nat.popCount + builtin-Nat.popCount:termlink + builtin-Nat.toFloat + builtin-Nat.toFloat:termlink + builtin-Nat.trailingZeros + builtin-Nat.trailingZeros:termlink + builtin-Text.indexOf + builtin-Text.indexOf:termlink + builtin-Text.== + builtin-Text.==:termlink + builtin-Text.!= + builtin-Text.!=:termlink + builtin-Text.<= + builtin-Text.<=:termlink + builtin-Text.>= + builtin-Text.>=:termlink + builtin-Text.< + builtin-Text.<:termlink + builtin-Text.> + builtin-Text.>:termlink + builtin-Bytes.indexOf + builtin-Bytes.indexOf:termlink + builtin-IO.randomBytes + builtin-IO.randomBytes:termlink + builtin-IO.tryEval + builtin-IO.tryEval:termlink - builtin-Scope.bytearrayOf - builtin-Scope.bytearrayOf:termlink + builtin-Scope.bytearrayOf + builtin-Scope.bytearrayOf:termlink - builtin-Universal.== - builtin-Universal.==:termlink - builtin-Universal.> - builtin-Universal.>:termlink - builtin-Universal.>= - builtin-Universal.>=:termlink - builtin-Universal.< - builtin-Universal.<:termlink - builtin-Universal.<= - builtin-Universal.<=:termlink - builtin-Universal.compare - builtin-Universal.compare:termlink - builtin-Universal.murmurHash:termlink + builtin-Universal.== + builtin-Universal.==:termlink + builtin-Universal.> + builtin-Universal.>:termlink + builtin-Universal.>= + builtin-Universal.>=:termlink + builtin-Universal.< + builtin-Universal.<:termlink + builtin-Universal.<= + builtin-Universal.<=:termlink + builtin-Universal.compare + builtin-Universal.compare:termlink + builtin-Universal.murmurHash:termlink - builtin-unsafe.coerceAbilities - builtin-unsafe.coerceAbilities:termlink + builtin-unsafe.coerceAbilities + builtin-unsafe.coerceAbilities:termlink - builtin-List.splitLeft - builtin-List.splitLeft:termlink - builtin-List.splitRight - builtin-List.splitRight:termlink + builtin-List.splitLeft + builtin-List.splitLeft:termlink + builtin-List.splitRight + builtin-List.splitRight:termlink - builtin-Link.Term.toText - builtin-Link.Term.toText:termlink + builtin-Link.Term.toText + builtin-Link.Term.toText:termlink - builtin-Value.toBuiltin - builtin-Value.toBuiltin:termlink - builtin-Value.fromBuiltin - builtin-Value.fromBuiltin:termlink - builtin-Code.fromGroup - builtin-Code.fromGroup:termlink - builtin-Code.toGroup - builtin-Code.toGroup:termlink - builtin-TermLink.fromReferent - builtin-TermLink.fromReferent:termlink - builtin-TermLink.toReferent - builtin-TermLink.toReferent:termlink - builtin-TypeLink.toReference - builtin-TypeLink.toReference:termlink + builtin-Value.toBuiltin + builtin-Value.toBuiltin:termlink + builtin-Value.fromBuiltin + builtin-Value.fromBuiltin:termlink + builtin-Code.fromGroup + builtin-Code.fromGroup:termlink + builtin-Code.toGroup + builtin-Code.toGroup:termlink + builtin-TermLink.fromReferent + builtin-TermLink.fromReferent:termlink + builtin-TermLink.toReferent + builtin-TermLink.toReferent:termlink + builtin-TypeLink.toReference + builtin-TypeLink.toReference:termlink - builtin-IO.UDP.clientSocket.impl.v1 - builtin-IO.UDP.clientSocket.impl.v1:termlink - builtin-IO.UDP.UDPSocket.recv.impl.v1 - builtin-IO.UDP.UDPSocket.recv.impl.v1:termlink - builtin-IO.UDP.UDPSocket.send.impl.v1 - builtin-IO.UDP.UDPSocket.send.impl.v1:termlink - builtin-IO.UDP.UDPSocket.close.impl.v1 - builtin-IO.UDP.UDPSocket.close.impl.v1:termlink - builtin-IO.UDP.ListenSocket.close.impl.v1 - builtin-IO.UDP.ListenSocket.close.impl.v1:termlink - builtin-IO.UDP.UDPSocket.toText.impl.v1 - builtin-IO.UDP.UDPSocket.toText.impl.v1:termlink - builtin-IO.UDP.serverSocket.impl.v1 - builtin-IO.UDP.serverSocket.impl.v1:termlink - builtin-IO.UDP.ListenSocket.toText.impl.v1 - builtin-IO.UDP.ListenSocket.toText.impl.v1:termlink - builtin-IO.UDP.ListenSocket.recvFrom.impl.v1 - builtin-IO.UDP.ListenSocket.recvFrom.impl.v1:termlink - builtin-IO.UDP.ClientSockAddr.toText.v1 - builtin-IO.UDP.ClientSockAddr.toText.v1:termlink - builtin-IO.UDP.ListenSocket.sendTo.impl.v1 - builtin-IO.UDP.ListenSocket.sendTo.impl.v1:termlink + builtin-IO.UDP.clientSocket.impl.v1 + builtin-IO.UDP.clientSocket.impl.v1:termlink + builtin-IO.UDP.UDPSocket.recv.impl.v1 + builtin-IO.UDP.UDPSocket.recv.impl.v1:termlink + builtin-IO.UDP.UDPSocket.send.impl.v1 + builtin-IO.UDP.UDPSocket.send.impl.v1:termlink + builtin-IO.UDP.UDPSocket.close.impl.v1 + builtin-IO.UDP.UDPSocket.close.impl.v1:termlink + builtin-IO.UDP.ListenSocket.close.impl.v1 + builtin-IO.UDP.ListenSocket.close.impl.v1:termlink + builtin-IO.UDP.UDPSocket.toText.impl.v1 + builtin-IO.UDP.UDPSocket.toText.impl.v1:termlink + builtin-IO.UDP.serverSocket.impl.v1 + builtin-IO.UDP.serverSocket.impl.v1:termlink + builtin-IO.UDP.ListenSocket.toText.impl.v1 + builtin-IO.UDP.ListenSocket.toText.impl.v1:termlink + builtin-IO.UDP.ListenSocket.recvFrom.impl.v1 + builtin-IO.UDP.ListenSocket.recvFrom.impl.v1:termlink + builtin-IO.UDP.ClientSockAddr.toText.v1 + builtin-IO.UDP.ClientSockAddr.toText.v1:termlink + builtin-IO.UDP.ListenSocket.sendTo.impl.v1 + builtin-IO.UDP.ListenSocket.sendTo.impl.v1:termlink - unison-FOp-internal.dataTag - unison-FOp-Char.toText - ; unison-FOp-Code.dependencies - ; unison-FOp-Code.serialize - unison-FOp-IO.closeFile.impl.v3 - unison-FOp-IO.openFile.impl.v3 - ; unison-FOp-IO.isFileEOF.impl.v3 - unison-FOp-IO.putBytes.impl.v3 - unison-FOp-IO.getBytes.impl.v3 - builtin-IO.seekHandle.impl.v3 - builtin-IO.seekHandle.impl.v3:termlink - builtin-IO.getLine.impl.v1 - builtin-IO.getLine.impl.v1:termlink - builtin-IO.getSomeBytes.impl.v1 - builtin-IO.getSomeBytes.impl.v1:termlink - builtin-IO.setBuffering.impl.v3 - builtin-IO.setBuffering.impl.v3:termlink - builtin-IO.getBuffering.impl.v3 - builtin-IO.getBuffering.impl.v3:termlink - builtin-IO.setEcho.impl.v1 - builtin-IO.setEcho.impl.v1:termlink - builtin-IO.isFileOpen.impl.v3 - builtin-IO.isFileOpen.impl.v3:termlink - builtin-IO.ready.impl.v1 - builtin-IO.ready.impl.v1:termlink - builtin-IO.process.call - builtin-IO.process.call:termlink - builtin-IO.getEcho.impl.v1 - builtin-IO.getEcho.impl.v1:termlink - builtin-IO.getArgs.impl.v1 - builtin-IO.getArgs.impl.v1:termlink - builtin-IO.getEnv.impl.v1 - builtin-IO.getEnv.impl.v1:termlink - builtin-IO.getChar.impl.v1 - builtin-IO.getChar.impl.v1:termlink - builtin-IO.getCurrentDirectory.impl.v3 - builtin-IO.getCurrentDirectory.impl.v3:termlink - builtin-IO.removeDirectory.impl.v3 - builtin-IO.removeDirectory.impl.v3:termlink - builtin-IO.renameFile.impl.v3 - builtin-IO.renameFile.impl.v3:termlink - builtin-IO.createTempDirectory.impl.v3 - builtin-IO.createTempDirectory.impl.v3:termlink - builtin-IO.createDirectory.impl.v3 - builtin-IO.createDirectory.impl.v3:termlink - builtin-IO.setCurrentDirectory.impl.v3 - builtin-IO.setCurrentDirectory.impl.v3:termlink - builtin-IO.renameDirectory.impl.v3 - builtin-IO.renameDirectory.impl.v3:termlink - builtin-IO.isDirectory.impl.v3 - builtin-IO.isDirectory.impl.v3:termlink - builtin-IO.isSeekable.impl.v3 - builtin-IO.isSeekable.impl.v3:termlink - builtin-IO.handlePosition.impl.v3 - builtin-IO.handlePosition.impl.v3:termlink - builtin-IO.systemTime.impl.v3 - builtin-IO.systemTime.impl.v3:termlink - builtin-IO.systemTimeMicroseconds.impl.v3 - builtin-IO.systemTimeMicroseconds.impl.v3:termlink + unison-FOp-internal.dataTag + unison-FOp-Char.toText + ; unison-FOp-Code.dependencies + ; unison-FOp-Code.serialize + unison-FOp-IO.closeFile.impl.v3 + unison-FOp-IO.openFile.impl.v3 + ; unison-FOp-IO.isFileEOF.impl.v3 + unison-FOp-IO.putBytes.impl.v3 + unison-FOp-IO.getBytes.impl.v3 + builtin-IO.seekHandle.impl.v3 + builtin-IO.seekHandle.impl.v3:termlink + builtin-IO.getLine.impl.v1 + builtin-IO.getLine.impl.v1:termlink + builtin-IO.getSomeBytes.impl.v1 + builtin-IO.getSomeBytes.impl.v1:termlink + builtin-IO.setBuffering.impl.v3 + builtin-IO.setBuffering.impl.v3:termlink + builtin-IO.getBuffering.impl.v3 + builtin-IO.getBuffering.impl.v3:termlink + builtin-IO.setEcho.impl.v1 + builtin-IO.setEcho.impl.v1:termlink + builtin-IO.isFileOpen.impl.v3 + builtin-IO.isFileOpen.impl.v3:termlink + builtin-IO.ready.impl.v1 + builtin-IO.ready.impl.v1:termlink + builtin-IO.process.call + builtin-IO.process.call:termlink + builtin-IO.getEcho.impl.v1 + builtin-IO.getEcho.impl.v1:termlink + builtin-IO.getArgs.impl.v1 + builtin-IO.getArgs.impl.v1:termlink + builtin-IO.getEnv.impl.v1 + builtin-IO.getEnv.impl.v1:termlink + builtin-IO.getChar.impl.v1 + builtin-IO.getChar.impl.v1:termlink + builtin-IO.getCurrentDirectory.impl.v3 + builtin-IO.getCurrentDirectory.impl.v3:termlink + builtin-IO.removeDirectory.impl.v3 + builtin-IO.removeDirectory.impl.v3:termlink + builtin-IO.renameFile.impl.v3 + builtin-IO.renameFile.impl.v3:termlink + builtin-IO.createTempDirectory.impl.v3 + builtin-IO.createTempDirectory.impl.v3:termlink + builtin-IO.createDirectory.impl.v3 + builtin-IO.createDirectory.impl.v3:termlink + builtin-IO.setCurrentDirectory.impl.v3 + builtin-IO.setCurrentDirectory.impl.v3:termlink + builtin-IO.renameDirectory.impl.v3 + builtin-IO.renameDirectory.impl.v3:termlink + builtin-IO.isDirectory.impl.v3 + builtin-IO.isDirectory.impl.v3:termlink + builtin-IO.isSeekable.impl.v3 + builtin-IO.isSeekable.impl.v3:termlink + builtin-IO.handlePosition.impl.v3 + builtin-IO.handlePosition.impl.v3:termlink + builtin-IO.systemTime.impl.v3 + builtin-IO.systemTime.impl.v3:termlink + builtin-IO.systemTimeMicroseconds.impl.v3 + builtin-IO.systemTimeMicroseconds.impl.v3:termlink - builtin-Char.Class.is - builtin-Char.Class.is:termlink - builtin-Pattern.captureAs - builtin-Pattern.captureAs:termlink - builtin-Pattern.many.corrected - builtin-Pattern.many.corrected:termlink - builtin-Pattern.isMatch - builtin-Pattern.isMatch:termlink - builtin-IO.fileExists.impl.v3 - builtin-IO.fileExists.impl.v3:termlink - builtin-IO.isFileEOF.impl.v3 - builtin-IO.isFileEOF.impl.v3:termlink + builtin-Char.Class.is + builtin-Char.Class.is:termlink + builtin-Pattern.captureAs + builtin-Pattern.captureAs:termlink + builtin-Pattern.many.corrected + builtin-Pattern.many.corrected:termlink + builtin-Pattern.isMatch + builtin-Pattern.isMatch:termlink + builtin-IO.fileExists.impl.v3 + builtin-IO.fileExists.impl.v3:termlink + builtin-IO.isFileEOF.impl.v3 + builtin-IO.isFileEOF.impl.v3:termlink - unison-FOp-IO.getFileSize.impl.v3 - unison-FOp-IO.getFileTimestamp.impl.v3 - ; unison-FOp-IO.fileExists.impl.v3 - unison-FOp-IO.removeFile.impl.v3 - unison-FOp-IO.getTempDirectory.impl.v3 - unison-FOp-Text.fromUtf8.impl.v3 - unison-FOp-Text.repeat - unison-FOp-Text.reverse - unison-FOp-Text.toUtf8 - unison-FOp-Text.toLowercase - unison-FOp-Text.toUppercase - unison-FOp-Pattern.run - unison-FOp-Pattern.isMatch - unison-FOp-Pattern.many - unison-FOp-Pattern.capture - unison-FOp-Pattern.join - unison-FOp-Pattern.or - unison-FOp-Pattern.replicate - unison-FOp-Text.patterns.digit - unison-FOp-Text.patterns.letter - unison-FOp-Text.patterns.punctuation - unison-FOp-Text.patterns.charIn - unison-FOp-Text.patterns.notCharIn - unison-FOp-Text.patterns.anyChar - unison-FOp-Text.patterns.space - unison-FOp-Text.patterns.charRange - unison-FOp-Text.patterns.notCharRange - unison-FOp-Text.patterns.literal - unison-FOp-Text.patterns.eof - unison-FOp-Text.patterns.char - unison-FOp-Char.Class.is - unison-FOp-Char.Class.any - unison-FOp-Char.Class.alphanumeric - unison-FOp-Char.Class.upper - unison-FOp-Char.Class.lower - unison-FOp-Char.Class.number - unison-FOp-Char.Class.punctuation - unison-FOp-Char.Class.symbol - unison-FOp-Char.Class.letter - unison-FOp-Char.Class.whitespace - unison-FOp-Char.Class.control - unison-FOp-Char.Class.printable - unison-FOp-Char.Class.mark - unison-FOp-Char.Class.separator - unison-FOp-Char.Class.or - unison-FOp-Char.Class.range - unison-FOp-Char.Class.anyOf - unison-FOp-Char.Class.and - unison-FOp-Char.Class.not - unison-FOp-Clock.internals.nsec.v1 - unison-FOp-Clock.internals.sec.v1 - unison-FOp-Clock.internals.threadCPUTime.v1 - unison-FOp-Clock.internals.processCPUTime.v1 - unison-FOp-Clock.internals.realtime.v1 - unison-FOp-Clock.internals.monotonic.v1 - builtin-Clock.internals.systemTimeZone.v1 - builtin-Clock.internals.systemTimeZone.v1:termlink + unison-FOp-IO.getFileSize.impl.v3 + unison-FOp-IO.getFileTimestamp.impl.v3 + ; unison-FOp-IO.fileExists.impl.v3 + unison-FOp-IO.removeFile.impl.v3 + unison-FOp-IO.getTempDirectory.impl.v3 + unison-FOp-Text.fromUtf8.impl.v3 + unison-FOp-Text.repeat + unison-FOp-Text.reverse + unison-FOp-Text.toUtf8 + unison-FOp-Text.toLowercase + unison-FOp-Text.toUppercase + unison-FOp-Pattern.run + unison-FOp-Pattern.isMatch + unison-FOp-Pattern.many + unison-FOp-Pattern.capture + unison-FOp-Pattern.join + unison-FOp-Pattern.or + unison-FOp-Pattern.replicate + unison-FOp-Text.patterns.digit + unison-FOp-Text.patterns.letter + unison-FOp-Text.patterns.punctuation + unison-FOp-Text.patterns.charIn + unison-FOp-Text.patterns.notCharIn + unison-FOp-Text.patterns.anyChar + unison-FOp-Text.patterns.space + unison-FOp-Text.patterns.charRange + unison-FOp-Text.patterns.notCharRange + unison-FOp-Text.patterns.literal + unison-FOp-Text.patterns.eof + unison-FOp-Text.patterns.char + unison-FOp-Char.Class.is + unison-FOp-Char.Class.any + unison-FOp-Char.Class.alphanumeric + unison-FOp-Char.Class.upper + unison-FOp-Char.Class.lower + unison-FOp-Char.Class.number + unison-FOp-Char.Class.punctuation + unison-FOp-Char.Class.symbol + unison-FOp-Char.Class.letter + unison-FOp-Char.Class.whitespace + unison-FOp-Char.Class.control + unison-FOp-Char.Class.printable + unison-FOp-Char.Class.mark + unison-FOp-Char.Class.separator + unison-FOp-Char.Class.or + unison-FOp-Char.Class.range + unison-FOp-Char.Class.anyOf + unison-FOp-Char.Class.and + unison-FOp-Char.Class.not + unison-FOp-Clock.internals.nsec.v1 + unison-FOp-Clock.internals.sec.v1 + unison-FOp-Clock.internals.threadCPUTime.v1 + unison-FOp-Clock.internals.processCPUTime.v1 + unison-FOp-Clock.internals.realtime.v1 + unison-FOp-Clock.internals.monotonic.v1 + builtin-Clock.internals.systemTimeZone.v1 + builtin-Clock.internals.systemTimeZone.v1:termlink - ; unison-FOp-Value.serialize - unison-FOp-IO.stdHandle - unison-FOp-IO.getArgs.impl.v1 + ; unison-FOp-Value.serialize + unison-FOp-IO.stdHandle + unison-FOp-IO.getArgs.impl.v1 - builtin-IO.directoryContents.impl.v3 - builtin-IO.directoryContents.impl.v3:termlink - unison-FOp-IO.systemTimeMicroseconds.v1 + builtin-IO.directoryContents.impl.v3 + builtin-IO.directoryContents.impl.v3:termlink + unison-FOp-IO.systemTimeMicroseconds.v1 - unison-FOp-ImmutableArray.copyTo! - unison-FOp-ImmutableArray.read + unison-FOp-ImmutableArray.copyTo! + unison-FOp-ImmutableArray.read - unison-FOp-MutableArray.copyTo! - unison-FOp-MutableArray.freeze! - unison-FOp-MutableArray.freeze - unison-FOp-MutableArray.read - unison-FOp-MutableArray.write + unison-FOp-MutableArray.copyTo! + unison-FOp-MutableArray.freeze! + unison-FOp-MutableArray.freeze + unison-FOp-MutableArray.read + unison-FOp-MutableArray.write - unison-FOp-MutableArray.size - unison-FOp-ImmutableArray.size + unison-FOp-MutableArray.size + unison-FOp-ImmutableArray.size - unison-FOp-MutableByteArray.size - unison-FOp-ImmutableByteArray.size + unison-FOp-MutableByteArray.size + unison-FOp-ImmutableByteArray.size - unison-FOp-MutableByteArray.length - unison-FOp-ImmutableByteArray.length + unison-FOp-MutableByteArray.length + unison-FOp-ImmutableByteArray.length - unison-FOp-ImmutableByteArray.copyTo! - unison-FOp-ImmutableByteArray.read8 - unison-FOp-ImmutableByteArray.read16be - unison-FOp-ImmutableByteArray.read24be - unison-FOp-ImmutableByteArray.read32be - unison-FOp-ImmutableByteArray.read40be - unison-FOp-ImmutableByteArray.read48be - unison-FOp-ImmutableByteArray.read56be - unison-FOp-ImmutableByteArray.read64be + unison-FOp-ImmutableByteArray.copyTo! + unison-FOp-ImmutableByteArray.read8 + unison-FOp-ImmutableByteArray.read16be + unison-FOp-ImmutableByteArray.read24be + unison-FOp-ImmutableByteArray.read32be + unison-FOp-ImmutableByteArray.read40be + unison-FOp-ImmutableByteArray.read48be + unison-FOp-ImmutableByteArray.read56be + unison-FOp-ImmutableByteArray.read64be - unison-FOp-MutableByteArray.copyTo! - unison-FOp-MutableByteArray.freeze! - unison-FOp-MutableByteArray.write8 - unison-FOp-MutableByteArray.write16be - unison-FOp-MutableByteArray.write32be - unison-FOp-MutableByteArray.write64be - unison-FOp-MutableByteArray.read8 - unison-FOp-MutableByteArray.read16be - unison-FOp-MutableByteArray.read24be - unison-FOp-MutableByteArray.read32be - unison-FOp-MutableByteArray.read40be - unison-FOp-MutableByteArray.read64be + unison-FOp-MutableByteArray.copyTo! + unison-FOp-MutableByteArray.freeze! + unison-FOp-MutableByteArray.write8 + unison-FOp-MutableByteArray.write16be + unison-FOp-MutableByteArray.write32be + unison-FOp-MutableByteArray.write64be + unison-FOp-MutableByteArray.read8 + unison-FOp-MutableByteArray.read16be + unison-FOp-MutableByteArray.read24be + unison-FOp-MutableByteArray.read32be + unison-FOp-MutableByteArray.read40be + unison-FOp-MutableByteArray.read64be - unison-FOp-Scope.bytearray - unison-FOp-Scope.bytearrayOf - unison-FOp-Scope.array - unison-FOp-Scope.arrayOf - unison-FOp-Scope.ref + unison-FOp-Scope.bytearray + unison-FOp-Scope.bytearrayOf + unison-FOp-Scope.array + unison-FOp-Scope.arrayOf + unison-FOp-Scope.ref - unison-FOp-IO.bytearray - unison-FOp-IO.bytearrayOf - unison-FOp-IO.array - unison-FOp-IO.arrayOf + unison-FOp-IO.bytearray + unison-FOp-IO.bytearrayOf + unison-FOp-IO.array + unison-FOp-IO.arrayOf - unison-FOp-IO.ref - unison-FOp-Ref.read - unison-FOp-Ref.write - unison-FOp-Ref.readForCas - unison-FOp-Ref.Ticket.read - unison-FOp-Ref.cas + unison-FOp-IO.ref + unison-FOp-Ref.read + unison-FOp-Ref.write + unison-FOp-Ref.readForCas + unison-FOp-Ref.Ticket.read + unison-FOp-Ref.cas - unison-FOp-Promise.new - unison-FOp-Promise.read - unison-FOp-Promise.tryRead - unison-FOp-Promise.write + unison-FOp-Promise.new + unison-FOp-Promise.read + unison-FOp-Promise.tryRead + unison-FOp-Promise.write - unison-FOp-IO.delay.impl.v3 - unison-POp-FORK - unison-FOp-IO.kill.impl.v3 + unison-FOp-IO.delay.impl.v3 + unison-POp-FORK + unison-FOp-IO.kill.impl.v3 - unison-FOp-Handle.toText - unison-FOp-Socket.toText - unison-FOp-ThreadId.toText + unison-FOp-Handle.toText + unison-FOp-Socket.toText + unison-FOp-ThreadId.toText - unison-POp-ABSF - unison-POp-ACOS - unison-POp-ACSH - unison-POp-ADDF - unison-POp-ASIN - unison-POp-ASNH - unison-POp-ATAN - unison-POp-ATN2 - unison-POp-ATNH - unison-POp-CEIL - unison-POp-FLOR - unison-POp-COSF - unison-POp-COSH - unison-POp-DIVF - unison-POp-DIVI - unison-POp-EQLF - unison-POp-EQLI - unison-POp-SUBF - unison-POp-SUBI - unison-POp-SGNI - unison-POp-LEQF - unison-POp-SINF - unison-POp-SINH - unison-POp-TRNF - unison-POp-RNDF - unison-POp-SQRT - unison-POp-TANH - unison-POp-TANF - unison-POp-TZRO - unison-POp-POPC - unison-POp-ITOF + unison-POp-ABSF + unison-POp-ACOS + unison-POp-ACSH + unison-POp-ADDF + unison-POp-ASIN + unison-POp-ASNH + unison-POp-ATAN + unison-POp-ATN2 + unison-POp-ATNH + unison-POp-CEIL + unison-POp-FLOR + unison-POp-COSF + unison-POp-COSH + unison-POp-DIVF + unison-POp-DIVI + unison-POp-EQLF + unison-POp-EQLI + unison-POp-SUBF + unison-POp-SUBI + unison-POp-SGNI + unison-POp-LEQF + unison-POp-SINF + unison-POp-SINH + unison-POp-TRNF + unison-POp-RNDF + unison-POp-SQRT + unison-POp-TANH + unison-POp-TANF + unison-POp-TZRO + unison-POp-POPC + unison-POp-ITOF - unison-POp-ADDN - unison-POp-ANDN - unison-POp-BLDS - unison-POp-CATS - unison-POp-CATT - unison-POp-CATB - unison-POp-CMPU - unison-POp-COMN - unison-POp-CONS - unison-POp-DBTX - unison-POp-DECI - unison-POp-INCI - unison-POp-DECN - unison-POp-INCN - unison-POp-DIVN - unison-POp-DRPB - unison-POp-DRPS - unison-POp-DRPT - unison-POp-EQLN - unison-POp-EQLT - unison-POp-EXPF - unison-POp-LEQT - unison-POp-EQLU - unison-POp-EROR - unison-POp-FTOT - unison-POp-IDXB - unison-POp-IDXS - unison-POp-IORN - unison-POp-ITOT - unison-POp-LEQN - ; unison-POp-LKUP - unison-POp-LZRO - unison-POp-MULN - unison-POp-MODN - unison-POp-NTOT - unison-POp-PAKT - unison-POp-SHLI - unison-POp-SHLN - unison-POp-SHRI - unison-POp-SHRN - unison-POp-SIZS - unison-POp-SIZT - unison-POp-SIZB - unison-POp-SNOC - unison-POp-SUBN - unison-POp-SUBI - unison-POp-TAKS - unison-POp-TAKT - unison-POp-TAKB - unison-POp-TRCE - unison-POp-PRNT - unison-POp-TTON - unison-POp-TTOI - unison-POp-TTOF - unison-POp-UPKT - unison-POp-XORN - unison-POp-VALU - unison-POp-VWLS - unison-POp-UCNS - unison-POp-USNC - unison-POp-FLTB - unison-POp-MAXF - unison-POp-MINF - unison-POp-MULF - unison-POp-MULI - unison-POp-NEGI - unison-POp-NTOF - unison-POp-POWF - unison-POp-POWI - unison-POp-POWN + unison-POp-ADDN + unison-POp-ANDN + unison-POp-BLDS + unison-POp-CATS + unison-POp-CATT + unison-POp-CATB + unison-POp-CMPU + unison-POp-COMN + unison-POp-CONS + unison-POp-DBTX + unison-POp-DECI + unison-POp-INCI + unison-POp-DECN + unison-POp-INCN + unison-POp-DIVN + unison-POp-DRPB + unison-POp-DRPS + unison-POp-DRPT + unison-POp-EQLN + unison-POp-EQLT + unison-POp-EXPF + unison-POp-LEQT + unison-POp-EQLU + unison-POp-EROR + unison-POp-FTOT + unison-POp-IDXB + unison-POp-IDXS + unison-POp-IORN + unison-POp-ITOT + unison-POp-LEQN + ; unison-POp-LKUP + unison-POp-LZRO + unison-POp-MULN + unison-POp-MODN + unison-POp-NTOT + unison-POp-PAKT + unison-POp-SHLI + unison-POp-SHLN + unison-POp-SHRI + unison-POp-SHRN + unison-POp-SIZS + unison-POp-SIZT + unison-POp-SIZB + unison-POp-SNOC + unison-POp-SUBN + unison-POp-SUBI + unison-POp-TAKS + unison-POp-TAKT + unison-POp-TAKB + unison-POp-TRCE + unison-POp-PRNT + unison-POp-TTON + unison-POp-TTOI + unison-POp-TTOF + unison-POp-UPKT + unison-POp-XORN + unison-POp-VALU + unison-POp-VWLS + unison-POp-UCNS + unison-POp-USNC + unison-POp-FLTB + unison-POp-MAXF + unison-POp-MINF + unison-POp-MULF + unison-POp-MULI + unison-POp-NEGI + unison-POp-NTOF + unison-POp-POWF + unison-POp-POWI + unison-POp-POWN - unison-POp-UPKB - unison-POp-PAKB - unison-POp-ADDI - unison-POp-MULI - unison-POp-MODI - unison-POp-LEQI - unison-POp-LOGB - unison-POp-LOGF - unison-POp-POWN - unison-POp-VWRS - unison-POp-SPLL - unison-POp-SPLR + unison-POp-UPKB + unison-POp-PAKB + unison-POp-ADDI + unison-POp-MULI + unison-POp-MODI + unison-POp-LEQI + unison-POp-LOGB + unison-POp-LOGF + unison-POp-POWN + unison-POp-VWRS + unison-POp-SPLL + unison-POp-SPLR - unison-FOp-Bytes.gzip.compress - unison-FOp-Bytes.gzip.decompress - unison-FOp-Bytes.zlib.compress - unison-FOp-Bytes.zlib.decompress - unison-FOp-Bytes.toBase16 - unison-FOp-Bytes.toBase32 - unison-FOp-Bytes.toBase64 - unison-FOp-Bytes.toBase64UrlUnpadded - unison-FOp-Bytes.fromBase16 - unison-FOp-Bytes.fromBase32 - unison-FOp-Bytes.fromBase64 - unison-FOp-Bytes.fromBase64UrlUnpadded - unison-FOp-Bytes.encodeNat16be - unison-FOp-Bytes.encodeNat16le - unison-FOp-Bytes.encodeNat32be - unison-FOp-Bytes.encodeNat32le - unison-FOp-Bytes.encodeNat64be - unison-FOp-Bytes.encodeNat64le - unison-FOp-Bytes.decodeNat16be - unison-FOp-Bytes.decodeNat16le - unison-FOp-Bytes.decodeNat32be - unison-FOp-Bytes.decodeNat32le - unison-FOp-Bytes.decodeNat64be - unison-FOp-Bytes.decodeNat64le + unison-FOp-Bytes.gzip.compress + unison-FOp-Bytes.gzip.decompress + unison-FOp-Bytes.zlib.compress + unison-FOp-Bytes.zlib.decompress + unison-FOp-Bytes.toBase16 + unison-FOp-Bytes.toBase32 + unison-FOp-Bytes.toBase64 + unison-FOp-Bytes.toBase64UrlUnpadded + unison-FOp-Bytes.fromBase16 + unison-FOp-Bytes.fromBase32 + unison-FOp-Bytes.fromBase64 + unison-FOp-Bytes.fromBase64UrlUnpadded + unison-FOp-Bytes.encodeNat16be + unison-FOp-Bytes.encodeNat16le + unison-FOp-Bytes.encodeNat32be + unison-FOp-Bytes.encodeNat32le + unison-FOp-Bytes.encodeNat64be + unison-FOp-Bytes.encodeNat64le + unison-FOp-Bytes.decodeNat16be + unison-FOp-Bytes.decodeNat16le + unison-FOp-Bytes.decodeNat32be + unison-FOp-Bytes.decodeNat32le + unison-FOp-Bytes.decodeNat64be + unison-FOp-Bytes.decodeNat64le - unison-FOp-crypto.hashBytes - unison-FOp-crypto.hmacBytes - unison-FOp-crypto.HashAlgorithm.Md5 - unison-FOp-crypto.HashAlgorithm.Sha1 - unison-FOp-crypto.HashAlgorithm.Sha2_256 - unison-FOp-crypto.HashAlgorithm.Sha2_512 - unison-FOp-crypto.HashAlgorithm.Sha3_256 - unison-FOp-crypto.HashAlgorithm.Sha3_512 - unison-FOp-crypto.HashAlgorithm.Blake2s_256 - unison-FOp-crypto.HashAlgorithm.Blake2b_256 - unison-FOp-crypto.HashAlgorithm.Blake2b_512 + unison-FOp-crypto.hashBytes + unison-FOp-crypto.hmacBytes + unison-FOp-crypto.HashAlgorithm.Md5 + unison-FOp-crypto.HashAlgorithm.Sha1 + unison-FOp-crypto.HashAlgorithm.Sha2_256 + unison-FOp-crypto.HashAlgorithm.Sha2_512 + unison-FOp-crypto.HashAlgorithm.Sha3_256 + unison-FOp-crypto.HashAlgorithm.Sha3_512 + unison-FOp-crypto.HashAlgorithm.Blake2s_256 + unison-FOp-crypto.HashAlgorithm.Blake2b_256 + unison-FOp-crypto.HashAlgorithm.Blake2b_512 - unison-FOp-IO.clientSocket.impl.v3 - unison-FOp-IO.closeSocket.impl.v3 - unison-FOp-IO.socketReceive.impl.v3 - unison-FOp-IO.socketSend.impl.v3 - unison-FOp-IO.socketPort.impl.v3 - unison-FOp-IO.serverSocket.impl.v3 - unison-FOp-IO.socketAccept.impl.v3 - unison-FOp-IO.listen.impl.v3 - unison-FOp-Tls.ClientConfig.default - unison-FOp-Tls.ClientConfig.certificates.set - unison-FOp-Tls.decodeCert.impl.v3 - unison-FOp-Tls.encodeCert - unison-FOp-Tls.newServer.impl.v3 - unison-FOp-Tls.decodePrivateKey - unison-FOp-Tls.encodePrivateKey - unison-FOp-Tls.ServerConfig.default - unison-FOp-Tls.handshake.impl.v3 - unison-FOp-Tls.newClient.impl.v3 - unison-FOp-Tls.receive.impl.v3 - unison-FOp-Tls.send.impl.v3 - unison-FOp-Tls.terminate.impl.v3 + unison-FOp-IO.clientSocket.impl.v3 + unison-FOp-IO.closeSocket.impl.v3 + unison-FOp-IO.socketReceive.impl.v3 + unison-FOp-IO.socketSend.impl.v3 + unison-FOp-IO.socketPort.impl.v3 + unison-FOp-IO.serverSocket.impl.v3 + unison-FOp-IO.socketAccept.impl.v3 + unison-FOp-IO.listen.impl.v3 + unison-FOp-Tls.ClientConfig.default + unison-FOp-Tls.ClientConfig.certificates.set + unison-FOp-Tls.decodeCert.impl.v3 + unison-FOp-Tls.encodeCert + unison-FOp-Tls.newServer.impl.v3 + unison-FOp-Tls.decodePrivateKey + unison-FOp-Tls.encodePrivateKey + unison-FOp-Tls.ServerConfig.default + unison-FOp-Tls.handshake.impl.v3 + unison-FOp-Tls.newClient.impl.v3 + unison-FOp-Tls.receive.impl.v3 + unison-FOp-Tls.send.impl.v3 + unison-FOp-Tls.terminate.impl.v3 - ; fake builtins - builtin-murmurHashBytes) + ; fake builtins + builtin-murmurHashBytes) - (import (rnrs) - (only (srfi :13) string-reverse) - (racket performance-hint) - (only (racket flonum) - fl< - fl> - fl<= - fl>= - fl=) - (rename - (only (racket) - car - cdr - exact-integer? - exact-nonnegative-integer? - foldl - integer-length - bytes->string/utf-8 - string->bytes/utf-8 - exn:fail:contract? - file-stream-buffer-mode - with-handlers - match - modulo - quotient - regexp-match-positions - sequence-ref - vector-copy! - bytes-copy! - sub1 - add1 - exn:break? - exn:fail? - exn:fail:read? - exn:fail:filesystem? - exn:fail:network? - exn:fail:contract:divide-by-zero? - exn:fail:contract:non-fixnum-result?) - (car icar) (cdr icdr)) - (only (racket string) - string-contains? - string-replace) - (unison arithmetic) - (unison bytevector) - (unison core) - (only (unison boot) - define-unison - referent->termlink - termlink->referent - typelink->reference - clamp-integer - clamp-natural - wrap-natural - exn:bug->exception - raise-unison-exception - bit64 - bit63 - nbit63) - (unison data) - (unison data-info) - (unison math) - (unison chunked-seq) - (unison chunked-bytes) - (unison string-search) - (unison bytes-nat) - (unison pattern) - (unison crypto) - (unison io) - (unison io-handles) - (unison murmurhash) - (unison tls) - (unison tcp) - (unison udp) - (unison gzip) - (unison zlib) - (unison concurrent) - (racket random)) +(require + (except-in racket + eof + sleep) - (define-builtin-link Float.*) - (define-builtin-link Float.fromRepresentation) - (define-builtin-link Float.toRepresentation) - (define-builtin-link Float.ceiling) - (define-builtin-link Float.exp) - (define-builtin-link Float.log) - (define-builtin-link Float.max) - (define-builtin-link Float.min) - (define-builtin-link Float.tan) - (define-builtin-link Float.tanh) - (define-builtin-link Float.logBase) - (define-builtin-link Float.pow) - (define-builtin-link Float.>) - (define-builtin-link Float.<) - (define-builtin-link Float.>=) - (define-builtin-link Float.<=) - (define-builtin-link Float.==) - (define-builtin-link Int.pow) - (define-builtin-link Int.*) - (define-builtin-link Int.+) - (define-builtin-link Int.-) - (define-builtin-link Int./) - (define-builtin-link Int.>) - (define-builtin-link Int.<) - (define-builtin-link Int.>=) - (define-builtin-link Int.<=) - (define-builtin-link Int.==) - (define-builtin-link Int.isEven) - (define-builtin-link Int.isOdd) - (define-builtin-link Int.increment) - (define-builtin-link Int.negate) - (define-builtin-link Int.fromRepresentation) - (define-builtin-link Int.toRepresentation) - (define-builtin-link Int.signum) - (define-builtin-link Int.trailingZeros) - (define-builtin-link Int.popCount) - (define-builtin-link Nat.increment) - (define-builtin-link Nat.popCount) - (define-builtin-link Nat.toFloat) - (define-builtin-link Nat.trailingZeros) - (define-builtin-link Nat.+) - (define-builtin-link Nat.>) - (define-builtin-link Nat.<) - (define-builtin-link Nat.>=) - (define-builtin-link Nat.<=) - (define-builtin-link Nat.==) - (define-builtin-link Nat.drop) - (define-builtin-link Nat.isEven) - (define-builtin-link Nat.isOdd) - (define-builtin-link Text.indexOf) - (define-builtin-link Text.>) - (define-builtin-link Text.<) - (define-builtin-link Text.>=) - (define-builtin-link Text.<=) - (define-builtin-link Text.==) - (define-builtin-link Text.!=) - (define-builtin-link Bytes.indexOf) - (define-builtin-link IO.randomBytes) - (define-builtin-link IO.tryEval) - (define-builtin-link List.splitLeft) - (define-builtin-link List.splitRight) - (define-builtin-link Value.toBuiltin) - (define-builtin-link Value.fromBuiltin) - (define-builtin-link Code.fromGroup) - (define-builtin-link Code.toGroup) - (define-builtin-link TermLink.fromReferent) - (define-builtin-link TermLink.toReferent) - (define-builtin-link TypeLink.toReference) - (define-builtin-link IO.seekHandle.impl.v3) - (define-builtin-link IO.getLine.impl.v1) - (define-builtin-link IO.getSomeBytes.impl.v1) - (define-builtin-link IO.setBuffering.impl.v3) - (define-builtin-link IO.getBuffering.impl.v3) - (define-builtin-link IO.setEcho.impl.v1) - (define-builtin-link IO.isFileOpen.impl.v3) - (define-builtin-link IO.ready.impl.v1) - (define-builtin-link IO.process.call) - (define-builtin-link IO.getEcho.impl.v1) - (define-builtin-link IO.getArgs.impl.v1) - (define-builtin-link IO.getEnv.impl.v1) - (define-builtin-link IO.getChar.impl.v1) - (define-builtin-link IO.getCurrentDirectory.impl.v3) - (define-builtin-link IO.directoryContents.impl.v3) - (define-builtin-link IO.removeDirectory.impl.v3) - (define-builtin-link IO.renameFile.impl.v3) - (define-builtin-link IO.createTempDirectory.impl.v3) - (define-builtin-link IO.createDirectory.impl.v3) - (define-builtin-link IO.setCurrentDirectory.impl.v3) - (define-builtin-link IO.renameDirectory.impl.v3) - (define-builtin-link IO.fileExists.impl.v3) - (define-builtin-link IO.isDirectory.impl.v3) - (define-builtin-link IO.isFileEOF.impl.v3) - (define-builtin-link IO.isSeekable.impl.v3) - (define-builtin-link IO.handlePosition.impl.v3) - (define-builtin-link IO.systemTime.impl.v3) - (define-builtin-link IO.systemTimeMicroseconds.impl.v3) - (define-builtin-link Universal.==) - (define-builtin-link Universal.>) - (define-builtin-link Universal.<) - (define-builtin-link Universal.>=) - (define-builtin-link Universal.<=) - (define-builtin-link Universal.compare) - (define-builtin-link Universal.murmurHash) - (define-builtin-link Pattern.captureAs) - (define-builtin-link Pattern.many.corrected) - (define-builtin-link Pattern.isMatch) - (define-builtin-link Char.Class.is) - (define-builtin-link Scope.bytearrayOf) - (define-builtin-link unsafe.coerceAbilities) - (define-builtin-link Clock.internals.systemTimeZone.v1) + (only-in srfi/13 string-reverse) + rnrs/bytevectors-6 + racket/performance-hint + + (only-in racket/flonum + fl< + fl> + fl<= + fl>= + fl=) + + (only-in racket/string + string-contains? + string-replace) + + unison/arithmetic + unison/bytevector + unison/core + + (only-in unison/boot + define-unison-builtin + referent->termlink + termlink->referent + typelink->reference + clamp-integer + clamp-natural + wrap-natural + exn:bug->exception + raise-unison-exception + bit64 + bit63 + nbit63) + + unison/data + unison/data-info + unison/math + unison/chunked-seq + unison/chunked-bytes + unison/string-search + unison/bytes-nat + unison/pattern + unison/crypto + unison/io + unison/io-handles + unison/murmurhash + unison/tls + unison/tcp + unison/udp + unison/gzip + unison/zlib + unison/concurrent + racket/random) + +; (define-builtin-link Float.*) +; (define-builtin-link Float.fromRepresentation) +; (define-builtin-link Float.toRepresentation) +; (define-builtin-link Float.ceiling) +; (define-builtin-link Float.exp) +; (define-builtin-link Float.log) +; (define-builtin-link Float.max) +; (define-builtin-link Float.min) +; (define-builtin-link Float.tan) +; (define-builtin-link Float.tanh) +; (define-builtin-link Float.logBase) +; (define-builtin-link Float.pow) +; (define-builtin-link Float.>) +; (define-builtin-link Float.<) +; (define-builtin-link Float.>=) +; (define-builtin-link Float.<=) +; (define-builtin-link Float.==) +; (define-builtin-link Int.pow) +; (define-builtin-link Int.*) +; (define-builtin-link Int.+) +; (define-builtin-link Int.-) +; (define-builtin-link Int./) +; (define-builtin-link Int.>) +; (define-builtin-link Int.<) +; (define-builtin-link Int.>=) +; (define-builtin-link Int.<=) +; (define-builtin-link Int.==) +; (define-builtin-link Int.isEven) +; (define-builtin-link Int.isOdd) +; (define-builtin-link Int.increment) +; (define-builtin-link Int.negate) +; (define-builtin-link Int.fromRepresentation) +; (define-builtin-link Int.toRepresentation) +; (define-builtin-link Int.signum) +; (define-builtin-link Int.trailingZeros) +; (define-builtin-link Int.popCount) +; (define-builtin-link Nat.increment) +; (define-builtin-link Nat.popCount) +; (define-builtin-link Nat.toFloat) +; (define-builtin-link Nat.trailingZeros) +; (define-builtin-link Nat.+) +; (define-builtin-link Nat.>) +; (define-builtin-link Nat.<) +; (define-builtin-link Nat.>=) +; (define-builtin-link Nat.<=) +; (define-builtin-link Nat.==) +; (define-builtin-link Nat.drop) +; (define-builtin-link Nat.isEven) +; (define-builtin-link Nat.isOdd) +; (define-builtin-link Text.indexOf) +; (define-builtin-link Text.>) +; (define-builtin-link Text.<) +; (define-builtin-link Text.>=) +; (define-builtin-link Text.<=) +; (define-builtin-link Text.==) +; (define-builtin-link Text.!=) +; (define-builtin-link Bytes.indexOf) +; (define-builtin-link IO.randomBytes) +; (define-builtin-link IO.tryEval) +; (define-builtin-link List.splitLeft) +; (define-builtin-link List.splitRight) +; (define-builtin-link Value.toBuiltin) +; (define-builtin-link Value.fromBuiltin) +; (define-builtin-link Code.fromGroup) +; (define-builtin-link Code.toGroup) +; (define-builtin-link TermLink.fromReferent) +; (define-builtin-link TermLink.toReferent) +; (define-builtin-link TypeLink.toReference) +; (define-builtin-link IO.seekHandle.impl.v3) +; (define-builtin-link IO.getLine.impl.v1) +; (define-builtin-link IO.getSomeBytes.impl.v1) +; (define-builtin-link IO.setBuffering.impl.v3) +; (define-builtin-link IO.getBuffering.impl.v3) +; (define-builtin-link IO.setEcho.impl.v1) +; (define-builtin-link IO.isFileOpen.impl.v3) +; (define-builtin-link IO.ready.impl.v1) +; (define-builtin-link IO.process.call) +; (define-builtin-link IO.getEcho.impl.v1) +; (define-builtin-link IO.getArgs.impl.v1) +; (define-builtin-link IO.getEnv.impl.v1) +; (define-builtin-link IO.getChar.impl.v1) +; (define-builtin-link IO.getCurrentDirectory.impl.v3) +; (define-builtin-link IO.directoryContents.impl.v3) +; (define-builtin-link IO.removeDirectory.impl.v3) +; (define-builtin-link IO.renameFile.impl.v3) +; (define-builtin-link IO.createTempDirectory.impl.v3) +; (define-builtin-link IO.createDirectory.impl.v3) +; (define-builtin-link IO.setCurrentDirectory.impl.v3) +; (define-builtin-link IO.renameDirectory.impl.v3) +; (define-builtin-link IO.fileExists.impl.v3) +; (define-builtin-link IO.isDirectory.impl.v3) +; (define-builtin-link IO.isFileEOF.impl.v3) +; (define-builtin-link IO.isSeekable.impl.v3) +; (define-builtin-link IO.handlePosition.impl.v3) +; (define-builtin-link IO.systemTime.impl.v3) +; (define-builtin-link IO.systemTimeMicroseconds.impl.v3) +; (define-builtin-link Universal.==) +; (define-builtin-link Universal.>) +; (define-builtin-link Universal.<) +; (define-builtin-link Universal.>=) +; (define-builtin-link Universal.<=) +; (define-builtin-link Universal.compare) +(define-builtin-link Universal.murmurHash) +; (define-builtin-link Pattern.captureAs) +; (define-builtin-link Pattern.many.corrected) +; (define-builtin-link Pattern.isMatch) +; (define-builtin-link Char.Class.is) +; (define-builtin-link Scope.bytearrayOf) +; (define-builtin-link unsafe.coerceAbilities) +(define-builtin-link Clock.internals.systemTimeZone.v1) + +(begin-encourage-inline + (define-unison-builtin (builtin-Value.toBuiltin v) (unison-quote v)) + (define-unison-builtin (builtin-Value.fromBuiltin v) + (unison-quote-val v)) + (define-unison-builtin (builtin-Code.fromGroup sg) (unison-code sg)) + (define-unison-builtin (builtin-Code.toGroup co) + (unison-code-rep co)) + (define-unison-builtin (builtin-TermLink.fromReferent rf) + (referent->termlink rf)) + (define-unison-builtin (builtin-TermLink.toReferent tl) + (termlink->referent tl)) + (define-unison-builtin (builtin-TypeLink.toReference tl) + (typelink->reference tl)) + (define-unison-builtin (builtin-murmurHashBytes bs) + (murmurhash-bytes (chunked-bytes->bytes bs))) + + (define-unison-builtin (builtin-IO.randomBytes n) + (bytes->chunked-bytes (crypto-random-bytes n))) + + (define-unison-builtin (builtin-List.splitLeft n s) + (match (unison-POp-SPLL n s) + [(unison-sum 0 fs) ref-seqview-empty] + [(unison-sum 1 (list l r)) (ref-seqview-elem l r)])) + + (define-unison-builtin (builtin-List.splitRight n s) + (match (unison-POp-SPLR n s) + [(unison-sum 0 fs) ref-seqview-empty] + [(unison-sum 1 (list l r)) (ref-seqview-elem l r)])) + + (define-unison-builtin (builtin-Float.> x y) (fl> x y)) + (define-unison-builtin (builtin-Float.< x y) (fl< x y)) + (define-unison-builtin (builtin-Float.>= x y) (fl>= x y)) + (define-unison-builtin (builtin-Float.<= x y) (fl<= x y)) + (define-unison-builtin (builtin-Float.== x y) (fl= x y)) + + (define-unison-builtin (builtin-Int.> x y) (> x y)) + (define-unison-builtin (builtin-Int.< x y) (< x y)) + (define-unison-builtin (builtin-Int.>= x y) (>= x y)) + (define-unison-builtin (builtin-Int.<= x y) (<= x y)) + (define-unison-builtin (builtin-Int.== x y) (= x y)) + (define-unison-builtin (builtin-Int.isEven x) (even? x)) + (define-unison-builtin (builtin-Int.isOdd x) (odd? x)) + + (define-unison-builtin (builtin-Nat.> x y) (> x y)) + (define-unison-builtin (builtin-Nat.< x y) (< x y)) + (define-unison-builtin (builtin-Nat.>= x y) (>= x y)) + (define-unison-builtin (builtin-Nat.<= x y) (<= x y)) (begin-encourage-inline - (define-unison (builtin-Value.toBuiltin v) (unison-quote v)) - (define-unison (builtin-Value.fromBuiltin v) - (unison-quote-val v)) - (define-unison (builtin-Code.fromGroup sg) (unison-code sg)) - (define-unison (builtin-Code.toGroup co) - (unison-code-rep co)) - (define-unison (builtin-TermLink.fromReferent rf) - (referent->termlink rf)) - (define-unison (builtin-TermLink.toReferent tl) - (termlink->referent tl)) - (define-unison (builtin-TypeLink.toReference tl) - (typelink->reference tl)) - (define-unison (builtin-murmurHashBytes bs) - (murmurhash-bytes (chunked-bytes->bytes bs))) - - (define-unison (builtin-IO.randomBytes n) - (bytes->chunked-bytes (crypto-random-bytes n))) - - (define-unison (builtin-List.splitLeft n s) - (match (unison-POp-SPLL n s) - [(unison-sum 0 fs) ref-seqview-empty] - [(unison-sum 1 (list l r)) (ref-seqview-elem l r)])) - - (define-unison (builtin-List.splitRight n s) - (match (unison-POp-SPLR n s) - [(unison-sum 0 fs) ref-seqview-empty] - [(unison-sum 1 (list l r)) (ref-seqview-elem l r)])) - - (define-unison (builtin-Float.> x y) (fl> x y)) - (define-unison (builtin-Float.< x y) (fl< x y)) - (define-unison (builtin-Float.>= x y) (fl>= x y)) - (define-unison (builtin-Float.<= x y) (fl<= x y)) - (define-unison (builtin-Float.== x y) (fl= x y)) - - (define-unison (builtin-Int.> x y) (> x y)) - (define-unison (builtin-Int.< x y) (< x y)) - (define-unison (builtin-Int.>= x y) (>= x y)) - (define-unison (builtin-Int.<= x y) (<= x y)) - (define-unison (builtin-Int.== x y) (= x y)) - (define-unison (builtin-Int.isEven x) (even? x)) - (define-unison (builtin-Int.isOdd x) (odd? x)) - - (define-unison (builtin-Nat.> x y) (> x y)) - (define-unison (builtin-Nat.< x y) (< x y)) - (define-unison (builtin-Nat.>= x y) (>= x y)) - (define-unison (builtin-Nat.<= x y) (<= x y)) - (begin-encourage-inline - (define-unison (builtin-Nat.== x y) (= x y))) - - (define-unison (builtin-Nat.isEven x) (even? x)) - (define-unison (builtin-Nat.isOdd x) (odd? x)) - - ; Note: chunked-string x y) - (not (chunked-string= x y) (chunked-string x y) - (case (universal-compare x y) [(>) #t] [else #f])) - (define-unison (builtin-Universal.< x y) - (case (universal-compare x y) [(<) #t] [else #f])) - (define-unison (builtin-Universal.<= x y) - (case (universal-compare x y) [(>) #f] [else #t])) - (define-unison (builtin-Universal.>= x y) - (case (universal-compare x y) [(<) #f] [else #t])) - (define-unison (builtin-Universal.compare x y) - (case (universal-compare x y) - [(>) 1] [(<) -1] [else 0])) - - (define-unison (builtin-Scope.bytearrayOf i n) - (make-bytevector n i)) - - (define-builtin-link Link.Type.toText) - (define-unison (builtin-Link.Type.toText ln) - (string->chunked-string (typelink->string ln))) - - (define-builtin-link Link.Term.toText) - (define-unison (builtin-Link.Term.toText ln) - (string->chunked-string (termlink->string ln))) - - (define-unison (builtin-Char.Class.is cc c) - (pattern-match? cc (string->chunked-string (string c)))) - - (define-unison (builtin-Pattern.captureAs c p) - (capture-as c p)) - - (define-unison (builtin-Pattern.many.corrected p) (many p)) - - (define-unison (builtin-Pattern.isMatch p s) - (pattern-match? p s)) - - (define-unison (builtin-unsafe.coerceAbilities f) f) - - (define (unison-POp-UPKB bs) - (build-chunked-list - (chunked-bytes-length bs) - (lambda (i) (chunked-bytes-ref bs i)))) - - (define (unison-POp-ADDI i j) (clamp-integer (+ i j))) - (define (unison-POp-MULI i j) (clamp-integer (* i j))) - (define (unison-POp-MODI i j) (clamp-integer (modulo i j))) - (define (unison-POp-LEQI a b) (bool (<= a b))) - (define (unison-POp-POWN m n) (clamp-natural (expt m n))) - (define unison-POp-LOGF log) - - (define (reify-exn thunk) - (guard - (e [else - (sum 0 '() (exception->string e) ref-unit-unit)]) - (thunk))) - - ; Core implemented primops, upon which primops-in-unison can be built. - (define (unison-POp-ADDN m n) (clamp-natural (+ m n))) - (define (unison-POp-ANDN m n) (bitwise-and m n)) - (define unison-POp-BLDS - (lambda args-list - (fold-right (lambda (e l) (chunked-list-add-first l e)) empty-chunked-list args-list))) - (define (unison-POp-CATS l r) (chunked-list-append l r)) - (define (unison-POp-CATT l r) (chunked-string-append l r)) - (define (unison-POp-CATB l r) (chunked-bytes-append l r)) - (define (unison-POp-CMPU l r) (ord (universal-compare l r))) - (define (unison-POp-COMN n) (wrap-natural (bitwise-not n))) - (define (unison-POp-CONS x xs) (chunked-list-add-first xs x)) - (define (unison-POp-DECI n) (clamp-integer (sub1 n))) - (define (unison-POp-INCI n) (clamp-integer (add1 n))) - (define (unison-POp-DECN n) (wrap-natural (sub1 n))) - (define (unison-POp-INCN n) (clamp-natural (add1 n))) - (define (unison-POp-DIVN m n) (quotient m n)) - (define (unison-POp-DRPB n bs) (chunked-bytes-drop bs n)) - (define (unison-POp-DRPS n l) (chunked-list-drop l n)) - (define (unison-POp-DRPT n t) (chunked-string-drop t n)) - (define (unison-POp-EQLN m n) (bool (= m n))) - (define (unison-POp-EQLT s t) (bool (equal? s t))) - (define (unison-POp-LEQT s t) (bool (chunked-stringstring fnm)]) - (put-string p snm) - (put-string p ": ") - (display (describe-value x) p) - (raise (make-exn:bug snm x)))) - (define (unison-POp-FTOT f) - (define base (number->string f)) - (define dotted - (if (string-contains? base ".") - base - (string-replace base "e" ".0e"))) - (string->chunked-string - (string-replace dotted "+" ""))) - (define (unison-POp-IDXB n bs) - (guard (x [else none]) - (some (chunked-bytes-ref bs n)))) - (define (unison-POp-IDXS n l) - (guard (x [else none]) - (some (chunked-list-ref l n)))) - (define (unison-POp-IORN m n) (bitwise-ior m n)) - (define (unison-POp-ITOT n) - (string->chunked-string (number->string n))) - (define (unison-POp-LEQN m n) (bool (fx<=? m n))) - (define (unison-POp-LZRO m) (- 64 (integer-length m))) - (define (unison-POp-MULN m n) (clamp-natural (* m n))) - (define (unison-POp-MODN m n) (modulo m n)) - (define (unison-POp-NTOT n) (string->chunked-string (number->string n))) - (define (unison-POp-PAKB l) - (build-chunked-bytes - (chunked-list-length l) - (lambda (i) (chunked-list-ref l i)))) - (define (unison-POp-PAKT l) - (build-chunked-string - (chunked-list-length l) - (lambda (i) (chunked-list-ref l i)))) - (define (unison-POp-SHLI i k) - (clamp-integer (bitwise-arithmetic-shift-left i k))) - (define (unison-POp-SHLN n k) - (clamp-natural (bitwise-arithmetic-shift-left n k))) - (define (unison-POp-SHRI i k) (bitwise-arithmetic-shift-right i k)) - (define (unison-POp-SHRN n k) (bitwise-arithmetic-shift-right n k)) - (define (unison-POp-SIZS l) (chunked-list-length l)) - (define (unison-POp-SIZT t) (chunked-string-length t)) - (define (unison-POp-SIZB b) (chunked-bytes-length b)) - (define (unison-POp-SNOC xs x) (chunked-list-add-last xs x)) - (define (unison-POp-SUBN m n) (clamp-integer (- m n))) - (define (unison-POp-SUBI m n) (clamp-integer (- m n))) - (define (unison-POp-TAKS n s) (chunked-list-take s n)) - (define (unison-POp-TAKT n t) (chunked-string-take t n)) - (define (unison-POp-TAKB n t) (chunked-bytes-take t n)) - - (define (->optional v) - (if v - (ref-optional-some v) - ref-optional-none)) - - (define-unison (builtin-Text.indexOf n h) - (->optional (chunked-string-index-of h n))) - (define-unison (builtin-Bytes.indexOf n h) - (->optional (chunked-bytes-index-of h n))) - - ;; TODO currently only runs in low-level tracing support - (define (unison-POp-DBTX x) - (sum 1 (string->chunked-string (describe-value x)))) - - (define (unison-FOp-Handle.toText h) - (string->chunked-string (describe-value h))) - (define (unison-FOp-Socket.toText s) - (string->chunked-string (describe-value s))) - (define (unison-FOp-ThreadId.toText tid) - (string->chunked-string (describe-value tid))) - - (define (unison-POp-TRCE s x) - (display "trace: ") - (display (chunked-string->string s)) - (newline) - (display (describe-value x)) - (newline)) - (define (unison-POp-PRNT s) - (display (chunked-string->string s)) - (newline)) - (define (unison-POp-TTON s) - (let ([mn (string->number (chunked-string->string s))]) - (if (and (exact-nonnegative-integer? mn) (< mn bit64)) - (some mn) - none))) - (define (unison-POp-TTOI s) - (let ([mn (string->number (chunked-string->string s))]) - (if (and (exact-integer? mn) (>= mn nbit63) (< mn bit63)) - (some mn) - none))) - (define (unison-POp-TTOF s) - (let ([mn (string->number (chunked-string->string s))]) - (if mn (some mn) none))) - (define (unison-POp-UPKT s) - (build-chunked-list - (chunked-string-length s) - (lambda (i) (chunked-string-ref s i)))) - (define (unison-POp-VWLS l) - (if (chunked-list-empty? l) - (sum 0) - (let-values ([(t h) (chunked-list-pop-first l)]) - (sum 1 h t)))) - (define (unison-POp-VWRS l) - (if (chunked-list-empty? l) - (sum 0) - (let-values ([(t h) (chunked-list-pop-last l)]) - (sum 1 t h)))) - (define (unison-POp-SPLL i s) - (if (< (chunked-list-length s) i) - (sum 0) - (let-values ([(l r) (chunked-list-split-at s i)]) - (sum 1 l r)))) - (define (unison-POp-SPLR i s) ; TODO write test that stresses this - (let ([len (chunked-list-length s) ]) - (if (< len i) - (sum 0) - (let-values ([(l r) (chunked-list-split-at s (- len i))]) - (sum 1 l r))))) - - (define (unison-POp-UCNS s) - (if (chunked-string-empty? s) - (sum 0) - (let-values ([(t h) (chunked-string-pop-first s)]) - (sum 1 (char h) t)))) - - (define (unison-POp-USNC s) - (if (chunked-string-empty? s) - (sum 0) - (let-values ([(t h) (chunked-string-pop-last s)]) - (sum 1 t (char h))))) - - ;; TODO flatten operation on Bytes is a no-op for now (and possibly ever) - (define (unison-POp-FLTB b) b) - - (define (unison-POp-XORN m n) (bitwise-xor m n)) - (define (unison-POp-VALU c) (decode-value c)) - - (define (unison-FOp-ImmutableByteArray.read16be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u16-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read24be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u24-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read32be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u32-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read40be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u40-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read48be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u48-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read56be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u56-ref bs n 'big))))) - - (define (unison-FOp-ImmutableByteArray.read64be bs n) - (reify-exn - (lambda () - (sum 1 (bytevector-u64-ref bs n 'big))))) - - (define unison-FOp-internal.dataTag unison-data-tag) - - (define (unison-FOp-IO.getBytes.impl.v3 p n) - (reify-exn - (lambda () - (right - (bytes->chunked-bytes - (get-bytevector-n p n)))))) - - (define (unison-FOp-IO.putBytes.impl.v3 p bs) - (begin - (put-bytevector p (chunked-bytes->bytes bs)) - (flush-output-port p) - (sum 1 #f))) - - (define (unison-FOp-Char.toText c) (string->chunked-string (string (integer->char c)))) - - (define (unison-FOp-IO.getArgs.impl.v1) - (sum 1 (cdr (command-line)))) - - (define unison-FOp-IO.systemTimeMicroseconds.v1 current-microseconds) - - ;; TODO should we convert Bytes -> Text directly without the intermediate conversions? - (define (unison-FOp-Text.fromUtf8.impl.v3 b) - (with-handlers - ([exn:fail:contract? - (lambda (e) - (exception - ref-iofailure:typelink - (string->chunked-string - (string-append - "Invalid UTF-8 stream: " - (describe-value b))) - (exception->string e)))]) - (right (string->chunked-string (bytes->string/utf-8 (chunked-bytes->bytes b)))))) - - ;; TODO should we convert Text -> Bytes directly without the intermediate conversions? - (define (unison-FOp-Text.toUtf8 s) - (bytes->chunked-bytes (string->bytes/utf-8 (chunked-string->string s)))) - - (define-unison (builtin-IO.isFileEOF.impl.v3 p) - (ref-either-right (port-eof? p))) - - (define (unison-FOp-IO.closeFile.impl.v3 h) - (if (input-port? h) - (close-input-port h) - (close-output-port h)) - (right none)) - - (define (unison-FOp-Text.repeat n t) - (let loop ([cnt 0] - [acc empty-chunked-string]) - (if (= cnt n) - acc - (loop (+ cnt 1) (chunked-string-append acc t))))) - - (define (unison-FOp-Text.reverse s) - (chunked-string-foldMap-chunks - s - string-reverse - (lambda (acc c) (chunked-string-append c acc)))) - - (define (unison-FOp-Text.toLowercase s) - (chunked-string-foldMap-chunks s string-downcase chunked-string-append)) - - (define (unison-FOp-Text.toUppercase s) - (chunked-string-foldMap-chunks s string-upcase chunked-string-append)) - - (define (unison-FOp-Pattern.run p s) - (let* ([r (pattern-match p s)]) - (if r (sum 1 (icdr r) (icar r)) (sum 0)))) - - (define (unison-FOp-Pattern.isMatch p s) (bool (pattern-match? p s))) - (define (unison-FOp-Pattern.many p) (many p)) - (define (unison-FOp-Pattern.capture p) (capture p)) - (define (unison-FOp-Pattern.join ps) - (join* ps)) - (define (unison-FOp-Pattern.or p1 p2) (choice p1 p2)) - (define (unison-FOp-Pattern.replicate n m p) (replicate p n m)) - - (define (unison-FOp-Text.patterns.digit) digit) - (define (unison-FOp-Text.patterns.letter) letter) - (define (unison-FOp-Text.patterns.punctuation) punctuation) - (define (unison-FOp-Text.patterns.charIn cs) (chars cs)) - (define (unison-FOp-Text.patterns.notCharIn cs) (not-chars cs)) - (define (unison-FOp-Text.patterns.anyChar) any-char) - (define (unison-FOp-Text.patterns.space) space) - (define (unison-FOp-Text.patterns.charRange a z) (char-range (integer->char a) (integer->char z))) - (define (unison-FOp-Text.patterns.notCharRange a z) (not-char-range (integer->char a) (integer->char z))) - (define (unison-FOp-Text.patterns.literal s) (literal s)) - (define (unison-FOp-Text.patterns.eof) eof) - (define (unison-FOp-Text.patterns.char cc) cc) - (define (unison-FOp-Char.Class.is cc c) - (unison-FOp-Pattern.isMatch cc (unison-FOp-Char.toText c))) - (define (unison-FOp-Char.Class.any) (unison-FOp-Text.patterns.anyChar)) - (define (unison-FOp-Char.Class.punctuation) - (unison-FOp-Text.patterns.punctuation)) - (define (unison-FOp-Char.Class.letter) (unison-FOp-Text.patterns.letter)) - (define (unison-FOp-Char.Class.alphanumeric) alphanumeric) - (define (unison-FOp-Char.Class.upper) upper) - (define (unison-FOp-Char.Class.lower) lower) - (define (unison-FOp-Char.Class.number) number) - (define (unison-FOp-Char.Class.symbol) symbol) - (define (unison-FOp-Char.Class.whitespace) space) - (define (unison-FOp-Char.Class.control) control) - (define (unison-FOp-Char.Class.printable) printable) - (define (unison-FOp-Char.Class.mark) mark) - (define (unison-FOp-Char.Class.separator) separator) - (define (unison-FOp-Char.Class.or p1 p2) (char-class-or p1 p2)) - (define (unison-FOp-Char.Class.range a z) - (unison-FOp-Text.patterns.charRange a z)) - (define (unison-FOp-Char.Class.anyOf cs) (unison-FOp-Text.patterns.charIn cs)) - (define (unison-FOp-Char.Class.and cc1 cc2) (char-class-and cc1 cc2)) - (define (unison-FOp-Char.Class.not cc) (char-class-not cc)) - - (define (catch-array thunk) - (reify-exn thunk)) - - (define (unison-FOp-ImmutableArray.read vec i) - (catch-array - (lambda () - (sum 1 (vector-ref vec i))))) - - (define (unison-FOp-ImmutableArray.copyTo! dst doff src soff n) - (catch-array - (lambda () - (vector-copy! dst doff src soff n) - (sum 1)))) - - (define (unison-FOp-MutableArray.copyTo! dst doff src soff l) - (catch-array - (lambda () - (vector-copy! dst doff src soff l) - (sum 1)))) - - (define unison-FOp-MutableArray.freeze! freeze-vector!) - - (define unison-FOp-MutableArray.freeze freeze-subvector) - - (define (unison-FOp-MutableArray.read src i) - (catch-array - (lambda () - (sum 1 (vector-ref src i))))) - - (define (unison-FOp-MutableArray.write dst i x) - (catch-array - (lambda () - (vector-set! dst i x) - (sum 1)))) - - (define (unison-FOp-ImmutableByteArray.copyTo! dst doff src soff n) - (catch-array - (lambda () - (bytes-copy! dst doff src soff n) - (sum 1)))) - - (define (unison-FOp-ImmutableByteArray.read8 arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u8-ref arr i))))) - - (define (unison-FOp-MutableByteArray.copyTo! dst doff src soff l) - (catch-array - (lambda () - (bytes-copy! dst doff src soff l) - (sum 1)))) - - (define unison-FOp-MutableByteArray.freeze! freeze-bytevector!) - - (define (unison-FOp-MutableByteArray.write8 arr i b) - (catch-array - (lambda () - (bytevector-u8-set! arr i b) - (sum 1)))) - - (define (unison-FOp-MutableByteArray.write16be arr i b) - (catch-array - (lambda () - (bytevector-u16-set! arr i b 'big) - (sum 1)))) - - (define (unison-FOp-MutableByteArray.write32be arr i b) - (catch-array - (lambda () - (bytevector-u32-set! arr i b 'big) - (sum 1)))) - - (define (unison-FOp-MutableByteArray.write64be arr i b) - (catch-array - (lambda () - (bytevector-u64-set! arr i b 'big) - (sum 1)))) - - (define (unison-FOp-MutableByteArray.read8 arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u8-ref arr i))))) - - (define (unison-FOp-MutableByteArray.read16be arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u16-ref arr i 'big))))) - - (define (unison-FOp-MutableByteArray.read24be arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u24-ref arr i 'big))))) - - (define (unison-FOp-MutableByteArray.read32be arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u32-ref arr i 'big))))) - - (define (unison-FOp-MutableByteArray.read40be arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u40-ref arr i 'big))))) - - (define (unison-FOp-MutableByteArray.read64be arr i) - (catch-array - (lambda () - (sum 1 (bytevector-u64-ref arr i 'big))))) - - (define (unison-FOp-Scope.bytearray n) (make-bytevector n)) - (define (unison-FOp-IO.bytearray n) (make-bytevector n)) - - (define (unison-FOp-Scope.array n) (make-vector n)) - (define (unison-FOp-IO.array n) (make-vector n)) - - (define (unison-FOp-Scope.bytearrayOf b n) (make-bytevector n b)) - (define (unison-FOp-IO.bytearrayOf b n) (make-bytevector n b)) - - (define (unison-FOp-Scope.arrayOf v n) (make-vector n v)) - (define (unison-FOp-IO.arrayOf v n) (make-vector n v)) - - (define unison-FOp-MutableByteArray.length bytevector-length) - (define unison-FOp-ImmutableByteArray.length bytevector-length) - (define unison-FOp-MutableByteArray.size bytevector-length) - (define unison-FOp-ImmutableByteArray.size bytevector-length) - (define unison-FOp-MutableArray.size vector-length) - (define unison-FOp-ImmutableArray.size vector-length) - - (define (unison-POp-FORK thunk) (fork thunk)) - (define (unison-FOp-IO.delay.impl.v3 micros) (sleep micros)) - (define (unison-FOp-IO.kill.impl.v3 threadId) (kill threadId)) - (define (unison-FOp-Scope.ref a) (ref-new a)) - (define (unison-FOp-IO.ref a) (ref-new a)) - (define (unison-FOp-Ref.read ref) (ref-read ref)) - (define (unison-FOp-Ref.write ref a) (ref-write ref a)) - (define (unison-FOp-Ref.readForCas ref) (ref-read ref)) - (define (unison-FOp-Ref.Ticket.read ticket) ticket) - (define (unison-FOp-Ref.cas ref ticket value) (ref-cas ref ticket value)) - (define (unison-FOp-Promise.new) (promise-new)) - (define (unison-FOp-Promise.read promise) (promise-read promise)) - (define (unison-FOp-Promise.tryRead promise) (promise-try-read promise)) - (define (unison-FOp-Promise.write promise a) (promise-write promise a))) - - - (define (exn:io? e) - (or (exn:fail:read? e) - (exn:fail:filesystem? e) - (exn:fail:network? e))) - - (define (exn:arith? e) - (or (exn:fail:contract:divide-by-zero? e) - (exn:fail:contract:non-fixnum-result? e))) - - (define-unison (builtin-IO.tryEval thunk) + (define-unison-builtin (builtin-Nat.== x y) (= x y))) + + (define-unison-builtin (builtin-Nat.isEven x) (even? x)) + (define-unison-builtin (builtin-Nat.isOdd x) (odd? x)) + + ; Note: chunked-string x y) + (not (chunked-string= x y) (chunked-string x y) + (case (universal-compare x y) [(>) #t] [else #f])) + (define-unison-builtin (builtin-Universal.< x y) + (case (universal-compare x y) [(<) #t] [else #f])) + (define-unison-builtin (builtin-Universal.<= x y) + (case (universal-compare x y) [(>) #f] [else #t])) + (define-unison-builtin (builtin-Universal.>= x y) + (case (universal-compare x y) [(<) #f] [else #t])) + (define-unison-builtin (builtin-Universal.compare x y) + (case (universal-compare x y) + [(>) 1] [(<) -1] [else 0])) + + (define-unison-builtin (builtin-Scope.bytearrayOf i n) + (make-bytes n i)) + + ; (define-builtin-link Link.Type.toText) + (define-unison-builtin (builtin-Link.Type.toText ln) + (string->chunked-string (typelink->string ln))) + + ; (define-builtin-link Link.Term.toText) + (define-unison-builtin (builtin-Link.Term.toText ln) + (string->chunked-string (termlink->string ln))) + + (define-unison-builtin (builtin-Char.Class.is cc c) + (pattern-match? cc (string->chunked-string (string c)))) + + (define-unison-builtin (builtin-Pattern.captureAs c p) + (capture-as c p)) + + (define-unison-builtin (builtin-Pattern.many.corrected p) (many p)) + + (define-unison-builtin (builtin-Pattern.isMatch p s) + (pattern-match? p s)) + + (define-unison-builtin (builtin-unsafe.coerceAbilities f) f) + + (define (unison-POp-UPKB bs) + (build-chunked-list + (chunked-bytes-length bs) + (lambda (i) (chunked-bytes-ref bs i)))) + + (define (unison-POp-ADDI i j) (clamp-integer (+ i j))) + (define (unison-POp-MULI i j) (clamp-integer (* i j))) + (define (unison-POp-MODI i j) (clamp-integer (modulo i j))) + (define (unison-POp-LEQI a b) (bool (<= a b))) + (define (unison-POp-POWN m n) (clamp-natural (expt m n))) + (define unison-POp-LOGF log) + + (define (reify-exn thunk) (with-handlers - ([exn:break? + ([exn:fail:contract? + (lambda (e) + (sum 0 '() (exception->string e) ref-unit-unit))]) + (thunk))) + + ; Core implemented primops, upon which primops-in-unison can be built. + (define (unison-POp-ADDN m n) (clamp-natural (+ m n))) + (define (unison-POp-ANDN m n) (bitwise-and m n)) + (define unison-POp-BLDS + (lambda args-list + (foldr (lambda (e l) (chunked-list-add-first l e)) empty-chunked-list args-list))) + (define (unison-POp-CATS l r) (chunked-list-append l r)) + (define (unison-POp-CATT l r) (chunked-string-append l r)) + (define (unison-POp-CATB l r) (chunked-bytes-append l r)) + (define (unison-POp-CMPU l r) (ord (universal-compare l r))) + (define (unison-POp-COMN n) (wrap-natural (bitwise-not n))) + (define (unison-POp-CONS x xs) (chunked-list-add-first xs x)) + (define (unison-POp-DECI n) (clamp-integer (sub1 n))) + (define (unison-POp-INCI n) (clamp-integer (add1 n))) + (define (unison-POp-DECN n) (wrap-natural (sub1 n))) + (define (unison-POp-INCN n) (clamp-natural (add1 n))) + (define (unison-POp-DIVN m n) (quotient m n)) + (define (unison-POp-DRPB n bs) (chunked-bytes-drop bs n)) + (define (unison-POp-DRPS n l) (chunked-list-drop l n)) + (define (unison-POp-DRPT n t) (chunked-string-drop t n)) + (define (unison-POp-EQLN m n) (bool (= m n))) + (define (unison-POp-EQLT s t) (bool (equal? s t))) + (define (unison-POp-LEQT s t) (bool (chunked-stringstring fnm)]) + (raise (make-exn:bug snm x)))) + (define (unison-POp-FTOT f) + (define base (number->string f)) + (define dotted + (if (string-contains? base ".") + base + (string-replace base "e" ".0e"))) + (string->chunked-string + (string-replace dotted "+" ""))) + (define (unison-POp-IDXB n bs) + (with-handlers + ([exn:fail:contract? (lambda (e) none)]) + (some (chunked-bytes-ref bs n)))) + (define (unison-POp-IDXS n l) + (with-handlers + ([exn:fail:contract? (lambda (x) none)]) + (some (chunked-list-ref l n)))) + (define (unison-POp-IORN m n) (bitwise-ior m n)) + (define (unison-POp-ITOT n) + (string->chunked-string (number->string n))) + (define (unison-POp-LEQN m n) (bool (<= m n))) + (define (unison-POp-LZRO m) (- 64 (integer-length m))) + (define (unison-POp-MULN m n) (clamp-natural (* m n))) + (define (unison-POp-MODN m n) (modulo m n)) + (define (unison-POp-NTOT n) (string->chunked-string (number->string n))) + (define (unison-POp-PAKB l) + (build-chunked-bytes + (chunked-list-length l) + (lambda (i) (chunked-list-ref l i)))) + (define (unison-POp-PAKT l) + (build-chunked-string + (chunked-list-length l) + (lambda (i) (chunked-list-ref l i)))) + (define (unison-POp-SHLI i k) + (clamp-integer (arithmetic-shift i k))) + (define (unison-POp-SHLN n k) + (clamp-natural (arithmetic-shift n k))) + (define (unison-POp-SHRI i k) (arithmetic-shift i (- k))) + (define (unison-POp-SHRN n k) (arithmetic-shift n (- k))) + (define (unison-POp-SIZS l) (chunked-list-length l)) + (define (unison-POp-SIZT t) (chunked-string-length t)) + (define (unison-POp-SIZB b) (chunked-bytes-length b)) + (define (unison-POp-SNOC xs x) (chunked-list-add-last xs x)) + (define (unison-POp-SUBN m n) (clamp-integer (- m n))) + (define (unison-POp-SUBI m n) (clamp-integer (- m n))) + (define (unison-POp-TAKS n s) (chunked-list-take s n)) + (define (unison-POp-TAKT n t) (chunked-string-take t n)) + (define (unison-POp-TAKB n t) (chunked-bytes-take t n)) + + (define (->optional v) + (if v + (ref-optional-some v) + ref-optional-none)) + + (define-unison-builtin (builtin-Text.indexOf n h) + (->optional (chunked-string-index-of h n))) + (define-unison-builtin (builtin-Bytes.indexOf n h) + (->optional (chunked-bytes-index-of h n))) + + ;; TODO currently only runs in low-level tracing support + (define (unison-POp-DBTX x) + (sum 1 (string->chunked-string (describe-value x)))) + + (define (unison-FOp-Handle.toText h) + (string->chunked-string (describe-value h))) + (define (unison-FOp-Socket.toText s) + (string->chunked-string (describe-value s))) + (define (unison-FOp-ThreadId.toText tid) + (string->chunked-string (describe-value tid))) + + (define (unison-POp-TRCE s x) + (display "trace: ") + (display (chunked-string->string s)) + (newline) + (display (describe-value x)) + (newline)) + (define (unison-POp-PRNT s) + (display (chunked-string->string s)) + (newline)) + (define (unison-POp-TTON s) + (let ([mn (string->number (chunked-string->string s))]) + (if (and (exact-nonnegative-integer? mn) (< mn bit64)) + (some mn) + none))) + (define (unison-POp-TTOI s) + (let ([mn (string->number (chunked-string->string s))]) + (if (and (exact-integer? mn) (>= mn nbit63) (< mn bit63)) + (some mn) + none))) + (define (unison-POp-TTOF s) + (let ([mn (string->number (chunked-string->string s))]) + (if mn (some mn) none))) + (define (unison-POp-UPKT s) + (build-chunked-list + (chunked-string-length s) + (lambda (i) (chunked-string-ref s i)))) + (define (unison-POp-VWLS l) + (if (chunked-list-empty? l) + (sum 0) + (let-values ([(t h) (chunked-list-pop-first l)]) + (sum 1 h t)))) + (define (unison-POp-VWRS l) + (if (chunked-list-empty? l) + (sum 0) + (let-values ([(t h) (chunked-list-pop-last l)]) + (sum 1 t h)))) + (define (unison-POp-SPLL i s) + (if (< (chunked-list-length s) i) + (sum 0) + (let-values ([(l r) (chunked-list-split-at s i)]) + (sum 1 l r)))) + (define (unison-POp-SPLR i s) ; TODO write test that stresses this + (let ([len (chunked-list-length s) ]) + (if (< len i) + (sum 0) + (let-values ([(l r) (chunked-list-split-at s (- len i))]) + (sum 1 l r))))) + + (define (unison-POp-UCNS s) + (if (chunked-string-empty? s) + (sum 0) + (let-values ([(t h) (chunked-string-pop-first s)]) + (sum 1 (char h) t)))) + + (define (unison-POp-USNC s) + (if (chunked-string-empty? s) + (sum 0) + (let-values ([(t h) (chunked-string-pop-last s)]) + (sum 1 t (char h))))) + + ;; TODO flatten operation on Bytes is a no-op for now (and possibly ever) + (define (unison-POp-FLTB b) b) + + (define (unison-POp-XORN m n) (bitwise-xor m n)) + (define (unison-POp-VALU c) (decode-value c)) + + (define (unison-FOp-ImmutableByteArray.read16be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u16-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read24be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u24-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read32be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u32-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read40be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u40-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read48be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u48-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read56be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u56-ref bs n 'big))))) + + (define (unison-FOp-ImmutableByteArray.read64be bs n) + (reify-exn + (lambda () + (sum 1 (bytevector-u64-ref bs n 'big))))) + + (define unison-FOp-internal.dataTag unison-data-tag) + + (define (unison-FOp-IO.getBytes.impl.v3 p n) + (reify-exn + (lambda () + (right + (bytes->chunked-bytes + (read-bytes n p)))))) + + (define (unison-FOp-IO.putBytes.impl.v3 p bs) + (begin + (write-bytes (chunked-bytes->bytes bs) p) + (flush-output p) + (sum 1 #f))) + + (define (unison-FOp-Char.toText c) (string->chunked-string (string (integer->char c)))) + + (define (unison-FOp-IO.getArgs.impl.v1) + (sum 1 (cdr (command-line)))) + + (define unison-FOp-IO.systemTimeMicroseconds.v1 current-microseconds) + + ;; TODO should we convert Bytes -> Text directly without the intermediate conversions? + (define (unison-FOp-Text.fromUtf8.impl.v3 b) + (with-handlers + ([exn:fail:contract? (lambda (e) - (raise-unison-exception - ref-threadkilledfailure:typelink - (string->chunked-string "thread killed") - ref-unit-unit))] - [exn:io? - (lambda (e) - (raise-unison-exception - ref-iofailure:typelink - (exception->string e) - ref-unit-unit))] - [exn:arith? - (lambda (e) - (raise-unison-exception - ref-arithfailure:typelink - (exception->string e) - ref-unit-unit))] - [exn:bug? (lambda (e) (exn:bug->exception e))] - [exn:fail? - (lambda (e) - (raise-unison-exception - ref-runtimefailure:typelink - (exception->string e) - ref-unit-unit))] - [(lambda (x) #t) - (lambda (e) - (raise-unison-exception - ref-miscfailure:typelink - (exception->string e) - ref-unit-unit))]) - (thunk ref-unit-unit))) - - (declare-builtin-link builtin-Float.*) - (declare-builtin-link builtin-Float.fromRepresentation) - (declare-builtin-link builtin-Float.toRepresentation) - (declare-builtin-link builtin-Float.ceiling) - (declare-builtin-link builtin-Float.exp) - (declare-builtin-link builtin-Float.log) - (declare-builtin-link builtin-Float.max) - (declare-builtin-link builtin-Float.min) - (declare-builtin-link builtin-Float.tan) - (declare-builtin-link builtin-Float.tanh) - (declare-builtin-link builtin-Float.logBase) - (declare-builtin-link builtin-Float.pow) - (declare-builtin-link builtin-Float.>) - (declare-builtin-link builtin-Float.<) - (declare-builtin-link builtin-Float.>=) - (declare-builtin-link builtin-Float.<=) - (declare-builtin-link builtin-Float.==) - (declare-builtin-link builtin-Int.pow) - (declare-builtin-link builtin-Int.*) - (declare-builtin-link builtin-Int.+) - (declare-builtin-link builtin-Int.-) - (declare-builtin-link builtin-Int./) - (declare-builtin-link builtin-Int.>) - (declare-builtin-link builtin-Int.<) - (declare-builtin-link builtin-Int.>=) - (declare-builtin-link builtin-Int.<=) - (declare-builtin-link builtin-Int.==) - (declare-builtin-link builtin-Int.isEven) - (declare-builtin-link builtin-Int.isOdd) - (declare-builtin-link builtin-Int.increment) - (declare-builtin-link builtin-Int.negate) - (declare-builtin-link builtin-Int.fromRepresentation) - (declare-builtin-link builtin-Int.toRepresentation) - (declare-builtin-link builtin-Int.signum) - (declare-builtin-link builtin-Int.trailingZeros) - (declare-builtin-link builtin-Int.popCount) - (declare-builtin-link builtin-Nat.increment) - (declare-builtin-link builtin-Nat.popCount) - (declare-builtin-link builtin-Nat.toFloat) - (declare-builtin-link builtin-Nat.trailingZeros) - (declare-builtin-link builtin-Nat.+) - (declare-builtin-link builtin-Nat.>) - (declare-builtin-link builtin-Nat.<) - (declare-builtin-link builtin-Nat.>=) - (declare-builtin-link builtin-Nat.<=) - (declare-builtin-link builtin-Nat.==) - (declare-builtin-link builtin-Nat.drop) - (declare-builtin-link builtin-Nat.isEven) - (declare-builtin-link builtin-Nat.isOdd) - (declare-builtin-link builtin-Text.indexOf) - (declare-builtin-link builtin-Text.>) - (declare-builtin-link builtin-Text.<) - (declare-builtin-link builtin-Text.>=) - (declare-builtin-link builtin-Text.<=) - (declare-builtin-link builtin-Text.==) - (declare-builtin-link builtin-Text.!=) - (declare-builtin-link builtin-Bytes.indexOf) - (declare-builtin-link builtin-IO.randomBytes) - (declare-builtin-link builtin-IO.tryEval) - (declare-builtin-link builtin-List.splitLeft) - (declare-builtin-link builtin-List.splitRight) - (declare-builtin-link builtin-Value.toBuiltin) - (declare-builtin-link builtin-Value.fromBuiltin) - (declare-builtin-link builtin-Code.fromGroup) - (declare-builtin-link builtin-Code.toGroup) - (declare-builtin-link builtin-TermLink.fromReferent) - (declare-builtin-link builtin-TermLink.toReferent) - (declare-builtin-link builtin-TypeLink.toReference) - (declare-builtin-link builtin-IO.seekHandle.impl.v3) - (declare-builtin-link builtin-IO.getLine.impl.v1) - (declare-builtin-link builtin-IO.getSomeBytes.impl.v1) - (declare-builtin-link builtin-IO.setBuffering.impl.v3) - (declare-builtin-link builtin-IO.getBuffering.impl.v3) - (declare-builtin-link builtin-IO.setEcho.impl.v1) - (declare-builtin-link builtin-IO.isFileOpen.impl.v3) - (declare-builtin-link builtin-IO.ready.impl.v1) - (declare-builtin-link builtin-IO.process.call) - (declare-builtin-link builtin-IO.getEcho.impl.v1) - (declare-builtin-link builtin-IO.getArgs.impl.v1) - (declare-builtin-link builtin-IO.getEnv.impl.v1) - (declare-builtin-link builtin-IO.getChar.impl.v1) - (declare-builtin-link builtin-IO.directoryContents.impl.v3) - (declare-builtin-link builtin-IO.getCurrentDirectory.impl.v3) - (declare-builtin-link builtin-IO.removeDirectory.impl.v3) - (declare-builtin-link builtin-IO.renameFile.impl.v3) - (declare-builtin-link builtin-IO.createTempDirectory.impl.v3) - (declare-builtin-link builtin-IO.createDirectory.impl.v3) - (declare-builtin-link builtin-IO.setCurrentDirectory.impl.v3) - (declare-builtin-link builtin-IO.renameDirectory.impl.v3) - (declare-builtin-link builtin-IO.fileExists.impl.v3) - (declare-builtin-link builtin-IO.isDirectory.impl.v3) - (declare-builtin-link builtin-IO.isFileEOF.impl.v3) - (declare-builtin-link builtin-IO.isSeekable.impl.v3) - (declare-builtin-link builtin-IO.handlePosition.impl.v3) - (declare-builtin-link builtin-IO.systemTime.impl.v3) - (declare-builtin-link builtin-IO.systemTimeMicroseconds.impl.v3) - (declare-builtin-link builtin-Universal.==) - (declare-builtin-link builtin-Universal.>) - (declare-builtin-link builtin-Universal.<) - (declare-builtin-link builtin-Universal.>=) - (declare-builtin-link builtin-Universal.<=) - (declare-builtin-link builtin-Universal.compare) - (declare-builtin-link builtin-Pattern.isMatch) - (declare-builtin-link builtin-Scope.bytearrayOf) - (declare-builtin-link builtin-Char.Class.is) - (declare-builtin-link builtin-Pattern.many.corrected) - (declare-builtin-link builtin-unsafe.coerceAbilities) - (declare-builtin-link builtin-Clock.internals.systemTimeZone.v1) - ) + (exception + ref-iofailure:typelink + (string->chunked-string + (string-append + "Invalid UTF-8 stream: " + (describe-value b))) + (exception->string e)))]) + (right (string->chunked-string (bytes->string/utf-8 (chunked-bytes->bytes b)))))) + + ;; TODO should we convert Text -> Bytes directly without the intermediate conversions? + (define (unison-FOp-Text.toUtf8 s) + (bytes->chunked-bytes (string->bytes/utf-8 (chunked-string->string s)))) + + (define-unison-builtin (builtin-IO.isFileEOF.impl.v3 p) + (ref-either-right (eof-object? (peek-byte p)))) + + (define (unison-FOp-IO.closeFile.impl.v3 h) + (if (input-port? h) + (close-input-port h) + (close-output-port h)) + (right none)) + + (define (unison-FOp-Text.repeat n t) + (let loop ([cnt 0] + [acc empty-chunked-string]) + (if (= cnt n) + acc + (loop (+ cnt 1) (chunked-string-append acc t))))) + + (define (unison-FOp-Text.reverse s) + (chunked-string-foldMap-chunks + s + string-reverse + (lambda (acc c) (chunked-string-append c acc)))) + + (define (unison-FOp-Text.toLowercase s) + (chunked-string-foldMap-chunks s string-downcase chunked-string-append)) + + (define (unison-FOp-Text.toUppercase s) + (chunked-string-foldMap-chunks s string-upcase chunked-string-append)) + + (define (unison-FOp-Pattern.run p s) + (let* ([r (pattern-match p s)]) + (if r (sum 1 (cdr r) (car r)) (sum 0)))) + + (define (unison-FOp-Pattern.isMatch p s) (bool (pattern-match? p s))) + (define (unison-FOp-Pattern.many p) (many p)) + (define (unison-FOp-Pattern.capture p) (capture p)) + (define (unison-FOp-Pattern.join ps) + (join* ps)) + (define (unison-FOp-Pattern.or p1 p2) (choice p1 p2)) + (define (unison-FOp-Pattern.replicate n m p) (replicate p n m)) + + (define (unison-FOp-Text.patterns.digit) digit) + (define (unison-FOp-Text.patterns.letter) letter) + (define (unison-FOp-Text.patterns.punctuation) punctuation) + (define (unison-FOp-Text.patterns.charIn cs) (chars cs)) + (define (unison-FOp-Text.patterns.notCharIn cs) (not-chars cs)) + (define (unison-FOp-Text.patterns.anyChar) any-char) + (define (unison-FOp-Text.patterns.space) space) + (define (unison-FOp-Text.patterns.charRange a z) (char-range (integer->char a) (integer->char z))) + (define (unison-FOp-Text.patterns.notCharRange a z) (not-char-range (integer->char a) (integer->char z))) + (define (unison-FOp-Text.patterns.literal s) (literal s)) + (define (unison-FOp-Text.patterns.eof) eof) + (define (unison-FOp-Text.patterns.char cc) cc) + (define (unison-FOp-Char.Class.is cc c) + (unison-FOp-Pattern.isMatch cc (unison-FOp-Char.toText c))) + (define (unison-FOp-Char.Class.any) (unison-FOp-Text.patterns.anyChar)) + (define (unison-FOp-Char.Class.punctuation) + (unison-FOp-Text.patterns.punctuation)) + (define (unison-FOp-Char.Class.letter) (unison-FOp-Text.patterns.letter)) + (define (unison-FOp-Char.Class.alphanumeric) alphanumeric) + (define (unison-FOp-Char.Class.upper) upper) + (define (unison-FOp-Char.Class.lower) lower) + (define (unison-FOp-Char.Class.number) number) + (define (unison-FOp-Char.Class.symbol) symbol) + (define (unison-FOp-Char.Class.whitespace) space) + (define (unison-FOp-Char.Class.control) control) + (define (unison-FOp-Char.Class.printable) printable) + (define (unison-FOp-Char.Class.mark) mark) + (define (unison-FOp-Char.Class.separator) separator) + (define (unison-FOp-Char.Class.or p1 p2) (char-class-or p1 p2)) + (define (unison-FOp-Char.Class.range a z) + (unison-FOp-Text.patterns.charRange a z)) + (define (unison-FOp-Char.Class.anyOf cs) (unison-FOp-Text.patterns.charIn cs)) + (define (unison-FOp-Char.Class.and cc1 cc2) (char-class-and cc1 cc2)) + (define (unison-FOp-Char.Class.not cc) (char-class-not cc)) + + (define (catch-array thunk) + (reify-exn thunk)) + + (define (unison-FOp-ImmutableArray.read vec i) + (catch-array + (lambda () + (sum 1 (vector-ref vec i))))) + + (define (unison-FOp-ImmutableArray.copyTo! dst doff src soff n) + (catch-array + (lambda () + (vector-copy! dst doff src soff n) + (sum 1)))) + + (define (unison-FOp-MutableArray.copyTo! dst doff src soff l) + (catch-array + (lambda () + (vector-copy! dst doff src soff l) + (sum 1)))) + + (define unison-FOp-MutableArray.freeze! freeze-vector!) + + (define unison-FOp-MutableArray.freeze freeze-subvector) + + (define (unison-FOp-MutableArray.read src i) + (catch-array + (lambda () + (sum 1 (vector-ref src i))))) + + (define (unison-FOp-MutableArray.write dst i x) + (catch-array + (lambda () + (vector-set! dst i x) + (sum 1)))) + + (define (unison-FOp-ImmutableByteArray.copyTo! dst doff src soff n) + (catch-array + (lambda () + (bytes-copy! dst doff src soff n) + (sum 1)))) + + (define (unison-FOp-ImmutableByteArray.read8 arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u8-ref arr i))))) + + (define (unison-FOp-MutableByteArray.copyTo! dst doff src soff l) + (catch-array + (lambda () + (bytes-copy! dst doff src soff l) + (sum 1)))) + + (define unison-FOp-MutableByteArray.freeze! freeze-bytevector!) + + (define (unison-FOp-MutableByteArray.write8 arr i b) + (catch-array + (lambda () + (bytevector-u8-set! arr i b) + (sum 1)))) + + (define (unison-FOp-MutableByteArray.write16be arr i b) + (catch-array + (lambda () + (bytevector-u16-set! arr i b 'big) + (sum 1)))) + + (define (unison-FOp-MutableByteArray.write32be arr i b) + (catch-array + (lambda () + (bytevector-u32-set! arr i b 'big) + (sum 1)))) + + (define (unison-FOp-MutableByteArray.write64be arr i b) + (catch-array + (lambda () + (bytevector-u64-set! arr i b 'big) + (sum 1)))) + + (define (unison-FOp-MutableByteArray.read8 arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u8-ref arr i))))) + + (define (unison-FOp-MutableByteArray.read16be arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u16-ref arr i 'big))))) + + (define (unison-FOp-MutableByteArray.read24be arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u24-ref arr i 'big))))) + + (define (unison-FOp-MutableByteArray.read32be arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u32-ref arr i 'big))))) + + (define (unison-FOp-MutableByteArray.read40be arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u40-ref arr i 'big))))) + + (define (unison-FOp-MutableByteArray.read64be arr i) + (catch-array + (lambda () + (sum 1 (bytevector-u64-ref arr i 'big))))) + + (define (unison-FOp-Scope.bytearray n) (make-bytes n)) + (define (unison-FOp-IO.bytearray n) (make-bytes n)) + + (define (unison-FOp-Scope.array n) (make-vector n)) + (define (unison-FOp-IO.array n) (make-vector n)) + + (define (unison-FOp-Scope.bytearrayOf b n) (make-bytes n b)) + (define (unison-FOp-IO.bytearrayOf b n) (make-bytes n b)) + + (define (unison-FOp-Scope.arrayOf v n) (make-vector n v)) + (define (unison-FOp-IO.arrayOf v n) (make-vector n v)) + + (define unison-FOp-MutableByteArray.length bytevector-length) + (define unison-FOp-ImmutableByteArray.length bytevector-length) + (define unison-FOp-MutableByteArray.size bytevector-length) + (define unison-FOp-ImmutableByteArray.size bytevector-length) + (define unison-FOp-MutableArray.size vector-length) + (define unison-FOp-ImmutableArray.size vector-length) + + (define (unison-POp-FORK thunk) (fork thunk)) + (define (unison-FOp-IO.delay.impl.v3 micros) (sleep micros)) + (define (unison-FOp-IO.kill.impl.v3 threadId) (kill threadId)) + (define (unison-FOp-Scope.ref a) (ref-new a)) + (define (unison-FOp-IO.ref a) (ref-new a)) + (define (unison-FOp-Ref.read ref) (ref-read ref)) + (define (unison-FOp-Ref.write ref a) (ref-write ref a)) + (define (unison-FOp-Ref.readForCas ref) (ref-read ref)) + (define (unison-FOp-Ref.Ticket.read ticket) ticket) + (define (unison-FOp-Ref.cas ref ticket value) (ref-cas ref ticket value)) + (define (unison-FOp-Promise.new) (promise-new)) + (define (unison-FOp-Promise.read promise) (promise-read promise)) + (define (unison-FOp-Promise.tryRead promise) (promise-try-read promise)) + (define (unison-FOp-Promise.write promise a) (promise-write promise a))) + + +(define (exn:io? e) + (or (exn:fail:read? e) + (exn:fail:filesystem? e) + (exn:fail:network? e))) + +(define (exn:arith? e) + (or (exn:fail:contract:divide-by-zero? e) + (exn:fail:contract:non-fixnum-result? e))) + +(define-unison-builtin (builtin-IO.tryEval thunk) + (with-handlers + ([exn:break? + (lambda (e) + (raise-unison-exception + ref-threadkilledfailure:typelink + (string->chunked-string "thread killed") + ref-unit-unit))] + [exn:io? + (lambda (e) + (raise-unison-exception + ref-iofailure:typelink + (exception->string e) + ref-unit-unit))] + [exn:arith? + (lambda (e) + (raise-unison-exception + ref-arithfailure:typelink + (exception->string e) + ref-unit-unit))] + [exn:bug? (lambda (e) (exn:bug->exception e))] + [exn:fail? + (lambda (e) + (raise-unison-exception + ref-runtimefailure:typelink + (exception->string e) + ref-unit-unit))] + [(lambda (x) #t) + (lambda (e) + (raise-unison-exception + ref-miscfailure:typelink + (exception->string e) + ref-unit-unit))]) + (thunk ref-unit-unit))) + +; (declare-builtin-link builtin-Float.*) +; (declare-builtin-link builtin-Float.fromRepresentation) +; (declare-builtin-link builtin-Float.toRepresentation) +; (declare-builtin-link builtin-Float.ceiling) +; (declare-builtin-link builtin-Float.exp) +; (declare-builtin-link builtin-Float.log) +; (declare-builtin-link builtin-Float.max) +; (declare-builtin-link builtin-Float.min) +; (declare-builtin-link builtin-Float.tan) +; (declare-builtin-link builtin-Float.tanh) +; (declare-builtin-link builtin-Float.logBase) +; (declare-builtin-link builtin-Float.pow) +; (declare-builtin-link builtin-Float.>) +; (declare-builtin-link builtin-Float.<) +; (declare-builtin-link builtin-Float.>=) +; (declare-builtin-link builtin-Float.<=) +; (declare-builtin-link builtin-Float.==) +; (declare-builtin-link builtin-Int.pow) +; (declare-builtin-link builtin-Int.*) +; (declare-builtin-link builtin-Int.+) +; (declare-builtin-link builtin-Int.-) +; (declare-builtin-link builtin-Int./) +; (declare-builtin-link builtin-Int.>) +; (declare-builtin-link builtin-Int.<) +; (declare-builtin-link builtin-Int.>=) +; (declare-builtin-link builtin-Int.<=) +; (declare-builtin-link builtin-Int.==) +; (declare-builtin-link builtin-Int.isEven) +; (declare-builtin-link builtin-Int.isOdd) +; (declare-builtin-link builtin-Int.increment) +; (declare-builtin-link builtin-Int.negate) +; (declare-builtin-link builtin-Int.fromRepresentation) +; (declare-builtin-link builtin-Int.toRepresentation) +; (declare-builtin-link builtin-Int.signum) +; (declare-builtin-link builtin-Int.trailingZeros) +; (declare-builtin-link builtin-Int.popCount) +; (declare-builtin-link builtin-Nat.increment) +; (declare-builtin-link builtin-Nat.popCount) +; (declare-builtin-link builtin-Nat.toFloat) +; (declare-builtin-link builtin-Nat.trailingZeros) +; (declare-builtin-link builtin-Nat.+) +; (declare-builtin-link builtin-Nat.>) +; (declare-builtin-link builtin-Nat.<) +; (declare-builtin-link builtin-Nat.>=) +; (declare-builtin-link builtin-Nat.<=) +; (declare-builtin-link builtin-Nat.==) +; (declare-builtin-link builtin-Nat.drop) +; (declare-builtin-link builtin-Nat.isEven) +; (declare-builtin-link builtin-Nat.isOdd) +; (declare-builtin-link builtin-Text.indexOf) +; (declare-builtin-link builtin-Text.>) +; (declare-builtin-link builtin-Text.<) +; (declare-builtin-link builtin-Text.>=) +; (declare-builtin-link builtin-Text.<=) +; (declare-builtin-link builtin-Text.==) +; (declare-builtin-link builtin-Text.!=) +; (declare-builtin-link builtin-Bytes.indexOf) +; (declare-builtin-link builtin-IO.randomBytes) +; (declare-builtin-link builtin-IO.tryEval) +; (declare-builtin-link builtin-List.splitLeft) +; (declare-builtin-link builtin-List.splitRight) +; (declare-builtin-link builtin-Value.toBuiltin) +; (declare-builtin-link builtin-Value.fromBuiltin) +; (declare-builtin-link builtin-Code.fromGroup) +; (declare-builtin-link builtin-Code.toGroup) +; (declare-builtin-link builtin-TermLink.fromReferent) +; (declare-builtin-link builtin-TermLink.toReferent) +; (declare-builtin-link builtin-TypeLink.toReference) +; (declare-builtin-link builtin-IO.seekHandle.impl.v3) +; (declare-builtin-link builtin-IO.getLine.impl.v1) +; (declare-builtin-link builtin-IO.getSomeBytes.impl.v1) +; (declare-builtin-link builtin-IO.setBuffering.impl.v3) +; (declare-builtin-link builtin-IO.getBuffering.impl.v3) +; (declare-builtin-link builtin-IO.setEcho.impl.v1) +; (declare-builtin-link builtin-IO.isFileOpen.impl.v3) +; (declare-builtin-link builtin-IO.ready.impl.v1) +; (declare-builtin-link builtin-IO.process.call) +; (declare-builtin-link builtin-IO.getEcho.impl.v1) +; (declare-builtin-link builtin-IO.getArgs.impl.v1) +; (declare-builtin-link builtin-IO.getEnv.impl.v1) +; (declare-builtin-link builtin-IO.getChar.impl.v1) +; (declare-builtin-link builtin-IO.directoryContents.impl.v3) +; (declare-builtin-link builtin-IO.getCurrentDirectory.impl.v3) +; (declare-builtin-link builtin-IO.removeDirectory.impl.v3) +; (declare-builtin-link builtin-IO.renameFile.impl.v3) +; (declare-builtin-link builtin-IO.createTempDirectory.impl.v3) +; (declare-builtin-link builtin-IO.createDirectory.impl.v3) +; (declare-builtin-link builtin-IO.setCurrentDirectory.impl.v3) +; (declare-builtin-link builtin-IO.renameDirectory.impl.v3) +; (declare-builtin-link builtin-IO.fileExists.impl.v3) +; (declare-builtin-link builtin-IO.isDirectory.impl.v3) +; (declare-builtin-link builtin-IO.isFileEOF.impl.v3) +; (declare-builtin-link builtin-IO.isSeekable.impl.v3) +; (declare-builtin-link builtin-IO.handlePosition.impl.v3) +; (declare-builtin-link builtin-IO.systemTime.impl.v3) +; (declare-builtin-link builtin-IO.systemTimeMicroseconds.impl.v3) +; (declare-builtin-link builtin-Universal.==) +; (declare-builtin-link builtin-Universal.>) +; (declare-builtin-link builtin-Universal.<) +; (declare-builtin-link builtin-Universal.>=) +; (declare-builtin-link builtin-Universal.<=) +; (declare-builtin-link builtin-Universal.compare) +; (declare-builtin-link builtin-Pattern.isMatch) +; (declare-builtin-link builtin-Scope.bytearrayOf) +; (declare-builtin-link builtin-Char.Class.is) +; (declare-builtin-link builtin-Pattern.many.corrected) +; (declare-builtin-link builtin-unsafe.coerceAbilities) +; (declare-builtin-link builtin-Clock.internals.systemTimeZone.v1) diff --git a/scheme-libs/racket/unison/sandbox.rkt b/scheme-libs/racket/unison/sandbox.rkt index a24c70f2f..248d0b06e 100644 --- a/scheme-libs/racket/unison/sandbox.rkt +++ b/scheme-libs/racket/unison/sandbox.rkt @@ -4,7 +4,7 @@ (provide expand-sandbox check-sandbox set-sandbox) (require racket racket/hash) -(require (except-in unison/data true false unit)) +(require unison/data) ; sandboxing information (define sandbox-links (make-hash)) diff --git a/scheme-libs/racket/unison/udp.rkt b/scheme-libs/racket/unison/udp.rkt index 360767326..2f1170e01 100644 --- a/scheme-libs/racket/unison/udp.rkt +++ b/scheme-libs/racket/unison/udp.rkt @@ -2,7 +2,7 @@ #lang racket/base (require racket/udp racket/format - (only-in unison/boot define-unison) + (only-in unison/boot define-unison-builtin) unison/data unison/data-info unison/chunked-seq @@ -11,32 +11,29 @@ unison/core) (provide - (prefix-out - builtin-IO.UDP. - (combine-out - clientSocket.impl.v1 - clientSocket.impl.v1:termlink - UDPSocket.recv.impl.v1 - UDPSocket.recv.impl.v1:termlink - UDPSocket.send.impl.v1 - UDPSocket.send.impl.v1:termlink - UDPSocket.close.impl.v1 - UDPSocket.close.impl.v1:termlink - ListenSocket.close.impl.v1 - ListenSocket.close.impl.v1:termlink - UDPSocket.toText.impl.v1 - UDPSocket.toText.impl.v1:termlink - serverSocket.impl.v1 - serverSocket.impl.v1:termlink - ListenSocket.toText.impl.v1 - ListenSocket.toText.impl.v1:termlink - ListenSocket.recvFrom.impl.v1 - ListenSocket.recvFrom.impl.v1:termlink - ClientSockAddr.toText.v1 - ClientSockAddr.toText.v1:termlink - ListenSocket.sendTo.impl.v1 - ListenSocket.sendTo.impl.v1:termlink))) - + builtin-IO.UDP.clientSocket.impl.v1 + builtin-IO.UDP.clientSocket.impl.v1:termlink + builtin-IO.UDP.UDPSocket.recv.impl.v1 + builtin-IO.UDP.UDPSocket.recv.impl.v1:termlink + builtin-IO.UDP.UDPSocket.send.impl.v1 + builtin-IO.UDP.UDPSocket.send.impl.v1:termlink + builtin-IO.UDP.UDPSocket.close.impl.v1 + builtin-IO.UDP.UDPSocket.close.impl.v1:termlink + builtin-IO.UDP.ListenSocket.close.impl.v1 + builtin-IO.UDP.ListenSocket.close.impl.v1:termlink + builtin-IO.UDP.UDPSocket.toText.impl.v1 + builtin-IO.UDP.UDPSocket.toText.impl.v1:termlink + builtin-IO.UDP.serverSocket.impl.v1 + builtin-IO.UDP.serverSocket.impl.v1:termlink + builtin-IO.UDP.ListenSocket.toText.impl.v1 + builtin-IO.UDP.ListenSocket.toText.impl.v1:termlink + builtin-IO.UDP.ListenSocket.recvFrom.impl.v1 + builtin-IO.UDP.ListenSocket.recvFrom.impl.v1:termlink + builtin-IO.UDP.ClientSockAddr.toText.v1 + builtin-IO.UDP.ClientSockAddr.toText.v1:termlink + builtin-IO.UDP.ListenSocket.sendTo.impl.v1 + builtin-IO.UDP.ListenSocket.sendTo.impl.v1:termlink) + (struct client-sock-addr (host port)) @@ -48,10 +45,10 @@ (sum-case a (0 (type msg meta) (ref-either-left (ref-failure-failure type msg (unison-any-any meta)))) - (1 (data) + (1 (data) (ref-either-right data)))) -(define +(define (format-socket socket) (let*-values ([(local-hn local-port remote-hn remote-port) (udp-addresses socket #t)] [(rv) (~a "")]) @@ -64,7 +61,7 @@ (wrap-in-either rv))) ;; define termlink builtins -(define clientSocket.impl.v1:termlink +(define clientSocket.impl.v1:termlink (unison-termlink-builtin "IO.UDP.clientSocket.impl.v1")) (define UDPSocket.recv.impl.v1:termlink (unison-termlink-builtin "IO.UDP.UDPSocket.recv.impl.v1")) @@ -72,7 +69,7 @@ (unison-termlink-builtin "IO.UDP.UDPSocket.send.impl.v1")) (define UDPSocket.close.impl.v1:termlink (unison-termlink-builtin "IO.UDP.UDPSocket.close.impl.v1")) -(define ListenSocket.close.impl.v1:termlink +(define ListenSocket.close.impl.v1:termlink (unison-termlink-builtin "IO.UDP.ListenSocket.close.impl.v1")) (define UDPSocket.toText.impl.v1:termlink (unison-termlink-builtin "IO.UDP.UDPSocket.toText.impl.v1")) @@ -89,22 +86,25 @@ ;; define builtins -(define-unison - (UDPSocket.recv.impl.v1 socket) ; socket -> Either Failure Bytes - (let - ([rv (handle-errors (lambda() +(define-unison-builtin + (builtin-IO.UDP.UDPSocket.recv.impl.v1 socket) + ; socket -> Either Failure Bytes + (let + ([rv (handle-errors (lambda() (let*-values ([(buffer) (make-bytes buffer-size)] [(len a b) (udp-receive! socket buffer)]) (right (bytes->chunked-bytes (subbytes buffer 0 len))))))]) (wrap-in-either rv))) -(define-unison - (ListenSocket.close.impl.v1 socket) ; socket -> Either Failure () +(define-unison-builtin + (builtin-IO.UDP.ListenSocket.close.impl.v1 socket) + ; socket -> Either Failure () (close-socket socket)) -(define-unison - (serverSocket.impl.v1 ip port) ; string string -> Either Failure socket +(define-unison-builtin + (builtin-IO.UDP.serverSocket.impl.v1 ip port) + ; string string -> Either Failure socket (let ([result (handle-errors (lambda() (let* ([iip (chunked-string->string ip)] @@ -115,12 +115,13 @@ (right sock)))))]) (wrap-in-either result))) -(define-unison - (ListenSocket.recvFrom.impl.v1 socket) ; socket -> Either Failure (Bytes, ClientSockAddr) - (let ([result (handle-errors (lambda() +(define-unison-builtin + (builtin-IO.UDP.ListenSocket.recvFrom.impl.v1 socket) + ; socket -> Either Failure (Bytes, ClientSockAddr) + (let ([result (handle-errors (lambda() (if (not (udp? socket)) (raise-argument-error 'socket "a UDP socket" socket) - (let*-values + (let*-values ([(buffer) (make-bytes buffer-size)] [(len host port) (udp-receive! socket buffer)] [(csa) (client-sock-addr host port)] @@ -129,18 +130,20 @@ (right (ref-tuple-pair chunked (ref-tuple-pair csa ref-unit-unit)))))))]) (wrap-in-either result))) -(define-unison - (UDPSocket.send.impl.v1 socket data) ; socket -> Bytes -> Either Failure () +(define-unison-builtin + (builtin-IO.UDP.UDPSocket.send.impl.v1 socket data) + ; socket -> Bytes -> Either Failure () (let ([result (handle-errors (lambda () (begin - (udp-send socket (chunked-bytes->bytes data)) + (udp-send socket (chunked-bytes->bytes data)) (right ref-unit-unit))))]) (wrap-in-either result))) -(define-unison - (ListenSocket.sendTo.impl.v1 sock bytes addr) ; socket -> Bytes -> ClientSockAddr -> Either Failure () +(define-unison-builtin + (builtin-IO.UDP.ListenSocket.sendTo.impl.v1 sock bytes addr) + ; socket -> Bytes -> ClientSockAddr -> Either Failure () (let - ([result (handle-errors (lambda() + ([result (handle-errors (lambda() (let* ([host (client-sock-addr-host addr)] [port (client-sock-addr-port addr)] [bytes (chunked-bytes->bytes bytes)]) @@ -149,28 +152,32 @@ (right ref-unit-unit)))))]) (wrap-in-either result))) -(define-unison - (UDPSocket.toText.impl.v1 socket) ; socket -> string +(define-unison-builtin + (builtin-IO.UDP.UDPSocket.toText.impl.v1 socket) ; socket -> string (format-socket socket)) -(define-unison - (ClientSockAddr.toText.v1 addr) ; ClientSocketAddr -> string +(define-unison-builtin + (builtin-IO.UDP.ClientSockAddr.toText.v1 addr) + ; ClientSocketAddr -> string (string->chunked-string (format "" (client-sock-addr-host addr) (client-sock-addr-port addr)))) -(define-unison - (ListenSocket.toText.impl.v1 socket) ; socket -> string +(define-unison-builtin + (builtin-IO.UDP.ListenSocket.toText.impl.v1 socket) + ; socket -> string (format-socket socket)) -(define-unison - (UDPSocket.close.impl.v1 socket) ; socket -> Either Failure () +(define-unison-builtin + (builtin-IO.UDP.UDPSocket.close.impl.v1 socket) + ; socket -> Either Failure () (let ([rv (handle-errors (lambda() (begin (udp-close socket) (right ref-unit-unit))))]) (wrap-in-either rv))) -(define-unison - (clientSocket.impl.v1 host port) ; string string -> Either Failure socket +(define-unison-builtin + (builtin-IO.UDP.clientSocket.impl.v1 host port) + ; string string -> Either Failure socket (let ([rv (handle-errors (lambda() (let* ([pport (string->number (chunked-string->string port))] [hhost (chunked-string->string host)] [sock (udp-open-socket hhost pport)] diff --git a/stack.yaml b/stack.yaml index ff76c60ea..477547cab 100644 --- a/stack.yaml +++ b/stack.yaml @@ -29,7 +29,6 @@ packages: - lib/unison-util-bytes - lib/unison-util-cache - lib/unison-util-file-embed - - lib/unison-util-nametree - lib/unison-util-relation - lib/unison-util-rope - parser-typechecker diff --git a/unison-cli/package.yaml b/unison-cli/package.yaml index 3402e98c9..923d0c7ae 100644 --- a/unison-cli/package.yaml +++ b/unison-cli/package.yaml @@ -93,7 +93,6 @@ dependencies: - unison-sqlite - unison-syntax - unison-util-base32hex - - unison-util-nametree - unison-util-relation - unliftio - unordered-containers diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs index 45efd7b33..2175ce06a 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs @@ -77,7 +77,6 @@ import Unison.Codebase.Editor.HandleInput.NamespaceDiffUtils (diffHelper) import Unison.Codebase.Editor.HandleInput.ProjectClone (handleClone) import Unison.Codebase.Editor.HandleInput.ProjectCreate (projectCreate) import Unison.Codebase.Editor.HandleInput.ProjectRename (handleProjectRename) -import Unison.Codebase.Editor.HandleInput.Todo (handleTodo) import Unison.Codebase.Editor.HandleInput.ProjectSwitch (projectSwitch) import Unison.Codebase.Editor.HandleInput.Projects (handleProjects) import Unison.Codebase.Editor.HandleInput.Pull (handlePull, mergeBranchAndPropagateDefaultPatch) @@ -88,6 +87,7 @@ import Unison.Codebase.Editor.HandleInput.RuntimeUtils qualified as RuntimeUtils import Unison.Codebase.Editor.HandleInput.ShowDefinition (showDefinitions) import Unison.Codebase.Editor.HandleInput.TermResolution (resolveMainRef) import Unison.Codebase.Editor.HandleInput.Tests qualified as Tests +import Unison.Codebase.Editor.HandleInput.Todo (handleTodo) import Unison.Codebase.Editor.HandleInput.UI (openUI) import Unison.Codebase.Editor.HandleInput.Update (doSlurpAdds, handleUpdate) import Unison.Codebase.Editor.HandleInput.Update2 (handleUpdate2) @@ -104,7 +104,6 @@ import Unison.Codebase.Editor.StructuredArgument qualified as SA import Unison.Codebase.IntegrityCheck qualified as IntegrityCheck (integrityCheckFullCodebase) import Unison.Codebase.Metadata qualified as Metadata import Unison.Codebase.Path (Path, Path' (..)) -import Unison.Codebase.Path qualified as HQSplit' import Unison.Codebase.Path qualified as Path import Unison.Codebase.Runtime qualified as Runtime import Unison.Codebase.ShortCausalHash qualified as SCH @@ -119,7 +118,6 @@ import Unison.DataDeclaration qualified as DD import Unison.Hash qualified as Hash import Unison.HashQualified qualified as HQ import Unison.HashQualified' qualified as HQ' -import Unison.HashQualified' qualified as HashQualified import Unison.LabeledDependency (LabeledDependency) import Unison.LabeledDependency qualified as LD import Unison.LabeledDependency qualified as LabeledDependency @@ -494,7 +492,7 @@ loop e = do description <- inputDescription input Cli.stepAt description (BranchUtil.makeAddTermName (first Path.unabsolute dest) srcTerm) Cli.respond Success - AliasTypeI src' dest' -> do + AliasTypeI force src' dest' -> do src <- traverseOf _Right Cli.resolveSplit' src' srcTypes <- either @@ -512,7 +510,7 @@ loop e = do pure (DeleteNameAmbiguous hqLength name Set.empty srcTypes) dest <- Cli.resolveSplit' dest' destTypes <- Cli.getTypesAt (HQ'.NameOnly <$> dest) - when (not (Set.null destTypes)) do + when (not force && not (Set.null destTypes)) do Cli.returnEarly (TypeAlreadyExists dest' destTypes) description <- inputDescription input Cli.stepAt description (BranchUtil.makeAddTypeName (first Path.unabsolute dest) srcType) @@ -574,7 +572,7 @@ loop e = do (Just as1, Just as2) -> (missingSrcs, actions ++ as1 ++ as2) fixupOutput :: Path.HQSplit -> HQ.HashQualified Name - fixupOutput = fmap Path.unsafeToName . HQ'.toHQ . Path.unsplitHQ + fixupOutput = HQ'.toHQ . Path.nameFromHQSplit NamesI global query -> do hqLength <- Cli.runTransaction Codebase.hashLength root <- Cli.getRootBranch @@ -659,7 +657,7 @@ loop e = do description <- inputDescription input let toDelete = Names.prefix0 - (Path.unsafeToName (Path.unsplit (p))) + (Path.nameFromSplit' $ first (Path.RelativePath' . Path.Relative) p) (Branch.toNames (Branch.head branch)) afterDelete <- do names <- Cli.currentNames @@ -980,11 +978,11 @@ inputDescription input = AliasTermI force src0 dest0 -> do src <- hhqs' src0 dest <- ps' dest0 - pure ((if force then "alias.term.force " else "alias.term ") <> src <> " " <> dest) - AliasTypeI src0 dest0 -> do + pure ((if force then "debug.alias.term.force " else "alias.term ") <> src <> " " <> dest) + AliasTypeI force src0 dest0 -> do src <- hhqs' src0 dest <- ps' dest0 - pure ("alias.type " <> src <> " " <> dest) + pure ((if force then "debug.alias.type.force " else "alias.term ") <> src <> " " <> dest) AliasManyI srcs0 dest0 -> do srcs <- traverse hqs srcs0 dest <- p' dest0 @@ -1540,7 +1538,7 @@ delete input doutput getTerms getTypes hqs' = do then do let toName :: [(Path.HQSplit', Set Reference, Set referent)] -> [Name] toName notFounds = - mapMaybe (\(split, _, _) -> Path.toName' $ HashQualified.toName (HQSplit'.unsplitHQ' split)) notFounds + map (\(split, _, _) -> HQ'.toName $ Path.nameFromHQSplit' split) notFounds Cli.returnEarly $ NamesNotFound (toName notFounds) else do checkDeletes typesTermsTuple doutput input @@ -1551,8 +1549,14 @@ checkDeletes typesTermsTuples doutput inputs = do (Path.HQSplit', Set Reference, Set Referent) -> Cli (Path.Split, Name, Set Reference, Set Referent) toSplitName hq = do + -- __FIXME__: `resolvedPath` is ostensiby `Absolute`, but the paths here must be `Relative` below resolvedPath <- first Path.unabsolute <$> Cli.resolveSplit' (HQ'.toName <$> hq ^. _1) - return (resolvedPath, Path.unsafeToName (Path.unsplit resolvedPath), hq ^. _2, hq ^. _3) + return + ( resolvedPath, + Path.nameFromSplit' $ first (Path.RelativePath' . Path.Relative) resolvedPath, + hq ^. _2, + hq ^. _3 + ) -- get the splits and names with terms and types splitsNames <- traverse toSplitName typesTermsTuples let toRel :: (Ord ref) => Set ref -> Name -> R.Relation Name ref diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput/Tests.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput/Tests.hs index 3eb365800..172ceea30 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput/Tests.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput/Tests.hs @@ -14,7 +14,6 @@ import Data.Map qualified as Map import Data.Set qualified as Set import Data.Set.NonEmpty (NESet) import Data.Set.NonEmpty qualified as NESet -import Data.Tuple qualified as Tuple import Unison.ABT qualified as ABT import Unison.Builtin.Decls qualified as DD import Unison.Cli.Monad (Cli) @@ -69,21 +68,24 @@ handleTest TestInput {includeLibNamespace, path, showFailures, showSuccesses} = Map.fromList <$> Cli.runTransaction do Set.toList testRefs & wither \case rid -> fmap (rid,) <$> Codebase.getWatch codebase WK.TestWatch rid - let (oks, fails) = passFails cachedTests - passFails :: (Ord r) => Map r (Term v a) -> ([(r, Text)], [(r, Text)]) - passFails = Tuple.swap . partitionEithers . concat . map p . Map.toList + let (fails, oks) = passFails cachedTests + passFails :: (Ord r) => Map r (Term v a) -> (Map r [Text], Map r [Text]) + passFails = + Map.foldrWithKey + (\r v (f, o) -> bimap (\ts -> if null ts then f else Map.insert r ts f) (\ts -> if null ts then o else Map.insert r ts o) . partitionEithers $ p v) + (Map.empty, Map.empty) where - p :: (r, Term v a) -> [Either (r, Text) (r, Text)] - p (r, tm) = case tm of - Term.List' ts -> mapMaybe (q r) (toList ts) + p :: Term v a -> [Either Text Text] + p = \case + Term.List' ts -> mapMaybe q $ toList ts _ -> [] - q r = \case + q = \case Term.App' (Term.Constructor' (ConstructorReference ref cid)) (Term.Text' msg) -> if | ref == DD.testResultRef -> if - | cid == DD.okConstructorId -> Just (Right (r, msg)) - | cid == DD.failConstructorId -> Just (Left (r, msg)) + | cid == DD.okConstructorId -> Just (Right msg) + | cid == DD.failConstructorId -> Just (Left msg) | otherwise -> Nothing | otherwise -> Nothing _ -> Nothing @@ -91,7 +93,7 @@ handleTest TestInput {includeLibNamespace, path, showFailures, showSuccesses} = names <- Cli.currentNames pped <- Cli.prettyPrintEnvDeclFromNames names let fqnPPE = PPED.unsuffixifiedPPE pped - Cli.respond $ + Cli.respondNumbered $ TestResults stats fqnPPE @@ -123,8 +125,8 @@ handleTest TestInput {includeLibNamespace, path, showFailures, showSuccesses} = pure [(r, tm')] let m = Map.fromList computedTests - (mOks, mFails) = passFails m - Cli.respond $ TestResults Output.NewlyComputed fqnPPE showSuccesses showFailures mOks mFails + (mFails, mOks) = passFails m + Cli.respondNumbered $ TestResults Output.NewlyComputed fqnPPE showSuccesses showFailures mOks mFails handleIOTest :: HQ.HashQualified Name -> Cli () handleIOTest main = do @@ -135,11 +137,15 @@ handleIOTest main = do let isIOTest typ = Foldable.any (Typechecker.isSubtype typ) $ Runtime.ioTestTypes runtime refs <- resolveHQNames names (Set.singleton main) (fails, oks) <- - refs & foldMapM \(ref, typ) -> do - when (not $ isIOTest typ) do - Cli.returnEarly (BadMainFunction "io.test" main typ suffixifiedPPE (Foldable.toList $ Runtime.ioTestTypes runtime)) - runIOTest suffixifiedPPE ref - Cli.respond $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails + Foldable.foldrM + ( \(ref, typ) (f, o) -> do + when (not $ isIOTest typ) $ + Cli.returnEarly (BadMainFunction "io.test" main typ suffixifiedPPE (Foldable.toList $ Runtime.ioTestTypes runtime)) + bimap (\ts -> if null ts then f else Map.insert ref ts f) (\ts -> if null ts then o else Map.insert ref ts o) <$> runIOTest suffixifiedPPE ref + ) + (Map.empty, Map.empty) + refs + Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails findTermsOfTypes :: Codebase.Codebase m Symbol Ann -> Bool -> Path -> NESet (Type.Type Symbol Ann) -> Cli (Set TermReferenceId) findTermsOfTypes codebase includeLib path filterTypes = do @@ -163,16 +169,21 @@ handleAllIOTests = do let suffixifiedPPE = PPED.suffixifiedPPE pped ioTestRefs <- findTermsOfTypes codebase False Path.empty (Runtime.ioTestTypes runtime) case NESet.nonEmptySet ioTestRefs of - Nothing -> Cli.respond $ TestResults Output.NewlyComputed suffixifiedPPE True True [] [] + Nothing -> Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True Map.empty Map.empty Just neTestRefs -> do let total = NESet.size neTestRefs (fails, oks) <- - toList neTestRefs & zip [1 :: Int ..] & foldMapM \(n, r) -> do - Cli.respond $ TestIncrementalOutputStart suffixifiedPPE (n, total) r - (fails, oks) <- runIOTest suffixifiedPPE r - Cli.respond $ TestIncrementalOutputEnd suffixifiedPPE (n, total) r (null fails) - pure (fails, oks) - Cli.respond $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails + toList neTestRefs + & zip [1 :: Int ..] + & Foldable.foldrM + ( \(n, r) (f, o) -> do + Cli.respond $ TestIncrementalOutputStart suffixifiedPPE (n, total) r + (fails, oks) <- runIOTest suffixifiedPPE r + Cli.respond $ TestIncrementalOutputEnd suffixifiedPPE (n, total) r (null fails) + pure (if null fails then f else Map.insert r fails f, if null oks then o else Map.insert r oks o) + ) + (Map.empty, Map.empty) + Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails resolveHQNames :: Names -> Set (HQ.HashQualified Name) -> Cli (Set (Reference.Id, Type.Type Symbol Ann)) resolveHQNames parseNames hqNames = @@ -197,19 +208,16 @@ resolveHQNames parseNames hqNames = typ <- MaybeT (Codebase.getTypeOfReferent codebase (Referent.fromTermReferenceId ref)) pure (ref, typ) -runIOTest :: PPE.PrettyPrintEnv -> Reference.Id -> Cli ([(Reference.Id, Text)], [(Reference.Id, Text)]) +runIOTest :: PPE.PrettyPrintEnv -> Reference.Id -> Cli ([Text], [Text]) runIOTest ppe ref = do let a = ABT.annotation tm tm = DD.forceTerm a a (Term.refId a ref) -- Don't cache IO tests tm' <- RuntimeUtils.evalUnisonTerm False ppe False tm - pure $ partitionTestResults [(ref, tm')] + pure $ partitionTestResults tm' -partitionTestResults :: - [(Reference.Id, Term Symbol Ann)] -> - ([(Reference.Id, Text {- fails -})], [(Reference.Id, Text {- oks -})]) -partitionTestResults results = fold $ do - (ref, tm) <- results +partitionTestResults :: Term Symbol Ann -> ([Text {- fails -}], [Text {- oks -}]) +partitionTestResults tm = fold $ do element <- case tm of Term.List' ts -> toList ts _ -> empty @@ -217,8 +225,8 @@ partitionTestResults results = fold $ do Term.App' (Term.Constructor' (ConstructorReference conRef cid)) (Term.Text' msg) -> do guard (conRef == DD.testResultRef) if - | cid == DD.okConstructorId -> pure (mempty, [(ref, msg)]) - | cid == DD.failConstructorId -> pure ([(ref, msg)], mempty) + | cid == DD.okConstructorId -> pure (mempty, [msg]) + | cid == DD.failConstructorId -> pure ([msg], mempty) | otherwise -> empty _ -> empty diff --git a/unison-cli/src/Unison/Codebase/Editor/Input.hs b/unison-cli/src/Unison/Codebase/Editor/Input.hs index 8dc38bb14..86ecb3849 100644 --- a/unison-cli/src/Unison/Codebase/Editor/Input.hs +++ b/unison-cli/src/Unison/Codebase/Editor/Input.hs @@ -133,7 +133,7 @@ data Input -- > names #sdflkjsdfhsdf NamesI IsGlobal (HQ.HashQualified Name) | AliasTermI !Bool HashOrHQSplit' Path.Split' -- bool = force? - | AliasTypeI HashOrHQSplit' Path.Split' + | AliasTypeI !Bool HashOrHQSplit' Path.Split' -- bool = force? | AliasManyI [Path.HQSplit] Path' | MoveAllI Path.Path' Path.Path' | -- Move = Rename; It's an HQSplit' not an HQSplit', meaning the arg has to have a name. diff --git a/unison-cli/src/Unison/Codebase/Editor/Output.hs b/unison-cli/src/Unison/Codebase/Editor/Output.hs index 105683c2b..1534f42d0 100644 --- a/unison-cli/src/Unison/Codebase/Editor/Output.hs +++ b/unison-cli/src/Unison/Codebase/Editor/Output.hs @@ -9,6 +9,7 @@ module Unison.Codebase.Editor.Output HistoryTail (..), TestReportStats (..), TodoOutput (..), + todoOutputIsEmpty, UndoFailureReason (..), ShareError (..), UpdateOrUpgrade (..), @@ -18,6 +19,7 @@ module Unison.Codebase.Editor.Output where import Data.List.NonEmpty (NonEmpty) +import Data.Set qualified as Set import Data.Set.NonEmpty (NESet) import Data.Time (UTCTime) import Network.URI (URI) @@ -76,10 +78,11 @@ import Unison.Term (Term) import Unison.Type (Type) import Unison.Typechecker.Context qualified as Context import Unison.UnisonFile qualified as UF -import Unison.Util.Defns (DefnsF) +import Unison.Util.Defns (DefnsF, defnsAreEmpty) import Unison.Util.Pretty qualified as P import Unison.Util.Relation (Relation) import Unison.WatchKind qualified as WK +import qualified Unison.Names as Names type ListDetailed = Bool @@ -119,6 +122,13 @@ data NumberedOutput | ShowDiffAfterPull Path.Path' Path.Absolute PPE.PrettyPrintEnv (BranchDiffOutput Symbol Ann) | -- ShowDiffAfterCreateAuthor NameSegment Path.Path' Path.Absolute PPE.PrettyPrintEnv (BranchDiffOutput Symbol Ann) + | TestResults + TestReportStats + PPE.PrettyPrintEnv + ShowSuccesses + ShowFailures + (Map TermReferenceId [Text]) -- oks + (Map TermReferenceId [Text]) -- fails | Output'Todo !TodoOutput | -- | CantDeleteDefinitions ppe couldntDelete becauseTheseStillReferenceThem CantDeleteDefinitions PPE.PrettyPrintEnvDecl (Map LabeledDependency (NESet LabeledDependency)) @@ -150,6 +160,12 @@ data TodoOutput = TodoOutput ppe :: !PrettyPrintEnvDecl } +todoOutputIsEmpty :: TodoOutput -> Bool +todoOutputIsEmpty todo = + Set.null todo.dependentsOfTodo + && defnsAreEmpty todo.directDependenciesWithoutNames + && Names.isEmpty todo.nameConflicts + data AmbiguousReset'Argument = AmbiguousReset'Hash | AmbiguousReset'Target @@ -263,13 +279,6 @@ data Output | LoadedDefinitionsToSourceFile FilePath Int | TestIncrementalOutputStart PPE.PrettyPrintEnv (Int, Int) TermReferenceId | TestIncrementalOutputEnd PPE.PrettyPrintEnv (Int, Int) TermReferenceId Bool {- True if success, False for Failure -} - | TestResults - TestReportStats - PPE.PrettyPrintEnv - ShowSuccesses - ShowFailures - [(TermReferenceId, Text)] -- oks - [(TermReferenceId, Text)] -- fails | CantUndo UndoFailureReason | -- new/unrepresented references followed by old/removed -- todo: eventually replace these sets with [SearchResult' v Ann] @@ -542,7 +551,6 @@ isFailure o = case o of DisplayRendered {} -> False TestIncrementalOutputStart {} -> False TestIncrementalOutputEnd {} -> False - TestResults _ _ _ _ _ fails -> not (null fails) CantUndo {} -> True BustedBuiltins {} -> True NoConfiguredRemoteMapping {} -> True @@ -677,4 +685,5 @@ isNumberedFailure = \case ShowDiffAfterUndo {} -> False ShowDiffNamespace _ _ _ bd -> BD.isEmpty bd ListNamespaceDependencies {} -> False + TestResults _ _ _ _ _ fails -> not (null fails) Output'Todo {} -> False diff --git a/unison-cli/src/Unison/CommandLine/InputPatterns.hs b/unison-cli/src/Unison/CommandLine/InputPatterns.hs index bfe9d51b4..a453f5f5a 100644 --- a/unison-cli/src/Unison/CommandLine/InputPatterns.hs +++ b/unison-cli/src/Unison/CommandLine/InputPatterns.hs @@ -1400,8 +1400,8 @@ aliasTerm = _ -> Left $ P.wrap "`alias.term` takes two arguments, like `alias.term oldname newname`." } -aliasTermForce :: InputPattern -aliasTermForce = +debugAliasTermForce :: InputPattern +debugAliasTermForce = InputPattern { patternName = "debug.alias.term.force", aliases = [], @@ -1424,9 +1424,24 @@ aliasType = [("type to alias", Required, exactDefinitionTypeQueryArg), ("alias name", Required, newNameArg)] "`alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`." \case - [oldName, newName] -> Input.AliasTypeI <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName + [oldName, newName] -> Input.AliasTypeI False <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName _ -> Left $ P.wrap "`alias.type` takes two arguments, like `alias.type oldname newname`." +debugAliasTypeForce :: InputPattern +debugAliasTypeForce = + InputPattern + { patternName = "debug.alias.type.force", + aliases = [], + visibility = I.Hidden, + args = [("type to alias", Required, exactDefinitionTypeQueryArg), ("alias name", Required, newNameArg)], + help = "`debug.alias.type.force Foo Bar` introduces `Bar` with the same definition as `Foo`.", + parse = \case + [oldName, newName] -> Input.AliasTypeI True <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName + _ -> + Left . warn $ + P.wrap "`debug.alias.type.force` takes two arguments, like `debug.alias.type.force oldname newname`." + } + aliasMany :: InputPattern aliasMany = InputPattern @@ -3303,7 +3318,6 @@ validInputs = [ add, aliasMany, aliasTerm, - aliasTermForce, aliasType, api, authLogin, @@ -3317,6 +3331,8 @@ validInputs = clone, compileScheme, createAuthor, + debugAliasTermForce, + debugAliasTypeForce, debugClearWatchCache, debugDoctor, debugDumpNamespace, diff --git a/unison-cli/src/Unison/CommandLine/OutputMessages.hs b/unison-cli/src/Unison/CommandLine/OutputMessages.hs index 781b7d410..298af2787 100644 --- a/unison-cli/src/Unison/CommandLine/OutputMessages.hs +++ b/unison-cli/src/Unison/CommandLine/OutputMessages.hs @@ -55,6 +55,7 @@ import Unison.Codebase.Editor.Output TestReportStats (CachedTests, NewlyComputed), TodoOutput, UndoFailureReason (CantUndoPastMerge, CantUndoPastStart), + todoOutputIsEmpty, ) import Unison.Codebase.Editor.Output qualified as E import Unison.Codebase.Editor.Output.BranchDiff qualified as OBD @@ -110,7 +111,7 @@ import Unison.PrintError renderCompilerBug, ) import Unison.Project (ProjectAndBranch (..)) -import Unison.Reference (Reference, TermReferenceId) +import Unison.Reference (Reference) import Unison.Reference qualified as Reference import Unison.Referent (Referent) import Unison.Referent qualified as Referent @@ -307,6 +308,29 @@ notifyNumbered = \case ] ) (showDiffNamespace ShowNumbers ppe (absPathToBranchId bAbs) (absPathToBranchId bAbs) diff) + TestResults stats ppe _showSuccess _showFailures oksUnsorted failsUnsorted -> + let oks = Name.sortByText (HQ.toText . fst) [(name r, msgs) | (r, msgs) <- Map.toList oksUnsorted] + fails = Name.sortByText (HQ.toText . fst) [(name r, msgs) | (r, msgs) <- Map.toList failsUnsorted] + name r = PPE.termName ppe (Referent.fromTermReferenceId r) + in ( case stats of + CachedTests 0 _ -> P.callout "😶" $ "No tests to run." + CachedTests n n' | n == n' -> P.lines [cache, "", displayTestResults True oks fails] + CachedTests _n m -> + if m == 0 + then "✅ " + else + P.indentN 2 $ + P.lines ["", cache, "", displayTestResults False oks fails, "", "✅ "] + NewlyComputed -> + P.lines + [ " " <> P.bold "New test results:", + "", + displayTestResults True oks fails + ], + fmap (SA.HashQualified . fst) $ oks <> fails + ) + where + cache = P.bold "Cached test results " <> "(`help testcache` to learn more)" Output'Todo todoOutput -> runNumbered (handleTodoOutput todoOutput) CantDeleteDefinitions ppeDecl endangerments -> ( P.warnCallout $ @@ -638,29 +662,6 @@ notifyUser dir = \case OutputRewrittenFile dest vs -> displayOutputRewrittenFile dest vs DisplayRendered outputLoc pp -> displayRendered outputLoc pp - TestResults stats ppe _showSuccess _showFailures oks fails -> case stats of - CachedTests 0 _ -> pure . P.callout "😶" $ "No tests to run." - CachedTests n n' - | n == n' -> - pure $ - P.lines [cache, "", displayTestResults True ppe oks fails] - CachedTests _n m -> - pure $ - if m == 0 - then "✅ " - else - P.indentN 2 $ - P.lines ["", cache, "", displayTestResults False ppe oks fails, "", "✅ "] - NewlyComputed -> do - clearCurrentLine - pure $ - P.lines - [ " " <> P.bold "New test results:", - "", - displayTestResults True ppe oks fails - ] - where - cache = P.bold "Cached test results " <> "(`help testcache` to learn more)" TestIncrementalOutputStart ppe (n, total) r -> do putPretty' $ P.shown (total - n) @@ -1199,7 +1200,7 @@ notifyUser dir = \case ] where name :: Name - name = Path.unsafeToName' (HQ'.toName (Path.unsplitHQ' p)) + name = HQ'.toName $ Path.nameFromHQSplit' p qualifyTerm :: Referent -> Pretty qualifyTerm = P.syntaxToColor . prettyNamedReferent hashLen name qualifyType :: Reference -> Pretty @@ -2535,38 +2536,37 @@ displayRendered outputLoc pp = displayTestResults :: Bool -> -- whether to show the tip - PPE.PrettyPrintEnv -> - [(TermReferenceId, Text)] -> - [(TermReferenceId, Text)] -> + [(HQ.HashQualified Name, [Text])] -> + [(HQ.HashQualified Name, [Text])] -> Pretty -displayTestResults showTip ppe oksUnsorted failsUnsorted = - let oks = Name.sortByText fst [(name r, msg) | (r, msg) <- oksUnsorted] - fails = Name.sortByText fst [(name r, msg) | (r, msg) <- failsUnsorted] - name r = HQ.toText $ PPE.termName ppe (Referent.fromTermReferenceId r) +displayTestResults showTip oks fails = + let name = P.text . HQ.toText okMsg = if null oks then mempty - else P.column2 [(P.green "◉ " <> P.text r, " " <> P.green (P.text msg)) | (r, msg) <- oks] + else + P.indentN 2 $ + P.numberedColumn2ListFrom 0 [(name r, P.lines $ P.green . (" ◉ " <>) . P.text <$> msgs) | (r, msgs) <- oks] okSummary = if null oks then mempty - else "✅ " <> P.bold (P.num (length oks)) <> P.green " test(s) passing" + else "✅ " <> P.bold (P.num (sum $ fmap (length . snd) oks)) <> P.green " test(s) passing" failMsg = if null fails then mempty - else P.column2 [(P.red "✗ " <> P.text r, " " <> P.red (P.text msg)) | (r, msg) <- fails] + else + P.indentN 2 $ + P.numberedColumn2ListFrom + (length oks) + [(name r, P.lines $ P.red . (" ✗ " <>) . P.text <$> msgs) | (r, msgs) <- fails] failSummary = if null fails then mempty - else "🚫 " <> P.bold (P.num (length fails)) <> P.red " test(s) failing" + else "🚫 " <> P.bold (P.num (sum $ fmap (length . snd) fails)) <> P.red " test(s) failing" tipMsg = if not showTip || (null oks && null fails) then mempty - else - tip $ - "Use " - <> P.blue ("view " <> P.text (fst $ head (fails ++ oks))) - <> "to view the source of a test." + else tip $ "Use " <> P.blue "view 1" <> "to view the source of a test." in if null oks && null fails then "😶 No tests available." else @@ -2662,66 +2662,68 @@ runNumbered m = in (a, Foldable.toList args) handleTodoOutput :: TodoOutput -> Numbered Pretty -handleTodoOutput todo = do - prettyConflicts <- - if todo.nameConflicts == mempty - then pure mempty - else renderNameConflicts todo.ppe.unsuffixifiedPPE todo.nameConflicts +handleTodoOutput todo + | todoOutputIsEmpty todo = pure "You have no pending todo items. Good work! ✅" + | otherwise = do + prettyConflicts <- + if todo.nameConflicts == mempty + then pure mempty + else renderNameConflicts todo.ppe.unsuffixifiedPPE todo.nameConflicts - prettyDependentsOfTodo <- do - if Set.null todo.dependentsOfTodo - then pure mempty - else do - terms <- - for (Set.toList todo.dependentsOfTodo) \term -> do - n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.idToShortHash term))) - let name = - term - & Referent.fromTermReferenceId - & PPE.termName todo.ppe.suffixifiedPPE - & prettyHashQualified - & P.syntaxToColor - pure (formatNum n <> name) - pure $ - P.wrap "These terms call `todo`:" - <> P.newline - <> P.newline - <> P.indentN 2 (P.lines terms) + prettyDependentsOfTodo <- do + if Set.null todo.dependentsOfTodo + then pure mempty + else do + terms <- + for (Set.toList todo.dependentsOfTodo) \term -> do + n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.idToShortHash term))) + let name = + term + & Referent.fromTermReferenceId + & PPE.termName todo.ppe.suffixifiedPPE + & prettyHashQualified + & P.syntaxToColor + pure (formatNum n <> name) + pure $ + P.wrap "These terms call `todo`:" + <> P.newline + <> P.newline + <> P.indentN 2 (P.lines terms) - prettyDirectTermDependenciesWithoutNames <- do - if Set.null todo.directDependenciesWithoutNames.terms - then pure mempty - else do - terms <- - for (Set.toList todo.directDependenciesWithoutNames.terms) \term -> do - n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.toShortHash term))) - pure (formatNum n <> P.syntaxToColor (prettyReference todo.hashLen term)) - pure $ - P.wrap "These terms do not have any names in the current namespace:" - <> P.newline - <> P.newline - <> P.indentN 2 (P.lines terms) + prettyDirectTermDependenciesWithoutNames <- do + if Set.null todo.directDependenciesWithoutNames.terms + then pure mempty + else do + terms <- + for (Set.toList todo.directDependenciesWithoutNames.terms) \term -> do + n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.toShortHash term))) + pure (formatNum n <> P.syntaxToColor (prettyReference todo.hashLen term)) + pure $ + P.wrap "These terms do not have any names in the current namespace:" + <> P.newline + <> P.newline + <> P.indentN 2 (P.lines terms) - prettyDirectTypeDependenciesWithoutNames <- do - if Set.null todo.directDependenciesWithoutNames.types - then pure mempty - else do - types <- - for (Set.toList todo.directDependenciesWithoutNames.types) \typ -> do - n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.toShortHash typ))) - pure (formatNum n <> P.syntaxToColor (prettyReference todo.hashLen typ)) - pure $ - P.wrap "These types do not have any names in the current namespace:" - <> P.newline - <> P.newline - <> P.indentN 2 (P.lines types) + prettyDirectTypeDependenciesWithoutNames <- do + if Set.null todo.directDependenciesWithoutNames.types + then pure mempty + else do + types <- + for (Set.toList todo.directDependenciesWithoutNames.types) \typ -> do + n <- addNumberedArg (SA.HashQualified (HQ.HashOnly (Reference.toShortHash typ))) + pure (formatNum n <> P.syntaxToColor (prettyReference todo.hashLen typ)) + pure $ + P.wrap "These types do not have any names in the current namespace:" + <> P.newline + <> P.newline + <> P.indentN 2 (P.lines types) - (pure . P.sep "\n\n" . P.nonEmpty) - [ prettyDependentsOfTodo, - prettyDirectTermDependenciesWithoutNames, - prettyDirectTypeDependenciesWithoutNames, - prettyConflicts - ] + (pure . P.sep "\n\n" . P.nonEmpty) + [ prettyDependentsOfTodo, + prettyDirectTermDependenciesWithoutNames, + prettyDirectTypeDependenciesWithoutNames, + prettyConflicts + ] listOfDefinitions :: (Var v) => Input.FindScope -> PPE.PrettyPrintEnv -> E.ListDetailed -> [SR'.SearchResult' v a] -> IO Pretty @@ -3449,7 +3451,7 @@ listDependentsOrDependencies ppe labelStart label lds types terms = P.lines $ [ P.indentN 2 $ P.bold "Types:", "", - P.indentN 2 $ P.numbered (numFrom 0) $ c . prettyHashQualified <$> types + P.indentN 2 . P.numberedList $ c . prettyHashQualified <$> types ] termsOut = if null terms @@ -3458,7 +3460,6 @@ listDependentsOrDependencies ppe labelStart label lds types terms = P.lines [ P.indentN 2 $ P.bold "Terms:", "", - P.indentN 2 $ P.numbered (numFrom $ length types) $ c . prettyHashQualified <$> terms + P.indentN 2 . P.numberedListFrom (length types) $ c . prettyHashQualified <$> terms ] - numFrom k n = P.hiBlack $ P.shown (k + n) <> "." c = P.syntaxToColor diff --git a/unison-cli/src/Unison/LSP/VFS.hs b/unison-cli/src/Unison/LSP/VFS.hs index 4be5573a4..8244d6461 100644 --- a/unison-cli/src/Unison/LSP/VFS.hs +++ b/unison-cli/src/Unison/LSP/VFS.hs @@ -81,7 +81,11 @@ identifierSplitAtPosition uri pos = do vf <- getVirtualFile uri PosPrefixInfo {fullLine, cursorPos} <- MaybeT (VFS.getCompletionPrefix pos vf) let (before, after) = Text.splitAt (cursorPos ^. character . to fromIntegral) fullLine - pure (Text.takeWhileEnd isIdentifierChar before, Text.takeWhile isIdentifierChar after) + pure + ( Text.takeWhileEnd isIdentifierChar before, + -- names can end with '!', and it's not a force, so we include it in the identifier if it's at the end. + Text.takeWhile (\c -> isIdentifierChar c || c == '!') after + ) where isIdentifierChar c = -- Manually exclude '!' and apostrophe, since those are usually just forces and diff --git a/unison-cli/unison-cli.cabal b/unison-cli/unison-cli.cabal index dd26e4321..a8b820276 100644 --- a/unison-cli/unison-cli.cabal +++ b/unison-cli/unison-cli.cabal @@ -266,7 +266,6 @@ library , unison-sqlite , unison-syntax , unison-util-base32hex - , unison-util-nametree , unison-util-relation , unliftio , unordered-containers @@ -410,7 +409,6 @@ executable transcripts , unison-sqlite , unison-syntax , unison-util-base32hex - , unison-util-nametree , unison-util-relation , unliftio , unordered-containers @@ -558,7 +556,6 @@ test-suite cli-tests , unison-sqlite , unison-syntax , unison-util-base32hex - , unison-util-nametree , unison-util-relation , unliftio , unordered-containers diff --git a/unison-core/package.yaml b/unison-core/package.yaml index 210367d23..fb5b62b73 100644 --- a/unison-core/package.yaml +++ b/unison-core/package.yaml @@ -24,6 +24,8 @@ library: - mtl - rfc5051 - safe + - semialign + - semigroups - text - text-builder - these @@ -54,7 +56,7 @@ tests: source-dirs: test default-extensions: - - ApplicativeDo + - BangPatterns - BlockArguments - DeriveAnyClass - DeriveFoldable @@ -62,17 +64,20 @@ default-extensions: - DeriveGeneric - DeriveTraversable - DerivingStrategies + - DerivingVia - DoAndIfThenElse - FlexibleContexts - FlexibleInstances - GADTs - GeneralizedNewtypeDeriving - ImportQualifiedPost + - InstanceSigs - KindSignatures - LambdaCase - MultiParamTypeClasses - NamedFieldPuns - OverloadedStrings + - OverloadedRecordDot - PatternSynonyms - RankNTypes - ScopedTypeVariables diff --git a/lib/unison-util-nametree/src/Unison/Util/Defns.hs b/unison-core/src/Unison/Util/Defns.hs similarity index 100% rename from lib/unison-util-nametree/src/Unison/Util/Defns.hs rename to unison-core/src/Unison/Util/Defns.hs diff --git a/lib/unison-util-nametree/src/Unison/Util/Nametree.hs b/unison-core/src/Unison/Util/Nametree.hs similarity index 100% rename from lib/unison-util-nametree/src/Unison/Util/Nametree.hs rename to unison-core/src/Unison/Util/Nametree.hs diff --git a/unison-core/unison-core1.cabal b/unison-core/unison-core1.cabal index f5ea030c4..f40185f4d 100644 --- a/unison-core/unison-core1.cabal +++ b/unison-core/unison-core1.cabal @@ -55,12 +55,14 @@ library Unison.Type Unison.Type.Names Unison.Util.Components + Unison.Util.Defns + Unison.Util.Nametree Unison.Var Unison.WatchKind hs-source-dirs: src default-extensions: - ApplicativeDo + BangPatterns BlockArguments DeriveAnyClass DeriveFoldable @@ -68,17 +70,20 @@ library DeriveGeneric DeriveTraversable DerivingStrategies + DerivingVia DoAndIfThenElse FlexibleContexts FlexibleInstances GADTs GeneralizedNewtypeDeriving ImportQualifiedPost + InstanceSigs KindSignatures LambdaCase MultiParamTypeClasses NamedFieldPuns OverloadedStrings + OverloadedRecordDot PatternSynonyms RankNTypes ScopedTypeVariables @@ -102,6 +107,8 @@ library , nonempty-containers , rfc5051 , safe + , semialign + , semigroups , text , text-builder , these @@ -123,7 +130,7 @@ test-suite tests hs-source-dirs: test default-extensions: - ApplicativeDo + BangPatterns BlockArguments DeriveAnyClass DeriveFoldable @@ -131,17 +138,20 @@ test-suite tests DeriveGeneric DeriveTraversable DerivingStrategies + DerivingVia DoAndIfThenElse FlexibleContexts FlexibleInstances GADTs GeneralizedNewtypeDeriving ImportQualifiedPost + InstanceSigs KindSignatures LambdaCase MultiParamTypeClasses NamedFieldPuns OverloadedStrings + OverloadedRecordDot PatternSynonyms RankNTypes ScopedTypeVariables diff --git a/unison-merge/package.yaml b/unison-merge/package.yaml index 73f33af4a..68cb7d072 100644 --- a/unison-merge/package.yaml +++ b/unison-merge/package.yaml @@ -34,7 +34,6 @@ dependencies: - unison-sqlite - unison-syntax - unison-util-cache - - unison-util-nametree - unison-util-relation - vector - witherable diff --git a/unison-merge/unison-merge.cabal b/unison-merge/unison-merge.cabal index ab6bebe3d..ee5b36f48 100644 --- a/unison-merge/unison-merge.cabal +++ b/unison-merge/unison-merge.cabal @@ -103,7 +103,6 @@ library , unison-sqlite , unison-syntax , unison-util-cache - , unison-util-nametree , unison-util-relation , vector , witherable diff --git a/unison-share-api/src/Unison/Server/Local.hs b/unison-share-api/src/Unison/Server/Local.hs index f5c3525f4..04a6d9f41 100644 --- a/unison-share-api/src/Unison/Server/Local.hs +++ b/unison-share-api/src/Unison/Server/Local.hs @@ -41,11 +41,11 @@ relocateToNameRoot perspective query rootBranch = do -- Since the project root is lower down we need to strip the part of the prefix -- which is now redundant. pure . Right $ (projectRoot, query <&> \n -> fromMaybe n $ Path.unprefixName (Path.Absolute remainder) n) - -- The namesRoot is _inside_ of the project containing the query + -- The namesRoot is _inside (or equal to)_ the project containing the query (_sharedPrefix, remainder, Path.Empty) -> do -- Since the project is higher up, we need to prefix the query -- with the remainder of the path - pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.AbsolutePath' $ Path.Absolute remainder)) + pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.RelativePath' $ Path.Relative remainder)) -- The namesRoot and project root are disjoint, this shouldn't ever happen. (_, _, _) -> pure $ Left (DisjointProjectAndPerspective perspective projectRoot) diff --git a/unison-src/builtin-tests/base.md b/unison-src/builtin-tests/base.md index d4717fdcc..70443ad0f 100644 --- a/unison-src/builtin-tests/base.md +++ b/unison-src/builtin-tests/base.md @@ -5,7 +5,7 @@ Thus, make sure the contents of this file define the contents of the cache (e.g. don't pull `latest`.) ```ucm -.> pull @unison/base/releases/2.5.0 .base -.> builtins.mergeio -.> undo +scratch/main> pull @unison/base/releases/2.5.0 .base +scratch/main> builtins.mergeio +scratch/main> undo ``` diff --git a/unison-src/builtin-tests/interpreter-tests.tpl.md b/unison-src/builtin-tests/interpreter-tests.tpl.md index 2d09efdc0..9e34968a7 100644 --- a/unison-src/builtin-tests/interpreter-tests.tpl.md +++ b/unison-src/builtin-tests/interpreter-tests.tpl.md @@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release. ```ucm:hide:error -.> this is a hack to trigger an error, in order to swallow any error on the next line. -.> we delete the project to avoid any merge conflicts or complaints from ucm. -.> delete.project runtime-tests +scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line. +scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm. +scratch/main> delete.project runtime-tests ``` ```ucm:hide -.> clone ${runtime_tests_version} runtime-tests/selected +scratch/main> clone ${runtime_tests_version} runtime-tests/selected ``` ```ucm diff --git a/unison-src/builtin-tests/jit-tests.output.md b/unison-src/builtin-tests/jit-tests.output.md index 55c9234d5..36da40929 100644 --- a/unison-src/builtin-tests/jit-tests.output.md +++ b/unison-src/builtin-tests/jit-tests.output.md @@ -40,11 +40,11 @@ foo = do ``` ```ucm -.> run.native foo +scratch/main> run.native foo () -.> run.native foo +scratch/main> run.native foo () diff --git a/unison-src/builtin-tests/jit-tests.tpl.md b/unison-src/builtin-tests/jit-tests.tpl.md index b24a7c7c7..ea4a65793 100644 --- a/unison-src/builtin-tests/jit-tests.tpl.md +++ b/unison-src/builtin-tests/jit-tests.tpl.md @@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release. ```ucm:hide:error -.> this is a hack to trigger an error, in order to swallow any error on the next line. -.> we delete the project to avoid any merge conflicts or complaints from ucm. -.> delete.project runtime-tests +scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line. +scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm. +scratch/main> delete.project runtime-tests ``` ```ucm:hide -.> clone ${runtime_tests_version} runtime-tests/selected +scratch/main> clone ${runtime_tests_version} runtime-tests/selected ``` ```ucm @@ -31,8 +31,8 @@ foo = do ``` ```ucm -.> run.native foo -.> run.native foo +scratch/main> run.native foo +scratch/main> run.native foo ``` This can also only be tested by separately running this test, because diff --git a/unison-src/transcripts-manual/benchmarks.md b/unison-src/transcripts-manual/benchmarks.md index 0a8ff9358..2a3fe38a6 100644 --- a/unison-src/transcripts-manual/benchmarks.md +++ b/unison-src/transcripts-manual/benchmarks.md @@ -1,6 +1,6 @@ ```ucm:hide -.> pull unison.public.base.releases.M4d base -.> pull runarorama.public.sort.data sort +scratch/main> pull unison.public.base.releases.M4d base +scratch/main> pull runarorama.public.sort.data sort ``` ```unison:hide @@ -34,63 +34,63 @@ prepare = do ``` ```ucm:hide -.> add -.> run prepare +scratch/main> add +scratch/main> run prepare ``` ## Benchmarks ```ucm -.> load unison-src/transcripts-manual/benchmarks/each.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/each.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/listmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/listmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/listfilter.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/listfilter.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/random.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/random.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/simpleloop.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/simpleloop.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/fibonacci.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/fibonacci.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/map.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/map.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/natmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/natmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/stm.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/stm.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/tmap.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/tmap.u +scratch/main> run main ``` ```ucm -.> load unison-src/transcripts-manual/benchmarks/array-sort.u -.> run main +scratch/main> load unison-src/transcripts-manual/benchmarks/array-sort.u +scratch/main> run main ``` \ No newline at end of file diff --git a/unison-src/transcripts-manual/docs.to-html.md b/unison-src/transcripts-manual/docs.to-html.md index 528d038e4..282de4e5e 100644 --- a/unison-src/transcripts-manual/docs.to-html.md +++ b/unison-src/transcripts-manual/docs.to-html.md @@ -1,6 +1,5 @@ ```ucm -.> project.create test-html-docs -test-html-docs/main> builtins.merge +test-html-docs/main> builtins.mergeio lib.builtins ``` ```unison diff --git a/unison-src/transcripts-manual/docs.to-html.output.md b/unison-src/transcripts-manual/docs.to-html.output.md index fbd51a4ea..7755e2e2d 100644 --- a/unison-src/transcripts-manual/docs.to-html.output.md +++ b/unison-src/transcripts-manual/docs.to-html.output.md @@ -1,26 +1,5 @@ ```ucm -.> project.create test-html-docs - - 🎉 I've created the project test-html-docs. - - I'll now fetch the latest version of the base Unison - library... - - Downloaded 12886 entities. - - 🎨 Type `ui` to explore this project's code in your browser. - 🔭 Discover libraries at https://share.unison-lang.org - 📖 Use `help-topic projects` to learn more about projects. - - Write your first Unison code with UCM: - - 1. Open scratch.u. - 2. Write some Unison code and save the file. - 3. In UCM, type `add` to save it to your new project. - - 🎉 🥳 Happy coding! - -test-html-docs/main> builtins.merge +test-html-docs/main> builtins.mergeio lib.builtins Done. @@ -47,13 +26,11 @@ some.outside = 3 ⍟ These new definitions are ok to `add`: some.ns.direct : Nat - some.ns.direct.doc : Doc + some.ns.direct.doc : Doc2 some.ns.pretty.deeply.nested : Nat - (also named lib.base.data.Map.internal.ratio) - some.ns.pretty.deeply.nested.doc : Doc + some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat - (also named lib.base.data.Map.internal.delta) - some.outside.doc : Doc + some.outside.doc : Doc2 ``` ```ucm @@ -62,13 +39,11 @@ test-html-docs/main> add ⍟ I've added these definitions: some.ns.direct : Nat - some.ns.direct.doc : Doc + some.ns.direct.doc : Doc2 some.ns.pretty.deeply.nested : Nat - (also named lib.base.data.Map.internal.ratio) - some.ns.pretty.deeply.nested.doc : Doc + some.ns.pretty.deeply.nested.doc : Doc2 some.outside : Nat - (also named lib.base.data.Map.internal.delta) - some.outside.doc : Doc + some.outside.doc : Doc2 test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html diff --git a/unison-src/transcripts-manual/gen-racket-libs.md b/unison-src/transcripts-manual/gen-racket-libs.md index 811ec14f5..178503c96 100644 --- a/unison-src/transcripts-manual/gen-racket-libs.md +++ b/unison-src/transcripts-manual/gen-racket-libs.md @@ -4,7 +4,7 @@ When we start out, `./scheme-libs/racket` contains a bunch of library files that Next, we'll download the jit project and generate a few Racket files from it. ```ucm -jit-setup/main> lib.install @unison/internal/releases/0.0.17 +jit-setup/main> lib.install @unison/internal/releases/0.0.18 ``` ```unison diff --git a/unison-src/transcripts-manual/gen-racket-libs.output.md b/unison-src/transcripts-manual/gen-racket-libs.output.md index 241a9cdc5..1e003ab48 100644 --- a/unison-src/transcripts-manual/gen-racket-libs.output.md +++ b/unison-src/transcripts-manual/gen-racket-libs.output.md @@ -4,29 +4,12 @@ When we start out, `./scheme-libs/racket` contains a bunch of library files that Next, we'll download the jit project and generate a few Racket files from it. ```ucm -.> project.create-empty jit-setup +jit-setup/main> lib.install @unison/internal/releases/0.0.18 - 🎉 I've created the project jit-setup. + Downloaded 14917 entities. - 🎨 Type `ui` to explore this project's code in your browser. - 🔭 Discover libraries at https://share.unison-lang.org - 📖 Use `help-topic projects` to learn more about projects. - - Write your first Unison code with UCM: - - 1. Open scratch.u. - 2. Write some Unison code and save the file. - 3. In UCM, type `add` to save it to your new project. - - 🎉 🥳 Happy coding! - -jit-setup/main> pull @unison/internal/releases/0.0.17 lib.jit - - Downloaded 15091 entities. - - ✅ - - Successfully pulled into lib.jit, which was empty. + I installed @unison/internal/releases/0.0.18 as + unison_internal_0_0_18. ``` ```unison diff --git a/unison-src/transcripts-manual/remote-tab-completion.md b/unison-src/transcripts-manual/remote-tab-completion.md index da783b9de..55b4adeec 100644 --- a/unison-src/transcripts-manual/remote-tab-completion.md +++ b/unison-src/transcripts-manual/remote-tab-completion.md @@ -3,5 +3,5 @@ Note: this makes a network call to share to get completions ```ucm -.> debug.tab-complete pull unison.pub +scratch/main> debug.tab-complete pull unison.pub ``` diff --git a/unison-src/transcripts-manual/rewrites.md b/unison-src/transcripts-manual/rewrites.md index 15a5a0638..891cf53bd 100644 --- a/unison-src/transcripts-manual/rewrites.md +++ b/unison-src/transcripts-manual/rewrites.md @@ -1,8 +1,8 @@ ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` ## Structural find and replace @@ -37,19 +37,19 @@ rule2 x = @rewrite signature Optional ==> Optional2 Let's rewrite these: ```ucm -.> rewrite rule1 -.> rewrite eitherToOptional +scratch/main> rewrite rule1 +scratch/main> rewrite eitherToOptional ``` ```ucm:hide -.> load -.> add +scratch/main> load +scratch/main> add ``` After adding to the codebase, here's the rewritten source: ```ucm -.> view ex1 Either.mapRight rule1 +scratch/main> view ex1 Either.mapRight rule1 ``` Another example, showing that we can rewrite to definitions that only exist in the file: @@ -75,18 +75,18 @@ blah2 = 456 Let's apply the rewrite `woot1to2`: ```ucm -.> rewrite woot1to2 +scratch/main> rewrite woot1to2 ``` ```ucm:hide -.> load -.> add +scratch/main> load +scratch/main> add ``` After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ```ucm -.> view wootEx +scratch/main> view wootEx ``` This example shows that rewrite rules can to refer to term definitions that only exist in the file: @@ -111,15 +111,15 @@ sameFileEx = ``` ```ucm:hide -.> rewrite rule -.> load -.> add +scratch/main> rewrite rule +scratch/main> load +scratch/main> add ``` After adding the rewritten form to the codebase, here's the rewritten definitions: ```ucm -.> view foo1 foo2 sameFileEx +scratch/main> view foo1 foo2 sameFileEx ``` ## Capture avoidance @@ -145,13 +145,13 @@ sameFileEx = In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding. ```ucm -.> rewrite rule +scratch/main> rewrite rule ``` Instead, it should be an unbound free variable, which doesn't typecheck: ```ucm:error -.> load +scratch/main> load ``` In this example, the `a` is locally bound by the rule, so it shouldn't capture the `a = 39494` binding which is in scope at the point of the replacement: @@ -167,13 +167,13 @@ rule a = @rewrite ``` ```ucm -.> rewrite rule +scratch/main> rewrite rule ``` The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error: ```ucm:error -.> load +scratch/main> load ``` ## Structural find @@ -183,7 +183,7 @@ eitherEx = Left ("hello", "there") ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison:hide @@ -192,7 +192,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ```ucm -.> sfind findEitherEx -.> sfind findEitherFailure -.> find 1-5 +scratch/main> sfind findEitherEx +scratch/main> sfind findEitherFailure +scratch/main> find 1-5 ``` diff --git a/unison-src/transcripts-manual/rewrites.output.md b/unison-src/transcripts-manual/rewrites.output.md index 415330f13..d1ab897dc 100644 --- a/unison-src/transcripts-manual/rewrites.output.md +++ b/unison-src/transcripts-manual/rewrites.output.md @@ -31,7 +31,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 Let's rewrite these: ```ucm -.> rewrite rule1 +scratch/main> rewrite rule1 ☝️ @@ -39,7 +39,7 @@ Let's rewrite these: The rewritten file has been added to the top of scratch.u -.> rewrite eitherToOptional +scratch/main> rewrite eitherToOptional ☝️ @@ -112,7 +112,7 @@ rule2 x = @rewrite signature Optional ==> Optional2 After adding to the codebase, here's the rewritten source: ```ucm -.> view ex1 Either.mapRight rule1 +scratch/main> view ex1 Either.mapRight rule1 Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b Either.mapRight f = cases @@ -158,7 +158,7 @@ blah2 = 456 Let's apply the rewrite `woot1to2`: ```ucm -.> rewrite woot1to2 +scratch/main> rewrite woot1to2 ☝️ @@ -194,7 +194,7 @@ blah2 = 456 After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`: ```ucm -.> view wootEx +scratch/main> view wootEx wootEx : Nat ->{Woot2} Nat wootEx a = @@ -226,7 +226,7 @@ sameFileEx = After adding the rewritten form to the codebase, here's the rewritten definitions: ```ucm -.> view foo1 foo2 sameFileEx +scratch/main> view foo1 foo2 sameFileEx foo1 : Nat foo1 = @@ -267,7 +267,7 @@ sameFileEx = In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding. ```ucm -.> rewrite rule +scratch/main> rewrite rule ☝️ @@ -301,7 +301,7 @@ sameFileEx = Instead, it should be an unbound free variable, which doesn't typecheck: ```ucm -.> load +scratch/main> load Loading changes detected in scratch.u. @@ -332,7 +332,7 @@ rule a = @rewrite ``` ```ucm -.> rewrite rule +scratch/main> rewrite rule ☝️ @@ -358,7 +358,7 @@ rule a = The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error: ```ucm -.> load +scratch/main> load Loading changes detected in scratch.u. @@ -388,7 +388,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () ``` ```ucm -.> sfind findEitherEx +scratch/main> sfind findEitherEx 🔎 @@ -398,7 +398,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () Tip: Try `edit 1` to bring this into your scratch file. -.> sfind findEitherFailure +scratch/main> sfind findEitherFailure 🔎 @@ -413,7 +413,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> () Tip: Try `edit 1` or `edit 1-5` to bring these into your scratch file. -.> find 1-5 +scratch/main> find 1-5 1. Exception.catch : '{g, Exception} a ->{g} Either Failure a 2. Exception.reraise : Either Failure a ->{Exception} a diff --git a/unison-src/transcripts-manual/scheme.md b/unison-src/transcripts-manual/scheme.md index 1c1427280..35aae31b2 100644 --- a/unison-src/transcripts-manual/scheme.md +++ b/unison-src/transcripts-manual/scheme.md @@ -2,8 +2,8 @@ This transcript executes very slowly, because the compiler has an entire copy of base (and other stuff) within it. ```ucm:hide -.> builtins.merge -.> pull.without-history unison.public.base.trunk base +scratch/main> builtins.merge +scratch/main> pull.without-history unison.public.base.trunk base ``` ```unison @@ -55,7 +55,7 @@ multiAddUp = repeat 35 '(printAddUp 3000000) ``` ```ucm -.> add -.> run singleAddUp -.> run.native multiAddUp +scratch/main> add +scratch/main> run singleAddUp +scratch/main> run.native multiAddUp ``` diff --git a/unison-src/transcripts-using-base/_base.md b/unison-src/transcripts-using-base/_base.md index 1befbcb2e..8c4d8c707 100644 --- a/unison-src/transcripts-using-base/_base.md +++ b/unison-src/transcripts-using-base/_base.md @@ -10,9 +10,9 @@ transcripts which contain less boilerplate. ## Usage ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` The test shows that `hex (fromHex str) == str` as expected. @@ -24,7 +24,7 @@ test> hex.tests.ex1 = checks let ``` ```ucm:hide -.> test +scratch/main> test ``` Lets do some basic testing of our test harness to make sure its @@ -50,6 +50,6 @@ testAutoClean _ = ``` ```ucm -.> add -.> io.test testAutoClean +scratch/main> add +scratch/main> io.test testAutoClean ``` diff --git a/unison-src/transcripts-using-base/_base.output.md b/unison-src/transcripts-using-base/_base.output.md index eeaebe564..ebc131c83 100644 --- a/unison-src/transcripts-using-base/_base.output.md +++ b/unison-src/transcripts-using-base/_base.output.md @@ -53,21 +53,21 @@ testAutoClean _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testAutoClean : '{IO} [Result] -.> io.test testAutoClean +scratch/main> io.test testAutoClean New test results: - ◉ testAutoClean our temporary directory should exist - ◉ testAutoClean our temporary directory should no longer exist + 1. testAutoClean ◉ our temporary directory should exist + ◉ our temporary directory should no longer exist ✅ 2 test(s) passing - Tip: Use view testAutoClean 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.md b/unison-src/transcripts-using-base/all-base-hashes.md index d7050cb77..bb0f27c2c 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.md +++ b/unison-src/transcripts-using-base/all-base-hashes.md @@ -1,5 +1,5 @@ This transcript is intended to make visible accidental changes to the hashing algorithm. ```ucm -.> find.verbose +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts-using-base/all-base-hashes.output.md b/unison-src/transcripts-using-base/all-base-hashes.output.md index 63c258e13..99d4128d0 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -1,7 +1,7 @@ This transcript is intended to make visible accidental changes to the hashing algorithm. ```ucm -.> find.verbose +scratch/main> find.verbose 1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo <| : (i ->{g} o) -> i ->{g} o diff --git a/unison-src/transcripts-using-base/binary-encoding-nats.md b/unison-src/transcripts-using-base/binary-encoding-nats.md index 711bcb330..2eee6caf5 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.md @@ -54,6 +54,6 @@ testABunchOfNats _ = ``` ```ucm -.> add -.> io.test testABunchOfNats +scratch/main> add +scratch/main> io.test testABunchOfNats ``` diff --git a/unison-src/transcripts-using-base/binary-encoding-nats.output.md b/unison-src/transcripts-using-base/binary-encoding-nats.output.md index 0227ff8e2..a0602ce7c 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -76,7 +76,7 @@ testABunchOfNats _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -91,81 +91,81 @@ testABunchOfNats _ = testNat : Nat -> '{IO, Stream Result} () testRoundTrip : Nat -> EncDec ->{IO, Stream Result} () -.> io.test testABunchOfNats +scratch/main> io.test testABunchOfNats New test results: - ◉ testABunchOfNats successfully decoded 4294967295 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4294967295 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4294967295 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4294967295 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 1090519040 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 1090519040 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 1090519040 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 1090519040 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4259840 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4259840 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4259840 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 4259840 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 16 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 16640 using 16 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 2255827097 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 2255827097 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 2255827097 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 2255827097 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 16 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 65 using 16 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 64 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 64 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 32 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 32 bit Little Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 16 bit Big Endian - ◉ testABunchOfNats consumed all input - ◉ testABunchOfNats successfully decoded 0 using 16 bit Little Endian - ◉ testABunchOfNats consumed all input + 1. testABunchOfNats ◉ successfully decoded 4294967295 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 4294967295 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 4294967295 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 4294967295 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 1090519040 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 1090519040 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 1090519040 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 1090519040 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 4259840 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 4259840 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 4259840 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 4259840 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 16 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 16640 using 16 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 2255827097 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 2255827097 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 2255827097 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 2255827097 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 65 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 65 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 65 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 65 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 65 using 16 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 65 using 16 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 0 using 64 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 0 using 64 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 0 using 32 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 0 using 32 bit Little Endian + ◉ consumed all input + ◉ successfully decoded 0 using 16 bit Big Endian + ◉ consumed all input + ◉ successfully decoded 0 using 16 bit Little Endian + ◉ consumed all input ✅ 68 test(s) passing - Tip: Use view testABunchOfNats 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.md b/unison-src/transcripts-using-base/codeops.md index 4754eb0aa..1e2797769 100644 --- a/unison-src/transcripts-using-base/codeops.md +++ b/unison-src/transcripts-using-base/codeops.md @@ -153,7 +153,7 @@ swapped name link = ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -236,9 +236,9 @@ we gain the ability to capture output in a transcript, it can be modified to actual show that the serialization works. ```ucm -.> add -.> io.test tests -.> io.test badLoad +scratch/main> add +scratch/main> io.test tests +scratch/main> io.test badLoad ``` ```unison @@ -278,8 +278,8 @@ codeTests = ``` ```ucm -.> add -.> io.test codeTests +scratch/main> add +scratch/main> io.test codeTests ``` ```unison @@ -309,6 +309,6 @@ vtests _ = ``` ```ucm -.> add -.> io.test vtests +scratch/main> add +scratch/main> io.test vtests ``` diff --git a/unison-src/transcripts-using-base/codeops.output.md b/unison-src/transcripts-using-base/codeops.output.md index 3f76560f4..4cae121f3 100644 --- a/unison-src/transcripts-using-base/codeops.output.md +++ b/unison-src/transcripts-using-base/codeops.output.md @@ -200,7 +200,7 @@ swapped name link = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -344,7 +344,7 @@ we gain the ability to capture output in a transcript, it can be modified to actual show that the serialization works. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -360,37 +360,37 @@ to actual show that the serialization works. tests : '{IO} [Result] zapper : Three Nat Nat Nat -> Request {Zap} r -> r -.> io.test tests +scratch/main> io.test tests New test results: - ◉ tests (ext f) passed - ◉ tests (ext h) passed - ◉ tests (ident compound) passed - ◉ tests (ident fib10) passed - ◉ tests (ident effect) passed - ◉ tests (ident zero) passed - ◉ tests (ident h) passed - ◉ tests (ident text) passed - ◉ tests (ident int) passed - ◉ tests (ident float) passed - ◉ tests (ident termlink) passed - ◉ tests (ident bool) passed - ◉ tests (ident bytes) passed + 1. tests ◉ (ext f) passed + ◉ (ext h) passed + ◉ (ident compound) passed + ◉ (ident fib10) passed + ◉ (ident effect) passed + ◉ (ident zero) passed + ◉ (ident h) passed + ◉ (ident text) passed + ◉ (ident int) passed + ◉ (ident float) passed + ◉ (ident termlink) passed + ◉ (ident bool) passed + ◉ (ident bytes) passed ✅ 13 test(s) passing - Tip: Use view tests to view the source of a test. + Tip: Use view 1 to view the source of a test. -.> io.test badLoad +scratch/main> io.test badLoad New test results: - ◉ badLoad serialized77 + 1. badLoad ◉ serialized77 ✅ 1 test(s) passing - Tip: Use view badLoad to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ```unison @@ -443,50 +443,50 @@ codeTests = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: codeTests : '{IO} [Result] -.> io.test codeTests +scratch/main> io.test codeTests New test results: - ◉ codeTests (idem f) passed - ◉ codeTests (idem h) passed - ◉ codeTests (idem rotate) passed - ◉ codeTests (idem zapper) passed - ◉ codeTests (idem showThree) passed - ◉ codeTests (idem concatMap) passed - ◉ codeTests (idem big) passed - ◉ codeTests (idem extensionality) passed - ◉ codeTests (idem identicality) passed - ◉ codeTests (verified f) passed - ◉ codeTests (verified h) passed - ◉ codeTests (verified rotate) passed - ◉ codeTests (verified zapper) passed - ◉ codeTests (verified showThree) passed - ◉ codeTests (verified concatMap) passed - ◉ codeTests (verified big) passed - ◉ codeTests (verified extensionality) passed - ◉ codeTests (verified identicality) passed - ◉ codeTests (verified mutual0) passed - ◉ codeTests (verified mutual1) passed - ◉ codeTests (verified mutual2) passed - ◉ codeTests (rejected missing mutual0) passed - ◉ codeTests (rejected missing mutual1) passed - ◉ codeTests (rejected missing mutual2) passed - ◉ codeTests (rejected swapped zapper) passed - ◉ codeTests (rejected swapped extensionality) passed - ◉ codeTests (rejected swapped identicality) passed - ◉ codeTests (rejected swapped mututal0) passed - ◉ codeTests (rejected swapped mututal1) passed - ◉ codeTests (rejected swapped mututal2) passed + 1. codeTests ◉ (idem f) passed + ◉ (idem h) passed + ◉ (idem rotate) passed + ◉ (idem zapper) passed + ◉ (idem showThree) passed + ◉ (idem concatMap) passed + ◉ (idem big) passed + ◉ (idem extensionality) passed + ◉ (idem identicality) passed + ◉ (verified f) passed + ◉ (verified h) passed + ◉ (verified rotate) passed + ◉ (verified zapper) passed + ◉ (verified showThree) passed + ◉ (verified concatMap) passed + ◉ (verified big) passed + ◉ (verified extensionality) passed + ◉ (verified identicality) passed + ◉ (verified mutual0) passed + ◉ (verified mutual1) passed + ◉ (verified mutual2) passed + ◉ (rejected missing mutual0) passed + ◉ (rejected missing mutual1) passed + ◉ (rejected missing mutual2) passed + ◉ (rejected swapped zapper) passed + ◉ (rejected swapped extensionality) passed + ◉ (rejected swapped identicality) passed + ◉ (rejected swapped mututal0) passed + ◉ (rejected swapped mututal1) passed + ◉ (rejected swapped mututal2) passed ✅ 30 test(s) passing - Tip: Use view codeTests to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ```unison @@ -530,28 +530,28 @@ vtests _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: validateTest : Link.Term ->{IO} Result vtests : '{IO} [Result] -.> io.test vtests +scratch/main> io.test vtests New test results: - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated - ◉ vtests validated + 1. vtests ◉ validated + ◉ validated + ◉ validated + ◉ validated + ◉ validated + ◉ validated + ◉ validated + ◉ validated ✅ 8 test(s) passing - Tip: Use view vtests 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.md b/unison-src/transcripts-using-base/doc.md index 461a4f04b..52973ddb3 100644 --- a/unison-src/transcripts-using-base/doc.md +++ b/unison-src/transcripts-using-base/doc.md @@ -33,9 +33,9 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im You can preview what docs will look like when rendered to the console using the `display` or `docs` commands: ```ucm -.> display d1 -.> docs ImportantConstant -.> docs DayOfWeek +scratch/main> display d1 +scratch/main> docs ImportantConstant +scratch/main> docs DayOfWeek ``` The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions. @@ -45,11 +45,11 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th First, we'll load the `syntax.u` file which has examples of all the syntax: ```ucm -.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u +scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u ``` ```ucm:hide -.> add +scratch/main> add ``` Now we can review different portions of the guide. @@ -57,25 +57,25 @@ we'll show both the pretty-printed source using `view` and the rendered output using `display`: ```ucm -.> view basicFormatting -.> display basicFormatting -.> view lists -.> display lists -.> view evaluation -.> display evaluation -.> view includingSource -.> display includingSource -.> view nonUnisonCodeBlocks -.> display nonUnisonCodeBlocks -.> view otherElements -.> display otherElements +scratch/main> view basicFormatting +scratch/main> display basicFormatting +scratch/main> view lists +scratch/main> display lists +scratch/main> view evaluation +scratch/main> display evaluation +scratch/main> view includingSource +scratch/main> display includingSource +scratch/main> view nonUnisonCodeBlocks +scratch/main> display nonUnisonCodeBlocks +scratch/main> view otherElements +scratch/main> display otherElements ``` Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: ```ucm -.> view doc.guide -.> display doc.guide +scratch/main> view doc.guide +scratch/main> display doc.guide ``` 🌻 THE END diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index 43edad988..e47d8d073 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -51,15 +51,15 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im You can preview what docs will look like when rendered to the console using the `display` or `docs` commands: ```ucm -.> display d1 +scratch/main> display d1 Hello there Alice! -.> docs ImportantConstant +scratch/main> docs ImportantConstant An important constant, equal to `42` -.> docs DayOfWeek +scratch/main> docs DayOfWeek The 7 days of the week, defined as: @@ -73,7 +73,7 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th First, we'll load the `syntax.u` file which has examples of all the syntax: ```ucm -.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u +scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u Loading changes detected in ./unison-src/transcripts-using-base/doc.md.files/syntax.u. @@ -100,7 +100,7 @@ we'll show both the pretty-printed source using `view` and the rendered output using `display`: ```ucm -.> view basicFormatting +scratch/main> view basicFormatting basicFormatting : Doc2 basicFormatting = @@ -130,7 +130,7 @@ and the rendered output using `display`: __Next up:__ {lists} }} -.> display basicFormatting +scratch/main> display basicFormatting # Basic formatting @@ -155,7 +155,7 @@ and the rendered output using `display`: *Next up:* lists -.> view lists +scratch/main> view lists lists : Doc2 lists = @@ -198,7 +198,7 @@ and the rendered output using `display`: 3. Get dressed. }} -.> display lists +scratch/main> display lists # Lists @@ -237,7 +237,7 @@ and the rendered output using `display`: 2. Take shower. 3. Get dressed. -.> view evaluation +scratch/main> view evaluation evaluation : Doc2 evaluation = @@ -272,7 +272,7 @@ and the rendered output using `display`: ``` }} -.> display evaluation +scratch/main> display evaluation # Evaluation @@ -300,7 +300,7 @@ and the rendered output using `display`: cube : Nat -> Nat cube x = x * x * x -.> view includingSource +scratch/main> view includingSource includingSource : Doc2 includingSource = @@ -341,7 +341,7 @@ and the rendered output using `display`: {{ docExample 1 do x -> sqr x }}. }} -.> display includingSource +scratch/main> display includingSource # Including Unison source code @@ -387,7 +387,7 @@ and the rendered output using `display`: application, you can put it in double backticks, like so: `sqr x`. This is equivalent to `sqr x`. -.> view nonUnisonCodeBlocks +scratch/main> view nonUnisonCodeBlocks nonUnisonCodeBlocks : Doc2 nonUnisonCodeBlocks = @@ -420,7 +420,7 @@ and the rendered output using `display`: ``` }} -.> display nonUnisonCodeBlocks +scratch/main> display nonUnisonCodeBlocks # Non-Unison code blocks @@ -449,7 +449,7 @@ and the rendered output using `display`: xs.foldLeft(Nil : List[A])((acc,a) => a +: acc) ``` -.> view otherElements +scratch/main> view otherElements otherElements : Doc2 otherElements = @@ -506,7 +506,7 @@ and the rendered output using `display`: ] }} }} -.> display otherElements +scratch/main> display otherElements There are also asides, callouts, tables, tooltips, and more. These don't currently have special syntax; just use the @@ -549,7 +549,7 @@ and the rendered output using `display`: Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way: ```ucm -.> view doc.guide +scratch/main> view doc.guide doc.guide : Doc2 doc.guide = @@ -569,7 +569,7 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub {{ otherElements }} }} -.> display doc.guide +scratch/main> display doc.guide # Unison computable documentation diff --git a/unison-src/transcripts-using-base/failure-tests.md b/unison-src/transcripts-using-base/failure-tests.md index 049b4fcbb..5f69a8c2a 100644 --- a/unison-src/transcripts-using-base/failure-tests.md +++ b/unison-src/transcripts-using-base/failure-tests.md @@ -19,13 +19,13 @@ test2 = do ``` ```ucm -.> add +scratch/main> add ``` ```ucm:error -.> io.test test1 +scratch/main> io.test test1 ``` ```ucm:error -.> io.test test2 +scratch/main> io.test test2 ``` diff --git a/unison-src/transcripts-using-base/failure-tests.output.md b/unison-src/transcripts-using-base/failure-tests.output.md index d59d3d7bc..7d33aad45 100644 --- a/unison-src/transcripts-using-base/failure-tests.output.md +++ b/unison-src/transcripts-using-base/failure-tests.output.md @@ -33,7 +33,7 @@ test2 = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -42,7 +42,7 @@ test2 = do ``` ```ucm -.> io.test test1 +scratch/main> io.test test1 💔💥 @@ -58,7 +58,7 @@ test2 = do ``` ```ucm -.> io.test test2 +scratch/main> io.test test2 💔💥 diff --git a/unison-src/transcripts-using-base/fix2358.md b/unison-src/transcripts-using-base/fix2358.md index 915a35060..1c543349e 100644 --- a/unison-src/transcripts-using-base/fix2358.md +++ b/unison-src/transcripts-using-base/fix2358.md @@ -10,5 +10,5 @@ timingApp2 _ = ``` ```ucm -.> run timingApp2 +scratch/main> run timingApp2 ``` diff --git a/unison-src/transcripts-using-base/fix2358.output.md b/unison-src/transcripts-using-base/fix2358.output.md index 61a3dd805..d20a06e16 100644 --- a/unison-src/transcripts-using-base/fix2358.output.md +++ b/unison-src/transcripts-using-base/fix2358.output.md @@ -23,7 +23,7 @@ timingApp2 _ = ``` ```ucm -.> run timingApp2 +scratch/main> run timingApp2 () diff --git a/unison-src/transcripts-using-base/fix3939.md b/unison-src/transcripts-using-base/fix3939.md index 7ec695e6c..e9634ee2f 100644 --- a/unison-src/transcripts-using-base/fix3939.md +++ b/unison-src/transcripts-using-base/fix3939.md @@ -6,7 +6,7 @@ meh = 9 ``` ```ucm -.> add -.> find meh -.> docs 1 +scratch/main> add +scratch/main> find meh +scratch/main> docs 1 ``` diff --git a/unison-src/transcripts-using-base/fix3939.output.md b/unison-src/transcripts-using-base/fix3939.output.md index 99197263c..ca4e6d909 100644 --- a/unison-src/transcripts-using-base/fix3939.output.md +++ b/unison-src/transcripts-using-base/fix3939.output.md @@ -20,20 +20,20 @@ meh = 9 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: meh : Nat meh.doc : Doc2 -.> find meh +scratch/main> find meh 1. meh : Nat 2. meh.doc : Doc2 -.> docs 1 +scratch/main> docs 1 A simple doc. diff --git a/unison-src/transcripts-using-base/hashing.md b/unison-src/transcripts-using-base/hashing.md index 99f7db247..f7d6a2bdd 100644 --- a/unison-src/transcripts-using-base/hashing.md +++ b/unison-src/transcripts-using-base/hashing.md @@ -3,7 +3,7 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases. ```ucm -.> ls builtin.Bytes +scratch/main> ls builtin.Bytes ``` Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`. @@ -43,7 +43,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex And here's the full API: ```ucm -.> find-in builtin.crypto +scratch/main> find-in builtin.crypto ``` Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime: @@ -189,11 +189,11 @@ test> crypto.hash.numTests = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` ## HMAC tests @@ -251,9 +251,9 @@ test> md5.tests.ex3 = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` diff --git a/unison-src/transcripts-using-base/hashing.output.md b/unison-src/transcripts-using-base/hashing.output.md index fee4fa0a2..e5d1be279 100644 --- a/unison-src/transcripts-using-base/hashing.output.md +++ b/unison-src/transcripts-using-base/hashing.output.md @@ -3,7 +3,7 @@ Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases. ```ucm -.> ls builtin.Bytes +scratch/main> ls builtin.Bytes 1. ++ (Bytes -> Bytes -> Bytes) 2. at (Nat -> Bytes -> Optional Nat) @@ -120,7 +120,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex And here's the full API: ```ucm -.> find-in builtin.crypto +scratch/main> find-in builtin.crypto 1. type CryptoFailure 2. Ed25519.sign.impl : Bytes @@ -312,40 +312,39 @@ test> crypto.hash.numTests = ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ blake2b_512.tests.ex1 Passed - ◉ blake2b_512.tests.ex2 Passed - ◉ blake2b_512.tests.ex3 Passed - ◉ blake2s_256.tests.ex1 Passed - ◉ crypto.hash.numTests Passed - ◉ sha1.tests.ex1 Passed - ◉ sha1.tests.ex2 Passed - ◉ sha1.tests.ex3 Passed - ◉ sha1.tests.ex4 Passed - ◉ sha2_256.tests.ex1 Passed - ◉ sha2_256.tests.ex2 Passed - ◉ sha2_256.tests.ex3 Passed - ◉ sha2_256.tests.ex4 Passed - ◉ sha2_512.tests.ex1 Passed - ◉ sha2_512.tests.ex2 Passed - ◉ sha2_512.tests.ex3 Passed - ◉ sha2_512.tests.ex4 Passed - ◉ sha3_256.tests.ex1 Passed - ◉ sha3_256.tests.ex2 Passed - ◉ sha3_256.tests.ex3 Passed - ◉ sha3_256.tests.ex4 Passed - ◉ sha3_512.tests.ex1 Passed - ◉ sha3_512.tests.ex2 Passed - ◉ sha3_512.tests.ex3 Passed - ◉ sha3_512.tests.ex4 Passed + 1. blake2b_512.tests.ex1 ◉ Passed + 2. blake2b_512.tests.ex2 ◉ Passed + 3. blake2b_512.tests.ex3 ◉ Passed + 4. blake2s_256.tests.ex1 ◉ Passed + 5. crypto.hash.numTests ◉ Passed + 6. sha1.tests.ex1 ◉ Passed + 7. sha1.tests.ex2 ◉ Passed + 8. sha1.tests.ex3 ◉ Passed + 9. sha1.tests.ex4 ◉ Passed + 10. sha2_256.tests.ex1 ◉ Passed + 11. sha2_256.tests.ex2 ◉ Passed + 12. sha2_256.tests.ex3 ◉ Passed + 13. sha2_256.tests.ex4 ◉ Passed + 14. sha2_512.tests.ex1 ◉ Passed + 15. sha2_512.tests.ex2 ◉ Passed + 16. sha2_512.tests.ex3 ◉ Passed + 17. sha2_512.tests.ex4 ◉ Passed + 18. sha3_256.tests.ex1 ◉ Passed + 19. sha3_256.tests.ex2 ◉ Passed + 20. sha3_256.tests.ex3 ◉ Passed + 21. sha3_256.tests.ex4 ◉ Passed + 22. sha3_512.tests.ex1 ◉ Passed + 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 blake2b_512.tests.ex1 to view the source of a - test. + Tip: Use view 1 to view the source of a test. ``` ## HMAC tests @@ -475,42 +474,41 @@ test> md5.tests.ex3 = ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ blake2b_512.tests.ex1 Passed - ◉ blake2b_512.tests.ex2 Passed - ◉ blake2b_512.tests.ex3 Passed - ◉ blake2s_256.tests.ex1 Passed - ◉ crypto.hash.numTests Passed - ◉ md5.tests.ex1 Passed - ◉ md5.tests.ex2 Passed - ◉ md5.tests.ex3 Passed - ◉ sha1.tests.ex1 Passed - ◉ sha1.tests.ex2 Passed - ◉ sha1.tests.ex3 Passed - ◉ sha1.tests.ex4 Passed - ◉ sha2_256.tests.ex1 Passed - ◉ sha2_256.tests.ex2 Passed - ◉ sha2_256.tests.ex3 Passed - ◉ sha2_256.tests.ex4 Passed - ◉ sha2_512.tests.ex1 Passed - ◉ sha2_512.tests.ex2 Passed - ◉ sha2_512.tests.ex3 Passed - ◉ sha2_512.tests.ex4 Passed - ◉ sha3_256.tests.ex1 Passed - ◉ sha3_256.tests.ex2 Passed - ◉ sha3_256.tests.ex3 Passed - ◉ sha3_256.tests.ex4 Passed - ◉ sha3_512.tests.ex1 Passed - ◉ sha3_512.tests.ex2 Passed - ◉ sha3_512.tests.ex3 Passed - ◉ sha3_512.tests.ex4 Passed + 1. blake2b_512.tests.ex1 ◉ Passed + 2. blake2b_512.tests.ex2 ◉ Passed + 3. blake2b_512.tests.ex3 ◉ Passed + 4. blake2s_256.tests.ex1 ◉ Passed + 5. crypto.hash.numTests ◉ Passed + 6. md5.tests.ex1 ◉ Passed + 7. md5.tests.ex2 ◉ Passed + 8. md5.tests.ex3 ◉ Passed + 9. sha1.tests.ex1 ◉ Passed + 10. sha1.tests.ex2 ◉ Passed + 11. sha1.tests.ex3 ◉ Passed + 12. sha1.tests.ex4 ◉ Passed + 13. sha2_256.tests.ex1 ◉ Passed + 14. sha2_256.tests.ex2 ◉ Passed + 15. sha2_256.tests.ex3 ◉ Passed + 16. sha2_256.tests.ex4 ◉ Passed + 17. sha2_512.tests.ex1 ◉ Passed + 18. sha2_512.tests.ex2 ◉ Passed + 19. sha2_512.tests.ex3 ◉ Passed + 20. sha2_512.tests.ex4 ◉ Passed + 21. sha3_256.tests.ex1 ◉ Passed + 22. sha3_256.tests.ex2 ◉ Passed + 23. sha3_256.tests.ex3 ◉ Passed + 24. sha3_256.tests.ex4 ◉ Passed + 25. sha3_512.tests.ex1 ◉ Passed + 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 blake2b_512.tests.ex1 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.md b/unison-src/transcripts-using-base/mvar.md index d2114c2e2..81be1ed79 100644 --- a/unison-src/transcripts-using-base/mvar.md +++ b/unison-src/transcripts-using-base/mvar.md @@ -51,7 +51,7 @@ testMvars _ = runTest test ``` ```ucm -.> add -.> io.test testMvars +scratch/main> add +scratch/main> io.test testMvars ``` diff --git a/unison-src/transcripts-using-base/mvar.output.md b/unison-src/transcripts-using-base/mvar.output.md index 26cccc7ba..7d92d90c5 100644 --- a/unison-src/transcripts-using-base/mvar.output.md +++ b/unison-src/transcripts-using-base/mvar.output.md @@ -66,33 +66,33 @@ testMvars _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean testMvars : '{IO} [Result] -.> io.test testMvars +scratch/main> io.test testMvars New test results: - ◉ testMvars ma should not be empty - ◉ testMvars should read what you sow - ◉ testMvars should reap what you sow - ◉ testMvars ma should be empty - ◉ testMvars swap returns old contents - ◉ testMvars swap returns old contents - ◉ testMvars tryRead should succeed when not empty - ◉ testMvars tryPut should fail when not empty - ◉ testMvars tryTake should succeed when not empty - ◉ testMvars tryTake should not succeed when empty - ◉ testMvars ma2 should be empty - ◉ testMvars tryTake should fail when empty - ◉ testMvars tryRead should fail when empty + 1. testMvars ◉ ma should not be empty + ◉ should read what you sow + ◉ should reap what you sow + ◉ ma should be empty + ◉ swap returns old contents + ◉ swap returns old contents + ◉ tryRead should succeed when not empty + ◉ tryPut should fail when not empty + ◉ tryTake should succeed when not empty + ◉ tryTake should not succeed when empty + ◉ ma2 should be empty + ◉ tryTake should fail when empty + ◉ tryRead should fail when empty ✅ 13 test(s) passing - Tip: Use view testMvars 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.md b/unison-src/transcripts-using-base/nat-coersion.md index 3f7750189..ca5ad40f2 100644 --- a/unison-src/transcripts-using-base/nat-coersion.md +++ b/unison-src/transcripts-using-base/nat-coersion.md @@ -33,6 +33,6 @@ test = 'let ``` ```ucm -.> add -.> io.test test +scratch/main> add +scratch/main> io.test test ``` diff --git a/unison-src/transcripts-using-base/nat-coersion.output.md b/unison-src/transcripts-using-base/nat-coersion.output.md index 38ab4450f..d4aaf5ef6 100644 --- a/unison-src/transcripts-using-base/nat-coersion.output.md +++ b/unison-src/transcripts-using-base/nat-coersion.output.md @@ -49,7 +49,7 @@ test = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,27 +59,27 @@ test = 'let -> Optional Float ->{Stream Result} () -.> io.test test +scratch/main> io.test test New test results: - ◉ test expected 0.0 got 0.0 - ◉ test round trip though float, expected 0 got 0 - ◉ test expected 0 got 0 - ◉ test round trip though Int, expected 0 got 0 - ◉ test skipped - ◉ test expected 1 got 1 - ◉ test round trip though Int, expected 1 got 1 - ◉ test skipped - ◉ test expected -1 got -1 - ◉ test round trip though Int, expected 18446744073709551615 got 18446744073709551615 - ◉ test expected 1.0000000000000002 got 1.0000000000000002 - ◉ test round trip though float, expected 4607182418800017409 got 4607182418800017409 - ◉ test expected 4607182418800017409 got 4607182418800017409 - ◉ test round trip though Int, expected 4607182418800017409 got 4607182418800017409 + 1. test ◉ expected 0.0 got 0.0 + ◉ round trip though float, expected 0 got 0 + ◉ expected 0 got 0 + ◉ round trip though Int, expected 0 got 0 + ◉ skipped + ◉ expected 1 got 1 + ◉ round trip though Int, expected 1 got 1 + ◉ skipped + ◉ expected -1 got -1 + ◉ round trip though Int, expected 18446744073709551615 got 18446744073709551615 + ◉ expected 1.0000000000000002 got 1.0000000000000002 + ◉ 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 test 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.md b/unison-src/transcripts-using-base/net.md index b1125f701..067f9b9a4 100644 --- a/unison-src/transcripts-using-base/net.md +++ b/unison-src/transcripts-using-base/net.md @@ -10,7 +10,7 @@ socketAccept = compose reraise socketAccept.impl ``` ```ucm:hide -.> add +scratch/main> add ``` # Tests for network related builtins @@ -93,8 +93,8 @@ testDefaultPort _ = runTest test ``` ```ucm -.> add -.> io.test testDefaultPort +scratch/main> add +scratch/main> io.test testDefaultPort ``` This example demonstrates connecting a TCP client socket to a TCP server socket. A thread is started for both client and server. The server socket asks for any availalbe port (by passing "0" as the port number). The server thread then queries for the actual assigned port number, and puts that into an MVar which the client thread can read. The client thread then reads a string from the server and reports it back to the main thread via a different MVar. @@ -149,6 +149,6 @@ testTcpConnect = 'let ``` ```ucm -.> add -.> io.test testTcpConnect +scratch/main> add +scratch/main> io.test testTcpConnect ``` diff --git a/unison-src/transcripts-using-base/net.output.md b/unison-src/transcripts-using-base/net.output.md index 572ef0fbf..cae095824 100644 --- a/unison-src/transcripts-using-base/net.output.md +++ b/unison-src/transcripts-using-base/net.output.md @@ -107,7 +107,7 @@ testDefaultPort _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,17 +115,17 @@ testDefaultPort _ = testDefaultPort : '{IO} [Result] testExplicitHost : '{IO} [Result] -.> io.test testDefaultPort +scratch/main> io.test testDefaultPort New test results: - ◉ testDefaultPort successfully created socket - ◉ testDefaultPort port should be > 1024 - ◉ testDefaultPort port should be < 65536 + 1. testDefaultPort ◉ successfully created socket + ◉ port should be > 1024 + ◉ port should be < 65536 ✅ 3 test(s) passing - Tip: Use view testDefaultPort 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. @@ -194,7 +194,7 @@ testTcpConnect = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -202,14 +202,14 @@ testTcpConnect = 'let serverThread : MVar Nat -> Text -> '{IO} () testTcpConnect : '{IO} [Result] -.> io.test testTcpConnect +scratch/main> io.test testTcpConnect New test results: - ◉ testTcpConnect should have reaped what we've sown + 1. testTcpConnect ◉ should have reaped what we've sown ✅ 1 test(s) passing - Tip: Use view testTcpConnect 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.md b/unison-src/transcripts-using-base/random-deserial.md index 1a97ca73d..2c6ff77de 100644 --- a/unison-src/transcripts-using-base/random-deserial.md +++ b/unison-src/transcripts-using-base/random-deserial.md @@ -56,6 +56,6 @@ serialTests = do ``` ```ucm -.> add -.> io.test serialTests +scratch/main> add +scratch/main> io.test serialTests ``` diff --git a/unison-src/transcripts-using-base/random-deserial.output.md b/unison-src/transcripts-using-base/random-deserial.output.md index 48ff86e18..2606511ba 100644 --- a/unison-src/transcripts-using-base/random-deserial.output.md +++ b/unison-src/transcripts-using-base/random-deserial.output.md @@ -74,7 +74,7 @@ serialTests = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -85,18 +85,18 @@ serialTests = do serialTests : '{IO, Exception} [Result] shuffle : Nat -> [a] -> [a] -.> io.test serialTests +scratch/main> io.test serialTests New test results: - ◉ serialTests case-00 - ◉ serialTests case-01 - ◉ serialTests case-02 - ◉ serialTests case-03 - ◉ serialTests case-04 + 1. serialTests ◉ case-00 + ◉ case-01 + ◉ case-02 + ◉ case-03 + ◉ case-04 ✅ 5 test(s) passing - Tip: Use view serialTests 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.md b/unison-src/transcripts-using-base/ref-promise.md index dd54328ec..3c2575951 100644 --- a/unison-src/transcripts-using-base/ref-promise.md +++ b/unison-src/transcripts-using-base/ref-promise.md @@ -19,8 +19,8 @@ casTest = do ``` ```ucm -.> add -.> io.test casTest +scratch/main> add +scratch/main> io.test casTest ``` Promise is a simple one-shot awaitable condition. @@ -54,9 +54,9 @@ promiseConcurrentTest = do ``` ```ucm -.> add -.> io.test promiseSequentialTest -.> io.test promiseConcurrentTest +scratch/main> add +scratch/main> io.test promiseSequentialTest +scratch/main> io.test promiseConcurrentTest ``` CAS can be used to write an atomic update function. @@ -70,7 +70,7 @@ atomicUpdate ref f = ``` ```ucm -.> add +scratch/main> add ``` Promise can be used to write an operation that spawns N concurrent @@ -91,7 +91,7 @@ spawnN n fa = map Promise.read (go n []) ``` ```ucm -.> add +scratch/main> add ``` We can use these primitives to write a more interesting example, where @@ -123,6 +123,6 @@ fullTest = do ``` ```ucm -.> add -.> io.test fullTest +scratch/main> add +scratch/main> io.test fullTest ``` diff --git a/unison-src/transcripts-using-base/ref-promise.output.md b/unison-src/transcripts-using-base/ref-promise.output.md index 727f62e89..9f4c700b1 100644 --- a/unison-src/transcripts-using-base/ref-promise.output.md +++ b/unison-src/transcripts-using-base/ref-promise.output.md @@ -32,22 +32,22 @@ casTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: casTest : '{IO} [Result] -.> io.test casTest +scratch/main> io.test casTest New test results: - ◉ casTest CAS is successful is there were no conflicting writes - ◉ casTest CAS fails when there was an intervening write + 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 casTest 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. @@ -95,35 +95,33 @@ promiseConcurrentTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: promiseConcurrentTest : '{IO} [Result] promiseSequentialTest : '{IO} [Result] -.> io.test promiseSequentialTest +scratch/main> io.test promiseSequentialTest New test results: - ◉ promiseSequentialTest Should read a value that's been written - ◉ promiseSequentialTest Promise can only be written to once + 1. promiseSequentialTest ◉ Should read a value that's been written + ◉ Promise can only be written to once ✅ 2 test(s) passing - Tip: Use view promiseSequentialTest to view the source of a - test. + Tip: Use view 1 to view the source of a test. -.> io.test promiseConcurrentTest +scratch/main> io.test promiseConcurrentTest New test results: - ◉ promiseConcurrentTest Reads awaits for completion of the Promise + 1. promiseConcurrentTest ◉ Reads awaits for completion of the Promise ✅ 1 test(s) passing - Tip: Use view promiseConcurrentTest 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. @@ -150,7 +148,7 @@ atomicUpdate ref f = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -189,7 +187,7 @@ spawnN n fa = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -238,20 +236,20 @@ fullTest = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: fullTest : '{IO} [Result] -.> io.test fullTest +scratch/main> io.test fullTest New test results: - ◉ fullTest The state of the counter is consistent + 1. fullTest ◉ The state of the counter is consistent ✅ 1 test(s) passing - Tip: Use view fullTest 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.md b/unison-src/transcripts-using-base/serial-test-00.md index ab71adfdd..21860243e 100644 --- a/unison-src/transcripts-using-base/serial-test-00.md +++ b/unison-src/transcripts-using-base/serial-test-00.md @@ -68,6 +68,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-00.output.md b/unison-src/transcripts-using-base/serial-test-00.output.md index 715680f06..88a18a705 100644 --- a/unison-src/transcripts-using-base/serial-test-00.output.md +++ b/unison-src/transcripts-using-base/serial-test-00.output.md @@ -95,7 +95,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,7 +115,7 @@ mkTestCase = do tree2 : Tree Nat tree3 : Tree Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-01.md b/unison-src/transcripts-using-base/serial-test-01.md index da25e8f4a..bc5f84af0 100644 --- a/unison-src/transcripts-using-base/serial-test-01.md +++ b/unison-src/transcripts-using-base/serial-test-01.md @@ -16,6 +16,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-01.output.md b/unison-src/transcripts-using-base/serial-test-01.output.md index 919462163..5825b36ff 100644 --- a/unison-src/transcripts-using-base/serial-test-01.output.md +++ b/unison-src/transcripts-using-base/serial-test-01.output.md @@ -33,7 +33,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -43,7 +43,7 @@ mkTestCase = do l3 : [Char] mkTestCase : '{IO, Exception} () -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-02.md b/unison-src/transcripts-using-base/serial-test-02.md index 3d13ee487..15518165a 100644 --- a/unison-src/transcripts-using-base/serial-test-02.md +++ b/unison-src/transcripts-using-base/serial-test-02.md @@ -30,6 +30,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-02.output.md b/unison-src/transcripts-using-base/serial-test-02.output.md index a6957230e..ecbe82ebe 100644 --- a/unison-src/transcripts-using-base/serial-test-02.output.md +++ b/unison-src/transcripts-using-base/serial-test-02.output.md @@ -49,7 +49,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -61,7 +61,7 @@ mkTestCase = do prod : [Nat] -> Nat products : ([Nat], [Nat], [Nat]) -> Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-03.md b/unison-src/transcripts-using-base/serial-test-03.md index d1f49c404..2e66f687d 100644 --- a/unison-src/transcripts-using-base/serial-test-03.md +++ b/unison-src/transcripts-using-base/serial-test-03.md @@ -44,6 +44,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-03.output.md b/unison-src/transcripts-using-base/serial-test-03.output.md index c161d048b..f21afcbbb 100644 --- a/unison-src/transcripts-using-base/serial-test-03.output.md +++ b/unison-src/transcripts-using-base/serial-test-03.output.md @@ -68,7 +68,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -84,7 +84,7 @@ mkTestCase = do reset : '{DC r} r -> r suspSum : [Nat] -> Delayed Nat -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/serial-test-04.md b/unison-src/transcripts-using-base/serial-test-04.md index f4763238f..212b59c9e 100644 --- a/unison-src/transcripts-using-base/serial-test-04.md +++ b/unison-src/transcripts-using-base/serial-test-04.md @@ -14,6 +14,6 @@ mkTestCase = do ``` ```ucm -.> add -.> run mkTestCase +scratch/main> add +scratch/main> run mkTestCase ``` diff --git a/unison-src/transcripts-using-base/serial-test-04.output.md b/unison-src/transcripts-using-base/serial-test-04.output.md index ca1949502..044eabd26 100644 --- a/unison-src/transcripts-using-base/serial-test-04.output.md +++ b/unison-src/transcripts-using-base/serial-test-04.output.md @@ -28,7 +28,7 @@ mkTestCase = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -36,7 +36,7 @@ mkTestCase = do mutual0 : Nat -> Text mutual1 : Nat -> Text -.> run mkTestCase +scratch/main> run mkTestCase () diff --git a/unison-src/transcripts-using-base/stm.md b/unison-src/transcripts-using-base/stm.md index 032035316..1a036fd26 100644 --- a/unison-src/transcripts-using-base/stm.md +++ b/unison-src/transcripts-using-base/stm.md @@ -28,7 +28,7 @@ body k out v = ``` ```ucm -.> add +scratch/main> add ``` Test case. @@ -67,6 +67,6 @@ tests = '(map spawn nats) ``` ```ucm -.> add -.> io.test tests +scratch/main> add +scratch/main> io.test tests ``` diff --git a/unison-src/transcripts-using-base/stm.output.md b/unison-src/transcripts-using-base/stm.output.md index a5d87ed52..f54199f8e 100644 --- a/unison-src/transcripts-using-base/stm.output.md +++ b/unison-src/transcripts-using-base/stm.output.md @@ -44,7 +44,7 @@ body k out v = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -106,7 +106,7 @@ tests = '(map spawn nats) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -115,23 +115,23 @@ tests = '(map spawn nats) spawn : Nat ->{IO} Result tests : '{IO} [Result] -.> io.test tests +scratch/main> io.test tests New test results: - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified - ◉ tests verified + 1. tests ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified + ◉ verified ✅ 10 test(s) passing - Tip: Use view tests 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.md b/unison-src/transcripts-using-base/test-watch-dependencies.md index 8f3c61056..3e7558da3 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.md @@ -9,7 +9,7 @@ x = 999 ``` ```ucm:hide -.> add +scratch/main> add ``` Now, we update that definition and define a test-watch which depends on it. @@ -22,7 +22,7 @@ test> mytest = checks [x + 1 == 1001] We expect this 'add' to fail because the test is blocked by the update to `x`. ```ucm:error -.> add +scratch/main> add ``` --- @@ -35,5 +35,5 @@ test> useY = checks [y + 1 == 43] This should correctly identify `y` as a dependency and add that too. ```ucm -.> add useY +scratch/main> add useY ``` diff --git a/unison-src/transcripts-using-base/test-watch-dependencies.output.md b/unison-src/transcripts-using-base/test-watch-dependencies.output.md index 53835d0f6..7b71b244b 100644 --- a/unison-src/transcripts-using-base/test-watch-dependencies.output.md +++ b/unison-src/transcripts-using-base/test-watch-dependencies.output.md @@ -43,7 +43,7 @@ test> mytest = checks [x + 1 == 1001] We expect this 'add' to fail because the test is blocked by the update to `x`. ```ucm -.> add +scratch/main> add x These definitions failed: @@ -85,7 +85,7 @@ test> useY = checks [y + 1 == 43] This should correctly identify `y` as a dependency and add that too. ```ucm -.> add useY +scratch/main> add useY ⍟ I've added these definitions: diff --git a/unison-src/transcripts-using-base/thread.md b/unison-src/transcripts-using-base/thread.md index d2c271204..9811d192c 100644 --- a/unison-src/transcripts-using-base/thread.md +++ b/unison-src/transcripts-using-base/thread.md @@ -19,8 +19,8 @@ testBasicFork = 'let See if we can get another thread to stuff a value into a MVar ```ucm:hide -.> add -.> io.test testBasicFork +scratch/main> add +scratch/main> io.test testBasicFork ``` ```unison @@ -48,8 +48,8 @@ testBasicMultiThreadMVar = 'let ``` ```ucm -.> add -.> io.test testBasicMultiThreadMVar +scratch/main> add +scratch/main> io.test testBasicMultiThreadMVar ``` ```unison @@ -91,6 +91,6 @@ testTwoThreads = 'let ``` ```ucm -.> add -.> io.test testTwoThreads +scratch/main> add +scratch/main> io.test testTwoThreads ``` diff --git a/unison-src/transcripts-using-base/thread.output.md b/unison-src/transcripts-using-base/thread.output.md index 76c28fa21..6fe4e8800 100644 --- a/unison-src/transcripts-using-base/thread.output.md +++ b/unison-src/transcripts-using-base/thread.output.md @@ -71,23 +71,22 @@ testBasicMultiThreadMVar = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testBasicMultiThreadMVar : '{IO} [Result] thread1 : Nat -> MVar Nat -> '{IO} () -.> io.test testBasicMultiThreadMVar +scratch/main> io.test testBasicMultiThreadMVar New test results: - ◉ testBasicMultiThreadMVar other thread should have incremented + 1. testBasicMultiThreadMVar ◉ other thread should have incremented ✅ 1 test(s) passing - Tip: Use view testBasicMultiThreadMVar to view the source of a - test. + Tip: Use view 1 to view the source of a test. ``` ```unison @@ -145,7 +144,7 @@ testTwoThreads = 'let ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -154,14 +153,14 @@ testTwoThreads = 'let (also named thread1) testTwoThreads : '{IO} [Result] -.> io.test testTwoThreads +scratch/main> io.test testTwoThreads New test results: - ◉ testTwoThreads + 1. testTwoThreads ◉ ✅ 1 test(s) passing - Tip: Use view testTwoThreads 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.md b/unison-src/transcripts-using-base/tls.md index 77c66db49..71b473837 100644 --- a/unison-src/transcripts-using-base/tls.md +++ b/unison-src/transcripts-using-base/tls.md @@ -12,7 +12,7 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----" ``` ```ucm:hide -.> add +scratch/main> add ``` # Using an alternative certificate store @@ -32,8 +32,8 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ```ucm -.> add -.> io.test what_should_work +scratch/main> add +scratch/main> io.test what_should_work ``` Test handshaking a client/server a local TCP connection using our @@ -191,8 +191,8 @@ testCNReject _ = ``` ```ucm -.> add -.> io.test testConnectSelfSigned -.> io.test testCAReject -.> io.test testCNReject +scratch/main> add +scratch/main> io.test testConnectSelfSigned +scratch/main> io.test testCAReject +scratch/main> io.test testCNReject ``` diff --git a/unison-src/transcripts-using-base/tls.output.md b/unison-src/transcripts-using-base/tls.output.md index 135f49018..a584bdfa9 100644 --- a/unison-src/transcripts-using-base/tls.output.md +++ b/unison-src/transcripts-using-base/tls.output.md @@ -43,7 +43,7 @@ what_should_work _ = this_should_work ++ this_should_not_work ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,16 +51,16 @@ what_should_work _ = this_should_work ++ this_should_not_work this_should_work : [Result] what_should_work : ∀ _. _ -> [Result] -.> io.test what_should_work +scratch/main> io.test what_should_work New test results: - ◉ what_should_work succesfully decoded self_signed_pem - ◉ what_should_work failed + 1. what_should_work ◉ succesfully decoded self_signed_pem + ◉ failed ✅ 2 test(s) passing - Tip: Use view what_should_work 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 @@ -238,7 +238,7 @@ testCNReject _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -251,35 +251,34 @@ testCNReject _ = -> '{IO, Exception} Text testConnectSelfSigned : '{IO} [Result] -.> io.test testConnectSelfSigned +scratch/main> io.test testConnectSelfSigned New test results: - ◉ testConnectSelfSigned should have reaped what we've sown + 1. testConnectSelfSigned ◉ should have reaped what we've sown ✅ 1 test(s) passing - Tip: Use view testConnectSelfSigned to view the source of a - test. + Tip: Use view 1 to view the source of a test. -.> io.test testCAReject +scratch/main> io.test testCAReject New test results: - ◉ testCAReject correctly rejected self-signed cert + 1. testCAReject ◉ correctly rejected self-signed cert ✅ 1 test(s) passing - Tip: Use view testCAReject to view the source of a test. + Tip: Use view 1 to view the source of a test. -.> io.test testCNReject +scratch/main> io.test testCNReject New test results: - ◉ testCNReject correctly rejected self-signed cert + 1. testCNReject ◉ correctly rejected self-signed cert ✅ 1 test(s) passing - Tip: Use view testCNReject 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.md b/unison-src/transcripts-using-base/utf8.md index 107bd260c..4bf058657 100644 --- a/unison-src/transcripts-using-base/utf8.md +++ b/unison-src/transcripts-using-base/utf8.md @@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text. ```ucm -.> find Utf8 +scratch/main> find Utf8 ``` ascii characters are encoded as single bytes (in the range 0-127). diff --git a/unison-src/transcripts-using-base/utf8.output.md b/unison-src/transcripts-using-base/utf8.output.md index 6bba05281..c06522211 100644 --- a/unison-src/transcripts-using-base/utf8.output.md +++ b/unison-src/transcripts-using-base/utf8.output.md @@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text. ```ucm -.> find Utf8 +scratch/main> find Utf8 1. builtin.Text.toUtf8 : Text -> Bytes 2. Text.fromUtf8 : Bytes ->{Exception} Text diff --git a/unison-src/transcripts/abilities.md b/unison-src/transcripts/abilities.md index 3bf6c47ec..a45ee504d 100644 --- a/unison-src/transcripts/abilities.md +++ b/unison-src/transcripts/abilities.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some random ability stuff to ensure things work. @@ -23,5 +23,5 @@ ha = cases ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index c90d76a45..8fd69ddbc 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -32,7 +32,7 @@ ha = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.md index 4a0606a4b..2e00cc0c2 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.md @@ -15,6 +15,6 @@ term2 _ = () ``` ```ucm -.> add -.> names term1 +scratch/main> add +scratch/main> names term1 ``` diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md index 879dc0c62..6f6eac30e 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -31,7 +31,7 @@ term2 _ = () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -40,7 +40,7 @@ term2 _ = () term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () -.> names term1 +scratch/main> names term1 Term Hash: #8hum58rlih diff --git a/unison-src/transcripts/ability-term-conflicts-on-update.md b/unison-src/transcripts/ability-term-conflicts-on-update.md index 04810a493..6a1a316a5 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/issues/2786 ```ucm:hide -.ns> builtins.merge +scratch/main> builtins.merge lib.builtins ``` First we add an ability to the codebase. @@ -15,7 +15,7 @@ unique ability Channels where ``` ```ucm -.ns> add +scratch/main> add ``` Now we update the ability, changing the name of the constructor, _but_, we simultaneously @@ -36,8 +36,8 @@ thing _ = send 1 These should fail with a term/ctor conflict since we exclude the ability from the update. ```ucm:error -.ns> update.old patch Channels.send -.ns> update.old patch thing +scratch/main> update.old patch Channels.send +scratch/main> update.old patch thing ``` If however, `Channels.send` and `thing` _depend_ on `Channels`, updating them should succeed since it pulls in the ability as a dependency. @@ -56,20 +56,20 @@ thing _ = send 1 These updates should succeed since `Channels` is a dependency. ```ucm -.ns> update.old.preview patch Channels.send -.ns> update.old.preview patch thing +scratch/main> update.old.preview patch Channels.send +scratch/main> update.old.preview patch thing ``` We should also be able to successfully update the whole thing. ```ucm -.ns> update.old +scratch/main> update.old ``` # Constructor-term conflict ```ucm:hide -.ns2> builtins.merge +scratch/main2> builtins.merge lib.builtins ``` @@ -78,7 +78,7 @@ X.x = 1 ``` ```ucm -.ns2> add +scratch/main2> add ``` ```unison @@ -89,5 +89,5 @@ structural ability X where This should fail with a ctor/term conflict. ```ucm:error -.ns2> add +scratch/main2> 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 901446e8d..7ea11e01c 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -24,7 +24,7 @@ unique ability Channels where ``` ```ucm -.ns> add +scratch/main> add ⍟ I've added these definitions: @@ -68,7 +68,7 @@ thing _ = send 1 These should fail with a term/ctor conflict since we exclude the ability from the update. ```ucm -.ns> update.old patch Channels.send +scratch/main> update.old patch Channels.send x These definitions failed: @@ -77,7 +77,7 @@ These should fail with a term/ctor conflict since we exclude the ability from th Tip: Use `help filestatus` to learn more. -.ns> update.old patch thing +scratch/main> update.old patch thing ⍟ I've added these definitions: @@ -122,7 +122,7 @@ thing _ = send 1 These updates should succeed since `Channels` is a dependency. ```ucm -.ns> update.old.preview patch Channels.send +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 @@ -135,7 +135,7 @@ These updates should succeed since `Channels` is a dependency. Channels.send : a ->{Channels} () -.ns> update.old.preview patch thing +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 @@ -153,7 +153,7 @@ These updates should succeed since `Channels` is a dependency. We should also be able to successfully update the whole thing. ```ucm -.ns> update.old +scratch/main> update.old ⊡ Ignored previously added definitions: Channels @@ -183,7 +183,7 @@ X.x = 1 ``` ```ucm -.ns2> add +scratch/main2> add ⍟ I've added these definitions: @@ -215,7 +215,7 @@ structural ability X where This should fail with a ctor/term conflict. ```ucm -.ns2> add +scratch/main2> add x These definitions failed: diff --git a/unison-src/transcripts/add-run.md b/unison-src/transcripts/add-run.md index 99ac7792e..3eeea7c03 100644 --- a/unison-src/transcripts/add-run.md +++ b/unison-src/transcripts/add-run.md @@ -3,7 +3,7 @@ ## Basic usage ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -20,26 +20,26 @@ is2even = '(even 2) it errors if there isn't a previous run ```ucm:error -.> add.run foo +scratch/main> add.run foo ``` ```ucm -.> run is2even +scratch/main> run is2even ``` it errors if the desired result name conflicts with a name in the unison file ```ucm:error -.> add.run is2even +scratch/main> add.run is2even ``` otherwise, the result is successfully persisted ```ucm -.> add.run foo.bar.baz +scratch/main> add.run foo.bar.baz ``` ```ucm -.> view foo.bar.baz +scratch/main> view foo.bar.baz ``` ## It resolves references within the unison file @@ -56,8 +56,8 @@ main _ = y ``` ```ucm -.> run main -.> add.run result +scratch/main> run main +scratch/main> add.run result ``` ## It resolves references within the codebase @@ -68,7 +68,7 @@ inc x = x + 1 ``` ```ucm -.> add inc +scratch/main> add inc ``` ```unison @@ -77,9 +77,9 @@ main _ x = inc x ``` ```ucm -.> run main -.> add.run natfoo -.> view natfoo +scratch/main> run main +scratch/main> add.run natfoo +scratch/main> view natfoo ``` ## It captures scratch file dependencies at run time @@ -91,7 +91,7 @@ main = 'y ``` ```ucm -.> run main +scratch/main> run main ``` @@ -101,8 +101,8 @@ x = 50 this saves 2 to xres, rather than 100 ```ucm -.> add.run xres -.> view xres +scratch/main> add.run xres +scratch/main> view xres ``` ## It fails with a message if add cannot complete cleanly @@ -112,8 +112,8 @@ main = '5 ``` ```ucm:error -.> run main -.> add.run xres +scratch/main> run main +scratch/main> add.run xres ``` ## It works with absolute names diff --git a/unison-src/transcripts/add-run.output.md b/unison-src/transcripts/add-run.output.md index 3d97788e7..53cc27b94 100644 --- a/unison-src/transcripts/add-run.output.md +++ b/unison-src/transcripts/add-run.output.md @@ -31,7 +31,7 @@ is2even = '(even 2) it errors if there isn't a previous run ```ucm -.> add.run foo +scratch/main> add.run foo ⚠️ @@ -40,7 +40,7 @@ it errors if there isn't a previous run ``` ```ucm -.> run is2even +scratch/main> run is2even true @@ -48,7 +48,7 @@ it errors if there isn't a previous run it errors if the desired result name conflicts with a name in the unison file ```ucm -.> add.run is2even +scratch/main> add.run is2even ⚠️ @@ -58,7 +58,7 @@ unison file ``` otherwise, the result is successfully persisted ```ucm -.> add.run foo.bar.baz +scratch/main> add.run foo.bar.baz ⍟ I've added these definitions: @@ -66,7 +66,7 @@ otherwise, the result is successfully persisted ``` ```ucm -.> view foo.bar.baz +scratch/main> view foo.bar.baz foo.bar.baz : Boolean foo.bar.baz = true @@ -101,11 +101,11 @@ main _ = y ``` ```ucm -.> run main +scratch/main> run main a b -> a Nat.+ b Nat.+ z 10 -.> add.run result +scratch/main> add.run result ⍟ I've added these definitions: @@ -134,7 +134,7 @@ inc x = x + 1 ``` ```ucm -.> add inc +scratch/main> add inc ⍟ I've added these definitions: @@ -160,17 +160,17 @@ main _ x = inc x ``` ```ucm -.> run main +scratch/main> run main inc -.> add.run natfoo +scratch/main> add.run natfoo ⍟ I've added these definitions: natfoo : Nat -> Nat -.> view natfoo +scratch/main> view natfoo natfoo : Nat -> Nat natfoo = inc @@ -200,7 +200,7 @@ main = 'y ``` ```ucm -.> run main +scratch/main> run main 2 @@ -224,13 +224,13 @@ x = 50 ``` this saves 2 to xres, rather than 100 ```ucm -.> add.run xres +scratch/main> add.run xres ⍟ I've added these definitions: xres : Nat -.> view xres +scratch/main> view xres xres : Nat xres = 2 @@ -256,11 +256,11 @@ main = '5 ``` ```ucm -.> run main +scratch/main> run main 5 -.> add.run xres +scratch/main> add.run xres x These definitions failed: diff --git a/unison-src/transcripts/add-test-watch-roundtrip.md b/unison-src/transcripts/add-test-watch-roundtrip.md index e8d070d2b..9b1cacf47 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -10,6 +10,6 @@ foo = [] Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though! ```ucm -.> add -.> view foo +scratch/main> add +scratch/main> view foo ``` diff --git a/unison-src/transcripts/add-test-watch-roundtrip.output.md b/unison-src/transcripts/add-test-watch-roundtrip.output.md index 5c9389ca1..114d9399f 100644 --- a/unison-src/transcripts/add-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/add-test-watch-roundtrip.output.md @@ -6,13 +6,13 @@ foo = [] Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though! ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo : [Result] -.> view foo +scratch/main> view foo foo : [Result] foo : [Result] diff --git a/unison-src/transcripts/addupdatemessages.md b/unison-src/transcripts/addupdatemessages.md index c644d921a..9c7daea43 100644 --- a/unison-src/transcripts/addupdatemessages.md +++ b/unison-src/transcripts/addupdatemessages.md @@ -3,7 +3,7 @@ Let's set up some definitions to start: ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,7 +17,7 @@ structural type Y = Two Nat Nat Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ```ucm -.> add +scratch/main> add ``` Let's add an alias for `1` and `One`: @@ -32,7 +32,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. ```ucm -.> add +scratch/main> add ``` Let's update something that has an alias (to a value that doesn't have a name already): @@ -45,7 +45,7 @@ structural type X = Three Nat Nat Nat Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated. ```ucm -.> update +scratch/main> update ``` Update it to something that already exists with a different name: @@ -58,6 +58,6 @@ structural type X = Two Nat Nat Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`. ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/addupdatemessages.output.md b/unison-src/transcripts/addupdatemessages.output.md index 44925f17c..ffd7bbd80 100644 --- a/unison-src/transcripts/addupdatemessages.output.md +++ b/unison-src/transcripts/addupdatemessages.output.md @@ -29,7 +29,7 @@ structural type Y = Two Nat Nat Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -67,7 +67,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`. Also, `Z` is an alias for `X`. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -104,7 +104,7 @@ structural type X = Three Nat Nat Nat Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -143,7 +143,7 @@ structural type X = Two Nat Nat Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/alias-many.md b/unison-src/transcripts/alias-many.md index c682faf22..57450c64d 100644 --- a/unison-src/transcripts/alias-many.md +++ b/unison-src/transcripts/alias-many.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge lib.builtins ``` ```unison:hide:all List.adjacentPairs : [a] -> [(a, a)] @@ -95,14 +95,14 @@ List.takeWhile p xs = go xs [] ``` ```ucm:hide -.stuff> add +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: ``` -.> help alias.many +scratch/main> help alias.many alias.many (or copy) `alias.many [relative2...] ` creates aliases `relative1`, `relative2`, ... @@ -113,8 +113,8 @@ The names that will be used in the target namespace are the names you specify, r Let's try it! ```ucm -.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib -.> find-in mylib +scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib +scratch/main> find-in mylib ``` Thanks, `alias.many`! diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index 8236c60d0..b12422e09 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -1,8 +1,8 @@ The `alias.many` command can be used to copy definitions from the current namespace into your curated one. The names that will be used in the target namespace are the names you specify, relative to the current namespace: -``` -.> help alias.many +```scratch +/main> help alias.many alias.many (or copy) `alias.many [relative2...] ` creates aliases `relative1`, `relative2`, ... @@ -14,55 +14,51 @@ The names that will be used in the target namespace are the names you specify, r Let's try it! ```ucm -.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib +scratch/main> alias.many 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 : + Here's what changed in mylib : Added definitions: - 1. stuff.List.adjacentPairs : [a] -> [(a, a)] - 2. stuff.List.all : (a ->{g} Boolean) - -> [a] - ->{g} Boolean - 3. stuff.List.any : (a ->{g} Boolean) - -> [a] - ->{g} Boolean - 4. stuff.List.chunk : Nat -> [a] -> [[a]] - 5. stuff.List.chunksOf : Nat -> [a] -> [[a]] - 6. stuff.List.dropWhile : (a ->{g} Boolean) - -> [a] - ->{g} [a] - 7. stuff.List.first : [a] -> Optional a - 8. stuff.List.init : [a] -> Optional [a] - 9. stuff.List.intersperse : a -> [a] -> [a] - 10. stuff.List.isEmpty : [a] -> Boolean - 11. stuff.List.last : [a] -> Optional a - 12. stuff.List.replicate : Nat -> a -> [a] - 13. stuff.List.splitAt : Nat -> [a] -> ([a], [a]) - 14. stuff.List.tail : [a] -> Optional [a] - 15. stuff.List.takeWhile : (a ->{𝕖} Boolean) - -> [a] - ->{𝕖} [a] + 1. List.adjacentPairs : [a] -> [(a, a)] + 2. List.all : (a ->{g} Boolean) + -> [a] + ->{g} Boolean + 3. List.any : (a ->{g} Boolean) + -> [a] + ->{g} Boolean + 4. List.chunk : Nat -> [a] -> [[a]] + 5. List.chunksOf : Nat -> [a] -> [[a]] + 6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] + 7. List.first : [a] -> Optional a + 8. List.init : [a] -> Optional [a] + 9. List.intersperse : a -> [a] -> [a] + 10. List.isEmpty : [a] -> Boolean + 11. List.last : [a] -> Optional a + 12. List.replicate : Nat -> a -> [a] + 13. List.splitAt : Nat -> [a] -> ([a], [a]) + 14. List.tail : [a] -> Optional [a] + 15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] Tip: You can use `undo` or `reflog` to undo this change. -.> find-in mylib +scratch/main> find-in mylib - 1. stuff.List.adjacentPairs : [a] -> [(a, a)] - 2. stuff.List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean - 3. stuff.List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean - 4. stuff.List.chunk : Nat -> [a] -> [[a]] - 5. stuff.List.chunksOf : Nat -> [a] -> [[a]] - 6. stuff.List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] - 7. stuff.List.first : [a] -> Optional a - 8. stuff.List.init : [a] -> Optional [a] - 9. stuff.List.intersperse : a -> [a] -> [a] - 10. stuff.List.isEmpty : [a] -> Boolean - 11. stuff.List.last : [a] -> Optional a - 12. stuff.List.replicate : Nat -> a -> [a] - 13. stuff.List.splitAt : Nat -> [a] -> ([a], [a]) - 14. stuff.List.tail : [a] -> Optional [a] - 15. stuff.List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] + 1. List.adjacentPairs : [a] -> [(a, a)] + 2. List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean + 3. List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean + 4. List.chunk : Nat -> [a] -> [[a]] + 5. List.chunksOf : Nat -> [a] -> [[a]] + 6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a] + 7. List.first : [a] -> Optional a + 8. List.init : [a] -> Optional [a] + 9. List.intersperse : a -> [a] -> [a] + 10. List.isEmpty : [a] -> Boolean + 11. List.last : [a] -> Optional a + 12. List.replicate : Nat -> a -> [a] + 13. List.splitAt : Nat -> [a] -> ([a], [a]) + 14. List.tail : [a] -> Optional [a] + 15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a] ``` diff --git a/unison-src/transcripts/alias-type.md b/unison-src/transcripts/alias-type.md new file mode 100644 index 000000000..b167daa2c --- /dev/null +++ b/unison-src/transcripts/alias-type.md @@ -0,0 +1,28 @@ +`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 +project/main> ls +``` + +It won't create a conflicted name, though. + +```ucm:error +project/main> alias.type lib.builtins.Int Foo +``` + +```ucm +project/main> ls +``` + +You can use `debug.alias.type.force` for that. + +```ucm +project/main> debug.alias.type.force lib.builtins.Int Foo +project/main> ls +``` + diff --git a/unison-src/transcripts/alias-type.output.md b/unison-src/transcripts/alias-type.output.md new file mode 100644 index 000000000..820c81761 --- /dev/null +++ b/unison-src/transcripts/alias-type.output.md @@ -0,0 +1,44 @@ +`alias.type` makes a new name for a type. + +```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 +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.md b/unison-src/transcripts/anf-tests.md index 122a67306..2a15836eb 100644 --- a/unison-src/transcripts/anf-tests.md +++ b/unison-src/transcripts/anf-tests.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This tests a variable related bug in the ANF compiler. @@ -29,6 +29,6 @@ foo _ = ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/anf-tests.output.md b/unison-src/transcripts/anf-tests.output.md index c200d1056..b9360ee4c 100644 --- a/unison-src/transcripts/anf-tests.output.md +++ b/unison-src/transcripts/anf-tests.output.md @@ -45,7 +45,7 @@ foo _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/any-extract.md b/unison-src/transcripts/any-extract.md index 5e9d09324..e65b36606 100644 --- a/unison-src/transcripts/any-extract.md +++ b/unison-src/transcripts/any-extract.md @@ -1,9 +1,9 @@ # Unit tests for Any.unsafeExtract ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` Any.unsafeExtract is a way to extract the value contained in an Any. This is unsafe because it allows the programmer to coerce a value into any type, which would cause undefined behaviour if used to coerce a value to the wrong type. @@ -19,5 +19,5 @@ test> Any.unsafeExtract.works = ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/any-extract.output.md b/unison-src/transcripts/any-extract.output.md index 75567fb41..c8fc99095 100644 --- a/unison-src/transcripts/any-extract.output.md +++ b/unison-src/transcripts/any-extract.output.md @@ -32,7 +32,7 @@ test> Any.unsafeExtract.works = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/api-doc-rendering.md b/unison-src/transcripts/api-doc-rendering.md index 6deffaaba..eb0d95694 100644 --- a/unison-src/transcripts/api-doc-rendering.md +++ b/unison-src/transcripts/api-doc-rendering.md @@ -1,7 +1,7 @@ # Doc rendering ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -82,13 +82,13 @@ term = 42 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> display term.doc +scratch/main> display term.doc ``` ```api -GET /api/non-project-code/getDefinition?names=term +GET /api/projects/scratch/branches/main/getDefinition?names=term ``` diff --git a/unison-src/transcripts/api-doc-rendering.output.md b/unison-src/transcripts/api-doc-rendering.output.md index cac34211a..f767c14cf 100644 --- a/unison-src/transcripts/api-doc-rendering.output.md +++ b/unison-src/transcripts/api-doc-rendering.output.md @@ -78,7 +78,7 @@ term = 42 ``` ```ucm -.> display term.doc +scratch/main> display term.doc # Heading @@ -147,7 +147,7 @@ term = 42 ``` ```api -GET /api/non-project-code/getDefinition?names=term +GET /api/projects/scratch/branches/main/getDefinition?names=term { "missingDefinitions": [], "termDefinitions": { diff --git a/unison-src/transcripts/api-find.md b/unison-src/transcripts/api-find.md index 201d3cad8..f11d98bfc 100644 --- a/unison-src/transcripts/api-find.md +++ b/unison-src/transcripts/api-find.md @@ -8,19 +8,19 @@ joey.yaml.zz = 45 ``` ```ucm -.> add +scratch/main> add ``` ```api -- Namespace segment prefix search -GET /api/non-project-code/find?query=http +GET /api/projects/scratch/branches/main/find?query=http -- Namespace segment suffix search -GET /api/non-project-code/find?query=Server +GET /api/projects/scratch/branches/main/find?query=Server -- Substring search -GET /api/non-project-code/find?query=lesys +GET /api/projects/scratch/branches/main/find?query=lesys -- Cross-segment search -GET /api/non-project-code/find?query=joey.http +GET /api/projects/scratch/branches/main/find?query=joey.http ``` diff --git a/unison-src/transcripts/api-find.output.md b/unison-src/transcripts/api-find.output.md index 6505a1a32..d44200e7a 100644 --- a/unison-src/transcripts/api-find.output.md +++ b/unison-src/transcripts/api-find.output.md @@ -24,7 +24,7 @@ joey.yaml.zz = 45 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -36,7 +36,7 @@ joey.yaml.zz = 45 ``` ```api -- Namespace segment prefix search -GET /api/non-project-code/find?query=http +GET /api/projects/scratch/branches/main/find?query=http [ [ { @@ -122,7 +122,7 @@ GET /api/non-project-code/find?query=http ] ] -- Namespace segment suffix search -GET /api/non-project-code/find?query=Server +GET /api/projects/scratch/branches/main/find?query=Server [ [ { @@ -167,7 +167,7 @@ GET /api/non-project-code/find?query=Server ] ] -- Substring search -GET /api/non-project-code/find?query=lesys +GET /api/projects/scratch/branches/main/find?query=lesys [ [ { @@ -212,7 +212,7 @@ GET /api/non-project-code/find?query=lesys ] ] -- Cross-segment search -GET /api/non-project-code/find?query=joey.http +GET /api/projects/scratch/branches/main/find?query=joey.http [ [ { diff --git a/unison-src/transcripts/api-getDefinition.md b/unison-src/transcripts/api-getDefinition.md index 4a56b2bc9..94f2341e7 100644 --- a/unison-src/transcripts/api-getDefinition.md +++ b/unison-src/transcripts/api-getDefinition.md @@ -1,54 +1,50 @@ # Get Definitions Test ```ucm:hide -.nested> builtins.mergeio +scratch/main> builtins.mergeio lib.builtins ``` ```unison:hide -{{ Documentation }} -names.x = 42 +nested.names.x.doc = {{ Documentation }} +nested.names.x = 42 ``` ```ucm:hide -.nested> add +scratch/main> add ``` ```api -- Should NOT find names by suffix -GET /api/non-project-code/getDefinition?names=x +GET /api/projects/scratch/branches/main/getDefinition?names=x -- Term names should strip relativeTo prefix. -GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested -- Should find definitions by hash, names should be relative -GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested -``` - -```ucm:hide -.doctest> builtins.mergeio +GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested ``` ```unison:hide -thing.doc = {{ The correct docs for the thing }} -thing = "A thing" -thingalias.doc = {{ Docs for the alias, should not be displayed }} -thingalias = "A thing" -otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} -otherstuff.thing = "A different thing" +doctest.thing.doc = {{ The correct docs for the thing }} +doctest.thing = "A thing" +doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }} +doctest.thingalias = "A thing" +doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} +doctest.otherstuff.thing = "A different thing" ``` ```ucm:hide -.doctest> add +scratch/main> add ``` Only docs for the term we request should be returned, even if there are other term docs with the same suffix. ```api -GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest ``` If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list. ```api -GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest ``` diff --git a/unison-src/transcripts/api-getDefinition.output.md b/unison-src/transcripts/api-getDefinition.output.md index 24debb744..5e854a440 100644 --- a/unison-src/transcripts/api-getDefinition.output.md +++ b/unison-src/transcripts/api-getDefinition.output.md @@ -1,13 +1,13 @@ # Get Definitions Test ```unison -{{ Documentation }} -names.x = 42 +nested.names.x.doc = {{ Documentation }} +nested.names.x = 42 ``` ```api -- Should NOT find names by suffix -GET /api/non-project-code/getDefinition?names=x +GET /api/projects/scratch/branches/main/getDefinition?names=x { "missingDefinitions": [ "x" @@ -16,7 +16,7 @@ GET /api/non-project-code/getDefinition?names=x "typeDefinitions": {} } -- Term names should strip relativeTo prefix. -GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested { "missingDefinitions": [], "termDefinitions": { @@ -104,14 +104,14 @@ GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested ] ], "termNames": [ - "names.x" + "nested.names.x" ] } }, "typeDefinitions": {} } -- Should find definitions by hash, names should be relative -GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested +GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested { "missingDefinitions": [], "termDefinitions": { @@ -199,30 +199,30 @@ GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested ] ], "termNames": [ - "names.x" + "nested.names.x" ] } }, "typeDefinitions": {} } ``````unison -thing.doc = {{ The correct docs for the thing }} -thing = "A thing" -thingalias.doc = {{ Docs for the alias, should not be displayed }} -thingalias = "A thing" -otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} -otherstuff.thing = "A different thing" +doctest.thing.doc = {{ The correct docs for the thing }} +doctest.thing = "A thing" +doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }} +doctest.thingalias = "A thing" +doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }} +doctest.otherstuff.thing = "A different thing" ``` Only docs for the term we request should be returned, even if there are other term docs with the same suffix. ```api -GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest { "missingDefinitions": [], "termDefinitions": { "#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": { - "bestTermName": "thing", + "bestTermName": "doctest.thing", "defnTermTag": "Plain", "signature": [ { @@ -237,10 +237,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest "contents": [ { "annotation": { - "contents": "thing", + "contents": "doctest.thing", "tag": "HashQualifier" }, - "segment": "thing" + "segment": "doctest.thing" }, { "annotation": { @@ -265,10 +265,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest }, { "annotation": { - "contents": "thing", + "contents": "doctest.thing", "tag": "HashQualifier" }, - "segment": "thing" + "segment": "doctest.thing" }, { "annotation": { @@ -291,7 +291,7 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest }, "termDocs": [ [ - "thing.doc", + "doctest.thing.doc", "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", { "contents": [ @@ -325,8 +325,8 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest ] ], "termNames": [ - "thing", - "thingalias" + "doctest.thing", + "doctest.thingalias" ] } }, @@ -335,12 +335,12 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest ```If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list. ```api -GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest +GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest { "missingDefinitions": [], "termDefinitions": { "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": { - "bestTermName": "thing.doc", + "bestTermName": "doctest.thing.doc", "defnTermTag": "Doc", "signature": [ { @@ -355,10 +355,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest "contents": [ { "annotation": { - "contents": "thing.doc", + "contents": "doctest.thing.doc", "tag": "HashQualifier" }, - "segment": "thing.doc" + "segment": "doctest.thing.doc" }, { "annotation": { @@ -383,10 +383,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest }, { "annotation": { - "contents": "thing.doc", + "contents": "doctest.thing.doc", "tag": "HashQualifier" }, - "segment": "thing.doc" + "segment": "doctest.thing.doc" }, { "annotation": { @@ -467,7 +467,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest }, "termDocs": [ [ - "thing.doc", + "doctest.thing.doc", "#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o", { "contents": [ @@ -501,7 +501,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest ] ], "termNames": [ - "thing.doc" + "doctest.thing.doc" ] } }, diff --git a/unison-src/transcripts/api-list-projects-branches.md b/unison-src/transcripts/api-list-projects-branches.md index 111489cf9..872cca22a 100644 --- a/unison-src/transcripts/api-list-projects-branches.md +++ b/unison-src/transcripts/api-list-projects-branches.md @@ -1,9 +1,9 @@ # List Projects And Branches Test ```ucm:hide -.> project.create-empty project-one -.> project.create-empty project-two -.> project.create-empty project-three +scratch/main> project.create-empty project-one +scratch/main> project.create-empty project-two +scratch/main> project.create-empty project-three project-one/main> branch branch-one project-one/main> branch branch-two project-one/main> branch branch-three diff --git a/unison-src/transcripts/api-list-projects-branches.output.md b/unison-src/transcripts/api-list-projects-branches.output.md index 1c12eea54..b3c09895d 100644 --- a/unison-src/transcripts/api-list-projects-branches.output.md +++ b/unison-src/transcripts/api-list-projects-branches.output.md @@ -12,6 +12,9 @@ GET /api/projects }, { "projectName": "project-two" + }, + { + "projectName": "scratch" } ] -- Should list projects starting with project-t diff --git a/unison-src/transcripts/api-namespace-details.md b/unison-src/transcripts/api-namespace-details.md index 0cfc7a835..2d50bdae9 100644 --- a/unison-src/transcripts/api-namespace-details.md +++ b/unison-src/transcripts/api-namespace-details.md @@ -1,7 +1,7 @@ # Namespace Details Test ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -14,10 +14,10 @@ Here's a *README*! ``` ```ucm -.> add +scratch/main> add ``` ```api -- Should find names by suffix -GET /api/non-project-code/namespaces/nested.names +GET /api/projects/scratch/branches/main/namespaces/nested.names ``` diff --git a/unison-src/transcripts/api-namespace-details.output.md b/unison-src/transcripts/api-namespace-details.output.md index 80d1d6ae0..0cdf2e88b 100644 --- a/unison-src/transcripts/api-namespace-details.output.md +++ b/unison-src/transcripts/api-namespace-details.output.md @@ -25,7 +25,7 @@ Here's a *README*! ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -36,7 +36,7 @@ Here's a *README*! ``` ```api -- Should find names by suffix -GET /api/non-project-code/namespaces/nested.names +GET /api/projects/scratch/branches/main/namespaces/nested.names { "fqn": "nested.names", "hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o", diff --git a/unison-src/transcripts/api-namespace-list.md b/unison-src/transcripts/api-namespace-list.md index 717607269..c3dbbeed1 100644 --- a/unison-src/transcripts/api-namespace-list.md +++ b/unison-src/transcripts/api-namespace-list.md @@ -1,7 +1,7 @@ # Namespace list api ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -12,11 +12,11 @@ nested.names.readme = {{ I'm a readme! }} ``` ```ucm -.> add +scratch/main> add ``` ```api -GET /api/non-project-code/list?namespace=nested.names +GET /api/projects/scratch/branches/main/list?namespace=nested.names -GET /api/non-project-code/list?namespace=names&relativeTo=nested +GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested ``` diff --git a/unison-src/transcripts/api-namespace-list.output.md b/unison-src/transcripts/api-namespace-list.output.md index 0ef32d194..4219aa191 100644 --- a/unison-src/transcripts/api-namespace-list.output.md +++ b/unison-src/transcripts/api-namespace-list.output.md @@ -23,7 +23,7 @@ nested.names.readme = {{ I'm a readme! }} ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -33,7 +33,7 @@ nested.names.readme = {{ I'm a readme! }} ``` ```api -GET /api/non-project-code/list?namespace=nested.names +GET /api/projects/scratch/branches/main/list?namespace=nested.names { "namespaceListingChildren": [ { @@ -82,7 +82,7 @@ GET /api/non-project-code/list?namespace=nested.names "namespaceListingFQN": "nested.names", "namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0" } -GET /api/non-project-code/list?namespace=names&relativeTo=nested +GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested { "namespaceListingChildren": [ { diff --git a/unison-src/transcripts/api-summaries.md b/unison-src/transcripts/api-summaries.md index cf473e778..6bbc793a9 100644 --- a/unison-src/transcripts/api-summaries.md +++ b/unison-src/transcripts/api-summaries.md @@ -1,7 +1,7 @@ # Definition Summary APIs ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` @@ -25,56 +25,56 @@ structural ability Stream s where ``` ```ucm:hide -.> add -.> alias.type ##Nat Nat -.> alias.term ##IO.putBytes.impl.v3 putBytesImpl +scratch/main> add +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl ``` ## Term Summary APIs ```api -- term -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat -- term without name uses hash -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary -- doc -GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc -- test -GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest -- function -GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func -- constructor -GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This -- Long type signature -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType -- Long type signature with render width -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType -- Builtin Term -GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl ``` ## Type Summary APIs ```api -- data -GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing -- data with type args -GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe -- ability -GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream -- builtin type -GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat ``` diff --git a/unison-src/transcripts/api-summaries.output.md b/unison-src/transcripts/api-summaries.output.md index cc5a9fcea..e9f93e624 100644 --- a/unison-src/transcripts/api-summaries.output.md +++ b/unison-src/transcripts/api-summaries.output.md @@ -23,7 +23,7 @@ structural ability Stream s where ```api -- term -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat { "displayName": "nat", "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", @@ -42,7 +42,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq "tag": "Plain" } -- term without name uses hash -GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary { "displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", "hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8", @@ -61,7 +61,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq "tag": "Plain" } -- doc -GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc { "displayName": "doc", "hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo", @@ -80,7 +80,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bl "tag": "Doc" } -- test -GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest { "displayName": "mytest", "hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8", @@ -111,7 +111,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccd "tag": "Test" } -- function -GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func { "displayName": "func", "hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o", @@ -151,7 +151,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3o "tag": "Plain" } -- constructor -GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This { "displayName": "Thing.This", "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0", @@ -191,7 +191,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5ad "tag": "DataConstructor" } -- Long type signature -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType { "displayName": "funcWithLongType", "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", @@ -378,7 +378,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton "tag": "Plain" } -- Long type signature with render width -GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType { "displayName": "funcWithLongType", "hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8", @@ -565,7 +565,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton "tag": "Plain" } -- Builtin Term -GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl +GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl { "displayName": "putBytesImpl", "hash": "##IO.putBytes.impl.v3", @@ -671,7 +671,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summar ```api -- data -GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing { "displayName": "Thing", "hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0", @@ -710,7 +710,7 @@ GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5ad "tag": "Data" } -- data with type args -GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe { "displayName": "Maybe", "hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg", @@ -759,7 +759,7 @@ GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6 "tag": "Data" } -- ability -GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream { "displayName": "Stream", "hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8", @@ -808,7 +808,7 @@ GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aa "tag": "Ability" } -- builtin type -GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat +GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat { "displayName": "Nat", "hash": "##Nat", diff --git a/unison-src/transcripts/block-on-required-update.md b/unison-src/transcripts/block-on-required-update.md index 1027188b0..3b339e6fe 100644 --- a/unison-src/transcripts/block-on-required-update.md +++ b/unison-src/transcripts/block-on-required-update.md @@ -3,7 +3,7 @@ Should block an `add` if it requires an update on an in-file dependency. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ x = 1 ``` ```ucm -.> add +scratch/main> add ``` Update `x`, and add a new `y` which depends on the update @@ -24,5 +24,5 @@ y = x + 1 Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. ```ucm:error -.> add y +scratch/main> add y ``` diff --git a/unison-src/transcripts/block-on-required-update.output.md b/unison-src/transcripts/block-on-required-update.output.md index 254a281e8..0935b7317 100644 --- a/unison-src/transcripts/block-on-required-update.output.md +++ b/unison-src/transcripts/block-on-required-update.output.md @@ -20,7 +20,7 @@ x = 1 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ y = x + 1 Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'. ```ucm -.> add y +scratch/main> add y x These definitions failed: diff --git a/unison-src/transcripts/blocks.md b/unison-src/transcripts/blocks.md index bac7ef187..b89ab4585 100644 --- a/unison-src/transcripts/blocks.md +++ b/unison-src/transcripts/blocks.md @@ -1,7 +1,7 @@ ## Blocks and scoping ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ### Names introduced by a block shadow names introduced in outer scopes diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.md b/unison-src/transcripts/boolean-op-pretty-print-2819.md index efdf493e9..b788c7833 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.md @@ -1,7 +1,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2819 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ hangExample = ``` ```ucm -.> add -.> view hangExample +scratch/main> add +scratch/main> view hangExample ``` diff --git a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md index 690b9fdc6..48fbfecf6 100644 --- a/unison-src/transcripts/boolean-op-pretty-print-2819.output.md +++ b/unison-src/transcripts/boolean-op-pretty-print-2819.output.md @@ -21,13 +21,13 @@ hangExample = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: hangExample : Boolean -.> view hangExample +scratch/main> view hangExample hangExample : Boolean hangExample = diff --git a/unison-src/transcripts/branch-command.md b/unison-src/transcripts/branch-command.md index 4b1636be4..d48e3c259 100644 --- a/unison-src/transcripts/branch-command.md +++ b/unison-src/transcripts/branch-command.md @@ -1,25 +1,25 @@ The `branch` command creates a new branch. ```ucm:hide -.> project.create-empty foo -.> project.create-empty bar +scratch/main> project.create-empty foo +scratch/main> project.create-empty bar ``` -First, we'll just create a loose code namespace with a term in it for later. +First, we'll create a term to include in the branches. ```unison:hide someterm = 18 ``` ```ucm -.some.loose.code.lib> builtins.merge -.some.loose.code> add +scratch/main> builtins.merge lib.builtins +scratch/main> add ``` Now, the `branch` demo: `branch` can create a branch from a different branch in the same project, from a different branch in a different -project, or from loose code. It can also create an empty branch. +project. It can also create an empty branch. ```ucm foo/main> branch topic1 @@ -33,22 +33,17 @@ foo/main> branch /main /topic8 foo/main> branch /main foo/topic9 foo/main> branch foo/main topic10 foo/main> branch foo/main /topic11 -.> branch foo/main foo/topic12 +scratch/main> branch foo/main foo/topic12 foo/main> branch bar/topic bar/main> branch foo/main topic2 bar/main> branch foo/main /topic3 -.> branch foo/main bar/topic4 - -.some.loose.code> branch foo/topic13 -foo/main> branch .some.loose.code topic14 -foo/main> branch .some.loose.code /topic15 -.> branch .some.loose.code foo/topic16 +scratch/main> branch foo/main bar/topic4 foo/main> branch.empty empty1 foo/main> branch.empty /empty2 foo/main> branch.empty foo/empty3 -.> branch.empty foo/empty4 +scratch/main> branch.empty foo/empty4 ``` The `branch` command can create branches named `releases/drafts/*` (because why not). diff --git a/unison-src/transcripts/branch-command.output.md b/unison-src/transcripts/branch-command.output.md index c074134bb..28dd680d5 100644 --- a/unison-src/transcripts/branch-command.output.md +++ b/unison-src/transcripts/branch-command.output.md @@ -1,19 +1,17 @@ The `branch` command creates a new branch. -First, we'll just create a loose code namespace with a term in it for later. +First, we'll create a term to include in the branches. ```unison someterm = 18 ``` ```ucm - ☝️ The namespace .some.loose.code.lib is empty. - -.some.loose.code.lib> builtins.merge +scratch/main> builtins.merge lib.builtins Done. -.some.loose.code> add +scratch/main> add ⍟ I've added these definitions: @@ -23,7 +21,7 @@ someterm = 18 Now, the `branch` demo: `branch` can create a branch from a different branch in the same project, from a different branch in a different -project, or from loose code. It can also create an empty branch. +project. It can also create an empty branch. ```ucm foo/main> branch topic1 @@ -103,7 +101,7 @@ foo/main> branch foo/main /topic11 Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic11`. -.> branch foo/main foo/topic12 +scratch/main> branch foo/main foo/topic12 Done. I've created the topic12 branch based off of main. @@ -122,30 +120,10 @@ bar/main> branch foo/main /topic3 Done. I've created the bar/topic3 branch based off foo/main. -.> branch foo/main bar/topic4 +scratch/main> branch foo/main bar/topic4 Done. I've created the bar/topic4 branch based off foo/main. -.some.loose.code> branch foo/topic13 - - Done. I've created the foo/topic13 branch from the namespace - .some.loose.code. - -foo/main> branch .some.loose.code topic14 - - Done. I've created the foo/topic14 branch from the namespace - .some.loose.code. - -foo/main> branch .some.loose.code /topic15 - - Done. I've created the foo/topic15 branch from the namespace - .some.loose.code. - -.> branch .some.loose.code foo/topic16 - - Done. I've created the foo/topic16 branch from the namespace - .some.loose.code. - foo/main> branch.empty empty1 Done. I've created an empty branch foo/empty1. @@ -164,7 +142,7 @@ foo/main> branch.empty foo/empty3 Tip: Use `merge /somebranch` to initialize this branch. -.> branch.empty foo/empty4 +scratch/main> branch.empty foo/empty4 Done. I've created an empty branch foo/empty4. diff --git a/unison-src/transcripts/branch-relative-path.md b/unison-src/transcripts/branch-relative-path.md index 8414db2f1..74298f4b2 100644 --- a/unison-src/transcripts/branch-relative-path.md +++ b/unison-src/transcripts/branch-relative-path.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.merge -.> project.create-empty p0 -.> project.create-empty p1 +scratch/main> builtins.merge +scratch/main> project.create-empty p0 +scratch/main> project.create-empty p1 ``` ```unison diff --git a/unison-src/transcripts/bug-fix-4354.md b/unison-src/transcripts/bug-fix-4354.md index c1d603258..1ea7f595d 100644 --- a/unison-src/transcripts/bug-fix-4354.md +++ b/unison-src/transcripts/bug-fix-4354.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/builtins-merge.md b/unison-src/transcripts/builtins-merge.md index 28bfb426c..942dd4b0d 100644 --- a/unison-src/transcripts/builtins-merge.md +++ b/unison-src/transcripts/builtins-merge.md @@ -1,6 +1,6 @@ -The `builtins.merge` command adds the known builtins to a `builtin` subnamespace within the current namespace. +The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace. ```ucm -.tmp> builtins.merge -.tmp> ls builtin +scratch/main> builtins.merge builtins +scratch/main> ls builtins ``` diff --git a/unison-src/transcripts/builtins-merge.output.md b/unison-src/transcripts/builtins-merge.output.md index 7bcf4910e..b79bdab58 100644 --- a/unison-src/transcripts/builtins-merge.output.md +++ b/unison-src/transcripts/builtins-merge.output.md @@ -1,13 +1,11 @@ -The `builtins.merge` command adds the known builtins to a `builtin` subnamespace within the current namespace. +The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace. ```ucm - ☝️ The namespace .tmp is empty. - -.tmp> builtins.merge +scratch/main> builtins.merge builtins Done. -.tmp> ls builtin +scratch/main> ls builtins 1. Any (builtin type) 2. Any/ (2 terms) diff --git a/unison-src/transcripts/builtins.md b/unison-src/transcripts/builtins.md index ab854be39..6834b85eb 100644 --- a/unison-src/transcripts/builtins.md +++ b/unison-src/transcripts/builtins.md @@ -1,12 +1,12 @@ # Unit tests for builtin functions ```ucm:hide -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` -This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. +This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. ## `Int` functions @@ -88,7 +88,7 @@ test> Int.tests.conversions = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Nat` functions @@ -163,7 +163,7 @@ test> Nat.tests.conversions = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Boolean` functions @@ -190,7 +190,7 @@ test> Boolean.tests.notTable = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Text` functions @@ -288,7 +288,7 @@ test> Text.tests.indexOfEmoji = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `Bytes` functions @@ -352,7 +352,7 @@ test> Bytes.tests.indexOf = ``` ```ucm:hide -.> add +scratch/main> add ``` ## `List` comparison @@ -371,7 +371,7 @@ test> checks [ ``` ```ucm:hide -.> add +scratch/main> add ``` Other list functions @@ -392,7 +392,7 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))] ``` ```ucm:hide -.> add +scratch/main> add ``` ## Sandboxing functions @@ -419,7 +419,7 @@ openFile] ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison @@ -436,8 +436,8 @@ openFilesIO = do ``` ```ucm -.> add -.> io.test openFilesIO +scratch/main> add +scratch/main> io.test openFilesIO ``` ## Universal hash functions @@ -450,7 +450,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive ``` ```ucm:hide -.> add +scratch/main> add ``` ## Run the tests @@ -458,5 +458,5 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing. ```ucm -.> test +scratch/main> test ``` diff --git a/unison-src/transcripts/builtins.output.md b/unison-src/transcripts/builtins.output.md index 4d3089d35..4f8967ae0 100644 --- a/unison-src/transcripts/builtins.output.md +++ b/unison-src/transcripts/builtins.output.md @@ -1,6 +1,6 @@ # Unit tests for builtin functions -This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. +This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail. ## `Int` functions @@ -480,21 +480,21 @@ openFilesIO = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: openFilesIO : '{IO} [Result] -.> io.test openFilesIO +scratch/main> io.test openFilesIO New test results: - ◉ openFilesIO Passed + 1. openFilesIO ◉ Passed ✅ 1 test(s) passing - Tip: Use view openFilesIO to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ## Universal hash functions @@ -535,40 +535,40 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing. ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ Any.test1 Passed - ◉ Any.test2 Passed - ◉ Boolean.tests.andTable Passed - ◉ Boolean.tests.notTable Passed - ◉ Boolean.tests.orTable Passed - ◉ Bytes.tests.at Passed - ◉ Bytes.tests.compression Passed - ◉ Bytes.tests.fromBase64UrlUnpadded Passed - ◉ Bytes.tests.indexOf Passed - ◉ Int.tests.arithmetic Passed - ◉ Int.tests.bitTwiddling Passed - ◉ Int.tests.conversions Passed - ◉ Nat.tests.arithmetic Passed - ◉ Nat.tests.bitTwiddling Passed - ◉ Nat.tests.conversions Passed - ◉ Sandbox.test1 Passed - ◉ Sandbox.test2 Passed - ◉ Sandbox.test3 Passed - ◉ test.rtjqan7bcs Passed - ◉ Text.tests.alignment Passed - ◉ Text.tests.indexOf Passed - ◉ Text.tests.indexOfEmoji Passed - ◉ Text.tests.literalsEq Passed - ◉ Text.tests.patterns Passed - ◉ Text.tests.repeat Passed - ◉ Text.tests.takeDropAppend Passed - ◉ Universal.murmurHash.tests Passed + 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 Any.test1 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.md b/unison-src/transcripts/bytesFromList.md index 9da15329f..1abb99879 100644 --- a/unison-src/transcripts/bytesFromList.md +++ b/unison-src/transcripts/bytesFromList.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`: diff --git a/unison-src/transcripts/check763.md b/unison-src/transcripts/check763.md index 3bb162b34..8b3204514 100644 --- a/unison-src/transcripts/check763.md +++ b/unison-src/transcripts/check763.md @@ -1,7 +1,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,8 +10,8 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ```ucm -.> add -.> move.term +-+ boppitybeep -.> move.term boppitybeep +-+ +scratch/main> add +scratch/main> move.term +-+ boppitybeep +scratch/main> move.term boppitybeep +-+ ``` diff --git a/unison-src/transcripts/check763.output.md b/unison-src/transcripts/check763.output.md index b8421509d..fe50b6834 100644 --- a/unison-src/transcripts/check763.output.md +++ b/unison-src/transcripts/check763.output.md @@ -19,17 +19,17 @@ Regression test for https://github.com/unisonweb/unison/issues/763 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: +-+ : Nat -> Nat -> Nat -.> move.term +-+ boppitybeep +scratch/main> move.term +-+ boppitybeep Done. -.> move.term boppitybeep +-+ +scratch/main> move.term boppitybeep +-+ Done. diff --git a/unison-src/transcripts/check873.md b/unison-src/transcripts/check873.md index 714518628..b70937821 100644 --- a/unison-src/transcripts/check873.md +++ b/unison-src/transcripts/check873.md @@ -1,7 +1,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point being, this shouldn't crash the runtime. :) ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -9,7 +9,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/check873.output.md b/unison-src/transcripts/check873.output.md index 289c592f3..5f21cec20 100644 --- a/unison-src/transcripts/check873.output.md +++ b/unison-src/transcripts/check873.output.md @@ -18,7 +18,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/constructor-applied-to-unit.md b/unison-src/transcripts/constructor-applied-to-unit.md index df1341aa5..fc598a883 100644 --- a/unison-src/transcripts/constructor-applied-to-unit.md +++ b/unison-src/transcripts/constructor-applied-to-unit.md @@ -1,6 +1,6 @@ ```ucm:hide -.> alias.type ##Nat Nat -.> alias.term ##Any.Any Any +scratch/main> alias.type ##Nat Nat +scratch/main> alias.term ##Any.Any Any ``` ```unison diff --git a/unison-src/transcripts/contrabilities.md b/unison-src/transcripts/contrabilities.md index 795ec1556..5d1fdcb64 100644 --- a/unison-src/transcripts/contrabilities.md +++ b/unison-src/transcripts/contrabilities.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/create-author.md b/unison-src/transcripts/create-author.md index d9a39c735..af0655866 100644 --- a/unison-src/transcripts/create-author.md +++ b/unison-src/transcripts/create-author.md @@ -1,10 +1,10 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` Demonstrating `create.author`: ```ucm -.foo> create.author alicecoder "Alice McGee" -.foo> view 2 +scratch/main> create.author alicecoder "Alice McGee" +scratch/main> find alicecoder ``` diff --git a/unison-src/transcripts/create-author.output.md b/unison-src/transcripts/create-author.output.md index 3a5635947..a71fca7b1 100644 --- a/unison-src/transcripts/create-author.output.md +++ b/unison-src/transcripts/create-author.output.md @@ -1,22 +1,21 @@ Demonstrating `create.author`: ```ucm - ☝️ The namespace .foo is empty. - -.foo> create.author alicecoder "Alice McGee" +scratch/main> create.author alicecoder "Alice McGee" Added definitions: - 1. metadata.authors.alicecoder : #345f3nptqq - 2. metadata.copyrightHolders.alicecoder : #pgornst1pq - 3. metadata.authors.alicecoder.guid : #hqectlr3gt + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID Tip: Add License values for alicecoder under metadata. -.foo> view 2 +scratch/main> find alicecoder - .foo.metadata.copyrightHolders.alicecoder : CopyrightHolder - .foo.metadata.copyrightHolders.alicecoder = - CopyrightHolder alicecoder.guid "Alice McGee" + 1. metadata.authors.alicecoder : Author + 2. metadata.copyrightHolders.alicecoder : CopyrightHolder + 3. metadata.authors.alicecoder.guid : GUID + ``` diff --git a/unison-src/transcripts/cycle-update-1.md b/unison-src/transcripts/cycle-update-1.md index 5294f2e49..b60bc763e 100644 --- a/unison-src/transcripts/cycle-update-1.md +++ b/unison-src/transcripts/cycle-update-1.md @@ -1,7 +1,7 @@ Update a member of a cycle, but retain the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping _ = !pong + 3 ``` ```ucm -.> update -.> view ping pong +scratch/main> update +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-1.output.md b/unison-src/transcripts/cycle-update-1.output.md index b5f381b73..25cd6f398 100644 --- a/unison-src/transcripts/cycle-update-1.output.md +++ b/unison-src/transcripts/cycle-update-1.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ ping _ = !pong + 3 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,7 +62,7 @@ ping _ = !pong + 3 Done. -.> view ping pong +scratch/main> view ping pong ping : 'Nat ping _ = diff --git a/unison-src/transcripts/cycle-update-2.md b/unison-src/transcripts/cycle-update-2.md index bd8c6edc1..0feb63afc 100644 --- a/unison-src/transcripts/cycle-update-2.md +++ b/unison-src/transcripts/cycle-update-2.md @@ -1,7 +1,7 @@ Update a member of a cycle with a type-preserving update, but sever the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping _ = 3 ``` ```ucm -.> update -.> view ping pong +scratch/main> update +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-2.output.md b/unison-src/transcripts/cycle-update-2.output.md index 4d9639a9c..89e740faa 100644 --- a/unison-src/transcripts/cycle-update-2.output.md +++ b/unison-src/transcripts/cycle-update-2.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ ping _ = 3 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,7 +62,7 @@ ping _ = 3 Done. -.> view ping pong +scratch/main> view ping pong ping : 'Nat ping _ = 3 diff --git a/unison-src/transcripts/cycle-update-3.md b/unison-src/transcripts/cycle-update-3.md index dfcd87305..b5e1e0555 100644 --- a/unison-src/transcripts/cycle-update-3.md +++ b/unison-src/transcripts/cycle-update-3.md @@ -1,7 +1,7 @@ Update a member of a cycle with a type-changing update, thus severing the cycle. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,6 +22,6 @@ ping = 3 ``` ```ucm -.> update.old -.> view ping pong +scratch/main> update.old +scratch/main> view ping pong ``` diff --git a/unison-src/transcripts/cycle-update-3.output.md b/unison-src/transcripts/cycle-update-3.output.md index 281e389e6..f21e3fe9d 100644 --- a/unison-src/transcripts/cycle-update-3.output.md +++ b/unison-src/transcripts/cycle-update-3.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,13 +51,13 @@ ping = 3 ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: ping : Nat -.> view ping pong +scratch/main> view ping pong ping : Nat ping = 3 diff --git a/unison-src/transcripts/cycle-update-4.md b/unison-src/transcripts/cycle-update-4.md index d2bf98f69..ae389489b 100644 --- a/unison-src/transcripts/cycle-update-4.md +++ b/unison-src/transcripts/cycle-update-4.md @@ -1,7 +1,7 @@ `update` properly discovers and establishes new cycles. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -25,6 +25,6 @@ clang _ = !pong + 3 ``` ```ucm -.> update.old ping -.> view ping pong clang +scratch/main> update.old ping +scratch/main> view ping pong clang ``` diff --git a/unison-src/transcripts/cycle-update-4.output.md b/unison-src/transcripts/cycle-update-4.output.md index d4b8b8030..0eb134f0f 100644 --- a/unison-src/transcripts/cycle-update-4.output.md +++ b/unison-src/transcripts/cycle-update-4.output.md @@ -23,7 +23,7 @@ pong _ = !ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -58,7 +58,7 @@ clang _ = !pong + 3 ``` ```ucm -.> update.old ping +scratch/main> update.old ping ⍟ I've added these definitions: @@ -69,7 +69,7 @@ clang _ = !pong + 3 ping : 'Nat pong : 'Nat -.> view ping pong clang +scratch/main> view ping pong clang clang : 'Nat clang _ = diff --git a/unison-src/transcripts/cycle-update-5.md b/unison-src/transcripts/cycle-update-5.md index c09a93c3d..60d283d55 100644 --- a/unison-src/transcripts/cycle-update-5.md +++ b/unison-src/transcripts/cycle-update-5.md @@ -1,7 +1,7 @@ Not yet working: properly updating nameless implicit terms. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,7 +13,7 @@ pong _ = !inner.ping + 2 ``` ```ucm -.> add +scratch/main> add ``` Here we queue up an update by saving in a namespace where `inner.ping` and `pong` both have names, but then apply the @@ -26,7 +26,7 @@ inner.ping _ = !pong + 3 ```ucm .inner> update.old -.> view inner.ping +scratch/main> view inner.ping ``` The bug here is that `inner.ping` still refers to `pong` by name. But if we properly identified the nameless (in the diff --git a/unison-src/transcripts/cycle-update-5.output.md b/unison-src/transcripts/cycle-update-5.output.md index 017d92b34..b6c1a0717 100644 --- a/unison-src/transcripts/cycle-update-5.output.md +++ b/unison-src/transcripts/cycle-update-5.output.md @@ -23,7 +23,7 @@ pong _ = !inner.ping + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -54,13 +54,15 @@ inner.ping _ = !pong + 3 ``` ```ucm + ☝️ The namespace .inner is empty. + .inner> update.old ⍟ I've added these definitions: inner.ping : '##Nat -.> view inner.ping +scratch/main> view inner.ping inner.ping : 'Nat inner.ping _ = diff --git a/unison-src/transcripts/debug-definitions.md b/unison-src/transcripts/debug-definitions.md index 471748691..0d10165f5 100644 --- a/unison-src/transcripts/debug-definitions.md +++ b/unison-src/transcripts/debug-definitions.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -17,12 +17,12 @@ ability Ask a where ``` ```ucm -.> add -.> debug.term.abt Nat.+ -.> debug.term.abt y -.> debug.term.abt Some -.> debug.term.abt ask -.> debug.type.abt Nat -.> debug.type.abt Optional -.> debug.type.abt Ask +scratch/main> add +scratch/main> debug.term.abt Nat.+ +scratch/main> debug.term.abt y +scratch/main> debug.term.abt Some +scratch/main> debug.term.abt ask +scratch/main> debug.type.abt Nat +scratch/main> debug.type.abt Optional +scratch/main> debug.type.abt Ask ``` diff --git a/unison-src/transcripts/debug-definitions.output.md b/unison-src/transcripts/debug-definitions.output.md index cb1b14d1a..37d6591e2 100644 --- a/unison-src/transcripts/debug-definitions.output.md +++ b/unison-src/transcripts/debug-definitions.output.md @@ -13,7 +13,7 @@ ability Ask a where ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -23,15 +23,15 @@ ability Ask a where x : Nat y : Nat -.> debug.term.abt Nat.+ +scratch/main> debug.term.abt Nat.+ Builtin term: ##Nat.+ -.> debug.term.abt y +scratch/main> debug.term.abt y (let Ref(ReferenceBuiltin "Nat.+") Ref(ReferenceDerived (Id "qpo3o788girkkbb43uf6ggqberfduhtnqbt7096eojlrp27jieco09mdasb7b0b06ej9hj60a00nnbbdo8he0b4e0m7vtopifiuhdig" 0)) 2 in (User "z". Ref(ReferenceBuiltin "Nat.+") (Var User "z") 10)):ReferenceBuiltin "Nat" -.> debug.term.abt Some +scratch/main> debug.term.abt Some Constructor #0 of the following type: DataDeclaration @@ -61,7 +61,7 @@ ability Ask a where ] } -.> debug.term.abt ask +scratch/main> debug.term.abt ask Constructor #0 of the following type: EffectDeclaration @@ -90,11 +90,11 @@ ability Ask a where } } -.> debug.type.abt Nat +scratch/main> debug.type.abt Nat Builtin type: ##Nat -.> debug.type.abt Optional +scratch/main> debug.type.abt Optional DataDeclaration { modifier = Structural @@ -123,7 +123,7 @@ ability Ask a where ] } -.> debug.type.abt Ask +scratch/main> debug.type.abt Ask EffectDeclaration { toDataDecl = DataDeclaration diff --git a/unison-src/transcripts/debug-name-diffs.md b/unison-src/transcripts/debug-name-diffs.md index 361142bf5..5d4970e59 100644 --- a/unison-src/transcripts/debug-name-diffs.md +++ b/unison-src/transcripts/debug-name-diffs.md @@ -10,10 +10,10 @@ structural type a.b.Baz = Boo ``` ```ucm -.> add -.> delete.term.verbose a.b.one -.> alias.term a.two a.newtwo -.> move.namespace a.x a.y -.> history -.> debug.name-diff 4 1 +scratch/main> add +scratch/main> delete.term.verbose a.b.one +scratch/main> alias.term a.two a.newtwo +scratch/main> move.namespace a.x a.y +scratch/main> history +scratch/main> debug.name-diff 4 1 ``` diff --git a/unison-src/transcripts/debug-name-diffs.output.md b/unison-src/transcripts/debug-name-diffs.output.md index ac6895c14..9d15bfe47 100644 --- a/unison-src/transcripts/debug-name-diffs.output.md +++ b/unison-src/transcripts/debug-name-diffs.output.md @@ -28,7 +28,7 @@ structural type a.b.Baz = Boo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -39,7 +39,7 @@ structural type a.b.Baz = Boo a.x.four : ##Nat a.x.three : ##Nat -.> delete.term.verbose a.b.one +scratch/main> delete.term.verbose a.b.one Removed definitions: @@ -47,15 +47,15 @@ structural type a.b.Baz = Boo Tip: You can use `undo` or `reflog` to undo this change. -.> alias.term a.two a.newtwo +scratch/main> alias.term a.two a.newtwo Done. -.> move.namespace a.x a.y +scratch/main> move.namespace a.x a.y Done. -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -90,7 +90,7 @@ structural type a.b.Baz = Boo □ 4. #gss5s88mo3 (start of history) -.> debug.name-diff 4 1 +scratch/main> debug.name-diff 4 1 Kind Name Change Ref Term a.newtwo Added #dcgdua2lj6upd1ah5v0qp09gjsej0d77d87fu6qn8e2qrssnlnmuinoio46hiu53magr7qn8vnqke8ndt0v76700o5u8gcvo7st28jg diff --git a/unison-src/transcripts/deep-names.md b/unison-src/transcripts/deep-names.md index 3487497cc..9d6695bc4 100644 --- a/unison-src/transcripts/deep-names.md +++ b/unison-src/transcripts/deep-names.md @@ -12,36 +12,42 @@ http.z = 8 ``` ```ucm:hide -.> add +scratch/main> add +scratch/main> branch /app1 +scratch/main> branch /app2 ``` Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm -.app1> fork .text lib.text_v1 -.app1> fork .text lib.text_v2 -.app1> fork .http lib.http_v3 -.app1> fork .http lib.http_v4 +scratch/app1> fork text lib.text_v1 +scratch/app1> fork text lib.text_v2 +scratch/app1> delete.namespace text +scratch/app1> fork http lib.http_v3 +scratch/app1> fork http lib.http_v4 +scratch/app1> delete.namespace http ``` As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> names a -.app1> names x +scratch/app1> names a +scratch/app1> names x ``` Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. It also includes the `text` library twice as indirect dependencies via `webutil` ```ucm -.app2> fork .http lib.http_v1 -.app2> fork .http lib.http_v2 -.app2> fork .text lib.webutil.lib.text_v1 -.app2> fork .text lib.webutil.lib.text_v2 -.app2> fork .http lib.webutil.lib.http +scratch/app2> fork http lib.http_v1 +scratch/app2> fork http lib.http_v2 +scratch/app2> fork text lib.webutil.lib.text_v1 +scratch/app2> fork text lib.webutil.lib.text_v2 +scratch/app2> fork http lib.webutil.lib.http +scratch/app2> delete.namespace http +scratch/app2> delete.namespace text ``` Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. ```ucm -.app2> names a -.app2> names x +scratch/app2> names a +scratch/app2> names x ``` diff --git a/unison-src/transcripts/deep-names.output.md b/unison-src/transcripts/deep-names.output.md index 3b6637d8a..833ae613a 100644 --- a/unison-src/transcripts/deep-names.output.md +++ b/unison-src/transcripts/deep-names.output.md @@ -13,28 +13,34 @@ http.z = 8 Our `app1` project includes the text library twice and the http library twice as direct dependencies. ```ucm - ☝️ The namespace .app1 is empty. - -.app1> fork .text lib.text_v1 +scratch/app1> fork text lib.text_v1 Done. -.app1> fork .text lib.text_v2 +scratch/app1> fork text lib.text_v2 Done. -.app1> fork .http lib.http_v3 +scratch/app1> delete.namespace text Done. -.app1> fork .http lib.http_v4 +scratch/app1> fork http lib.http_v3 + + Done. + +scratch/app1> fork http lib.http_v4 + + Done. + +scratch/app1> delete.namespace http Done. ``` As such, we see two copies of `a` and two copies of `x` via these direct dependencies. ```ucm -.app1> names a +scratch/app1> names a Term Hash: #gjmq673r1v @@ -42,7 +48,7 @@ As such, we see two copies of `a` and two copies of `x` via these direct depende Tip: Use `names.global` to see more results. -.app1> names x +scratch/app1> names x Term Hash: #nsmc4p1ra4 @@ -54,25 +60,31 @@ As such, we see two copies of `a` and two copies of `x` via these direct depende Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`. It also includes the `text` library twice as indirect dependencies via `webutil` ```ucm - ☝️ The namespace .app2 is empty. - -.app2> fork .http lib.http_v1 +scratch/app2> fork http lib.http_v1 Done. -.app2> fork .http lib.http_v2 +scratch/app2> fork http lib.http_v2 Done. -.app2> fork .text lib.webutil.lib.text_v1 +scratch/app2> fork text lib.webutil.lib.text_v1 Done. -.app2> fork .text lib.webutil.lib.text_v2 +scratch/app2> fork text lib.webutil.lib.text_v2 Done. -.app2> fork .http lib.webutil.lib.http +scratch/app2> fork http lib.webutil.lib.http + + Done. + +scratch/app2> delete.namespace http + + Done. + +scratch/app2> delete.namespace text Done. @@ -80,7 +92,7 @@ It also includes the `text` library twice as indirect dependencies via `webutil` Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`. We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them. ```ucm -.app2> names a +scratch/app2> names a Term Hash: #gjmq673r1v @@ -88,7 +100,7 @@ We see neither the second indirect copy of `a` nor the indirect copy of `x` via Tip: Use `names.global` to see more results. -.app2> names x +scratch/app2> names x Term Hash: #nsmc4p1ra4 diff --git a/unison-src/transcripts/delete-namespace.md b/unison-src/transcripts/delete-namespace.md index fe8f34630..5bbdda79e 100644 --- a/unison-src/transcripts/delete-namespace.md +++ b/unison-src/transcripts/delete-namespace.md @@ -1,7 +1,7 @@ # delete.namespace.force ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -15,47 +15,47 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 ``` ```ucm:hide -.> add +scratch/main> add ``` Deleting a namespace with no external dependencies should succeed. ```ucm -.> delete.namespace no_dependencies +scratch/main> delete.namespace no_dependencies ``` Deleting a namespace with external dependencies should fail and list all dependents. ```ucm:error -.> delete.namespace dependencies +scratch/main> delete.namespace dependencies ``` Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ```ucm -.> delete.namespace.force dependencies +scratch/main> delete.namespace.force dependencies ``` I should be able to view an affected dependency by number ```ucm -.> view 2 +scratch/main> view 2 ``` Deleting the root namespace should require confirmation if not forced. ```ucm -.> delete.namespace . -.> delete.namespace . +scratch/main> delete.namespace . +scratch/main> delete.namespace . -- Should have an empty history -.> history . +scratch/main> history . ``` Deleting the root namespace shouldn't require confirmation if forced. ```ucm -.> delete.namespace.force . +scratch/main> delete.namespace.force . -- Should have an empty history -.> history . +scratch/main> history . ``` diff --git a/unison-src/transcripts/delete-namespace.output.md b/unison-src/transcripts/delete-namespace.output.md index e7c09cbae..563b98ad2 100644 --- a/unison-src/transcripts/delete-namespace.output.md +++ b/unison-src/transcripts/delete-namespace.output.md @@ -13,7 +13,7 @@ dependents.usage2 = dependencies.term1 * dependencies.term2 Deleting a namespace with no external dependencies should succeed. ```ucm -.> delete.namespace no_dependencies +scratch/main> delete.namespace no_dependencies Done. @@ -21,7 +21,7 @@ Deleting a namespace with no external dependencies should succeed. Deleting a namespace with external dependencies should fail and list all dependents. ```ucm -.> delete.namespace dependencies +scratch/main> delete.namespace dependencies ⚠️ @@ -42,7 +42,7 @@ Deleting a namespace with external dependencies should fail and list all depende Deleting a namespace with external dependencies should succeed when using `delete.namespace.force` ```ucm -.> delete.namespace.force dependencies +scratch/main> delete.namespace.force dependencies Done. @@ -62,7 +62,7 @@ Deleting a namespace with external dependencies should succeed when using `delet I should be able to view an affected dependency by number ```ucm -.> view 2 +scratch/main> view 2 dependents.usage2 : Nat dependents.usage2 = @@ -73,21 +73,21 @@ I should be able to view an affected dependency by number Deleting the root namespace should require confirmation if not forced. ```ucm -.> delete.namespace . +scratch/main> delete.namespace . ⚠️ Are you sure you want to clear away everything? You could use `project.create` to switch to a new project instead. -.> delete.namespace . +scratch/main> delete.namespace . Okay, I deleted everything except the history. Use `undo` to undo, or `builtins.merge` to restore the absolute basics to the current path. -- Should have an empty history -.> history . +scratch/main> history . ☝️ The namespace . is empty. @@ -95,14 +95,14 @@ Deleting the root namespace should require confirmation if not forced. Deleting the root namespace shouldn't require confirmation if forced. ```ucm -.> delete.namespace.force . +scratch/main> delete.namespace.force . Okay, I deleted everything except the history. Use `undo` to undo, or `builtins.merge` to restore the absolute basics to the current path. -- Should have an empty history -.> history . +scratch/main> history . ☝️ The namespace . is empty. diff --git a/unison-src/transcripts/delete-project-branch.md b/unison-src/transcripts/delete-project-branch.md index c84dc95cc..091e9fa71 100644 --- a/unison-src/transcripts/delete-project-branch.md +++ b/unison-src/transcripts/delete-project-branch.md @@ -17,7 +17,7 @@ You can precede the branch name by a project name. ```ucm foo/main> branch topic -.> delete.branch foo/topic +scratch/main> delete.branch foo/topic ``` You can delete the only branch in a project. diff --git a/unison-src/transcripts/delete-project-branch.output.md b/unison-src/transcripts/delete-project-branch.output.md index d4458e8be..84568c97d 100644 --- a/unison-src/transcripts/delete-project-branch.output.md +++ b/unison-src/transcripts/delete-project-branch.output.md @@ -35,9 +35,7 @@ foo/main> branch topic Tip: To merge your work back into the main branch, first `switch /main` then `merge /topic`. - ☝️ The namespace . is empty. - -.> delete.branch foo/topic +scratch/main> delete.branch foo/topic ``` You can delete the only branch in a project. diff --git a/unison-src/transcripts/delete-project.md b/unison-src/transcripts/delete-project.md index df31873fb..b317a9f31 100644 --- a/unison-src/transcripts/delete-project.md +++ b/unison-src/transcripts/delete-project.md @@ -1,9 +1,9 @@ # delete.project ```ucm -.> project.create-empty foo -.> project.create-empty bar -.> projects +scratch/main> project.create-empty foo +scratch/main> project.create-empty bar +scratch/main> projects foo/main> delete.project foo -.> projects +scratch/main> projects ``` diff --git a/unison-src/transcripts/delete-project.output.md b/unison-src/transcripts/delete-project.output.md index 18af51f9c..e2b974a9c 100644 --- a/unison-src/transcripts/delete-project.output.md +++ b/unison-src/transcripts/delete-project.output.md @@ -1,7 +1,7 @@ # delete.project ```ucm -.> project.create-empty foo +scratch/main> project.create-empty foo 🎉 I've created the project foo. @@ -17,9 +17,7 @@ 🎉 🥳 Happy coding! - ☝️ The namespace . is empty. - -.> project.create-empty bar +scratch/main> project.create-empty bar 🎉 I've created the project bar. @@ -35,17 +33,17 @@ 🎉 🥳 Happy coding! - ☝️ The namespace . is empty. - -.> projects +scratch/main> projects 1. bar 2. foo + 3. scratch foo/main> delete.project foo -.> projects +scratch/main> projects 1. bar + 2. scratch ``` diff --git a/unison-src/transcripts/delete-silent.md b/unison-src/transcripts/delete-silent.md index 33ec668de..5a5037e9f 100644 --- a/unison-src/transcripts/delete-silent.md +++ b/unison-src/transcripts/delete-silent.md @@ -1,5 +1,5 @@ ```ucm:error -.> delete foo +scratch/main> delete foo ``` ```unison:hide @@ -8,8 +8,8 @@ structural type Foo = Foo () ``` ```ucm -.> add -.> delete foo -.> delete.type Foo -.> delete.term Foo.Foo +scratch/main> add +scratch/main> delete foo +scratch/main> delete.type Foo +scratch/main> delete.term Foo.Foo ``` diff --git a/unison-src/transcripts/delete-silent.output.md b/unison-src/transcripts/delete-silent.output.md index 7ea6d420d..3ec5397fc 100644 --- a/unison-src/transcripts/delete-silent.output.md +++ b/unison-src/transcripts/delete-silent.output.md @@ -1,5 +1,5 @@ ```ucm -.> delete foo +scratch/main> delete foo ⚠️ @@ -13,22 +13,22 @@ structural type Foo = Foo () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: structural type Foo foo : ##Nat -.> delete foo +scratch/main> delete foo Done. -.> delete.type Foo +scratch/main> delete.type Foo Done. -.> delete.term Foo.Foo +scratch/main> delete.term Foo.Foo Done. diff --git a/unison-src/transcripts/delete.md b/unison-src/transcripts/delete.md index e3e27ede9..aadb7a602 100644 --- a/unison-src/transcripts/delete.md +++ b/unison-src/transcripts/delete.md @@ -32,28 +32,18 @@ How about an ambiguous term? ```unison:hide foo = 1 +bar = 2 ``` ```ucm .a> add -``` - -```unison:hide -foo = 2 -``` - -```ucm -.b> add -.a> merge.old .b +.a> debug.alias.term.force bar foo ``` A delete should remove both versions of the term. ```ucm .> delete.verbose a.foo -``` - -```ucm:error .a> ls ``` @@ -61,26 +51,13 @@ Let's repeat all that on a type, for completeness. ```unison:hide structural type Foo = Foo () +structural type Bar = Bar ``` ```ucm .a> add -``` - -```unison:hide -structural type Foo = Foo -``` - -```ucm -.b> add -.a> merge.old .b -``` - -```ucm +.a> debug.alias.type.force Bar Foo .> delete.verbose a.Foo -``` - -```ucm .> delete.verbose a.Foo.Foo ``` @@ -93,9 +70,6 @@ structural type foo = Foo () ```ucm .> add -``` - -```ucm .> delete.verbose foo ``` diff --git a/unison-src/transcripts/delete.output.md b/unison-src/transcripts/delete.output.md index 02b757d4c..14ca930fe 100644 --- a/unison-src/transcripts/delete.output.md +++ b/unison-src/transcripts/delete.output.md @@ -59,6 +59,7 @@ How about an ambiguous term? ```unison foo = 1 +bar = 2 ``` ```ucm @@ -68,40 +69,12 @@ foo = 1 ⍟ I've added these definitions: + bar : ##Nat foo : ##Nat -``` -```unison -foo = 2 -``` +.a> debug.alias.term.force bar foo -```ucm - ☝️ The namespace .b is empty. - -.b> add - - ⍟ I've added these definitions: - - foo : ##Nat - -.a> merge.old .b - - Here's what's changed in the current namespace after the - merge: - - New name conflicts: - - 1. foo#gjmq673r1v : ##Nat - ↓ - 2. ┌ foo#dcgdua2lj6 : ##Nat - 3. └ foo#gjmq673r1v : ##Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... + Done. ``` A delete should remove both versions of the term. @@ -116,24 +89,21 @@ A delete should remove both versions of the term. Name changes: Original Changes - 2. b.foo ┐ 3. a.foo#dcgdua2lj6 (removed) + 2. a.bar ┐ 3. a.foo#dcgdua2lj6 (removed) 4. a.foo#dcgdua2lj6 ┘ Tip: You can use `undo` or `reflog` to undo this change. -``` -```ucm - ☝️ The namespace .a is empty. - .a> ls - nothing to show + 1. bar (##Nat) ``` Let's repeat all that on a type, for completeness. ```unison structural type Foo = Foo () +structural type Bar = Bar ``` ```ucm @@ -141,46 +111,13 @@ structural type Foo = Foo () ⍟ I've added these definitions: + structural type Bar structural type Foo -``` -```unison -structural type Foo = Foo -``` +.a> debug.alias.type.force Bar Foo -```ucm -.b> add + Done. - ⍟ I've added these definitions: - - structural type Foo - -.a> merge.old .b - - Here's what's changed in the current namespace after the - merge: - - New name conflicts: - - 1. structural type Foo#089vmor9c5 - ↓ - 2. ┌ structural type Foo#00nv2kob8f - 3. └ structural type Foo#089vmor9c5 - - 4. Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5 - ↓ - 5. ┌ Foo.Foo#00nv2kob8f#0 : () - 6. └ Foo.Foo#089vmor9c5#0 : 'Foo#089vmor9c5 - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - -``` -```ucm .> delete.verbose a.Foo Removed definitions: @@ -190,26 +127,17 @@ structural type Foo = Foo Name changes: Original Changes - 2. b.Foo ┐ 3. a.Foo#00nv2kob8f (removed) + 2. a.Bar ┐ 3. a.Foo#00nv2kob8f (removed) 4. builtin.Unit │ 5. a.Foo#00nv2kob8f ┘ Tip: You can use `undo` or `reflog` to undo this change. -``` -```ucm .> delete.verbose a.Foo.Foo Removed definitions: - 1. a.Foo.Foo#089vmor9c5#0 : '#089vmor9c5 - - Name changes: - - Original Changes - 2. b.Foo.Foo ┐ 3. a.Foo.Foo#00nv2kob8f#0 (removed) - 4. builtin.Unit.Unit │ - 5. a.Foo.Foo#00nv2kob8f#0 ┘ + 1. a.Foo.Foo : '#089vmor9c5 Tip: You can use `undo` or `reflog` to undo this change. @@ -229,8 +157,6 @@ structural type foo = Foo () structural type foo foo : Nat -``` -```ucm .> delete.verbose foo Removed definitions: @@ -354,7 +280,7 @@ d = a + b + c a : Nat b : Nat - (also named b.foo) + (also named a.bar) c : Nat d : Nat diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.md b/unison-src/transcripts/dependents-dependencies-debugfile.md index 46ffce8d3..30692285e 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ### `debug.file` @@ -18,7 +18,7 @@ inside.q x = x + p * p inside.r = d ``` ```ucm -.> debug.file +scratch/main> debug.file ``` This will help me make progress in some situations when UCM is being deficient or broken. @@ -26,13 +26,13 @@ This will help me make progress in some situations when UCM is being deficient o ### `dependents` / `dependencies` But wait, there's more. I can check the dependencies and dependents of a definition: ```ucm -.> add -.> dependents q -.> dependencies q -.> dependencies B -.> dependencies d -.> dependents d -.> +scratch/main> add +scratch/main> dependents q +scratch/main> dependencies q +scratch/main> dependencies B +scratch/main> dependencies d +scratch/main> dependents d +scratch/main> ``` We don't have an index for dependents of constructors, but iirc if you ask for that, it will show you dependents of the structural type that provided the constructor. diff --git a/unison-src/transcripts/dependents-dependencies-debugfile.output.md b/unison-src/transcripts/dependents-dependencies-debugfile.output.md index 413c7c210..90f3fefbc 100644 --- a/unison-src/transcripts/dependents-dependencies-debugfile.output.md +++ b/unison-src/transcripts/dependents-dependencies-debugfile.output.md @@ -15,7 +15,7 @@ inside.r = d ``` ```ucm -.> debug.file +scratch/main> debug.file type inside.M#h37a56c5ep type outside.A#6l6krl7n4l @@ -32,7 +32,7 @@ This will help me make progress in some situations when UCM is being deficient o ### `dependents` / `dependencies` But wait, there's more. I can check the dependencies and dependents of a definition: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,11 +45,11 @@ But wait, there's more. I can check the dependencies and dependents of a defini outside.c : Nat outside.d : Boolean -.> dependents q +scratch/main> dependents q q has no dependents. -.> dependencies q +scratch/main> dependencies q Dependencies of: q @@ -66,7 +66,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 4` to see the source of any numbered item in the above list. -.> dependencies B +scratch/main> dependencies B Dependencies of: type B, B @@ -78,7 +78,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 2` to see the source of any numbered item in the above list. -.> dependencies d +scratch/main> dependencies d Dependencies of: d @@ -97,7 +97,7 @@ But wait, there's more. I can check the dependencies and dependents of a defini Tip: Try `view 6` to see the source of any numbered item in the above list. -.> dependents d +scratch/main> dependents d Dependents of: d diff --git a/unison-src/transcripts/destructuring-binds.md b/unison-src/transcripts/destructuring-binds.md index f9a1eef97..2c8cf5a77 100644 --- a/unison-src/transcripts/destructuring-binds.md +++ b/unison-src/transcripts/destructuring-binds.md @@ -1,7 +1,7 @@ # Destructuring binds ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Here's a couple examples: @@ -19,8 +19,8 @@ ex1 tup = ``` ```ucm -.> add -.> view ex0 ex1 +scratch/main> add +scratch/main> view ex0 ex1 ``` Notice that `ex0` is printed using the `cases` syntax (but `ex1` is not). The pretty-printer currently prefers the `cases` syntax if definition can be printed using either destructuring bind or `cases`. @@ -58,8 +58,8 @@ ex5a _ = match (99 + 1, "hi") with ``` ```ucm -.> add -.> view ex5 ex5a +scratch/main> add +scratch/main> view ex5 ex5a ``` Notice how it prints both an ordinary match. @@ -74,6 +74,6 @@ ex6 x = match x with For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`: ```ucm -.> add -.> view ex6 +scratch/main> add +scratch/main> view ex6 ``` diff --git a/unison-src/transcripts/destructuring-binds.output.md b/unison-src/transcripts/destructuring-binds.output.md index af097fc52..4185a71b9 100644 --- a/unison-src/transcripts/destructuring-binds.output.md +++ b/unison-src/transcripts/destructuring-binds.output.md @@ -29,14 +29,14 @@ ex1 tup = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex0 : Nat -> Nat ex1 : (a, b, (Nat, Nat)) -> Nat -.> view ex0 ex1 +scratch/main> view ex0 ex1 ex0 : Nat -> Nat ex0 n = @@ -131,14 +131,14 @@ ex5a _ = match (99 + 1, "hi") with ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex5 : 'Text ex5a : 'Text -.> view ex5 ex5a +scratch/main> view ex5 ex5a ex5 : 'Text ex5 _ = match 99 Nat.+ 1 with @@ -163,13 +163,13 @@ ex6 x = match x with For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: ex6 : (Nat, Nat) -> Nat -.> view ex6 +scratch/main> view ex6 ex6 : (Nat, Nat) -> Nat ex6 = cases (x, y) -> x Nat.+ y diff --git a/unison-src/transcripts/diff-namespace.md b/unison-src/transcripts/diff-namespace.md index 7db0bc898..4d04dda79 100644 --- a/unison-src/transcripts/diff-namespace.md +++ b/unison-src/transcripts/diff-namespace.md @@ -3,23 +3,19 @@ ``` ```unison:hide -x = 23 +b1.x = 23 +b1.fslkdjflskdjflksjdf = 663 +b2.x = 23 +b2.fslkdjflskdjflksjdf = 23 +b2.abc = 23 ``` ```ucm -.b1> add -.b1> alias.term x fslkdjflskdjflksjdf -.> fork b1 b2 -.b2> alias.term x abc -``` - -```unison:hide -fslkdjflskdjflksjdf = 663 +.> add +.> debug.alias.term.force b1.x b1.fslkdjflskdjflksjdf ``` ```ucm -.b0> add -.> merge.old b0 b1 .> diff.namespace b1 b2 .b2> diff.namespace .b1 ``` @@ -63,12 +59,13 @@ Here's what we've done so far: ``` ```unison:hide -fromJust = "asldkfjasldkfj" +junk = "asldkfjasldkfj" ``` ```ucm -.ns1b> add -.> merge.old ns1b ns1 +.ns1> add +.ns1> debug.alias.term.force junk fromJust +.ns1> delete.term junk ``` ```unison:hide @@ -104,33 +101,40 @@ bdependent = "banana" ## 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 ``` + ```ucm .nsx> add .> fork nsx nsy .> fork nsx nsz ``` + ```unison:hide a = 444 ``` + ```ucm .nsy> update.old ``` + ```unison:hide a = 555 ``` + ```ucm .nsz> update.old -.> merge.old nsy nsw -``` -```ucm:error -.> merge.old nsz nsw +.> fork nsy nsw +.> debug.alias.term.force nsz.a nsw.a +.> debug.alias.term.force nsz.b nsw.b ``` + ```ucm .> diff.namespace nsx nsw .nsw> view a b diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index cacb9d1fc..490fb3fa2 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -1,60 +1,28 @@ ```unison -x = 23 +b1.x = 23 +b1.fslkdjflskdjflksjdf = 663 +b2.x = 23 +b2.fslkdjflskdjflksjdf = 23 +b2.abc = 23 ``` ```ucm - ☝️ The namespace .b1 is empty. - -.b1> add +.> add ⍟ I've added these definitions: - x : ##Nat + b1.fslkdjflskdjflksjdf : Nat + b1.x : Nat + b2.abc : Nat + b2.fslkdjflskdjflksjdf : Nat + b2.x : Nat -.b1> alias.term x fslkdjflskdjflksjdf - - Done. - -.> fork b1 b2 - - Done. - -.b2> alias.term x abc +.> debug.alias.term.force b1.x b1.fslkdjflskdjflksjdf Done. ``` -```unison -fslkdjflskdjflksjdf = 663 -``` - ```ucm - ☝️ The namespace .b0 is empty. - -.b0> add - - ⍟ I've added these definitions: - - fslkdjflskdjflksjdf : ##Nat - -.> merge.old b0 b1 - - Here's what's changed in b1 after the merge: - - New name conflicts: - - 1. fslkdjflskdjflksjdf#u520d1t9kc : Nat - ↓ - 2. ┌ fslkdjflskdjflksjdf#sekb3fdsvb : Nat - 3. └ fslkdjflskdjflksjdf#u520d1t9kc : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... - .> diff.namespace b1 b2 Resolved name conflicts: @@ -155,35 +123,23 @@ Here's what we've done so far: ``` ```unison -fromJust = "asldkfjasldkfj" +junk = "asldkfjasldkfj" ``` ```ucm - ☝️ The namespace .ns1b is empty. - -.ns1b> add +.ns1> add ⍟ I've added these definitions: - fromJust : ##Text + junk : ##Text -.> merge.old ns1b ns1 +.ns1> debug.alias.term.force junk fromJust - Here's what's changed in ns1 after the merge: - - New name conflicts: - - 1. fromJust#gjmq673r1v : Nat - ↓ - 2. ┌ fromJust#gjmq673r1v : Nat - 3. └ fromJust#rnbo52q2sh : Text - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. + Done. - Applying changes from patch... +.ns1> delete.term junk + + Done. ``` ```unison @@ -356,8 +312,10 @@ bdependent = "banana" ``` ## Two different auto-propagated changes creating a name conflict + Currently, the auto-propagated name-conflicted definitions are not explicitly shown, only their also-conflicted dependency is shown. + ```unison a = 333 b = a + 1 @@ -405,55 +363,17 @@ a = 555 a : ##Nat -.> merge.old nsy nsw +.> fork nsy nsw - Here's what's changed in nsw after the merge: - - Added definitions: - - 1. a : Nat - 2. b : Nat - - 3. patch patch (added 1 updates) - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. + Done. - Applying changes from patch... +.> debug.alias.term.force nsz.a nsw.a -``` -```ucm -.> merge.old nsz nsw + Done. - Here's what's changed in nsw after the merge: - - New name conflicts: - - 1. a#mdl4vqtu00 : Nat - ↓ - 2. ┌ a#mdl4vqtu00 : Nat - 3. └ a#vrs8gtkl2t : Nat - - 4. b#unkqhuu66p : Nat - ↓ - 5. ┌ b#aapqletas7 : Nat - 6. └ b#unkqhuu66p : Nat - - Updates: - - 7. patch patch (added 1 updates) - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. +.> debug.alias.term.force nsz.b nsw.b - Applying changes from patch... - - I tried to auto-apply the patch, but couldn't because it - contained contradictory entries. + Done. ``` ```ucm @@ -473,7 +393,7 @@ a = 555 Added definitions: - 7. patch patch (added 2 updates) + 7. patch patch (added 1 updates) .nsw> view a b diff --git a/unison-src/transcripts/doc-formatting.md b/unison-src/transcripts/doc-formatting.md index 51f6c51bc..1f5a63808 100644 --- a/unison-src/transcripts/doc-formatting.md +++ b/unison-src/transcripts/doc-formatting.md @@ -3,7 +3,7 @@ This transcript explains a few minor details about doc parsing and pretty-printi Docs can be used as inline code comments. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -14,10 +14,10 @@ foo n = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view foo +scratch/main> view foo ``` Note that `@` and `:]` must be escaped within docs. @@ -27,10 +27,10 @@ escaping = [: Docs look [: like \@this \:] :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view escaping +scratch/main> view escaping ``` (Alas you can't have `\@` or `\:]` in your doc, as there's currently no way to 'unescape' them.) @@ -46,10 +46,10 @@ commented = [: ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view commented +scratch/main> view commented ``` ### Indenting, and paragraph reflow @@ -64,10 +64,10 @@ doc1 = [: hi :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc1 +scratch/main> view doc1 ``` ```unison @@ -83,10 +83,10 @@ doc2 = [: hello ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc2 +scratch/main> view doc2 ``` ```unison @@ -105,10 +105,10 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc3 +scratch/main> view doc3 ``` ```unison @@ -120,10 +120,10 @@ doc4 = [: Here's another example of some paragraphs. ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc4 +scratch/main> view doc4 ``` ```unison @@ -137,10 +137,10 @@ doc5 = [: - foo ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc5 +scratch/main> view doc5 ``` ```unison @@ -153,10 +153,10 @@ doc6 = [: ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view doc6 +scratch/main> view doc6 ``` ### More testing @@ -168,10 +168,10 @@ empty = [::] expr = foo 1 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view empty +scratch/main> view empty ``` ```unison @@ -214,10 +214,10 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view test1 +scratch/main> view test1 ``` ```unison @@ -226,10 +226,10 @@ reg1363 = [: `@List.take foo` bar baz :] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view reg1363 +scratch/main> view reg1363 ``` ```unison @@ -242,13 +242,13 @@ test2 = [: :] ``` ```ucm:hide -.> add +scratch/main> add ``` View is fine. ```ucm -.> view test2 +scratch/main> view test2 ``` But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: ```ucm -.> display test2 +scratch/main> display test2 ``` diff --git a/unison-src/transcripts/doc-formatting.output.md b/unison-src/transcripts/doc-formatting.output.md index d4c000906..b472f9177 100644 --- a/unison-src/transcripts/doc-formatting.output.md +++ b/unison-src/transcripts/doc-formatting.output.md @@ -23,7 +23,7 @@ foo n = ``` ```ucm -.> view foo +scratch/main> view foo foo : Nat -> Nat foo n = @@ -52,7 +52,7 @@ escaping = [: Docs look [: like \@this \:] :] ``` ```ucm -.> view escaping +scratch/main> view escaping escaping : Doc escaping = [: Docs look [: like \@this \:] :] @@ -84,7 +84,7 @@ commented = [: ``` ```ucm -.> view commented +scratch/main> view commented commented : Doc commented = @@ -119,7 +119,7 @@ doc1 = [: hi :] ``` ```ucm -.> view doc1 +scratch/main> view doc1 doc1 : Doc doc1 = [: hi :] @@ -151,7 +151,7 @@ doc2 = [: hello ``` ```ucm -.> view doc2 +scratch/main> view doc2 doc2 : Doc doc2 = @@ -190,7 +190,7 @@ Note that because of the special treatment of the first line mentioned above, wh ``` ```ucm -.> view doc3 +scratch/main> view doc3 doc3 : Doc doc3 = @@ -237,7 +237,7 @@ doc4 = [: Here's another example of some paragraphs. ``` ```ucm -.> view doc4 +scratch/main> view doc4 doc4 : Doc doc4 = @@ -272,7 +272,7 @@ doc5 = [: - foo ``` ```ucm -.> view doc5 +scratch/main> view doc5 doc5 : Doc doc5 = @@ -304,7 +304,7 @@ doc6 = [: ``` ```ucm -.> view doc6 +scratch/main> view doc6 doc6 : Doc doc6 = @@ -338,7 +338,7 @@ expr = foo 1 ``` ```ucm -.> view empty +scratch/main> view empty empty : Doc empty = [: :] @@ -398,7 +398,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo ``` ```ucm -.> view test1 +scratch/main> view test1 test1 : Doc test1 = @@ -480,7 +480,7 @@ reg1363 = [: `@List.take foo` bar ``` ```ucm -.> view reg1363 +scratch/main> view reg1363 reg1363 : Doc reg1363 = [: `@List.take foo` bar baz :] @@ -511,7 +511,7 @@ test2 = [: ``` View is fine. ```ucm -.> view test2 +scratch/main> view test2 test2 : Doc test2 = @@ -522,7 +522,7 @@ View is fine. ``` But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing: ```ucm -.> display test2 +scratch/main> display test2 Take a look at this: foo : Nat -> Nat diff --git a/unison-src/transcripts/doc-type-link-keywords.md b/unison-src/transcripts/doc-type-link-keywords.md index a4cb0007a..736e256de 100644 --- a/unison-src/transcripts/doc-type-link-keywords.md +++ b/unison-src/transcripts/doc-type-link-keywords.md @@ -7,7 +7,7 @@ not the ability `Patterns`; the lexer should see this as a single identifier. See https://github.com/unisonweb/unison/issues/2642 for an example. ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -28,14 +28,14 @@ docs.example4 = {{A doc that links to the {type Labels} type}} ``` ```ucm:hide -.> add +scratch/main> add ``` Now we check that each doc links to the object of the correct name: ```ucm -.> display docs.example1 -.> display docs.example2 -.> display docs.example3 -.> display docs.example4 +scratch/main> display docs.example1 +scratch/main> display docs.example2 +scratch/main> display docs.example3 +scratch/main> display docs.example4 ``` diff --git a/unison-src/transcripts/doc-type-link-keywords.output.md b/unison-src/transcripts/doc-type-link-keywords.output.md index 9eea235a1..ed7b0b7b7 100644 --- a/unison-src/transcripts/doc-type-link-keywords.output.md +++ b/unison-src/transcripts/doc-type-link-keywords.output.md @@ -26,19 +26,19 @@ docs.example4 = {{A doc that links to the {type Labels} type}} Now we check that each doc links to the object of the correct name: ```ucm -.> display docs.example1 +scratch/main> display docs.example1 A doc that links to the abilityPatterns term -.> display docs.example2 +scratch/main> display docs.example2 A doc that links to the Patterns ability -.> display docs.example3 +scratch/main> display docs.example3 A doc that links to the typeLabels term -.> display docs.example4 +scratch/main> display docs.example4 A doc that links to the Labels type diff --git a/unison-src/transcripts/doc1.md b/unison-src/transcripts/doc1.md index 7379c4719..6f8459395 100644 --- a/unison-src/transcripts/doc1.md +++ b/unison-src/transcripts/doc1.md @@ -1,13 +1,13 @@ # Documenting Unison code ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge lib.builtins ``` Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm -.builtin> view Doc +scratch/main> view lib.builtins.Doc ``` You can create these `Doc` values with ordinary code, or you can use the special syntax. A value of structural type `Doc` can be created via syntax like: @@ -42,7 +42,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ```ucm -.builtin> add +scratch/main> add ``` And now let's write our docs and reference these examples: @@ -67,17 +67,17 @@ List.take.doc = [: Let's add it to the codebase. ```ucm -.builtin> add +scratch/main> add ``` We can view it with `docs`, which shows the `Doc` value that is associated with a definition. ```ucm -.builtin> docs List.take +scratch/main> docs List.take ``` Note that if we view the source of the documentation, the various references are *not* expanded. ```ucm -.builtin> view List.take +scratch/main> view List.take ``` diff --git a/unison-src/transcripts/doc1.output.md b/unison-src/transcripts/doc1.output.md index 9fc30e160..563932e2b 100644 --- a/unison-src/transcripts/doc1.output.md +++ b/unison-src/transcripts/doc1.output.md @@ -3,15 +3,15 @@ Unison documentation is written in Unison. Documentation is a value of the following type: ```ucm -.builtin> view Doc +scratch/main> view lib.builtins.Doc - type Doc + type lib.builtins.Doc = Blob Text | Link Link | Source Link | Signature Term | Evaluate Term - | Join [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: @@ -73,7 +73,7 @@ List.take.ex2 = take 2 [1,2,3,4,5] ``` ```ucm -.builtin> add +scratch/main> add ⍟ I've added these definitions: @@ -116,7 +116,7 @@ List.take.doc = [: Let's add it to the codebase. ```ucm -.builtin> add +scratch/main> add ⍟ I've added these definitions: @@ -126,7 +126,7 @@ Let's add it to the codebase. We can view it with `docs`, which shows the `Doc` value that is associated with a definition. ```ucm -.builtin> docs List.take +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 @@ -151,8 +151,9 @@ We can view it with `docs`, which shows the `Doc` value that is associated with Note that if we view the source of the documentation, the various references are *not* expanded. ```ucm -.builtin> view List.take +scratch/main> view List.take - builtin List.take : Nat -> [a] -> [a] + builtin lib.builtins.List.take : + lib.builtins.Nat -> [a] -> [a] ``` diff --git a/unison-src/transcripts/doc2.md b/unison-src/transcripts/doc2.md index 278cc8f49..32cb27429 100644 --- a/unison-src/transcripts/doc2.md +++ b/unison-src/transcripts/doc2.md @@ -1,7 +1,7 @@ # Test parsing and round-trip of doc2 syntax elements ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -114,5 +114,5 @@ Inline '' text literal with 1 space of padding '' in the middle of a sentence. Format it to check that everything pretty-prints in a valid way. ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/doc2.output.md b/unison-src/transcripts/doc2.output.md index e303b639a..7cb162400 100644 --- a/unison-src/transcripts/doc2.output.md +++ b/unison-src/transcripts/doc2.output.md @@ -110,7 +110,7 @@ Inline '' text literal with 1 space of padding '' in the middle of a sentence. Format it to check that everything pretty-prints in a valid way. ```ucm -.> debug.format +scratch/main> debug.format ``` ```unison:added-by-ucm scratch.u diff --git a/unison-src/transcripts/doc2markdown.md b/unison-src/transcripts/doc2markdown.md index a7ac7a808..89b068a29 100644 --- a/unison-src/transcripts/doc2markdown.md +++ b/unison-src/transcripts/doc2markdown.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -86,11 +86,11 @@ Table ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> debug.doc-to-markdown fulldoc +scratch/main> debug.doc-to-markdown fulldoc ``` You can add docs to a term or type with a top-level doc literal above the binding: diff --git a/unison-src/transcripts/doc2markdown.output.md b/unison-src/transcripts/doc2markdown.output.md index c9b98f984..5475c1cbf 100644 --- a/unison-src/transcripts/doc2markdown.output.md +++ b/unison-src/transcripts/doc2markdown.output.md @@ -82,7 +82,7 @@ Table ``` ```ucm -.> debug.doc-to-markdown fulldoc +scratch/main> debug.doc-to-markdown fulldoc Heres some text with a soft line break diff --git a/unison-src/transcripts/duplicate-names.md b/unison-src/transcripts/duplicate-names.md index 2935a401b..d40cc9e82 100644 --- a/unison-src/transcripts/duplicate-names.md +++ b/unison-src/transcripts/duplicate-names.md @@ -1,7 +1,7 @@ # Duplicate names in scratch file. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Term and ability constructor collisions should cause a parse error. @@ -49,6 +49,6 @@ X = () ``` ```ucm -.> add -.> view X +scratch/main> add +scratch/main> view X ``` diff --git a/unison-src/transcripts/duplicate-names.output.md b/unison-src/transcripts/duplicate-names.output.md index 7e82b2e04..9a15abbb7 100644 --- a/unison-src/transcripts/duplicate-names.output.md +++ b/unison-src/transcripts/duplicate-names.output.md @@ -125,7 +125,7 @@ X = () ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -133,7 +133,7 @@ X = () (also named builtin.Unit) X : () -.> view X +scratch/main> view X structural type X = Z diff --git a/unison-src/transcripts/duplicate-term-detection.md b/unison-src/transcripts/duplicate-term-detection.md index 61b2a8ebf..3df20584b 100644 --- a/unison-src/transcripts/duplicate-term-detection.md +++ b/unison-src/transcripts/duplicate-term-detection.md @@ -1,7 +1,7 @@ # Duplicate Term Detection ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` diff --git a/unison-src/transcripts/ed25519.md b/unison-src/transcripts/ed25519.md index 679a8900a..b7f7860c9 100644 --- a/unison-src/transcripts/ed25519.md +++ b/unison-src/transcripts/ed25519.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/edit-command.md b/unison-src/transcripts/edit-command.md index 4c4edc9e4..106b28fea 100644 --- a/unison-src/transcripts/edit-command.md +++ b/unison-src/transcripts/edit-command.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison /private/tmp/scratch.u @@ -11,11 +11,11 @@ mytest = [Ok "ok"] ``` ```ucm -.> add -.> edit foo bar -.> edit mytest +scratch/main> add +scratch/main> edit foo bar +scratch/main> edit mytest ``` ```ucm:error -.> edit missing +scratch/main> edit missing ``` diff --git a/unison-src/transcripts/edit-command.output.md b/unison-src/transcripts/edit-command.output.md index a4c428e28..644db7ce7 100644 --- a/unison-src/transcripts/edit-command.output.md +++ b/unison-src/transcripts/edit-command.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -33,7 +33,7 @@ mytest = [Ok "ok"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -41,7 +41,7 @@ mytest = [Ok "ok"] foo : Nat mytest : [Result] -.> edit foo bar +scratch/main> edit foo bar ☝️ @@ -50,7 +50,7 @@ mytest = [Ok "ok"] You can edit them there, then run `update` to replace the definitions currently in this namespace. -.> edit mytest +scratch/main> edit mytest ☝️ @@ -73,7 +73,7 @@ test> mytest = [Ok "ok"] ``` ```ucm -.> edit missing +scratch/main> edit missing ⚠️ diff --git a/unison-src/transcripts/empty-namespaces.md b/unison-src/transcripts/empty-namespaces.md index d9497fc93..ff9cb042d 100644 --- a/unison-src/transcripts/empty-namespaces.md +++ b/unison-src/transcripts/empty-namespaces.md @@ -5,19 +5,19 @@ mynamespace.x = 1 ``` ```ucm:hide -.> add -.> delete.namespace mynamespace +scratch/main> add +scratch/main> delete.namespace mynamespace ``` The deleted namespace shouldn't appear in `ls` output. ```ucm:error -.> ls +scratch/main> ls ``` ```ucm:error -.> find.verbose +scratch/main> find.verbose ``` ```ucm:error -.> find mynamespace +scratch/main> find mynamespace ``` ## history @@ -25,7 +25,7 @@ The deleted namespace shouldn't appear in `ls` output. The history of the namespace should be empty. ```ucm -.> history mynamespace +scratch/main> history mynamespace ``` Add and then delete a term to add some history to a deleted namespace. @@ -36,8 +36,8 @@ stuff.thing = 2 ``` ```ucm:hide -.> add -.> delete.namespace deleted +scratch/main> add +scratch/main> delete.namespace deleted ``` ## fork @@ -45,14 +45,14 @@ stuff.thing = 2 I should be allowed to fork over a deleted namespace ```ucm -.> fork stuff deleted +scratch/main> fork stuff deleted ``` The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ```ucm -.> history stuff -.> history deleted +scratch/main> history stuff +scratch/main> history deleted ``` ## move.namespace @@ -63,15 +63,15 @@ moveme.y = 2 ``` ```ucm:hide -.> add +scratch/main> add ``` I should be able to move a namespace over-top of a deleted namespace. The history should be that of the moved namespace. ```ucm -.> delete.namespace moveoverme -.> history moveme -.> move.namespace moveme moveoverme -.> history moveoverme +scratch/main> delete.namespace moveoverme +scratch/main> history moveme +scratch/main> move.namespace moveme moveoverme +scratch/main> history moveoverme ``` diff --git a/unison-src/transcripts/empty-namespaces.output.md b/unison-src/transcripts/empty-namespaces.output.md index 7fb5de89e..8eee1f1a1 100644 --- a/unison-src/transcripts/empty-namespaces.output.md +++ b/unison-src/transcripts/empty-namespaces.output.md @@ -6,13 +6,13 @@ mynamespace.x = 1 The deleted namespace shouldn't appear in `ls` output. ```ucm -.> ls +scratch/main> ls nothing to show ``` ```ucm -.> find.verbose +scratch/main> find.verbose ☝️ @@ -29,7 +29,7 @@ The deleted namespace shouldn't appear in `ls` output. ``` ```ucm -.> find mynamespace +scratch/main> find mynamespace ☝️ @@ -50,9 +50,9 @@ The deleted namespace shouldn't appear in `ls` output. The history of the namespace should be empty. ```ucm -.> history mynamespace +scratch/main> history mynamespace - ☝️ The namespace .mynamespace is empty. + ☝️ The namespace mynamespace is empty. ``` Add and then delete a term to add some history to a deleted namespace. @@ -67,7 +67,7 @@ stuff.thing = 2 I should be allowed to fork over a deleted namespace ```ucm -.> fork stuff deleted +scratch/main> fork stuff deleted Done. @@ -75,7 +75,7 @@ I should be allowed to fork over a deleted namespace The history from the `deleted` namespace should have been overwritten by the history from `stuff`. ```ucm -.> history stuff +scratch/main> history stuff Note: The most recent namespace hash is immediately below this message. @@ -84,7 +84,7 @@ The history from the `deleted` namespace should have been overwritten by the his □ 1. #q2dq4tsno1 (start of history) -.> history deleted +scratch/main> history deleted Note: The most recent namespace hash is immediately below this message. @@ -105,11 +105,11 @@ I should be able to move a namespace over-top of a deleted namespace. The history should be that of the moved namespace. ```ucm -.> delete.namespace moveoverme +scratch/main> delete.namespace moveoverme Done. -.> history moveme +scratch/main> history moveme Note: The most recent namespace hash is immediately below this message. @@ -118,11 +118,11 @@ The history should be that of the moved namespace. □ 1. #c5uisu4kll (start of history) -.> move.namespace moveme moveoverme +scratch/main> move.namespace moveme moveoverme Done. -.> history moveoverme +scratch/main> history moveoverme Note: The most recent namespace hash is immediately below this message. diff --git a/unison-src/transcripts/emptyCodebase.md b/unison-src/transcripts/emptyCodebase.md index a9ea55b85..03b4e44e9 100644 --- a/unison-src/transcripts/emptyCodebase.md +++ b/unison-src/transcripts/emptyCodebase.md @@ -7,21 +7,21 @@ Not even `Nat` or `+`! BEHOLD!!! ```ucm:error -.> ls +scratch/main> ls ``` Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ```ucm -.foo> builtins.merge -.foo> ls +scratch/main> builtins.merge lib.builtins +scratch/main> ls lib ``` And for a limited time, you can get even more builtin goodies: ```ucm -.foo> builtins.mergeio -.foo> ls +scratch/main> builtins.mergeio lib.builtinsio +scratch/main> ls lib ``` More typically, you'd start out by pulling `base`. diff --git a/unison-src/transcripts/emptyCodebase.output.md b/unison-src/transcripts/emptyCodebase.output.md index 672ac4857..bbb762a28 100644 --- a/unison-src/transcripts/emptyCodebase.output.md +++ b/unison-src/transcripts/emptyCodebase.output.md @@ -7,7 +7,7 @@ Not even `Nat` or `+`! BEHOLD!!! ```ucm -.> ls +scratch/main> ls nothing to show @@ -15,27 +15,26 @@ BEHOLD!!! Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace: ```ucm - ☝️ The namespace .foo is empty. - -.foo> builtins.merge +scratch/main> builtins.merge lib.builtins Done. -.foo> ls +scratch/main> ls lib - 1. builtin/ (469 terms, 74 types) + 1. builtins/ (469 terms, 74 types) ``` And for a limited time, you can get even more builtin goodies: ```ucm -.foo> builtins.mergeio +scratch/main> builtins.mergeio lib.builtinsio Done. -.foo> ls +scratch/main> ls lib - 1. builtin/ (643 terms, 92 types) + 1. builtins/ (469 terms, 74 types) + 2. builtinsio/ (643 terms, 92 types) ``` More typically, you'd start out by pulling `base. diff --git a/unison-src/transcripts/error-messages.md b/unison-src/transcripts/error-messages.md index de58eb43b..8490e491a 100644 --- a/unison-src/transcripts/error-messages.md +++ b/unison-src/transcripts/error-messages.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This file contains programs with parse errors and type errors, for visual inspection of error message quality and to check for regressions or changes to error reporting. diff --git a/unison-src/transcripts/errors/missing-result-typed.md b/unison-src/transcripts/errors/missing-result-typed.md index 47a3eb792..c61c2ccef 100644 --- a/unison-src/transcripts/errors/missing-result-typed.md +++ b/unison-src/transcripts/errors/missing-result-typed.md @@ -6,7 +6,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide:all diff --git a/unison-src/transcripts/errors/ucm-hide-all-error.md b/unison-src/transcripts/errors/ucm-hide-all-error.md index dcf94d8d3..5952056f4 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:all:error -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all-error.output.md b/unison-src/transcripts/errors/ucm-hide-all-error.output.md index e3a9558ab..9b8c0b43e 100644 --- a/unison-src/transcripts/errors/ucm-hide-all-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all-error.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all.md b/unison-src/transcripts/errors/ucm-hide-all.md index 22950a933..dd4b963df 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.md +++ b/unison-src/transcripts/errors/ucm-hide-all.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:all -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide-all.output.md b/unison-src/transcripts/errors/ucm-hide-all.output.md index 38ec6f09f..56cf454d4 100644 --- a/unison-src/transcripts/errors/ucm-hide-all.output.md +++ b/unison-src/transcripts/errors/ucm-hide-all.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.md b/unison-src/transcripts/errors/ucm-hide-error.md index 68da57efc..9b338dfd9 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.md +++ b/unison-src/transcripts/errors/ucm-hide-error.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide:error -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide-error.output.md b/unison-src/transcripts/errors/ucm-hide-error.output.md index 0056a3588..3e80bd4a7 100644 --- a/unison-src/transcripts/errors/ucm-hide-error.output.md +++ b/unison-src/transcripts/errors/ucm-hide-error.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> history +scratch/main> history ``` diff --git a/unison-src/transcripts/errors/ucm-hide.md b/unison-src/transcripts/errors/ucm-hide.md index aa725ada4..470c610b5 100644 --- a/unison-src/transcripts/errors/ucm-hide.md +++ b/unison-src/transcripts/errors/ucm-hide.md @@ -8,5 +8,5 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm:hide -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/errors/ucm-hide.output.md b/unison-src/transcripts/errors/ucm-hide.output.md index fe4faa583..2c88db7f5 100644 --- a/unison-src/transcripts/errors/ucm-hide.output.md +++ b/unison-src/transcripts/errors/ucm-hide.output.md @@ -8,7 +8,7 @@ then the transcript parser should print the stanza and surface a helpful message. ```ucm -.> move.namespace foo bar +scratch/main> move.namespace foo bar ``` diff --git a/unison-src/transcripts/find-by-type.md b/unison-src/transcripts/find-by-type.md index 009ad845e..ec6dd3f95 100644 --- a/unison-src/transcripts/find-by-type.md +++ b/unison-src/transcripts/find-by-type.md @@ -1,5 +1,5 @@ ```ucm:hide -.> alias.type ##Text builtin.Text +scratch/main> alias.type ##Text builtin.Text ``` ```unison:hide @@ -17,11 +17,11 @@ baz = cases ``` ```ucm -.> add -.> find : Text -> A -.> find : A -> Text -.> find : A +scratch/main> add +scratch/main> find : Text -> A +scratch/main> find : A -> Text +scratch/main> find : A ``` ```ucm:error -.> find : Text +scratch/main> find : Text ``` diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 0577051f9..4fcbf2d85 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -13,7 +13,7 @@ baz = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -22,25 +22,25 @@ baz = cases baz : A -> Text foo : A -.> find : Text -> A +scratch/main> find : Text -> A 1. bar : Text -> A 2. A.A : Text -> A -.> find : A -> Text +scratch/main> find : A -> Text 1. baz : A -> Text -.> find : A +scratch/main> find : A 1. foo : A ``` ```ucm -.> find : Text +scratch/main> find : Text ☝️ diff --git a/unison-src/transcripts/find-command.md b/unison-src/transcripts/find-command.md index 46f852dd3..019903556 100644 --- a/unison-src/transcripts/find-command.md +++ b/unison-src/transcripts/find-command.md @@ -1,6 +1,5 @@ ```ucm:hide -.> builtins.merge -.> move builtin lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison:hide @@ -14,37 +13,36 @@ somewhere.bar = 7 ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> find foo -.> view 1 -.> find.all foo -.> view 1 +scratch/main> find foo +scratch/main> view 1 +scratch/main> find.all foo +scratch/main> view 1 ``` ```ucm -.> find-in cat foo -.> view 1 -.> find-in.all cat foo -.> view 1 +scratch/main> find-in cat foo +scratch/main> view 1 +scratch/main> find-in.all cat foo +scratch/main> view 1 ``` -```ucm -.somewhere> find bar -.somewhere> find.global bar -``` +Finding within a namespace ```ucm -.> find bar -.> find-in somewhere bar +scratch/main> find bar +-- Shows UUIDs +-- scratch/main> find.global bar +scratch/main> find-in somewhere bar ``` ```ucm:error -.> find baz +scratch/main> find baz ``` ```ucm:error -.> find.global notHere +scratch/main> find.global notHere ``` diff --git a/unison-src/transcripts/find-command.output.md b/unison-src/transcripts/find-command.output.md index f3a11b891..f75da189b 100644 --- a/unison-src/transcripts/find-command.output.md +++ b/unison-src/transcripts/find-command.output.md @@ -9,18 +9,18 @@ somewhere.bar = 7 ``` ```ucm -.> find foo +scratch/main> find foo 1. cat.foo : Nat 2. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 -.> find.all foo +scratch/main> find.all foo 1. cat.foo : Nat 2. cat.lib.foo : Nat @@ -28,63 +28,53 @@ somewhere.bar = 7 4. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 ``` ```ucm -.> find-in cat foo +scratch/main> find-in cat foo 1. foo : Nat -.> view 1 +scratch/main> view 1 cat.foo : Nat cat.foo = 4 -.> find-in.all cat foo +scratch/main> find-in.all cat foo 1. lib.foo : Nat 2. foo : Nat -.> view 1 +scratch/main> view 1 cat.lib.foo : Nat cat.lib.foo = 5 ``` +Finding within a namespace + ```ucm -.somewhere> find bar - - 1. bar : ##Nat - - -.somewhere> find.global bar - - 1. .cat.lib.bar : Nat - 2. .lib.bar : Nat - 3. .somewhere.bar : Nat - - -``` -```ucm -.> find bar +scratch/main> find bar 1. somewhere.bar : Nat -.> find-in somewhere bar +-- Shows UUIDs +-- scratch/main> find.global bar +scratch/main> find-in somewhere bar 1. bar : Nat ``` ```ucm -.> find baz +scratch/main> find baz ☝️ @@ -101,7 +91,7 @@ somewhere.bar = 7 ``` ```ucm -.> find.global notHere +scratch/main> find.global notHere 😶 diff --git a/unison-src/transcripts/fix-1381-excess-propagate.md b/unison-src/transcripts/fix-1381-excess-propagate.md index 84da98c5b..e7314c9bd 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.md @@ -7,7 +7,7 @@ X.foo = "a namespace" ``` ```ucm -.> add +scratch/main> add ``` Here is an update which should not affect `X`: @@ -15,14 +15,14 @@ Here is an update which should not affect `X`: a = "an update" ``` ```ucm -.> update +scratch/main> update ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; ```ucm -.> history X +scratch/main> history X ``` however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: ```ucm:error -.> history #7nl6ppokhg +scratch/main> history #7nl6ppokhg ``` diff --git a/unison-src/transcripts/fix-1381-excess-propagate.output.md b/unison-src/transcripts/fix-1381-excess-propagate.output.md index f07217266..d35a89262 100644 --- a/unison-src/transcripts/fix-1381-excess-propagate.output.md +++ b/unison-src/transcripts/fix-1381-excess-propagate.output.md @@ -7,7 +7,7 @@ X.foo = "a namespace" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -21,7 +21,7 @@ a = "an update" ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -31,7 +31,7 @@ a = "an update" ``` As of the time of this writing, the history for `X` should be a single node, `#4eeuo5bsfr`; ```ucm -.> history X +scratch/main> history X Note: The most recent namespace hash is immediately below this message. @@ -43,7 +43,7 @@ As of the time of this writing, the history for `X` should be a single node, `#4 ``` however, as of release/M1i, we saw an extraneous node appear. If your `ucm` is fixed, you won't see it below: ```ucm -.> history #7nl6ppokhg +scratch/main> history #7nl6ppokhg 😶 diff --git a/unison-src/transcripts/fix-2258-if-as-list-element.md b/unison-src/transcripts/fix-2258-if-as-list-element.md index fbf9cc93d..1ebc3a225 100644 --- a/unison-src/transcripts/fix-2258-if-as-list-element.md +++ b/unison-src/transcripts/fix-2258-if-as-list-element.md @@ -1,7 +1,7 @@ Tests that `if` statements can appear as list and tuple elements. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide diff --git a/unison-src/transcripts/fix-big-list-crash.md b/unison-src/transcripts/fix-big-list-crash.md index 22be8f0cb..70c056515 100644 --- a/unison-src/transcripts/fix-big-list-crash.md +++ b/unison-src/transcripts/fix-big-list-crash.md @@ -1,7 +1,7 @@ #### Big list crash ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Big lists have been observed to crash, while in the garbage collection step. diff --git a/unison-src/transcripts/fix1063.md b/unison-src/transcripts/fix1063.md index a7160f356..03ea62be7 100644 --- a/unison-src/transcripts/fix1063.md +++ b/unison-src/transcripts/fix1063.md @@ -1,7 +1,7 @@ Tests that functions named `.` are rendered correctly. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ``` unison @@ -13,7 +13,7 @@ noop = not `.` not ``` ``` ucm -.> add -.> view noop +scratch/main> add +scratch/main> view noop ``` diff --git a/unison-src/transcripts/fix1063.output.md b/unison-src/transcripts/fix1063.output.md index 80a1cc8a2..d9d2e8380 100644 --- a/unison-src/transcripts/fix1063.output.md +++ b/unison-src/transcripts/fix1063.output.md @@ -23,14 +23,14 @@ noop = not `.` not ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: `.` : (i1 ->{g1} o) -> (i ->{g} i1) -> i ->{g1, g} o noop : Boolean -> Boolean -.> view noop +scratch/main> view noop noop : Boolean -> Boolean noop = diff --git a/unison-src/transcripts/fix1334.md b/unison-src/transcripts/fix1334.md index 68e696748..5ab5899ae 100644 --- a/unison-src/transcripts/fix1334.md +++ b/unison-src/transcripts/fix1334.md @@ -5,6 +5,6 @@ With this PR, the source of an alias can be a short hash (even of a definition t Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ```ucm -.> alias.type ##Nat Cat -.> alias.term ##Nat.+ please_fix_763.+ +scratch/main> alias.type ##Nat Cat +scratch/main> alias.term ##Nat.+ please_fix_763.+ ``` diff --git a/unison-src/transcripts/fix1334.output.md b/unison-src/transcripts/fix1334.output.md index d397a51a1..4e08c294b 100644 --- a/unison-src/transcripts/fix1334.output.md +++ b/unison-src/transcripts/fix1334.output.md @@ -5,11 +5,11 @@ With this PR, the source of an alias can be a short hash (even of a definition t Let's make some hash-only aliases, now that we can. :mad-with-power-emoji: ```ucm -.> alias.type ##Nat Cat +scratch/main> alias.type ##Nat Cat Done. -.> alias.term ##Nat.+ please_fix_763.+ +scratch/main> alias.term ##Nat.+ please_fix_763.+ Done. diff --git a/unison-src/transcripts/fix1390.md b/unison-src/transcripts/fix1390.md index 807cb14d2..2ef5e8ac9 100644 --- a/unison-src/transcripts/fix1390.md +++ b/unison-src/transcripts/fix1390.md @@ -1,6 +1,6 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -13,8 +13,8 @@ List.map f = ``` ```ucm -.> add -.> view List.map +scratch/main> add +scratch/main> view List.map ``` ```unison diff --git a/unison-src/transcripts/fix1390.output.md b/unison-src/transcripts/fix1390.output.md index 67155bde5..164f3a8a6 100644 --- a/unison-src/transcripts/fix1390.output.md +++ b/unison-src/transcripts/fix1390.output.md @@ -1,6 +1,6 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -28,13 +28,13 @@ List.map f = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: List.map : (i ->{g} o) -> [i] ->{g} [o] -.> view List.map +scratch/main> view List.map List.map : (i ->{g} o) -> [i] ->{g} [o] List.map f = diff --git a/unison-src/transcripts/fix1532.md b/unison-src/transcripts/fix1532.md index 6b5a07c93..fc835cc46 100644 --- a/unison-src/transcripts/fix1532.md +++ b/unison-src/transcripts/fix1532.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` First, lets create two namespaces. `foo` and `bar`, and add some definitions. @@ -11,30 +11,30 @@ bar.z = x + y ``` ```ucm -.> add +scratch/main> add ``` Let's see what we have created... ```ucm -.> ls +scratch/main> ls ``` Now, if we try deleting the namespace `foo`, we get an error, as expected. ```ucm:error -.> delete.namespace foo +scratch/main> delete.namespace foo ``` Any numbered arguments should refer to `bar.z`. ```ucm -.> debug.numberedArgs +scratch/main> debug.numberedArgs ``` We can then delete the dependent term, and then delete `foo`. ```ucm -.> delete.term 1 -.> delete.namespace foo +scratch/main> delete.term 1 +scratch/main> delete.namespace foo ``` diff --git a/unison-src/transcripts/fix1532.output.md b/unison-src/transcripts/fix1532.output.md index d2707bb51..6b856b35e 100644 --- a/unison-src/transcripts/fix1532.output.md +++ b/unison-src/transcripts/fix1532.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -28,7 +28,7 @@ bar.z = x + y ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -40,7 +40,7 @@ bar.z = x + y Let's see what we have created... ```ucm -.> ls +scratch/main> ls 1. bar/ (1 term) 2. builtin/ (469 terms, 74 types) @@ -50,7 +50,7 @@ Let's see what we have created... Now, if we try deleting the namespace `foo`, we get an error, as expected. ```ucm -.> delete.namespace foo +scratch/main> delete.namespace foo ⚠️ @@ -69,7 +69,7 @@ Now, if we try deleting the namespace `foo`, we get an error, as expected. Any numbered arguments should refer to `bar.z`. ```ucm -.> debug.numberedArgs +scratch/main> debug.numberedArgs 1. bar.z 2. bar.z @@ -78,11 +78,11 @@ Any numbered arguments should refer to `bar.z`. We can then delete the dependent term, and then delete `foo`. ```ucm -.> delete.term 1 +scratch/main> delete.term 1 Done. -.> delete.namespace foo +scratch/main> delete.namespace foo Done. diff --git a/unison-src/transcripts/fix1578.md b/unison-src/transcripts/fix1578.md index 8e2e7958f..809af6c16 100644 --- a/unison-src/transcripts/fix1578.md +++ b/unison-src/transcripts/fix1578.md @@ -3,7 +3,7 @@ This transcript shows how suffix-based name resolution works when definitions in ## Setup ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` As setup, we'll add a data type `Day` and a definition `foo.bar : Nat`. @@ -16,7 +16,7 @@ foo.bar = 23 ``` ```ucm:hide -.> add +scratch/main> add ``` Suffix-based name resolution prefers to use names locally defined in the current file, then checks for matches in the codebase. Here are the precise rules, which will be explained below with examples: diff --git a/unison-src/transcripts/fix1696.md b/unison-src/transcripts/fix1696.md index c80b41a73..4abb83f18 100644 --- a/unison-src/transcripts/fix1696.md +++ b/unison-src/transcripts/fix1696.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:error diff --git a/unison-src/transcripts-using-base/fix1709.md b/unison-src/transcripts/fix1709.md similarity index 83% rename from unison-src/transcripts-using-base/fix1709.md rename to unison-src/transcripts/fix1709.md index bc254f3b2..9b0e868d0 100644 --- a/unison-src/transcripts-using-base/fix1709.md +++ b/unison-src/transcripts/fix1709.md @@ -7,7 +7,7 @@ id2 x = ``` ```ucm -.scratch> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts-using-base/fix1709.output.md b/unison-src/transcripts/fix1709.output.md similarity index 84% rename from unison-src/transcripts-using-base/fix1709.output.md rename to unison-src/transcripts/fix1709.output.md index 953121aa2..8523d4e27 100644 --- a/unison-src/transcripts-using-base/fix1709.output.md +++ b/unison-src/transcripts/fix1709.output.md @@ -14,17 +14,14 @@ id2 x = do an `add` or `update`, here's how your codebase would change: - ⊡ Previously added definitions will be ignored: id - ⍟ These new definitions are ok to `add`: + id : x -> x id2 : x -> x ``` ```ucm - ☝️ The namespace .scratch is empty. - -.scratch> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix1731.md b/unison-src/transcripts/fix1731.md index 81adcd8de..82efd3cce 100644 --- a/unison-src/transcripts/fix1731.md +++ b/unison-src/transcripts/fix1731.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -10,7 +10,7 @@ structural ability CLI where ``` ```ucm:hide -.> add +scratch/main> add ``` The `input` here should parse as a wildcard, not as `CLI.input`. diff --git a/unison-src/transcripts/fix1800.md b/unison-src/transcripts/fix1800.md index a35edb8a2..533d95d84 100644 --- a/unison-src/transcripts/fix1800.md +++ b/unison-src/transcripts/fix1800.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -26,21 +26,21 @@ Testing a few variations here: * Should be able to run annotated and unannotated main functions from the codebase. ```ucm -.> run main1 -.> run main2 -.> run main3 -.> add -.> rename.term main1 code.main1 -.> rename.term main2 code.main2 -.> rename.term main3 code.main3 +scratch/main> run main1 +scratch/main> run main2 +scratch/main> run main3 +scratch/main> add +scratch/main> rename.term main1 code.main1 +scratch/main> rename.term main2 code.main2 +scratch/main> rename.term main3 code.main3 ``` The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ```ucm -.> run code.main1 -.> run code.main2 -.> run code.main3 +scratch/main> run code.main1 +scratch/main> run code.main2 +scratch/main> run code.main3 ``` Now testing a few variations that should NOT typecheck. @@ -56,9 +56,9 @@ main5 _ = () This shouldn't work since `main4` and `main5` don't have the right type. ```ucm:error -.> run main4 +scratch/main> run main4 ``` ```ucm:error -.> run main5 +scratch/main> run main5 ``` diff --git a/unison-src/transcripts/fix1800.output.md b/unison-src/transcripts/fix1800.output.md index 0a534138a..915f50e70 100644 --- a/unison-src/transcripts/fix1800.output.md +++ b/unison-src/transcripts/fix1800.output.md @@ -22,19 +22,19 @@ Testing a few variations here: * Should be able to run annotated and unannotated main functions from the codebase. ```ucm -.> run main1 +scratch/main> run main1 () -.> run main2 +scratch/main> run main2 () -.> run main3 +scratch/main> run main3 () -.> add +scratch/main> add ⍟ I've added these definitions: @@ -43,15 +43,15 @@ Testing a few variations here: main3 : '{IO} () printLine : Text ->{IO} () -.> rename.term main1 code.main1 +scratch/main> rename.term main1 code.main1 Done. -.> rename.term main2 code.main2 +scratch/main> rename.term main2 code.main2 Done. -.> rename.term main3 code.main3 +scratch/main> rename.term main3 code.main3 Done. @@ -59,15 +59,15 @@ Testing a few variations here: The renaming just ensures that when running `code.main1`, it has to get that main from the codebase rather than the scratch file: ```ucm -.> run code.main1 +scratch/main> run code.main1 () -.> run code.main2 +scratch/main> run code.main2 () -.> run code.main3 +scratch/main> run code.main3 () @@ -85,7 +85,7 @@ main5 _ = () This shouldn't work since `main4` and `main5` don't have the right type. ```ucm -.> run main4 +scratch/main> run main4 😶 @@ -99,7 +99,7 @@ This shouldn't work since `main4` and `main5` don't have the right type. ``` ```ucm -.> run main5 +scratch/main> run main5 😶 diff --git a/unison-src/transcripts/fix1926.md b/unison-src/transcripts/fix1926.md index 373cb0e95..0ebe0e3c8 100644 --- a/unison-src/transcripts/fix1926.md +++ b/unison-src/transcripts/fix1926.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix1926.output.md b/unison-src/transcripts/fix1926.output.md index 9eeb00583..a325470e9 100644 --- a/unison-src/transcripts/fix1926.output.md +++ b/unison-src/transcripts/fix1926.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix2026.md b/unison-src/transcripts/fix2026.md index 819a579e2..df2a51f45 100644 --- a/unison-src/transcripts/fix2026.md +++ b/unison-src/transcripts/fix2026.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -40,5 +40,5 @@ Exception.unsafeRun! e _ = ``` ```ucm -.> run ex +scratch/main> run ex ``` \ No newline at end of file diff --git a/unison-src/transcripts/fix2026.output.md b/unison-src/transcripts/fix2026.output.md index 1391a35c6..e4f9d8d17 100644 --- a/unison-src/transcripts/fix2026.output.md +++ b/unison-src/transcripts/fix2026.output.md @@ -64,7 +64,7 @@ Exception.unsafeRun! e _ = ``` ```ucm -.> run ex +scratch/main> run ex () diff --git a/unison-src/transcripts/fix2027.md b/unison-src/transcripts/fix2027.md index bcc082456..2a386ae31 100644 --- a/unison-src/transcripts/fix2027.md +++ b/unison-src/transcripts/fix2027.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -51,5 +51,5 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ```ucm:error -.> run myServer +scratch/main> run myServer ``` diff --git a/unison-src/transcripts/fix2027.output.md b/unison-src/transcripts/fix2027.output.md index b69a8b31b..2a7b30dec 100644 --- a/unison-src/transcripts/fix2027.output.md +++ b/unison-src/transcripts/fix2027.output.md @@ -80,7 +80,7 @@ myServer = unsafeRun! '(hello "127.0.0.1" "0") ``` ```ucm -.> run myServer +scratch/main> run myServer 💔💥 diff --git a/unison-src/transcripts/fix2049.md b/unison-src/transcripts/fix2049.md index ab1983e95..c0cfc4fdb 100644 --- a/unison-src/transcripts/fix2049.md +++ b/unison-src/transcripts/fix2049.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -74,6 +74,6 @@ tests _ = ``` ```ucm -.> add -.> io.test tests +scratch/main> add +scratch/main> io.test tests ``` diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index 7e18e1f6c..3db4fa2f2 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -121,23 +121,23 @@ tests _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: catcher : '{IO} () ->{IO} Result tests : ∀ _. _ ->{IO} [Result] -.> io.test tests +scratch/main> io.test tests New test results: - ◉ tests caught - ◉ tests caught - ◉ tests got the right answer + 1. tests ◉ caught + ◉ caught + ◉ got the right answer ✅ 3 test(s) passing - Tip: Use view tests 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.md b/unison-src/transcripts/fix2053.md index 120bbed31..71f36094c 100644 --- a/unison-src/transcripts/fix2053.md +++ b/unison-src/transcripts/fix2053.md @@ -1,7 +1,7 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```ucm -.> display List.map +scratch/main> display List.map ``` diff --git a/unison-src/transcripts/fix2053.output.md b/unison-src/transcripts/fix2053.output.md index d1cf4ec78..39766e272 100644 --- a/unison-src/transcripts/fix2053.output.md +++ b/unison-src/transcripts/fix2053.output.md @@ -1,5 +1,5 @@ ```ucm -.> display List.map +scratch/main> display List.map f a -> let diff --git a/unison-src/transcripts/fix2156.md b/unison-src/transcripts/fix2156.md index 2bc440b14..f18d03fd1 100644 --- a/unison-src/transcripts/fix2156.md +++ b/unison-src/transcripts/fix2156.md @@ -3,7 +3,7 @@ Tests for a case where bad eta reduction was causing erroneous watch output/caching. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2167.md b/unison-src/transcripts/fix2167.md index 4e65ddb6f..5d0381f70 100644 --- a/unison-src/transcripts/fix2167.md +++ b/unison-src/transcripts/fix2167.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This is just a simple transcript to regression check an ability diff --git a/unison-src/transcripts/fix2187.md b/unison-src/transcripts/fix2187.md index f519c30de..2d0eb3fe7 100644 --- a/unison-src/transcripts/fix2187.md +++ b/unison-src/transcripts/fix2187.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2231.md b/unison-src/transcripts/fix2231.md index 0b1ed1641..2fe2660b1 100644 --- a/unison-src/transcripts/fix2231.md +++ b/unison-src/transcripts/fix2231.md @@ -7,7 +7,7 @@ the choices may not work equally well with the type checking strategies. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -25,5 +25,5 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ```ucm -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/fix2231.output.md b/unison-src/transcripts/fix2231.output.md index 2ff24e5bc..b94ff2c9d 100644 --- a/unison-src/transcripts/fix2231.output.md +++ b/unison-src/transcripts/fix2231.output.md @@ -37,7 +37,7 @@ txt = foldl (Text.++) "" ["a", "b", "c"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2238.md b/unison-src/transcripts/fix2238.md index 356209639..37a948c0f 100644 --- a/unison-src/transcripts/fix2238.md +++ b/unison-src/transcripts/fix2238.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` This should not typecheck - the inline `@eval` expression uses abilities. @@ -14,5 +14,5 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. ```ucm:error -.> load unison-src/transcripts/fix2238.u +scratch/main> load unison-src/transcripts/fix2238.u ``` diff --git a/unison-src/transcripts/fix2238.output.md b/unison-src/transcripts/fix2238.output.md index 31a4aca9f..b9594f015 100644 --- a/unison-src/transcripts/fix2238.output.md +++ b/unison-src/transcripts/fix2238.output.md @@ -20,7 +20,7 @@ ex = {{ @eval{abort} }} This file should also not typecheck - it has a triple backticks block that uses abilities. ```ucm -.> load unison-src/transcripts/fix2238.u +scratch/main> load unison-src/transcripts/fix2238.u Loading changes detected in unison-src/transcripts/fix2238.u. diff --git a/unison-src/transcripts/fix2244.md b/unison-src/transcripts/fix2244.md index e270dc5f2..e1dba0b05 100644 --- a/unison-src/transcripts/fix2244.md +++ b/unison-src/transcripts/fix2244.md @@ -1,13 +1,13 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` Ensure closing token is emitted by closing brace in doc eval block. ```ucm -.> load ./unison-src/transcripts/fix2244.u +scratch/main> load ./unison-src/transcripts/fix2244.u ``` ```ucm:hide -.> add +scratch/main> add ``` diff --git a/unison-src/transcripts/fix2244.output.md b/unison-src/transcripts/fix2244.output.md index 44b65347d..63ac780c2 100644 --- a/unison-src/transcripts/fix2244.output.md +++ b/unison-src/transcripts/fix2244.output.md @@ -1,7 +1,7 @@ Ensure closing token is emitted by closing brace in doc eval block. ```ucm -.> load ./unison-src/transcripts/fix2244.u +scratch/main> load ./unison-src/transcripts/fix2244.u Loading changes detected in ./unison-src/transcripts/fix2244.u. diff --git a/unison-src/transcripts/fix2254.md b/unison-src/transcripts/fix2254.md index 3b6dd15e6..7af9ffd9f 100644 --- a/unison-src/transcripts/fix2254.md +++ b/unison-src/transcripts/fix2254.md @@ -1,6 +1,6 @@ ```ucm:hide -.a> builtins.merge +scratch/a> builtins.merge lib.builtins ``` This transcript checks that updates to data types propagate successfully to dependent types and dependent terms that do pattern matching. First let's create some types and terms: @@ -35,11 +35,12 @@ g = cases _ -> 43 ``` -We'll make our edits in a fork of the `a` namespace: +We'll make our edits in a new branch. ```ucm -.a> add -.> fork a a2 +scratch/a> add +scratch/a> branch a2 +scratch/a2> ``` First let's edit the `A` type, adding another constructor `E`. Note that the functions written against the old type have a wildcard in their pattern match, so they should work fine after the update. @@ -56,31 +57,29 @@ unique type A a b c d Let's do the update now, and verify that the definitions all look good and there's nothing `todo`: ```ucm -.a2> update.old -.a2> view A NeedsA f f2 f3 g -.a2> todo -``` - -```ucm:hide -.a2> builtins.merge +scratch/a2> update.old +scratch/a2> view A NeedsA f f2 f3 g +scratch/a2> todo ``` ## Record updates Here's a test of updating a record: +```ucm:hide +scratch/r1> builtins.merge lib.builtins +``` + + ```unison structural type Rec = { uno : Nat, dos : Nat } combine r = uno r + dos r ``` -```ucm:hide -.a3> builtins.merge -``` - ```ucm -.a3> add +scratch/r1> add +scratch/r1> branch r2 ``` ```unison @@ -90,7 +89,6 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } And checking that after updating this record, there's nothing `todo`: ```ucm -.> fork a3 a4 -.a4> update.old -.a4> todo +scratch/r2> update.old +scratch/r2> todo ``` diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index dbbdf4685..eed5075c1 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -31,10 +31,10 @@ g = cases _ -> 43 ``` -We'll make our edits in a fork of the `a` namespace: +We'll make our edits in a new branch. ```ucm -.a> add +scratch/a> add ⍟ I've added these definitions: @@ -45,9 +45,12 @@ We'll make our edits in a fork of the `a` namespace: f3 : NeedsA Nat Nat -> Nat g : A Nat Nat Nat Nat -> Nat -.> fork a a2 +scratch/a> branch a2 - Done. + 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. @@ -64,24 +67,24 @@ unique type A a b c d Let's do the update now, and verify that the definitions all look good and there's nothing `todo`: ```ucm -.a2> update.old +scratch/a2> update.old ⍟ I've updated these names to your new definition: type A a b c d -.a2> view A NeedsA f f2 f3 g +scratch/a2> view A NeedsA f f2 f3 g type A a b c d - = B b + = A a | D d | E a d + | B b | C c - | A a structural type NeedsA a b - = Zoink Text - | NeedsA (A a b Nat Nat) + = NeedsA (A a b Nat Nat) + | Zoink Text f : A Nat Nat Nat Nat -> Nat f = cases @@ -104,9 +107,9 @@ Let's do the update now, and verify that the definitions all look good and there D n -> n _ -> 43 -.a2> todo +scratch/a2> todo - + You have no pending todo items. Good work! ✅ ``` ## Record updates @@ -140,7 +143,7 @@ combine r = uno r + dos r ``` ```ucm -.a3> add +scratch/r1> add ⍟ I've added these definitions: @@ -153,6 +156,13 @@ combine r = uno r + dos r 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 } @@ -187,11 +197,7 @@ structural type Rec = { uno : Nat, dos : Nat, tres : Text } And checking that after updating this record, there's nothing `todo`: ```ucm -.> fork a3 a4 - - Done. - -.a4> update.old +scratch/r2> update.old ⍟ I've added these definitions: @@ -209,8 +215,8 @@ And checking that after updating this record, there's nothing `todo`: Rec.uno.modify : (Nat ->{g} Nat) -> Rec ->{g} Rec Rec.uno.set : Nat -> Rec -> Rec -.a4> todo +scratch/r2> todo - + You have no pending todo items. Good work! ✅ ``` diff --git a/unison-src/transcripts/fix2268.md b/unison-src/transcripts/fix2268.md index 504e2da73..0892d924e 100644 --- a/unison-src/transcripts/fix2268.md +++ b/unison-src/transcripts/fix2268.md @@ -3,7 +3,7 @@ inferred types that didn't contain arrows, so effects that just yield a value weren't getting disambiguated. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2334.md b/unison-src/transcripts/fix2334.md index 0bc9a2d7d..9044000b5 100644 --- a/unison-src/transcripts/fix2334.md +++ b/unison-src/transcripts/fix2334.md @@ -3,7 +3,7 @@ Tests an issue where pattern matching matrices involving built-in types was discarding default cases in some branches. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2344.md b/unison-src/transcripts/fix2344.md index 6dd1e0ca2..2593c2f18 100644 --- a/unison-src/transcripts/fix2344.md +++ b/unison-src/transcripts/fix2344.md @@ -5,7 +5,7 @@ The binds were causing some sequences of lets to be unnecessarily recursive. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2353.md b/unison-src/transcripts/fix2353.md index 50d0827a6..f9662633c 100644 --- a/unison-src/transcripts/fix2353.md +++ b/unison-src/transcripts/fix2353.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2354.md b/unison-src/transcripts/fix2354.md index 7346e368c..f8a637022 100644 --- a/unison-src/transcripts/fix2354.md +++ b/unison-src/transcripts/fix2354.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests that delaying an un-annotated higher-rank type gives a normal diff --git a/unison-src/transcripts/fix2355.md b/unison-src/transcripts/fix2355.md index 25f4840b3..a9b22fc3f 100644 --- a/unison-src/transcripts/fix2355.md +++ b/unison-src/transcripts/fix2355.md @@ -2,7 +2,7 @@ Tests for a loop that was previously occurring in the type checker. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:error diff --git a/unison-src/transcripts/fix2378.md b/unison-src/transcripts/fix2378.md index d4358c26e..586e6335c 100644 --- a/unison-src/transcripts/fix2378.md +++ b/unison-src/transcripts/fix2378.md @@ -4,7 +4,7 @@ checking wanted vs. provided abilities. It was necessary to re-check rows until a fixed point is reached. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2423.md b/unison-src/transcripts/fix2423.md index 4f5d073c0..72b345055 100644 --- a/unison-src/transcripts/fix2423.md +++ b/unison-src/transcripts/fix2423.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2474.md b/unison-src/transcripts/fix2474.md index a718719bd..3d48be95b 100644 --- a/unison-src/transcripts/fix2474.md +++ b/unison-src/transcripts/fix2474.md @@ -18,7 +18,7 @@ should be typed in the following way: the ability that contains `e`. ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2474.output.md b/unison-src/transcripts/fix2474.output.md index 7f6472f09..f023e162b 100644 --- a/unison-src/transcripts/fix2474.output.md +++ b/unison-src/transcripts/fix2474.output.md @@ -18,7 +18,7 @@ should be typed in the following way: the ability that contains `e`. ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix2628.md b/unison-src/transcripts/fix2628.md index 5c3ec8df5..cef5bd4a9 100644 --- a/unison-src/transcripts/fix2628.md +++ b/unison-src/transcripts/fix2628.md @@ -1,5 +1,5 @@ ```ucm:hide -.> alias.type ##Nat .base.Nat +scratch/main> alias.type ##Nat lib.base.Nat ``` ```unison:hide @@ -9,7 +9,7 @@ unique type foo.bar.baz.MyRecord = { ``` ```ucm -.> add +scratch/main> add -.> find : Nat -> MyRecord +scratch/main> find : Nat -> MyRecord ``` diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 64b45ed29..6dba18bfa 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -5,7 +5,7 @@ unique type foo.bar.baz.MyRecord = { ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -18,7 +18,7 @@ unique type foo.bar.baz.MyRecord = { -> MyRecord -> MyRecord -.> find : Nat -> MyRecord +scratch/main> find : Nat -> MyRecord 1. foo.bar.baz.MyRecord.MyRecord : Nat -> MyRecord diff --git a/unison-src/transcripts/fix2663.md b/unison-src/transcripts/fix2663.md index 6d2ccd724..e3b88b062 100644 --- a/unison-src/transcripts/fix2663.md +++ b/unison-src/transcripts/fix2663.md @@ -8,7 +8,7 @@ After pattern compilation, the match would end up: and z would end up referring to the first p3 rather than the second. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2693.md b/unison-src/transcripts/fix2693.md index 947e35b70..2bd2a0082 100644 --- a/unison-src/transcripts/fix2693.md +++ b/unison-src/transcripts/fix2693.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -14,7 +14,7 @@ range = loop [] ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix2693.output.md b/unison-src/transcripts/fix2693.output.md index 22a46bec2..7bb6d6088 100644 --- a/unison-src/transcripts/fix2693.output.md +++ b/unison-src/transcripts/fix2693.output.md @@ -24,7 +24,7 @@ range = loop [] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2712.md b/unison-src/transcripts/fix2712.md index fce751166..4483f00bd 100644 --- a/unison-src/transcripts/fix2712.md +++ b/unison-src/transcripts/fix2712.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ mapWithKey f m = Tip ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index 08cdb89a3..f691d22dc 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -20,7 +20,7 @@ mapWithKey f m = Tip ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix2795.md b/unison-src/transcripts/fix2795.md index d4b61c99b..1e2ca1764 100644 --- a/unison-src/transcripts/fix2795.md +++ b/unison-src/transcripts/fix2795.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio -.> load unison-src/transcripts/fix2795/docs.u -.> display test +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts/fix2795/docs.u +scratch/main> display test ``` diff --git a/unison-src/transcripts/fix2795.output.md b/unison-src/transcripts/fix2795.output.md index 13a789f03..09ae558fc 100644 --- a/unison-src/transcripts/fix2795.output.md +++ b/unison-src/transcripts/fix2795.output.md @@ -1,9 +1,9 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio Done. -.> load unison-src/transcripts/fix2795/docs.u +scratch/main> load unison-src/transcripts/fix2795/docs.u Loading changes detected in unison-src/transcripts/fix2795/docs.u. @@ -17,7 +17,7 @@ t1 : Text test : Doc2 -.> display test +scratch/main> display test t : Text t = "hi" diff --git a/unison-src/transcripts/fix2840.md b/unison-src/transcripts/fix2840.md index be481b5bb..518f90c45 100644 --- a/unison-src/transcripts/fix2840.md +++ b/unison-src/transcripts/fix2840.md @@ -1,7 +1,7 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to be present in the active codebase when the `display` command was used render `Doc` values. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First, a few \[hidden] definitions necessary for typechecking a simple Doc2. @@ -63,7 +63,7 @@ syntax.docWord = Word ``` ```ucm -.> add +scratch/main> add ``` Next, define and display a simple Doc: @@ -74,7 +74,7 @@ Hi ``` ```ucm -.> display README +scratch/main> display README ``` Previously, the error was: diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index c47df9a2c..ab59e8f1e 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -3,7 +3,7 @@ This bugfix addresses an issue where embedded Unison code in UCM was expected to First, a few \[hidden] definitions necessary for typechecking a simple Doc2. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -25,7 +25,7 @@ Hi ``` ```ucm -.> display README +scratch/main> display README Hi diff --git a/unison-src/transcripts/fix2970.md b/unison-src/transcripts/fix2970.md index d9a6a6b53..efcd59f18 100644 --- a/unison-src/transcripts/fix2970.md +++ b/unison-src/transcripts/fix2970.md @@ -1,7 +1,7 @@ Also fixes #1519 (it's the same issue). ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix2970.output.md b/unison-src/transcripts/fix2970.output.md index 904508e2c..52d017e84 100644 --- a/unison-src/transcripts/fix2970.output.md +++ b/unison-src/transcripts/fix2970.output.md @@ -1,7 +1,7 @@ Also fixes #1519 (it's the same issue). ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. diff --git a/unison-src/transcripts/fix3037.md b/unison-src/transcripts/fix3037.md index c16c1f284..af8fed981 100644 --- a/unison-src/transcripts/fix3037.md +++ b/unison-src/transcripts/fix3037.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests for an unsound case of ability checking that was erroneously being diff --git a/unison-src/transcripts/fix3171.md b/unison-src/transcripts/fix3171.md index 62790dd1a..ad166c7f5 100644 --- a/unison-src/transcripts/fix3171.md +++ b/unison-src/transcripts/fix3171.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests an case where decompiling could cause function arguments to occur in the diff --git a/unison-src/transcripts/fix3196.md b/unison-src/transcripts/fix3196.md index d04592aa6..46755570e 100644 --- a/unison-src/transcripts/fix3196.md +++ b/unison-src/transcripts/fix3196.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests ability checking in scenarios where one side is concrete and the other is diff --git a/unison-src/transcripts/fix3215.md b/unison-src/transcripts/fix3215.md index af0e67e86..a0d1715a1 100644 --- a/unison-src/transcripts/fix3215.md +++ b/unison-src/transcripts/fix3215.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests a case where concrete abilities were appearing multiple times in an diff --git a/unison-src/transcripts/fix3244.md b/unison-src/transcripts/fix3244.md index 0ae745e89..e07581e2e 100644 --- a/unison-src/transcripts/fix3244.md +++ b/unison-src/transcripts/fix3244.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This tests an previously erroneous case in the pattern compiler. It was assuming diff --git a/unison-src/transcripts/fix3265.md b/unison-src/transcripts/fix3265.md index fcf9ce8fb..5b0655111 100644 --- a/unison-src/transcripts/fix3265.md +++ b/unison-src/transcripts/fix3265.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Tests cases that produced bad decompilation output previously. There diff --git a/unison-src/transcripts/fix3634.md b/unison-src/transcripts/fix3634.md index 0cb5f88dd..fd1654739 100644 --- a/unison-src/transcripts/fix3634.md +++ b/unison-src/transcripts/fix3634.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` @@ -16,6 +16,6 @@ d = {{ ``` ```ucm -.> add -.> display d +scratch/main> add +scratch/main> display d ``` \ No newline at end of file diff --git a/unison-src/transcripts/fix3634.output.md b/unison-src/transcripts/fix3634.output.md index 46f009f8c..8648dd1cf 100644 --- a/unison-src/transcripts/fix3634.output.md +++ b/unison-src/transcripts/fix3634.output.md @@ -26,7 +26,7 @@ d = {{ ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -34,7 +34,7 @@ d = {{ (also named builtin.Optional) d : Doc2 -.> display d +scratch/main> display d `x -> J x` diff --git a/unison-src/transcripts/fix3678.md b/unison-src/transcripts/fix3678.md index 13bed5d26..59ecfe787 100644 --- a/unison-src/transcripts/fix3678.md +++ b/unison-src/transcripts/fix3678.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Array comparison was indexing out of bounds. diff --git a/unison-src/transcripts/fix3752.md b/unison-src/transcripts/fix3752.md index 72979087f..90fc20743 100644 --- a/unison-src/transcripts/fix3752.md +++ b/unison-src/transcripts/fix3752.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` These were failing to type check before, because id was not diff --git a/unison-src/transcripts/fix3759.md b/unison-src/transcripts/fix3759.md index 63047bc91..212bae665 100644 --- a/unison-src/transcripts/fix3759.md +++ b/unison-src/transcripts/fix3759.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison:hide @@ -14,7 +14,7 @@ Woot.frobnicate = 43 ``` ```ucm:hide -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/fix3773.md b/unison-src/transcripts/fix3773.md index 1a0ab22c7..991db6991 100644 --- a/unison-src/transcripts/fix3773.md +++ b/unison-src/transcripts/fix3773.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4172.md b/unison-src/transcripts/fix4172.md index 2c7d6c3b1..faaa93475 100644 --- a/unison-src/transcripts/fix4172.md +++ b/unison-src/transcripts/fix4172.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,8 +17,8 @@ allowDebug = debug [1,2,3] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` ```unison @@ -26,6 +26,6 @@ bool = false ``` ```ucm:error -.> update.old -.> test +scratch/main> update.old +scratch/main> test ``` diff --git a/unison-src/transcripts/fix4172.output.md b/unison-src/transcripts/fix4172.output.md index 59a5d83b8..da56c3940 100644 --- a/unison-src/transcripts/fix4172.output.md +++ b/unison-src/transcripts/fix4172.output.md @@ -36,7 +36,7 @@ allowDebug = debug [1,2,3] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,15 +45,15 @@ allowDebug = debug [1,2,3] debug : a -> Text t1 : [Result] -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ t1 Yay + 1. t1 ◉ Yay ✅ 1 test(s) passing - Tip: Use view t1 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ```unison @@ -75,13 +75,13 @@ bool = false ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: bool : Boolean -.> test +scratch/main> test ✅ @@ -91,10 +91,10 @@ bool = false New test results: - ✗ t1 [1, 2, 3] + 1. t1 ✗ [1, 2, 3] 🚫 1 test(s) failing - Tip: Use view t1 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.md b/unison-src/transcripts/fix4280.md index f4cf09a01..d994a4259 100644 --- a/unison-src/transcripts/fix4280.md +++ b/unison-src/transcripts/fix4280.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4424.md b/unison-src/transcripts/fix4424.md index 19963478f..8fb4d14ba 100644 --- a/unison-src/transcripts/fix4424.md +++ b/unison-src/transcripts/fix4424.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some basics: @@ -13,7 +13,7 @@ countCat = cases ``` ```ucm -.> add +scratch/main> add ``` Now I want to add a constructor. @@ -23,5 +23,5 @@ unique type Rat.Dog = Bird | Mouse ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index bb00ce730..dbf505ced 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -9,7 +9,7 @@ countCat = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -25,7 +25,7 @@ unique type Rat.Dog = Bird | Mouse ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4498.md b/unison-src/transcripts/fix4498.md index d1781e2e3..5e8918b30 100644 --- a/unison-src/transcripts/fix4498.md +++ b/unison-src/transcripts/fix4498.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ myterm = foo + 2 ``` ```ucm -.> add -.> view myterm +scratch/main> add +scratch/main> view myterm ``` diff --git a/unison-src/transcripts/fix4498.output.md b/unison-src/transcripts/fix4498.output.md index e13c5f8f0..fb5bbd771 100644 --- a/unison-src/transcripts/fix4498.output.md +++ b/unison-src/transcripts/fix4498.output.md @@ -22,7 +22,7 @@ myterm = foo + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -31,7 +31,7 @@ myterm = foo + 2 lib.dep0.zonk.foo : Text myterm : Nat -.> view myterm +scratch/main> view myterm myterm : Nat myterm = diff --git a/unison-src/transcripts/fix4556.md b/unison-src/transcripts/fix4556.md index d4775b587..1a0bbe25d 100644 --- a/unison-src/transcripts/fix4556.md +++ b/unison-src/transcripts/fix4556.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -10,7 +10,7 @@ hey = foo.hello ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,5 +18,5 @@ thing = 2 ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4556.output.md b/unison-src/transcripts/fix4556.output.md index d65321a31..2b4add6ca 100644 --- a/unison-src/transcripts/fix4556.output.md +++ b/unison-src/transcripts/fix4556.output.md @@ -22,7 +22,7 @@ hey = foo.hello ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ thing = 2 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4592.md b/unison-src/transcripts/fix4592.md index cf272e194..1118a281f 100644 --- a/unison-src/transcripts/fix4592.md +++ b/unison-src/transcripts/fix4592.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison diff --git a/unison-src/transcripts/fix4618.md b/unison-src/transcripts/fix4618.md index 3755f1099..1d69f1ac5 100644 --- a/unison-src/transcripts/fix4618.md +++ b/unison-src/transcripts/fix4618.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ unique type Bugs.Zonk = Bugs ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,5 +17,5 @@ unique type Bugs = ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/fix4618.output.md b/unison-src/transcripts/fix4618.output.md index ee988cf57..0b6a3921d 100644 --- a/unison-src/transcripts/fix4618.output.md +++ b/unison-src/transcripts/fix4618.output.md @@ -18,7 +18,7 @@ unique type Bugs.Zonk = Bugs ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,7 +50,7 @@ unique type Bugs = ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/fix4722.md b/unison-src/transcripts/fix4722.md index e674df56b..983e324f7 100644 --- a/unison-src/transcripts/fix4722.md +++ b/unison-src/transcripts/fix4722.md @@ -9,7 +9,7 @@ expected type into each case, allowing top-level annotations to act like annotations on each case. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/fix4780.md b/unison-src/transcripts/fix4780.md index a8fad4144..f1ebdad56 100644 --- a/unison-src/transcripts/fix4780.md +++ b/unison-src/transcripts/fix4780.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Just a simple test case to see whether partially applied diff --git a/unison-src/transcripts/fix4898.md b/unison-src/transcripts/fix4898.md index 9bc68041b..6d618d82b 100644 --- a/unison-src/transcripts/fix4898.md +++ b/unison-src/transcripts/fix4898.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ redouble x = double x + double x ``` ```ucm -.> add -.> dependents double -.> delete.term 1 +scratch/main> add +scratch/main> dependents double +scratch/main> delete.term 1 ``` diff --git a/unison-src/transcripts/fix4898.output.md b/unison-src/transcripts/fix4898.output.md index dceafc4cb..c348778f2 100644 --- a/unison-src/transcripts/fix4898.output.md +++ b/unison-src/transcripts/fix4898.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,14 +27,14 @@ redouble x = double x + double x ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: double : Int -> Int redouble : Int -> Int -.> dependents double +scratch/main> dependents double Dependents of: double @@ -45,7 +45,7 @@ redouble x = double x + double x Tip: Try `view 1` to see the source of any numbered item in the above list. -.> delete.term 1 +scratch/main> delete.term 1 Done. diff --git a/unison-src/transcripts/fix5080.md b/unison-src/transcripts/fix5080.md new file mode 100644 index 000000000..5c343603d --- /dev/null +++ b/unison-src/transcripts/fix5080.md @@ -0,0 +1,18 @@ +```ucm:hide +scratch/main> builtins.merge lib.builtins +``` + +```unison +test> fix5080.tests.success = [Ok "success"] +test> fix5080.tests.failure = [Fail "fail"] +``` + +```ucm:error +scratch/main> add +scratch/main> test +``` + +```ucm +scratch/main> delete.term 2 +scratch/main> test +``` diff --git a/unison-src/transcripts/fix5080.output.md b/unison-src/transcripts/fix5080.output.md new file mode 100644 index 000000000..c9d0b7c0c --- /dev/null +++ b/unison-src/transcripts/fix5080.output.md @@ -0,0 +1,67 @@ +```unison +test> fix5080.tests.success = [Ok "success"] +test> fix5080.tests.failure = [Fail "fail"] +``` + +```ucm + + Loading changes detected in scratch.u. + + I found and typechecked these definitions 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 +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/fix614.md b/unison-src/transcripts/fix614.md index 3e0ad6c76..3bc69c27c 100644 --- a/unison-src/transcripts/fix614.md +++ b/unison-src/transcripts/fix614.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This transcript demonstrates that Unison forces actions in blocks to have a return type of `()`. @@ -16,7 +16,7 @@ ex1 = do ``` ```ucm:hide -.> add +scratch/main> add ``` This does not typecheck, we've accidentally underapplied `Stream.emit`: diff --git a/unison-src/transcripts/fix689.md b/unison-src/transcripts/fix689.md index b22106eed..a75468b28 100644 --- a/unison-src/transcripts/fix689.md +++ b/unison-src/transcripts/fix689.md @@ -1,7 +1,7 @@ Tests the fix for https://github.com/unisonweb/unison/issues/689 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ``` unison diff --git a/unison-src/transcripts/fix693.md b/unison-src/transcripts/fix693.md index bcb714af9..f45d2eab1 100644 --- a/unison-src/transcripts/fix693.md +++ b/unison-src/transcripts/fix693.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ structural ability Abort where ``` ```ucm -.> add +scratch/main> add ``` This code should not type check. The match on X.x ought to introduce a diff --git a/unison-src/transcripts/fix693.output.md b/unison-src/transcripts/fix693.output.md index 6d869d63a..a5d037737 100644 --- a/unison-src/transcripts/fix693.output.md +++ b/unison-src/transcripts/fix693.output.md @@ -22,7 +22,7 @@ structural ability Abort where ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/fix845.md b/unison-src/transcripts/fix845.md index 4e361ca7c..99e426245 100644 --- a/unison-src/transcripts/fix845.md +++ b/unison-src/transcripts/fix845.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Add `List.zonk` to the codebase: @@ -14,7 +14,7 @@ Text.zonk txt = txt ++ "!! " ``` ```ucm:hide -.> add +scratch/main> add ``` Now, typecheck a file with a reference to `Blah.zonk` (which doesn't exist in the codebase). This should fail: diff --git a/unison-src/transcripts/fix849.md b/unison-src/transcripts/fix849.md index 4d111f9cc..63c40e821 100644 --- a/unison-src/transcripts/fix849.md +++ b/unison-src/transcripts/fix849.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` See [this ticket](https://github.com/unisonweb/unison/issues/849). diff --git a/unison-src/transcripts/fix942.md b/unison-src/transcripts/fix942.md index 5c12cb8c0..5cbf16ffb 100644 --- a/unison-src/transcripts/fix942.md +++ b/unison-src/transcripts/fix942.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First we add some code: @@ -11,7 +11,7 @@ z = y + 2 ``` ```ucm -.> add +scratch/main> add ``` Now we edit `x` to be `7`, which should make `z` equal `10`: @@ -21,8 +21,8 @@ x = 7 ``` ```ucm -.> update -.> view x y z +scratch/main> update +scratch/main> view x y z ``` Uh oh! `z` is still referencing the old version. Just to confirm: @@ -32,6 +32,6 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` diff --git a/unison-src/transcripts/fix942.output.md b/unison-src/transcripts/fix942.output.md index fd5f055d2..68ec09bba 100644 --- a/unison-src/transcripts/fix942.output.md +++ b/unison-src/transcripts/fix942.output.md @@ -22,7 +22,7 @@ z = y + 2 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -52,7 +52,7 @@ x = 7 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -63,7 +63,7 @@ x = 7 Done. -.> view x y z +scratch/main> view x y z x : Nat x = 7 @@ -106,20 +106,20 @@ test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: t1 : [Result] -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ t1 great + 1. t1 ◉ great ✅ 1 test(s) passing - Tip: Use view t1 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.md b/unison-src/transcripts/fix987.md index 0db69b1d7..5eb2a73bb 100644 --- a/unison-src/transcripts/fix987.md +++ b/unison-src/transcripts/fix987.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` First we'll add a definition: @@ -18,7 +18,7 @@ spaceAttack1 x = Add it to the codebase: ```ucm -.> add +scratch/main> add ``` Now we'll try to add a different definition that runs the actions in a different order. This should work fine: @@ -31,7 +31,7 @@ spaceAttack2 x = ``` ```ucm -.> add +scratch/main> add ``` Previously, this would fail because the hashing algorithm was being given one big let rec block whose binding order was normalized. diff --git a/unison-src/transcripts/fix987.output.md b/unison-src/transcripts/fix987.output.md index 5f6119c22..50d747862 100644 --- a/unison-src/transcripts/fix987.output.md +++ b/unison-src/transcripts/fix987.output.md @@ -28,7 +28,7 @@ spaceAttack1 x = Add it to the codebase: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,7 +59,7 @@ spaceAttack2 x = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/formatter.md b/unison-src/transcripts/formatter.md index 3848c0ba9..d2a921b2f 100644 --- a/unison-src/transcripts/formatter.md +++ b/unison-src/transcripts/formatter.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -88,7 +88,7 @@ with a strike-through block~ ``` ```ucm -.> debug.format +scratch/main> debug.format ``` Formatter should leave things alone if the file doesn't typecheck. @@ -98,5 +98,5 @@ brokenDoc = {{ hello }} + 1 ``` ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/formatter.output.md b/unison-src/transcripts/formatter.output.md index 5ddf656af..ce931ed31 100644 --- a/unison-src/transcripts/formatter.output.md +++ b/unison-src/transcripts/formatter.output.md @@ -84,7 +84,7 @@ with a strike-through block~ ``` ```ucm -.> debug.format +scratch/main> debug.format ``` ```unison:added-by-ucm scratch.u @@ -200,6 +200,6 @@ brokenDoc = {{ hello }} + 1 ``` ```ucm -.> debug.format +scratch/main> debug.format ``` diff --git a/unison-src/transcripts/fuzzy-options.md b/unison-src/transcripts/fuzzy-options.md index 13d953c93..e460ce923 100644 --- a/unison-src/transcripts/fuzzy-options.md +++ b/unison-src/transcripts/fuzzy-options.md @@ -5,14 +5,14 @@ If an argument is required but doesn't have a fuzzy resolver, the command should ```ucm:error -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver -.> move.term +scratch/main> move.term ``` If a fuzzy resolver doesn't have any options available it should print a message instead of opening an empty fuzzy-select. ```ucm:error -.empty> view +scratch/empty> view ``` @@ -25,21 +25,21 @@ nested.optionTwo = 2 Definition args ```ucm -.> add -.> debug.fuzzy-options view _ +scratch/main> add +scratch/main> debug.fuzzy-options view _ ``` Namespace args ```ucm -.> add -.> debug.fuzzy-options find-in _ +scratch/main> add +scratch/main> debug.fuzzy-options find-in _ ``` Project Branch args ```ucm myproject/main> branch mybranch -.> debug.fuzzy-options switch _ +scratch/main> debug.fuzzy-options switch _ ``` diff --git a/unison-src/transcripts/fuzzy-options.output.md b/unison-src/transcripts/fuzzy-options.output.md index f48f5cd6f..290d07aab 100644 --- a/unison-src/transcripts/fuzzy-options.output.md +++ b/unison-src/transcripts/fuzzy-options.output.md @@ -5,7 +5,7 @@ If an argument is required but doesn't have a fuzzy resolver, the command should ```ucm -- The second argument of move.term is a 'new-name' and doesn't have a fuzzy resolver -.> move.term +scratch/main> move.term `move.term foo bar` renames `foo` to `bar`. @@ -14,9 +14,7 @@ If a fuzzy resolver doesn't have any options available it should print a message opening an empty fuzzy-select. ```ucm - ☝️ The namespace .empty is empty. - -.empty> view +scratch/empty> view ⚠️ @@ -32,16 +30,14 @@ nested.optionTwo = 2 Definition args ```ucm - ☝️ The namespace . is empty. - -.> add +scratch/main> add ⍟ I've added these definitions: nested.optionTwo : ##Nat optionOne : ##Nat -.> debug.fuzzy-options view _ +scratch/main> debug.fuzzy-options view _ Select a definition to view: * optionOne @@ -51,12 +47,12 @@ Definition args Namespace args ```ucm -.> add +scratch/main> add ⊡ Ignored previously added definitions: nested.optionTwo optionOne -.> debug.fuzzy-options find-in _ +scratch/main> debug.fuzzy-options find-in _ Select a namespace: * nested @@ -72,11 +68,14 @@ myproject/main> branch mybranch Tip: To merge your work back into the main branch, first `switch /main` then `merge /mybranch`. -.> debug.fuzzy-options switch _ +scratch/main> debug.fuzzy-options switch _ Select a project or branch to switch to: * myproject/main * myproject/mybranch + * scratch/empty + * scratch/main * myproject + * scratch ``` diff --git a/unison-src/transcripts/hello.md b/unison-src/transcripts/hello.md index 187eb86ec..4c72096ff 100644 --- a/unison-src/transcripts/hello.md +++ b/unison-src/transcripts/hello.md @@ -2,7 +2,7 @@ # Hello! ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This markdown file is also a Unison transcript file. Transcript files are an easy way to create self-documenting Unison programs, libraries, and tutorials. @@ -33,8 +33,8 @@ x = 42 Let's go ahead and add that to the codebase, then make sure it's there: ```ucm -.> add -.> view x +scratch/main> add +scratch/main> view x ``` If `view` returned no results, the transcript would fail at this point. @@ -50,7 +50,7 @@ y = 99 This works for `ucm` blocks as well. ```ucm:hide -.> rename.term x answerToUltimateQuestionOfLife +scratch/main> rename.term x answerToUltimateQuestionOfLife ``` Doing `unison:hide:all` hides the block altogether, both input and output - this is useful for doing behind-the-scenes control of `ucm`'s state. diff --git a/unison-src/transcripts/hello.output.md b/unison-src/transcripts/hello.output.md index 8104114e0..e6d03ea95 100644 --- a/unison-src/transcripts/hello.output.md +++ b/unison-src/transcripts/hello.output.md @@ -48,13 +48,13 @@ x = 42 Let's go ahead and add that to the codebase, then make sure it's there: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: x : Nat -.> view x +scratch/main> view x x : Nat x = 42 diff --git a/unison-src/transcripts/higher-rank.md b/unison-src/transcripts/higher-rank.md index 7fe63de50..bf9efcf67 100644 --- a/unison-src/transcripts/higher-rank.md +++ b/unison-src/transcripts/higher-rank.md @@ -2,9 +2,9 @@ This transcript does some testing of higher-rank types. Regression tests related to higher-rank types can be added here. ```ucm:hide -.> alias.type ##Nat Nat -.> alias.type ##Text Text -.> alias.type ##IO IO +scratch/main> alias.type ##Nat Nat +scratch/main> alias.type ##Text Text +scratch/main> alias.type ##IO IO ``` In this example, a higher-rank function is defined, `f`. No annotation is needed at the call-site of `f`, because the lambda is being checked against the polymorphic type `forall a . a -> a`, rather than inferred: @@ -19,8 +19,8 @@ f id = (id 1, id "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 _ = +f : (forall a g . '{g} a -> '{g} a) -> () -> () +f id _ = _ = (id ('1 : '{} Nat), id ('("hi") : '{IO} Text)) () ``` @@ -34,17 +34,17 @@ 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 -> +Functor.blah = cases Functor f -> g : forall a b . (a -> b) -> f a -> f b g = f () ``` -This example is similar, but involves abilities: +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) +unique type Loc = Loc (forall t a . '{Remote t} a ->{Remote t} t a) Loc.blah : Loc -> () Loc.blah = cases Loc f -> @@ -52,20 +52,20 @@ Loc.blah = cases Loc f -> f0 = f () --- In this case, no annotation is needed since the lambda +-- 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.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.transform2 : (forall t a . '{Remote t} a -> '{Remote t} a) -> Loc -> Loc -Loc.transform2 nt = cases Loc f -> +Loc.transform2 nt = cases Loc f -> f' : forall t a . '{Remote t} a ->{Remote t} t a f' a = f (nt a) - Loc f' + Loc f' ``` ## Types with polymorphic fields @@ -77,6 +77,6 @@ structural type HigherRanked = HigherRanked (forall a. a -> a) We should be able to add and view records with higher-rank fields. ```ucm -.higher_ranked> add -.higher_ranked> view HigherRanked +scratch/main> add +scratch/main> view HigherRanked ``` diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index a64a48ae3..2054583f6 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -33,8 +33,8 @@ f id = (id 1, id "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 _ = +f : (forall a g . '{g} a -> '{g} a) -> () -> () +f id _ = _ = (id ('1 : '{} Nat), id ('("hi") : '{IO} Text)) () ``` @@ -61,7 +61,7 @@ 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 -> +Functor.blah = cases Functor f -> g : forall a b . (a -> b) -> f a -> f b g = f () @@ -83,11 +83,11 @@ Functor.blah = cases Functor f -> -> (∀ a b. (a -> b) -> f a -> f b) ``` -This example is similar, but involves abilities: +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) +unique type Loc = Loc (forall t a . '{Remote t} a ->{Remote t} t a) Loc.blah : Loc -> () Loc.blah = cases Loc f -> @@ -95,20 +95,20 @@ Loc.blah = cases Loc f -> f0 = f () --- In this case, no annotation is needed since the lambda +-- 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.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.transform2 : (forall t a . '{Remote t} a -> '{Remote t} a) -> Loc -> Loc -Loc.transform2 nt = cases Loc f -> +Loc.transform2 nt = cases Loc f -> f' : forall t a . '{Remote t} a ->{Remote t} t a f' a = f (nt a) - Loc f' + Loc f' ``` ```ucm @@ -141,15 +141,13 @@ structural type HigherRanked = HigherRanked (forall a. a -> a) We should be able to add and view records with higher-rank fields. ```ucm - ☝️ The namespace .higher_ranked is empty. - -.higher_ranked> add +scratch/main> add ⍟ I've added these definitions: structural type HigherRanked -.higher_ranked> view HigherRanked +scratch/main> view HigherRanked structural type HigherRanked = HigherRanked (∀ a. a -> a) diff --git a/unison-src/transcripts/io-test-command.md b/unison-src/transcripts/io-test-command.md index 98d55a3da..f10259137 100644 --- a/unison-src/transcripts/io-test-command.md +++ b/unison-src/transcripts/io-test-command.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` The `io.test` command should run all of the tests within the current namespace, excluding libs. @@ -20,24 +20,24 @@ lib.ioAndExceptionTestInLib = do ``` ```ucm:hide -.> add +scratch/main> add ``` Run a IO tests one by one ```ucm -.> io.test ioAndExceptionTest -.> io.test ioTest +scratch/main> io.test ioAndExceptionTest +scratch/main> io.test ioTest ``` `io.test` doesn't cache results ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest ``` `io.test.all` will run all matching tests except those in the `lib` namespace. ```ucm -.> io.test.all +scratch/main> io.test.all ``` diff --git a/unison-src/transcripts/io-test-command.output.md b/unison-src/transcripts/io-test-command.output.md index 840d72b4f..ec848f23d 100644 --- a/unison-src/transcripts/io-test-command.output.md +++ b/unison-src/transcripts/io-test-command.output.md @@ -18,45 +18,45 @@ lib.ioAndExceptionTestInLib = do Run a IO tests one by one ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest New test results: - ◉ ioAndExceptionTest Success + 1. ioAndExceptionTest ◉ Success ✅ 1 test(s) passing - Tip: Use view ioAndExceptionTest to view the source of a test. + Tip: Use view 1 to view the source of a test. -.> io.test ioTest +scratch/main> io.test ioTest New test results: - ◉ ioTest Success + 1. ioTest ◉ Success ✅ 1 test(s) passing - Tip: Use view ioTest to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` `io.test` doesn't cache results ```ucm -.> io.test ioAndExceptionTest +scratch/main> io.test ioAndExceptionTest New test results: - ◉ ioAndExceptionTest Success + 1. ioAndExceptionTest ◉ Success ✅ 1 test(s) passing - Tip: Use view ioAndExceptionTest 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. ```ucm -.> io.test.all +scratch/main> io.test.all @@ -68,11 +68,11 @@ Run a IO tests one by one New test results: - ◉ ioAndExceptionTest Success - ◉ ioTest Success + 1. ioAndExceptionTest ◉ Success + 2. ioTest ◉ Success ✅ 2 test(s) passing - Tip: Use view ioAndExceptionTest 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.md b/unison-src/transcripts/io.md index 4caedaef0..0051c7aa6 100644 --- a/unison-src/transcripts/io.md +++ b/unison-src/transcripts/io.md @@ -1,10 +1,10 @@ # tests for built-in IO functions ```ucm:hide -.> builtins.merge -.> builtins.mergeio -.> load unison-src/transcripts-using-base/base.u -.> add +scratch/main> builtins.merge +scratch/main> builtins.mergeio +scratch/main> load unison-src/transcripts-using-base/base.u +scratch/main> add ``` Tests for IO builtins which wired to foreign haskell calls. @@ -17,7 +17,7 @@ TempDirs/autoCleaned is an ability/hanlder which allows you to easily create a scratch directory which will automatically get cleaned up. ```ucm:hide -.> add +scratch/main> add ``` ## Basic File Functions @@ -57,8 +57,8 @@ testCreateRename _ = ``` ```ucm -.> add -.> io.test testCreateRename +scratch/main> add +scratch/main> io.test testCreateRename ``` ### Opening / Closing files @@ -107,8 +107,8 @@ testOpenClose _ = ``` ```ucm -.> add -.> io.test testOpenClose +scratch/main> add +scratch/main> io.test testOpenClose ``` ### Reading files with getSomeBytes @@ -166,8 +166,8 @@ testGetSomeBytes _ = ``` ```ucm -.> add -.> io.test testGetSomeBytes +scratch/main> add +scratch/main> io.test testGetSomeBytes ``` ### Seeking in open files @@ -240,9 +240,9 @@ testAppend _ = ``` ```ucm -.> add -.> io.test testSeek -.> io.test testAppend +scratch/main> add +scratch/main> io.test testSeek +scratch/main> io.test testAppend ``` ### SystemTime @@ -257,8 +257,8 @@ testSystemTime _ = ``` ```ucm -.> add -.> io.test testSystemTime +scratch/main> add +scratch/main> io.test testSystemTime ``` ### Get temp directory @@ -274,8 +274,8 @@ testGetTempDirectory _ = ``` ```ucm -.> add -.> io.test testGetTempDirectory +scratch/main> add +scratch/main> io.test testGetTempDirectory ``` ### Get current directory @@ -291,8 +291,8 @@ testGetCurrentDirectory _ = ``` ```ucm -.> add -.> io.test testGetCurrentDirectory +scratch/main> add +scratch/main> io.test testGetCurrentDirectory ``` ### Get directory contents @@ -310,8 +310,8 @@ testDirContents _ = ``` ```ucm -.> add -.> io.test testDirContents +scratch/main> add +scratch/main> io.test testDirContents ``` ### Read environment variables @@ -328,8 +328,8 @@ testGetEnv _ = runTest test ``` ```ucm -.> add -.> io.test testGetEnv +scratch/main> add +scratch/main> io.test testGetEnv ``` ### Read command line args @@ -368,27 +368,27 @@ testGetArgs.runMeWithTwoArgs = 'let Test that they can be run with the right number of args. ```ucm -.> add -.> run runMeWithNoArgs -.> run runMeWithOneArg foo -.> run runMeWithTwoArgs foo bar +scratch/main> add +scratch/main> run runMeWithNoArgs +scratch/main> run runMeWithOneArg foo +scratch/main> run runMeWithTwoArgs foo bar ``` Calling our examples with the wrong number of args will error. ```ucm:error -.> run runMeWithNoArgs foo +scratch/main> run runMeWithNoArgs foo ``` ```ucm:error -.> run runMeWithOneArg +scratch/main> run runMeWithOneArg ``` ```ucm:error -.> run runMeWithOneArg foo bar +scratch/main> run runMeWithOneArg foo bar ``` ```ucm:error -.> run runMeWithTwoArgs +scratch/main> run runMeWithTwoArgs ``` ### Get the time zone @@ -401,8 +401,8 @@ testTimeZone = do ``` ```ucm -.> add -.> run testTimeZone +scratch/main> add +scratch/main> run testTimeZone ``` ### Get some random bytes @@ -417,6 +417,6 @@ testRandom = do ``` ```ucm -.> add -.> io.test testGetEnv +scratch/main> add +scratch/main> io.test testGetEnv ``` diff --git a/unison-src/transcripts/io.output.md b/unison-src/transcripts/io.output.md index 3a7d44d4d..cbc177145 100644 --- a/unison-src/transcripts/io.output.md +++ b/unison-src/transcripts/io.output.md @@ -59,27 +59,27 @@ testCreateRename _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testCreateRename : '{IO} [Result] -.> io.test testCreateRename +scratch/main> io.test testCreateRename New test results: - ◉ testCreateRename create a foo directory - ◉ testCreateRename directory should exist - ◉ testCreateRename foo should no longer exist - ◉ testCreateRename directory should no longer exist - ◉ testCreateRename bar should now exist - ◉ testCreateRename removeDirectory works recursively - ◉ testCreateRename removeDirectory works recursively + 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 testCreateRename to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Opening / Closing files @@ -141,26 +141,26 @@ testOpenClose _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testOpenClose : '{IO} [Result] -.> io.test testOpenClose +scratch/main> io.test testOpenClose New test results: - ◉ testOpenClose file should be open - ◉ testOpenClose file handle buffering should match what we just set. - ◉ testOpenClose file should be closed - ◉ testOpenClose bytes have been written - ◉ testOpenClose bytes have been written - ◉ testOpenClose file should be closed + 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 testOpenClose to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Reading files with getSomeBytes @@ -231,28 +231,28 @@ testGetSomeBytes _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetSomeBytes : '{IO} [Result] -.> io.test testGetSomeBytes +scratch/main> io.test testGetSomeBytes New test results: - ◉ testGetSomeBytes chunk size splits data into 2 uneven sides - ◉ testGetSomeBytes file should be closed - ◉ testGetSomeBytes first chunk matches first part of testData - ◉ testGetSomeBytes second chunk matches rest of testData - ◉ testGetSomeBytes should be at end of file - ◉ testGetSomeBytes reading at end of file results in Bytes.empty - ◉ testGetSomeBytes requesting many bytes results in what's available - ◉ testGetSomeBytes file should be closed + 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 testGetSomeBytes to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Seeking in open files @@ -339,38 +339,38 @@ testAppend _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testAppend : '{IO} [Result] testSeek : '{IO} [Result] -.> io.test testSeek +scratch/main> io.test testSeek New test results: - ◉ testSeek seeked - ◉ testSeek readable file should be seekable - ◉ testSeek shouldn't be the EOF - ◉ testSeek we should be at position 0 - ◉ testSeek we should be at position 1 - ◉ testSeek should be able to read our temporary file after seeking - ◉ testSeek getLine should get a line + 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 testSeek to view the source of a test. + Tip: Use view 1 to view the source of a test. -.> io.test testAppend +scratch/main> io.test testAppend New test results: - ◉ testAppend should be able to read our temporary file + 1. testAppend ◉ should be able to read our temporary file ✅ 1 test(s) passing - Tip: Use view testAppend to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### SystemTime @@ -398,21 +398,21 @@ testSystemTime _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testSystemTime : '{IO} [Result] -.> io.test testSystemTime +scratch/main> io.test testSystemTime New test results: - ◉ testSystemTime systemTime should be sane + 1. testSystemTime ◉ systemTime should be sane ✅ 1 test(s) passing - Tip: Use view testSystemTime to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Get temp directory @@ -428,23 +428,22 @@ testGetTempDirectory _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetTempDirectory : '{IO} [Result] -.> io.test testGetTempDirectory +scratch/main> io.test testGetTempDirectory New test results: - ◉ testGetTempDirectory Temp directory is directory - ◉ testGetTempDirectory Temp directory should exist + 1. testGetTempDirectory ◉ Temp directory is directory + ◉ Temp directory should exist ✅ 2 test(s) passing - Tip: Use view testGetTempDirectory to view the source of a - test. + Tip: Use view 1 to view the source of a test. ``` ### Get current directory @@ -460,23 +459,22 @@ testGetCurrentDirectory _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetCurrentDirectory : '{IO} [Result] -.> io.test testGetCurrentDirectory +scratch/main> io.test testGetCurrentDirectory New test results: - ◉ testGetCurrentDirectory Current directory is directory - ◉ testGetCurrentDirectory Current directory should exist + 1. testGetCurrentDirectory ◉ Current directory is directory + ◉ Current directory should exist ✅ 2 test(s) passing - Tip: Use view testGetCurrentDirectory to view the source of a - test. + Tip: Use view 1 to view the source of a test. ``` ### Get directory contents @@ -494,22 +492,22 @@ testDirContents _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testDirContents : '{IO} [Result] -.> io.test testDirContents +scratch/main> io.test testDirContents New test results: - ◉ testDirContents directory size should be - ◉ testDirContents directory contents should have current directory and parent + 1. testDirContents ◉ directory size should be + ◉ directory contents should have current directory and parent ✅ 2 test(s) passing - Tip: Use view testDirContents to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Read environment variables @@ -527,22 +525,22 @@ testGetEnv _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testGetEnv : '{IO} [Result] -.> io.test testGetEnv +scratch/main> io.test testGetEnv New test results: - ◉ testGetEnv PATH environent variable should be set - ◉ testGetEnv DOESNTEXIST didn't exist + 1. testGetEnv ◉ PATH environent variable should be set + ◉ DOESNTEXIST didn't exist ✅ 2 test(s) passing - Tip: Use view testGetEnv to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ### Read command line args @@ -581,7 +579,7 @@ testGetArgs.runMeWithTwoArgs = 'let Test that they can be run with the right number of args. ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -590,15 +588,15 @@ Test that they can be run with the right number of args. testGetArgs.runMeWithOneArg : '{IO, Exception} () testGetArgs.runMeWithTwoArgs : '{IO, Exception} () -.> run runMeWithNoArgs +scratch/main> run runMeWithNoArgs () -.> run runMeWithOneArg foo +scratch/main> run runMeWithOneArg foo () -.> run runMeWithTwoArgs foo bar +scratch/main> run runMeWithTwoArgs foo bar () @@ -606,7 +604,7 @@ Test that they can be run with the right number of args. Calling our examples with the wrong number of args will error. ```ucm -.> run runMeWithNoArgs foo +scratch/main> run runMeWithNoArgs foo 💔💥 @@ -619,7 +617,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithOneArg +scratch/main> run runMeWithOneArg 💔💥 @@ -632,7 +630,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithOneArg foo bar +scratch/main> run runMeWithOneArg foo bar 💔💥 @@ -646,7 +644,7 @@ Calling our examples with the wrong number of args will error. ``` ```ucm -.> run runMeWithTwoArgs +scratch/main> run runMeWithTwoArgs 💔💥 @@ -668,13 +666,13 @@ testTimeZone = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testTimeZone : '{IO} () -.> run testTimeZone +scratch/main> run testTimeZone () @@ -691,21 +689,21 @@ testRandom = do ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: testRandom : '{IO} [Result] -.> io.test testGetEnv +scratch/main> io.test testGetEnv New test results: - ◉ testGetEnv PATH environent variable should be set - ◉ testGetEnv DOESNTEXIST didn't exist + 1. testGetEnv ◉ PATH environent variable should be set + ◉ DOESNTEXIST didn't exist ✅ 2 test(s) passing - Tip: Use view testGetEnv 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.md b/unison-src/transcripts/kind-inference.md index f81a3bf95..3af86ae85 100644 --- a/unison-src/transcripts/kind-inference.md +++ b/unison-src/transcripts/kind-inference.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ## A type param cannot have conflicting kind constraints within a single decl diff --git a/unison-src/transcripts/lambdacase.md b/unison-src/transcripts/lambdacase.md index e2e3a557e..a4d1ba96f 100644 --- a/unison-src/transcripts/lambdacase.md +++ b/unison-src/transcripts/lambdacase.md @@ -1,7 +1,7 @@ # Lambda case syntax ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This function takes a single argument and immediately pattern matches on it. As we'll see below, it can be written using `cases` syntax: @@ -13,7 +13,7 @@ isEmpty x = match x with ``` ```ucm:hide -.> add +scratch/main> add ``` Here's the same function written using `cases` syntax: @@ -27,7 +27,7 @@ isEmpty2 = cases Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ```ucm -.> view isEmpty +scratch/main> view isEmpty ``` it shows the definition using `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -47,7 +47,7 @@ merge xs ys = match (xs, ys) with ``` ```ucm -.> add +scratch/main> add ``` And here's a version using `cases`. The patterns are separated by commas: @@ -65,7 +65,7 @@ merge2 = cases Notice that Unison detects this as an alias of `merge`, and if we view `merge` ```ucm -.> view merge +scratch/main> view merge ``` it again shows the definition using the multi-argument `cases` syntax opportunistically, even though the code was originally written without that syntax. @@ -101,8 +101,8 @@ merge3 = cases ``` ```ucm -.> add -.> view merge3 +scratch/main> add +scratch/main> view merge3 ``` This is the same definition written with multiple patterns and not using the `cases` syntax; notice it is considered an alias of `merge3` above. diff --git a/unison-src/transcripts/lambdacase.output.md b/unison-src/transcripts/lambdacase.output.md index efb41cdce..2e55001a9 100644 --- a/unison-src/transcripts/lambdacase.output.md +++ b/unison-src/transcripts/lambdacase.output.md @@ -46,7 +46,7 @@ isEmpty2 = cases Notice that Unison detects this as an alias of `isEmpty`, and if we view `isEmpty` ```ucm -.> view isEmpty +scratch/main> view isEmpty isEmpty : [t] -> Boolean isEmpty = cases @@ -71,7 +71,7 @@ merge xs ys = match (xs, ys) with ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -107,7 +107,7 @@ merge2 = cases Notice that Unison detects this as an alias of `merge`, and if we view `merge` ```ucm -.> view merge +scratch/main> view merge merge : [a] -> [a] -> [a] merge = cases @@ -194,13 +194,13 @@ merge3 = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: merge3 : [a] -> [a] -> [a] -.> view merge3 +scratch/main> view merge3 merge3 : [a] -> [a] -> [a] merge3 = cases diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.md b/unison-src/transcripts/ls-pretty-print-scope-bug.md deleted file mode 100644 index a8d4cf5ed..000000000 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.md +++ /dev/null @@ -1,44 +0,0 @@ -```unison -unique type Foo = Foo -``` - -```ucm -.a.b> add -.> fork .a.b .c.d.f -.c.g.f> -``` - -```unison -unique type Foo = Foo -``` - -```ucm -.c.g.f> add -.c> -``` - -```unison -foo = .d.f.Foo.Foo -``` - -```ucm -.c> add -``` - -At this point we have: -`.a.b.Foo` -`.c.d.f.Foo` which is equal to `.a.b.Foo` -`.c.g.f.Foo` which is distinct from the other `Foo` types - -```ucm -.> delete .c.d.f.Foo -``` -Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `.>`, but an unnamed type when viewed from `.c>`, -since referencing `.a.b.Foo` would reference names outside of the -namespace rooted at `.c`. - -```ucm -.> ls c -.c> ls -``` diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md deleted file mode 100644 index 567a176b6..000000000 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md +++ /dev/null @@ -1,113 +0,0 @@ -```unison -unique type Foo = Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - type Foo - -``` -```ucm - ☝️ The namespace .a.b is empty. - -.a.b> add - - ⍟ I've added these definitions: - - type Foo - -.> fork .a.b .c.d.f - - Done. - - ☝️ The namespace .c.g.f is empty. - -``` -```unison -unique type Foo = Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - type Foo - -``` -```ucm -.c.g.f> add - - ⍟ I've added these definitions: - - type Foo - -``` -```unison -foo = .d.f.Foo.Foo -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - foo : d.f.Foo - -``` -```ucm -.c> add - - ⍟ I've added these definitions: - - foo : d.f.Foo - -``` -At this point we have: -`.a.b.Foo` -`.c.d.f.Foo` which is equal to `.a.b.Foo` -`.c.g.f.Foo` which is distinct from the other `Foo` types - -```ucm -.> delete .c.d.f.Foo - - Done. - -``` -Once `.c.d.f.Foo` is deleted `.c.foo` should have the type `.a.b.Foo` -when viewed from `.>`, but an unnamed type when viewed from `.c>`, -since referencing `.a.b.Foo` would reference names outside of the -namespace rooted at `.c`. - -```ucm -.> ls c - - 1. d/ (1 term) - 2. foo (b.Foo) - 3. g/ (1 term, 1 type) - -.c> ls - - 1. d/ (1 term) - 2. foo (#uj8oalgadr) - 3. g/ (1 term, 1 type) - -``` diff --git a/unison-src/transcripts/lsp-fold-ranges.md b/unison-src/transcripts/lsp-fold-ranges.md index 377c9170d..20dddc386 100644 --- a/unison-src/transcripts/lsp-fold-ranges.md +++ b/unison-src/transcripts/lsp-fold-ranges.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison:hide @@ -29,5 +29,5 @@ test> z = let ``` ```ucm -.> debug.lsp.fold-ranges +scratch/main> debug.lsp.fold-ranges ``` diff --git a/unison-src/transcripts/lsp-fold-ranges.output.md b/unison-src/transcripts/lsp-fold-ranges.output.md index 51f8b4ae9..2b76b3ff4 100644 --- a/unison-src/transcripts/lsp-fold-ranges.output.md +++ b/unison-src/transcripts/lsp-fold-ranges.output.md @@ -24,7 +24,7 @@ test> z = let ``` ```ucm -.> debug.lsp.fold-ranges +scratch/main> debug.lsp.fold-ranges 《{{ Type doc }}》 《structural type Optional a = diff --git a/unison-src/transcripts/merge.md b/unison-src/transcripts/merge.md index f95175689..164b458f5 100644 --- a/unison-src/transcripts/merge.md +++ b/unison-src/transcripts/merge.md @@ -4,8 +4,8 @@ The `merge` command merges together two branches in the same project: the curren branch. For example, to merge `topic` into `main`, switch to `main` and run `merge topic`: ```ucm -.> help merge -.> help merge.commit +scratch/main> help merge +scratch/main> help merge.commit ``` Let's see a simple unconflicted merge in action: Alice (us) and Bob (them) add different terms. The merged result @@ -48,7 +48,7 @@ project/alice> view foo bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Basic merge: two identical adds @@ -89,7 +89,7 @@ project/alice> view foo bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Simple update propagation @@ -142,7 +142,7 @@ project/alice> display bar ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Update propagation with common dependent @@ -208,7 +208,7 @@ project/alice> display foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Propagating an update to an update @@ -278,7 +278,7 @@ project/alice> display foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Update + delete isn't (currently) a conflict @@ -323,7 +323,7 @@ project/alice> view foo ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` In a future version, we'd like to give the user a warning at least. @@ -379,7 +379,7 @@ project/alice> view foo bar baz ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## No-op merge (Bob = Alice) @@ -397,7 +397,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## No-op merge (Bob < Alice) @@ -425,7 +425,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Fast-forward merge (Bob > Alice) @@ -453,7 +453,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## No-op merge: merge empty namespace into empty namespace @@ -509,7 +509,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type error @@ -559,7 +559,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: simple term conflict @@ -624,7 +624,7 @@ project/merge-bob-into-alice> view bar baz ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: simple type conflict @@ -667,7 +667,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type-update + constructor-rename conflict @@ -710,7 +710,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: constructor-rename conflict @@ -748,7 +748,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: non-constructor/constructor conflict @@ -789,7 +789,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge failure: type/type conflict with term/constructor conflict @@ -840,7 +840,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` Here's a more involved example that demonstrates the same idea. @@ -913,7 +913,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Merge algorithm quirk: add/add unique types @@ -1108,7 +1108,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Conflict involving builtin @@ -1149,7 +1149,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Constructor alias @@ -1195,7 +1195,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Missing constructor name @@ -1242,7 +1242,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Nested decl alias @@ -1290,7 +1290,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Stray constructor alias @@ -1334,7 +1334,7 @@ project/alice> merge bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Term or type in `lib` @@ -1375,7 +1375,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## LCA precondition violations @@ -1441,7 +1441,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ## Regression tests @@ -1486,7 +1486,7 @@ project/alice> merge /bob ``` ```ucm:hide -.> project.delete project +scratch/main> project.delete project ``` ### Delete a constructor diff --git a/unison-src/transcripts/merge.output.md b/unison-src/transcripts/merge.output.md index 63a4f852b..d0251764e 100644 --- a/unison-src/transcripts/merge.output.md +++ b/unison-src/transcripts/merge.output.md @@ -4,12 +4,12 @@ The `merge` command merges together two branches in the same project: the curren branch. For example, to merge `topic` into `main`, switch to `main` and run `merge topic`: ```ucm -.> help merge +scratch/main> help merge merge `merge /branch` merges `branch` into the current branch -.> help merge.commit +scratch/main> help merge.commit merge.commit (or commit.merge) `merge.commit` merges a temporary branch created by the diff --git a/unison-src/transcripts/move-all.md b/unison-src/transcripts/move-all.md index f3a4f5209..ee83aa33a 100644 --- a/unison-src/transcripts/move-all.md +++ b/unison-src/transcripts/move-all.md @@ -1,7 +1,7 @@ # Tests for `move` ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ## Happy Path - namespace, term, and type @@ -16,7 +16,7 @@ unique type Foo.T = T ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -25,16 +25,16 @@ unique type Foo.T = T1 | T2 ``` ```ucm -.> update +scratch/main> update ``` Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ```ucm -.> move Foo Bar -.> ls -.> ls Bar -.> history Bar +scratch/main> move Foo Bar +scratch/main> ls +scratch/main> ls Bar +scratch/main> history Bar ``` ## Happy Path - Just term @@ -44,10 +44,10 @@ bonk = 5 ``` ```ucm -.z> builtins.merge -.z> add -.z> move bonk zonk -.z> ls +z/main> builtins.merge +z/main> add +z/main> move bonk zonk +z/main> ls ``` ## Happy Path - Just namespace @@ -57,15 +57,15 @@ bonk.zonk = 5 ``` ```ucm -.a> builtins.merge -.a> add -.a> move bonk zonk -.a> ls -.a> view zonk.zonk +a/main> builtins.merge +a/main> add +a/main> move bonk zonk +a/main> ls +a/main> view zonk.zonk ``` ## Sad Path - No term, type, or namespace named src ```ucm:error -.> move doesntexist foo +scratch/main> move doesntexist foo ``` diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index f5fefba06..d7a7bec85 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -28,7 +28,7 @@ unique type Foo.T = T ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -60,7 +60,7 @@ unique type Foo.T = T1 | T2 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -71,25 +71,25 @@ unique type Foo.T = T1 | T2 Should be able to move the term, type, and namespace, including its types, terms, and sub-namespaces. ```ucm -.> move Foo Bar +scratch/main> move Foo Bar Done. -.> ls +scratch/main> ls 1. Bar (Nat) 2. Bar (type) 3. Bar/ (4 terms, 1 type) 4. builtin/ (469 terms, 74 types) -.> ls Bar +scratch/main> ls Bar 1. Foo (Bar) 2. T (type) 3. T/ (2 terms) 4. termInA (Nat) -.> history Bar +scratch/main> history Bar Note: The most recent namespace hash is immediately below this message. @@ -127,23 +127,21 @@ bonk = 5 ``` ```ucm - ☝️ The namespace .z is empty. - -.z> builtins.merge +z/main> builtins.merge Done. -.z> add +z/main> add ⍟ I've added these definitions: bonk : Nat -.z> move bonk zonk +z/main> move bonk zonk Done. -.z> ls +z/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk (Nat) @@ -170,28 +168,26 @@ bonk.zonk = 5 ``` ```ucm - ☝️ The namespace .a is empty. - -.a> builtins.merge +a/main> builtins.merge Done. -.a> add +a/main> add ⍟ I've added these definitions: bonk.zonk : Nat -.a> move bonk zonk +a/main> move bonk zonk Done. -.a> ls +a/main> ls 1. builtin/ (469 terms, 74 types) 2. zonk/ (1 term) -.a> view zonk.zonk +a/main> view zonk.zonk zonk.zonk : Nat zonk.zonk = 5 @@ -200,7 +196,7 @@ bonk.zonk = 5 ## Sad Path - No term, type, or namespace named src ```ucm -.> move doesntexist foo +scratch/main> move doesntexist foo ⚠️ diff --git a/unison-src/transcripts/move-namespace.md b/unison-src/transcripts/move-namespace.md index 15c66f74c..0d1c7ba3e 100644 --- a/unison-src/transcripts/move-namespace.md +++ b/unison-src/transcripts/move-namespace.md @@ -1,107 +1,16 @@ # Tests for `move.namespace` -```ucm:hide -.happy> builtins.merge -.history> builtins.merge -.existing> builtins.merge -``` -## Happy path - -Create a namespace and add some history to it - -```unison -a.termInA = 1 -unique type a.T = T -``` - -```ucm -.happy> add -``` - -```unison -a.termInA = 2 -unique type a.T = T1 | T2 -``` - -```ucm -.happy> update -``` - -Should be able to move the namespace, including its types, terms, and sub-namespaces. - -```ucm -.happy> move.namespace a b -.happy> ls b -.happy> history b -``` - - -## Namespace history - - -Create some namespaces and add some history to them - -```unison -a.termInA = 1 -b.termInB = 10 -``` - -```ucm -.history> add -``` - -```unison -a.termInA = 2 -b.termInB = 11 -``` - -```ucm -.history> update -``` - -Deleting a namespace should not leave behind any history, -if we move another to that location we expect the history to simply be the history -of the moved namespace. - -```ucm -.history> delete.namespace b -.history> move.namespace a b --- Should be the history from 'a' -.history> history b --- Should be empty -.history> history a -``` - - -## Moving over an existing branch - -Create some namespace and add some history to them - -```unison -a.termInA = 1 -b.termInB = 10 -``` - -```ucm -.existing> add -``` - -```unison -a.termInA = 2 -b.termInB = 11 -``` - -```ucm -.existing> update -.existing> move.namespace a b -``` - -## Moving the Root +## Moving the Root I should be able to move the root into a sub-namespace +```unison:hide +foo = 1 +``` + ```ucm +.> add -- Should request confirmation .> move.namespace . .root.at.path .> move.namespace . .root.at.path @@ -118,8 +27,8 @@ I should be able to move a sub namespace _over_ the root. ```ucm -- Should request confirmation -.> move.namespace .root.at.path.happy . -.> move.namespace .root.at.path.happy . +.> move.namespace .root.at.path . +.> move.namespace .root.at.path . .> ls .> history ``` @@ -127,6 +36,109 @@ I should be able to move a sub namespace _over_ the root. ```ucm:error -- should be empty -.> ls .root.at.path.happy -.> history .root.at.path.happy +.> ls .root.at.path +.> history .root.at.path ``` + +```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 +scratch/happy> add +``` + +```unison +a.termInA = 2 +unique type a.T = T1 | T2 +``` + +```ucm +scratch/happy> update +``` + +Should be able to move the namespace, including its types, terms, and sub-namespaces. + +```ucm +scratch/happy> move.namespace a b +scratch/happy> ls b +scratch/happy> history b +``` + + +## Namespace history + +```ucm:hide +scratch/history> builtins.merge lib.builtins +``` + +Create some namespaces and add some history to them + +```unison +a.termInA = 1 +b.termInB = 10 +``` + +```ucm +scratch/history> add +``` + +```unison +a.termInA = 2 +b.termInB = 11 +``` + +```ucm +scratch/history> update +``` + +Deleting a namespace should not leave behind any history, +if we move another to that location we expect the history to simply be the history +of the moved namespace. + +```ucm +scratch/history> delete.namespace b +scratch/history> move.namespace a b +-- Should be the history from 'a' +scratch/history> history b +-- Should be empty +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 +a.termInA = 1 +b.termInB = 10 +``` + +```ucm +scratch/existing> add +``` + +```unison +a.termInA = 2 +b.termInB = 11 +``` + +```ucm +scratch/existing> update +scratch/existing> move.namespace a b +``` + diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index 9b63baeb6..257365dbd 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -1,5 +1,102 @@ # Tests for `move.namespace` + +## Moving the Root + +I should be able to move the root into a sub-namespace + +```unison +foo = 1 +``` + +```ucm +.> add + + ⍟ I've added these definitions: + + foo : ##Nat + +-- Should request confirmation +.> move.namespace . .root.at.path + + ⚠️ + + Moves which affect the root branch cannot be undone, are you sure? + Re-run the same command to proceed. + +.> move.namespace . .root.at.path + + Done. + +.> ls + + 1. root/ (1 term) + +.> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #g97lh1m2v7 (start of history) + +``` +```ucm +.> ls .root.at.path + + 1. foo (##Nat) + +.> history .root.at.path + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #08a6hgi6s4 (start of history) + +``` +I should be able to move a sub namespace _over_ the root. + +```ucm +-- Should request confirmation +.> move.namespace .root.at.path . + + ⚠️ + + Moves which affect the root branch cannot be undone, are you sure? + Re-run the same command to proceed. + +.> move.namespace .root.at.path . + + Done. + +.> ls + + 1. foo (##Nat) + +.> history + + Note: The most recent namespace hash is immediately below this + message. + + + + □ 1. #08a6hgi6s4 (start of history) + +``` +```ucm +-- should be empty +.> ls .root.at.path + + nothing to show + +.> history .root.at.path + + ☝️ The namespace .root.at.path is empty. + +``` ## Happy path Create a namespace and add some history to it @@ -24,7 +121,7 @@ unique type a.T = T ``` ```ucm -.happy> add +scratch/happy> add ⍟ I've added these definitions: @@ -53,7 +150,7 @@ unique type a.T = T1 | T2 ``` ```ucm -.happy> update +scratch/happy> update Okay, I'm searching the branch for code that needs to be updated... @@ -64,22 +161,22 @@ unique type a.T = T1 | T2 Should be able to move the namespace, including its types, terms, and sub-namespaces. ```ucm -.happy> move.namespace a b +scratch/happy> move.namespace a b Done. -.happy> ls b +scratch/happy> ls b 1. T (type) 2. T/ (2 terms) 3. termInA (Nat) -.happy> history b +scratch/happy> history b Note: The most recent namespace hash is immediately below this message. - ⊙ 1. #4j747vnmdk + ⊙ 1. #rkvfe5p8fu + Adds / updates: @@ -89,12 +186,11 @@ Should be able to move the namespace, including its types, terms, and sub-namesp T.T - □ 2. #r71j4144fe (start of history) + □ 2. #avlnmh0erc (start of history) ``` ## Namespace history - Create some namespaces and add some history to them ```unison @@ -117,7 +213,7 @@ b.termInB = 10 ``` ```ucm -.history> add +scratch/history> add ⍟ I've added these definitions: @@ -146,7 +242,7 @@ b.termInB = 11 ``` ```ucm -.history> update +scratch/history> update Okay, I'm searching the branch for code that needs to be updated... @@ -156,19 +252,19 @@ b.termInB = 11 ``` Deleting a namespace should not leave behind any history, if we move another to that location we expect the history to simply be the history -of the moved namespace. +of the moved namespace. ```ucm -.history> delete.namespace b +scratch/history> delete.namespace b Done. -.history> move.namespace a b +scratch/history> move.namespace a b Done. -- Should be the history from 'a' -.history> history b +scratch/history> history b Note: The most recent namespace hash is immediately below this message. @@ -182,12 +278,12 @@ of the moved namespace. □ 2. #m8smmmgjso (start of history) -- Should be empty -.history> history a +scratch/history> history a - ☝️ The namespace .history.a is empty. + ☝️ The namespace a is empty. ``` -## Moving over an existing branch +## Moving over an existing branch Create some namespace and add some history to them @@ -211,7 +307,7 @@ b.termInB = 10 ``` ```ucm -.existing> add +scratch/existing> add ⍟ I've added these definitions: @@ -240,14 +336,14 @@ b.termInB = 11 ``` ```ucm -.existing> update +scratch/existing> update Okay, I'm searching the branch for code that needs to be updated... Done. -.existing> move.namespace a b +scratch/existing> move.namespace a b ⚠️ @@ -258,208 +354,3 @@ b.termInB = 11 Done. ``` -## Moving the Root - -I should be able to move the root into a sub-namespace - -```ucm --- Should request confirmation -.> move.namespace . .root.at.path - - ⚠️ - - Moves which affect the root branch cannot be undone, are you sure? - Re-run the same command to proceed. - -.> move.namespace . .root.at.path - - Done. - -.> ls - - 1. root/ (1412 terms, 223 types) - -.> history - - Note: The most recent namespace hash is immediately below this - message. - - - - □ 1. #o7cku9c0t9 (start of history) - -``` -```ucm -.> ls .root.at.path - - 1. existing/ (470 terms, 74 types) - 2. happy/ (472 terms, 75 types) - 3. history/ (470 terms, 74 types) - -.> history .root.at.path - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #fv72cqfto4 - - - Deletes: - - existing.b.termInB - - > Moves: - - Original name New name - existing.a.termInA existing.b.termInA - - ⊙ 2. #12iqsb3l9g - - + Adds / updates: - - existing.a.termInA existing.b.termInB - - = Copies: - - Original name New name(s) - happy.b.termInA existing.a.termInA - history.b.termInA existing.a.termInA - - ⊙ 3. #r9jmgtco5u - - + Adds / updates: - - existing.a.termInA existing.b.termInB - - ⊙ 4. #1k6kae1vn4 - - > Moves: - - Original name New name - history.a.termInA history.b.termInA - - ⊙ 5. #ua9re7leg7 - - - Deletes: - - history.b.termInB - - ⊙ 6. #3k8ouql6cc - - + Adds / updates: - - history.a.termInA history.b.termInB - - = Copies: - - Original name New name(s) - happy.b.termInA history.a.termInA - - ⊙ 7. #fp2331i1ek - - + Adds / updates: - - history.a.termInA history.b.termInB - - ⊙ 8. #5sj5jefgcu - - > Moves: - - Original name New name - happy.a.T happy.b.T - happy.a.T.T1 happy.b.T.T1 - happy.a.T.T2 happy.b.T.T2 - happy.a.termInA happy.b.termInA - - ⊙ 9. #ell48pttus - - + Adds / updates: - - happy.a.T happy.a.T.T1 happy.a.T.T2 happy.a.termInA - - - Deletes: - - happy.a.T.T - - ⊙ 10. #al8eguoh70 - - + Adds / updates: - - happy.a.T happy.a.T.T happy.a.termInA - - There's more history before the versions shown here. Use - `history #som3n4m3space` to view history starting from a given - namespace hash. - - ⠇ - - ⊙ 11. #okceqk39nf - - -``` -I should be able to move a sub namespace _over_ the root. - -```ucm --- Should request confirmation -.> move.namespace .root.at.path.happy . - - ⚠️ - - Moves which affect the root branch cannot be undone, are you sure? - Re-run the same command to proceed. - -.> move.namespace .root.at.path.happy . - - Done. - -.> ls - - 1. b/ (3 terms, 1 type) - 2. builtin/ (469 terms, 74 types) - -.> history - - Note: The most recent namespace hash is immediately below this - message. - - ⊙ 1. #0rvi5q5une - - + Adds / updates: - - b.T b.T.T1 b.T.T2 b.termInA - - ⊙ 2. #oaa8ltdusf - - - Deletes: - - a.T a.T.T1 a.T.T2 a.termInA - - ⊙ 3. #t1c91ou7ri - - + Adds / updates: - - a.T a.T.T1 a.T.T2 a.termInA - - - Deletes: - - a.T.T - - ⊙ 4. #hovh08jep4 - - + Adds / updates: - - a.T a.T.T a.termInA - - □ 5. #4bigcpnl7t (start of history) - -``` -```ucm --- should be empty -.> ls .root.at.path.happy - - nothing to show - -.> history .root.at.path.happy - - ☝️ The namespace .root.at.path.happy is empty. - -``` diff --git a/unison-src/transcripts/name-segment-escape.md b/unison-src/transcripts/name-segment-escape.md index a78295318..bf6bca128 100644 --- a/unison-src/transcripts/name-segment-escape.md +++ b/unison-src/transcripts/name-segment-escape.md @@ -1,8 +1,8 @@ You can use a keyword or reserved operator as a name segment if you surround it with backticks. ```ucm:error -.> view `match` -.> view `=` +scratch/main> view `match` +scratch/main> view `=` ``` You can also use backticks to expand the set of valid symbols in a symboly name segment to include these three: `.()` @@ -10,6 +10,6 @@ You can also use backticks to expand the set of valid symbols in a symboly name This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). ```ucm:error -.> view `.` -.> view `()` +scratch/main> view `.` +scratch/main> view `()` ``` diff --git a/unison-src/transcripts/name-segment-escape.output.md b/unison-src/transcripts/name-segment-escape.output.md index 7eef02077..f324018ff 100644 --- a/unison-src/transcripts/name-segment-escape.output.md +++ b/unison-src/transcripts/name-segment-escape.output.md @@ -1,14 +1,14 @@ You can use a keyword or reserved operator as a name segment if you surround it with backticks. ```ucm -.> view `match` +scratch/main> view `match` ⚠️ The following names were not found in the codebase. Check your spelling. `match` -.> view `=` +scratch/main> view `=` ⚠️ @@ -21,14 +21,14 @@ You can also use backticks to expand the set of valid symbols in a symboly name This allows you to spell `.` or `()` as name segments (which historically have appeared in the namespace). ```ucm -.> view `.` +scratch/main> view `.` ⚠️ The following names were not found in the codebase. Check your spelling. `.` -.> view `()` +scratch/main> view `()` ⚠️ diff --git a/unison-src/transcripts/name-selection.md b/unison-src/transcripts/name-selection.md index 992ee7949..cff6c15d4 100644 --- a/unison-src/transcripts/name-selection.md +++ b/unison-src/transcripts/name-selection.md @@ -12,46 +12,40 @@ This transcript shows how the pretty-printer picks names for a hash when multipl ``` ```unison:hide -a = b + 1 -b = 0 + 1 +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 -.a> add -.a> alias.term b aaa.but.more.segments +.> add .a> view a ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: -``` -.> fork a a2 -.> fork a a3 -``` - ```unison:hide -c = 1 -d = c + 10 -``` +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 -```ucm:hide -.a2> builtins.merge -``` -```ucm -.a2> add -.a2> alias.term c long.name.but.shortest.suffixification -``` - -```unison:hide -c = 2 -d = c + 10 +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 -.a3> add -.a3> merge.old .a2 .a3 +.> add +.> debug.alias.term.force a2.c a3.c +.> debug.alias.term.force a2.d a3.d ``` At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index e124c18a2..a9b3d9679 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -5,23 +5,21 @@ This transcript shows how the pretty-printer picks names for a hash when multipl 3. Otherwise if there are multiple names with a minimal number of segments, compare the names alphabetically. ```unison -a = b + 1 -b = 0 + 1 +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 -.a> add +.> add ⍟ I've added these definitions: - a : Nat - b : Nat - -.a> alias.term b aaa.but.more.segments - - Done. + a.a : Nat + a.aaa.but.more.segments : Nat + a.b : Nat .a> view a @@ -33,70 +31,53 @@ Will add `a` and `b` to the codebase and give `b` a longer (in terms of segment ``` Next let's introduce a conflicting symbol and show that its hash qualified name isn't used when it has an unconflicted name: -``` -.> fork a a2 -.> fork a a3 - -``` - ```unison -c = 1 -d = c + 10 +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 -.a2> add +.> add ⍟ I've added these definitions: - c : Nat - d : Nat + 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 -.a2> alias.term c long.name.but.shortest.suffixification +.> debug.alias.term.force a2.c a3.c Done. -``` -```unison -c = 2 -d = c + 10 -``` +.> debug.alias.term.force a2.d a3.d -```ucm -.a3> add - - ⍟ I've added these definitions: - - c : Nat - d : Nat - -.a3> merge.old .a2 .a3 - - Here's what's changed in .a3 after the merge: - - New name conflicts: - - 1. c#dcgdua2lj6 : Nat - ↓ - 2. ┌ c#dcgdua2lj6 : Nat - 3. └ c#gjmq673r1v : Nat - - 4. d#9ivhgvhthc : Nat - ↓ - 5. ┌ d#9ivhgvhthc : Nat - 6. └ d#ve16e6jmf6 : Nat - - Added definitions: - - 7. ┌ c#gjmq673r1v : Nat - 8. └ long.name.but.shortest.suffixification : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... + Done. ``` At this point, `a3` is conflicted for symbols `c` and `d`, so those are deprioritized. diff --git a/unison-src/transcripts/namespace-deletion-regression.md b/unison-src/transcripts/namespace-deletion-regression.md index d33a70710..a1bc14ca3 100644 --- a/unison-src/transcripts/namespace-deletion-regression.md +++ b/unison-src/transcripts/namespace-deletion-regression.md @@ -8,9 +8,9 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -.> alias.term ##Nat.+ .Nat.+ -.> ls Nat -.> move.namespace Nat Nat.operators -.> ls Nat -.> ls Nat.operators +scratch/main> alias.term ##Nat.+ Nat.+ +scratch/main> ls Nat +scratch/main> move.namespace Nat Nat.operators +scratch/main> ls Nat +scratch/main> ls Nat.operators ``` diff --git a/unison-src/transcripts/namespace-deletion-regression.output.md b/unison-src/transcripts/namespace-deletion-regression.output.md index 45af1bfcb..21e0866f7 100644 --- a/unison-src/transcripts/namespace-deletion-regression.output.md +++ b/unison-src/transcripts/namespace-deletion-regression.output.md @@ -8,23 +8,23 @@ Previously the following sequence delete the current namespace unexpectedly 😬. ```ucm -.> alias.term ##Nat.+ .Nat.+ +scratch/main> alias.term ##Nat.+ Nat.+ Done. -.> ls Nat +scratch/main> ls Nat 1. + (##Nat -> ##Nat -> ##Nat) -.> move.namespace Nat Nat.operators +scratch/main> move.namespace Nat Nat.operators Done. -.> ls Nat +scratch/main> ls Nat 1. operators/ (1 term) -.> ls Nat.operators +scratch/main> ls Nat.operators 1. + (##Nat -> ##Nat -> ##Nat) diff --git a/unison-src/transcripts-using-base/namespace-dependencies.md b/unison-src/transcripts/namespace-dependencies.md similarity index 65% rename from unison-src/transcripts-using-base/namespace-dependencies.md rename to unison-src/transcripts/namespace-dependencies.md index d338c0543..0e8223a6c 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.md +++ b/unison-src/transcripts/namespace-dependencies.md @@ -1,8 +1,9 @@ # namespace.dependencies command ```unison:hide +const a b = a external.mynat = 1 -mynamespace.dependsOnText = external.mynat Nat.+ 10 +mynamespace.dependsOnText = const external.mynat 10 ``` ```ucm diff --git a/unison-src/transcripts-using-base/namespace-dependencies.output.md b/unison-src/transcripts/namespace-dependencies.output.md similarity index 53% rename from unison-src/transcripts-using-base/namespace-dependencies.output.md rename to unison-src/transcripts/namespace-dependencies.output.md index caf4dc52c..0e7d29826 100644 --- a/unison-src/transcripts-using-base/namespace-dependencies.output.md +++ b/unison-src/transcripts/namespace-dependencies.output.md @@ -1,8 +1,9 @@ # namespace.dependencies command ```unison +const a b = a external.mynat = 1 -mynamespace.dependsOnText = external.mynat Nat.+ 10 +mynamespace.dependsOnText = const external.mynat 10 ``` ```ucm @@ -10,15 +11,16 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10 ⍟ I've added these definitions: - external.mynat : Nat - mynamespace.dependsOnText : Nat + const : a -> b -> a + external.mynat : ##Nat + mynamespace.dependsOnText : ##Nat .mynamespace> namespace.dependencies External dependency Dependents in .mynamespace - .builtin.Nat 1. dependsOnText + ##Nat 1. dependsOnText - .builtin.Nat.+ 1. dependsOnText + .const 1. dependsOnText .external.mynat 1. dependsOnText diff --git a/unison-src/transcripts/numbered-args.md b/unison-src/transcripts/numbered-args.md index f421a6717..02172710b 100644 --- a/unison-src/transcripts/numbered-args.md +++ b/unison-src/transcripts/numbered-args.md @@ -1,7 +1,7 @@ # Using numbered arguments in UCM ```ucm:hide -.temp> alias.type ##Text Text +scratch/main> alias.type ##Text Text ``` First lets add some contents to our codebase. @@ -16,41 +16,41 @@ corge = "corge" ``` ```ucm -.temp> add +scratch/main> add ``` We can get the list of things in the namespace, and UCM will give us a numbered list: ```ucm -.temp> find +scratch/main> find ``` We can ask to `view` the second element of this list: ```ucm -.temp> find -.temp> view 2 +scratch/main> find +scratch/main> view 2 ``` And we can `view` multiple elements by separating with spaces: ```ucm -.temp> find -.temp> view 2 3 5 +scratch/main> find +scratch/main> view 2 3 5 ``` We can also ask for a range: ```ucm -.temp> find -.temp> view 2-4 +scratch/main> find +scratch/main> view 2-4 ``` And we can ask for multiple ranges and use mix of ranges and numbers: ```ucm -.temp> find -.temp> view 1-3 4 5-6 +scratch/main> find +scratch/main> view 1-3 4 5-6 ``` diff --git a/unison-src/transcripts/numbered-args.output.md b/unison-src/transcripts/numbered-args.output.md index b8dfce49f..883a319de 100644 --- a/unison-src/transcripts/numbered-args.output.md +++ b/unison-src/transcripts/numbered-args.output.md @@ -30,7 +30,7 @@ corge = "corge" ``` ```ucm -.temp> add +scratch/main> add ⍟ I've added these definitions: @@ -46,7 +46,7 @@ We can get the list of things in the namespace, and UCM will give us a numbered list: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -61,7 +61,7 @@ list: We can ask to `view` the second element of this list: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -72,7 +72,7 @@ We can ask to `view` the second element of this list: 7. builtin type Text -.temp> view 2 +scratch/main> view 2 baz : Text baz = "baz" @@ -81,7 +81,7 @@ We can ask to `view` the second element of this list: And we can `view` multiple elements by separating with spaces: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -92,7 +92,7 @@ And we can `view` multiple elements by separating with spaces: 7. builtin type Text -.temp> view 2 3 5 +scratch/main> view 2 3 5 baz : Text baz = "baz" @@ -107,7 +107,7 @@ And we can `view` multiple elements by separating with spaces: We can also ask for a range: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -118,7 +118,7 @@ We can also ask for a range: 7. builtin type Text -.temp> view 2-4 +scratch/main> view 2-4 baz : Text baz = "baz" @@ -133,7 +133,7 @@ We can also ask for a range: And we can ask for multiple ranges and use mix of ranges and numbers: ```ucm -.temp> find +scratch/main> find 1. bar : Text 2. baz : Text @@ -144,7 +144,7 @@ And we can ask for multiple ranges and use mix of ranges and numbers: 7. builtin type Text -.temp> view 1-3 4 5-6 +scratch/main> view 1-3 4 5-6 bar : Text bar = "bar" diff --git a/unison-src/transcripts/old-fold-right.md b/unison-src/transcripts/old-fold-right.md index f3c01d5d0..179ad5b93 100644 --- a/unison-src/transcripts/old-fold-right.md +++ b/unison-src/transcripts/old-fold-right.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/pattern-match-coverage.md b/unison-src/transcripts/pattern-match-coverage.md index 8c35e07d5..e08ea269a 100644 --- a/unison-src/transcripts/pattern-match-coverage.md +++ b/unison-src/transcripts/pattern-match-coverage.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` # Basics @@ -292,7 +292,7 @@ unit2t = cases ``` ```ucm -.> add +scratch/main> add ``` Pattern coverage checking needs the data decl map to contain all @@ -316,7 +316,7 @@ evil = bug "" ``` ```ucm -.> add +scratch/main> add ``` ```unison:error @@ -330,7 +330,7 @@ unique type SomeType = A ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 0a0b290c9..b8d30cb25 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -650,7 +650,7 @@ unit2t = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -706,7 +706,7 @@ evil = bug "" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -747,7 +747,7 @@ unique type SomeType = A ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/pattern-pretty-print-2345.md b/unison-src/transcripts/pattern-pretty-print-2345.md index 0879808f2..8728aa4d8 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.md @@ -2,7 +2,7 @@ Regression test for https://github.com/unisonweb/unison/pull/2377 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -65,21 +65,21 @@ doc = cases ``` ```ucm -.> add -.> view dopey -.> view grumpy -.> view happy -.> view sneezy -.> view bashful -.> view mouthy -.> view pokey -.> view sleepy -.> view demure -.> view angry -.> view tremulous -.> view throaty -.> view agitated -.> view doc +scratch/main> add +scratch/main> view dopey +scratch/main> view grumpy +scratch/main> view happy +scratch/main> view sneezy +scratch/main> view bashful +scratch/main> view mouthy +scratch/main> view pokey +scratch/main> view sleepy +scratch/main> view demure +scratch/main> view angry +scratch/main> view tremulous +scratch/main> view throaty +scratch/main> view agitated +scratch/main> view doc ``` diff --git a/unison-src/transcripts/pattern-pretty-print-2345.output.md b/unison-src/transcripts/pattern-pretty-print-2345.output.md index 6c239772d..6157aa8e7 100644 --- a/unison-src/transcripts/pattern-pretty-print-2345.output.md +++ b/unison-src/transcripts/pattern-pretty-print-2345.output.md @@ -88,7 +88,7 @@ doc = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -108,94 +108,94 @@ doc = cases throaty : Request {g, Ab} x -> () tremulous : (Nat, Nat) -> () -.> view dopey +scratch/main> view dopey dopey : Char -> () dopey = cases ?0 -> () _ -> () -.> view grumpy +scratch/main> view grumpy grumpy : ff284oqf651 -> () grumpy = cases d -> () -.> view happy +scratch/main> view happy happy : Boolean -> () happy = cases true -> () false -> () -.> view sneezy +scratch/main> view sneezy sneezy : Int -> () sneezy = cases +1 -> () _ -> () -.> view bashful +scratch/main> view bashful bashful : Optional a -> () bashful = cases Some a -> () _ -> () -.> view mouthy +scratch/main> view mouthy mouthy : [t] -> () mouthy = cases [] -> () _ -> () -.> view pokey +scratch/main> view pokey pokey : [t] -> () pokey = cases h +: t -> () _ -> () -.> view sleepy +scratch/main> view sleepy sleepy : [t] -> () sleepy = cases i :+ l -> () _ -> () -.> view demure +scratch/main> view demure demure : [Nat] -> () demure = cases [0] -> () _ -> () -.> view angry +scratch/main> view angry angry : [t] -> () angry = cases a ++ [] -> () -.> view tremulous +scratch/main> view tremulous tremulous : (Nat, Nat) -> () tremulous = cases (0, 1) -> () _ -> () -.> view throaty +scratch/main> view throaty throaty : Request {g, Ab} x -> () throaty = cases { Ab.a a -> k } -> () { _ } -> () -.> view agitated +scratch/main> view agitated agitated : Nat -> () agitated = cases a | a == 2 -> () _ -> () -.> view doc +scratch/main> view doc doc : Nat -> () doc = cases diff --git a/unison-src/transcripts/patternMatchTls.md b/unison-src/transcripts/patternMatchTls.md index cfe5b177c..dbd851071 100644 --- a/unison-src/transcripts/patternMatchTls.md +++ b/unison-src/transcripts/patternMatchTls.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` We had bugs in the calling conventions for both send and terminate which would @@ -29,6 +29,6 @@ assertRight = cases ```ucm -.> add -.> run frank +scratch/main> add +scratch/main> run frank ``` diff --git a/unison-src/transcripts/patternMatchTls.output.md b/unison-src/transcripts/patternMatchTls.output.md index b1f82833b..65aa5153d 100644 --- a/unison-src/transcripts/patternMatchTls.output.md +++ b/unison-src/transcripts/patternMatchTls.output.md @@ -37,14 +37,14 @@ assertRight = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: assertRight : Either a b -> b frank : '{IO} () -.> run frank +scratch/main> run frank () diff --git a/unison-src/transcripts/patterns.md b/unison-src/transcripts/patterns.md index 104d1bc8a..8eb309ad7 100644 --- a/unison-src/transcripts/patterns.md +++ b/unison-src/transcripts/patterns.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Some tests of pattern behavior. diff --git a/unison-src/transcripts/propagate.md b/unison-src/transcripts/propagate.md index cc80ef885..b5eaf3ede 100644 --- a/unison-src/transcripts/propagate.md +++ b/unison-src/transcripts/propagate.md @@ -1,7 +1,7 @@ # Propagating type edits ```ucm:hide -.subpath.lib> builtins.merge +scratch/main> builtins.merge lib.builtins ``` We introduce a type `Foo` with a function dependent `fooToInt`. @@ -16,9 +16,9 @@ fooToInt _ = +42 And then we add it. ```ucm -.subpath> add -.subpath> find.verbose -.subpath> view fooToInt +scratch/main> add +scratch/main> find.verbose +scratch/main> view fooToInt ``` Then if we change the type `Foo`... @@ -30,13 +30,13 @@ unique type Foo = Foo | Bar and update the codebase to use the new type `Foo`... ```ucm -.subpath> update.old +scratch/main> update.old ``` ... it should automatically propagate the type to `fooToInt`. ```ucm -.subpath> view fooToInt +scratch/main> view fooToInt ``` ### Preserving user type variables @@ -55,7 +55,7 @@ preserve.otherTerm y = someTerm y Add that to the codebase: ```ucm -.subpath> add +scratch/main> add ``` Let's now edit the dependency: @@ -68,15 +68,15 @@ preserve.someTerm _ = None Update... ```ucm -.subpath> update.old +scratch/main> update.old ``` Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. ```ucm -.subpath> view preserve.someTerm -.subpath> view preserve.otherTerm +scratch/main> view preserve.someTerm +scratch/main> view preserve.otherTerm ``` ### Propagation only applies to the local branch @@ -84,7 +84,6 @@ type of `otherTerm` should remain the same. Cleaning up a bit... ```ucm -.> delete.namespace subpath .subpath.lib> builtins.merge ``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index 5f0b72bb3..5e16983bc 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -26,14 +26,14 @@ fooToInt _ = +42 And then we add it. ```ucm -.subpath> add +scratch/main> add ⍟ I've added these definitions: type Foo fooToInt : Foo -> Int -.subpath> find.verbose +scratch/main> find.verbose 1. -- #uj8oalgadr2f52qloufah6t8vsvbc76oqijkotek87vooih7aqu44k20hrs34kartusapghp4jmfv6g1409peklv3r6a527qpk52soo type Foo @@ -46,7 +46,7 @@ And then we add it. -.subpath> view fooToInt +scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 @@ -75,7 +75,7 @@ unique type Foo = Foo | Bar and update the codebase to use the new type `Foo`... ```ucm -.subpath> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: @@ -85,7 +85,7 @@ and update the codebase to use the new type `Foo`... ... it should automatically propagate the type to `fooToInt`. ```ucm -.subpath> view fooToInt +scratch/main> view fooToInt fooToInt : Foo -> Int fooToInt _ = +42 @@ -121,7 +121,7 @@ preserve.otherTerm y = someTerm y Add that to the codebase: ```ucm -.subpath> add +scratch/main> add ⍟ I've added these definitions: @@ -153,7 +153,7 @@ preserve.someTerm _ = None Update... ```ucm -.subpath> update.old +scratch/main> update.old ⍟ I've updated these names to your new definition: @@ -164,12 +164,12 @@ Now the type of `someTerm` should be `Optional x -> Optional x` and the type of `otherTerm` should remain the same. ```ucm -.subpath> view preserve.someTerm +scratch/main> view preserve.someTerm preserve.someTerm : Optional x -> Optional x preserve.someTerm _ = None -.subpath> view preserve.otherTerm +scratch/main> view preserve.otherTerm preserve.otherTerm : Optional baz -> Optional baz preserve.otherTerm y = someTerm y @@ -180,10 +180,6 @@ type of `otherTerm` should remain the same. Cleaning up a bit... ```ucm -.> delete.namespace subpath - - Done. - ☝️ The namespace .subpath.lib is empty. .subpath.lib> builtins.merge diff --git a/unison-src/transcripts/records.md b/unison-src/transcripts/records.md index 4a3d5d23d..199218f3e 100644 --- a/unison-src/transcripts/records.md +++ b/unison-src/transcripts/records.md @@ -1,8 +1,8 @@ Ensure that Records keep their syntax after being added to the codebase ```ucm:hide -.> builtins.merge -.> load unison-src/transcripts-using-base/base.u +scratch/main> builtins.merge +scratch/main> load unison-src/transcripts-using-base/base.u ``` ## Record with 1 field @@ -12,11 +12,11 @@ unique type Record1 = { a : Text } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record1 +scratch/main> view Record1 ``` ## Record with 2 fields @@ -26,11 +26,11 @@ unique type Record2 = { a : Text, b : Int } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record2 +scratch/main> view Record2 ``` ## Record with 3 fields @@ -40,11 +40,11 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record3 +scratch/main> view Record3 ``` ## Record with many fields @@ -62,11 +62,11 @@ unique type Record4 = ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record4 +scratch/main> view Record4 ``` ## Record with many many fields @@ -98,11 +98,11 @@ unique type Record5 = { ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> view Record5 +scratch/main> view Record5 ``` ## Record with user-defined type fields @@ -116,13 +116,13 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` ```ucm:hide -.> add +scratch/main> add ``` If you `view` or `edit` it, it _should_ be treated as a record type, but it does not (which is a bug) ```ucm -.> view RecordWithUserType +scratch/main> view RecordWithUserType ``` diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index 064e18c69..315bec4bb 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -7,7 +7,7 @@ unique type Record1 = { a : Text } ``` ```ucm -.> view Record1 +scratch/main> view Record1 type Record1 = { a : Text } @@ -19,7 +19,7 @@ unique type Record2 = { a : Text, b : Int } ``` ```ucm -.> view Record2 +scratch/main> view Record2 type Record2 = { a : Text, b : Int } @@ -31,7 +31,7 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ``` ```ucm -.> view Record3 +scratch/main> view Record3 type Record3 = { a : Text, b : Int, c : Nat } @@ -51,7 +51,7 @@ unique type Record4 = ``` ```ucm -.> view Record4 +scratch/main> view Record4 type Record4 = { a : Text, @@ -92,7 +92,7 @@ unique type Record5 = { ``` ```ucm -.> view Record5 +scratch/main> view Record5 type Record5 = { zero : Nat, @@ -131,7 +131,7 @@ unique type RecordWithUserType = { a : Text, b : Record4, c : UserType } If you `view` or `edit` it, it _should_ be treated as a record type, but it does not (which is a bug) ```ucm -.> view RecordWithUserType +scratch/main> view RecordWithUserType type RecordWithUserType = { a : Text, b : Record4, c : UserType } diff --git a/unison-src/transcripts/reset.md b/unison-src/transcripts/reset.md index a01351233..f8d18e782 100644 --- a/unison-src/transcripts/reset.md +++ b/unison-src/transcripts/reset.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` # reset loose code @@ -8,10 +8,10 @@ a = 5 ``` ```ucm -.> add -.> history -.> reset 2 -.> history +scratch/main> add +scratch/main> history +scratch/main> reset 2 +scratch/main> history ``` ```unison @@ -19,11 +19,11 @@ foo.a = 5 ``` ```ucm -.> add -.> ls foo -.> history -.> reset 1 foo -.> ls foo.foo +scratch/main> add +scratch/main> ls foo +scratch/main> history +scratch/main> reset 1 foo +scratch/main> ls foo.foo ``` # reset branch diff --git a/unison-src/transcripts/reset.output.md b/unison-src/transcripts/reset.output.md index 344b2c16f..9be437365 100644 --- a/unison-src/transcripts/reset.output.md +++ b/unison-src/transcripts/reset.output.md @@ -17,13 +17,13 @@ a = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: a : Nat -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -36,11 +36,11 @@ a = 5 □ 2. #4bigcpnl7t (start of history) -.> reset 2 +scratch/main> reset 2 Done. -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -68,17 +68,17 @@ foo.a = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo.a : Nat -.> ls foo +scratch/main> ls foo 1. a (Nat) -.> history +scratch/main> history Note: The most recent namespace hash is immediately below this message. @@ -91,11 +91,11 @@ foo.a = 5 □ 2. #4bigcpnl7t (start of history) -.> reset 1 foo +scratch/main> reset 1 foo Done. -.> ls foo.foo +scratch/main> ls foo.foo 1. a (Nat) diff --git a/unison-src/transcripts/resolution-failures.md b/unison-src/transcripts/resolution-failures.md index f6f0b0a4a..eff751b4a 100644 --- a/unison-src/transcripts/resolution-failures.md +++ b/unison-src/transcripts/resolution-failures.md @@ -15,7 +15,7 @@ two.ambiguousTerm = "term two" ``` ```ucm -.example.resolution_failures> add +scratch/main> add ``` ## Tests diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index 352e2f1c2..bca703a4e 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -31,9 +31,7 @@ two.ambiguousTerm = "term two" ``` ```ucm - ☝️ The namespace .example.resolution_failures is empty. - -.example.resolution_failures> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/rsa.md b/unison-src/transcripts/rsa.md index 6b9ed33b5..6fe211837 100644 --- a/unison-src/transcripts/rsa.md +++ b/unison-src/transcripts/rsa.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/scope-ref.md b/unison-src/transcripts/scope-ref.md index 67fcbc336..1abf26be2 100644 --- a/unison-src/transcripts/scope-ref.md +++ b/unison-src/transcripts/scope-ref.md @@ -2,7 +2,7 @@ A short script to test mutable references with local scope. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison diff --git a/unison-src/transcripts/suffixes.md b/unison-src/transcripts/suffixes.md index 3a4c47933..7245b4cb3 100644 --- a/unison-src/transcripts/suffixes.md +++ b/unison-src/transcripts/suffixes.md @@ -1,7 +1,7 @@ # Suffix-based resolution of names ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Any unique name suffix can be used to refer to a definition. For instance: @@ -20,15 +20,15 @@ optional.isNone = cases This also affects commands like find. Notice lack of qualified names in output: ```ucm -.> add -.> find take +scratch/main> add +scratch/main> find take ``` The `view` and `display` commands also benefit from this: ```ucm -.> view List.drop -.> display bar.a +scratch/main> view List.drop +scratch/main> display bar.a ``` In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name is still shown for each search result though. @@ -36,7 +36,7 @@ In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: ```ucm -.> find : Nat -> [a] -> [a] +scratch/main> find : Nat -> [a] -> [a] ``` ## Preferring names not in `lib.*.lib.*` @@ -51,7 +51,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> add +scratch/main> add ``` ```unison:error @@ -63,15 +63,15 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> view abra.cadabra -.> view baz.qux +scratch/main> view abra.cadabra +scratch/main> view baz.qux ``` Note that we can always still view indirect dependencies by using more name segments: ```ucm -.> view distributed.abra.cadabra -.> names distributed.lib.baz.qux +scratch/main> view distributed.abra.cadabra +scratch/main> names distributed.lib.baz.qux ``` ## Corner cases @@ -86,7 +86,7 @@ bar = 100 ``` ```ucm -.> add +scratch/main> add ``` ```unison diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 21aeafa44..411fdebba 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -16,14 +16,14 @@ optional.isNone = cases This also affects commands like find. Notice lack of qualified names in output: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo.bar.a : Int optional.isNone : Optional a -> Boolean -.> find take +scratch/main> find take 1. builtin.Bytes.take : Nat -> Bytes -> Bytes 2. builtin.List.take : Nat -> [a] -> [a] @@ -36,11 +36,11 @@ This also affects commands like find. Notice lack of qualified names in output: The `view` and `display` commands also benefit from this: ```ucm -.> view List.drop +scratch/main> view List.drop builtin builtin.List.drop : builtin.Nat -> [a] -> [a] -.> display bar.a +scratch/main> display bar.a +99 @@ -50,7 +50,7 @@ In the signature, we don't see `base.Nat`, just `Nat`. The full declaration name Type-based search also benefits from this, we can just say `Nat` rather than `.base.Nat`: ```ucm -.> find : Nat -> [a] -> [a] +scratch/main> find : Nat -> [a] -> [a] 1. builtin.List.drop : Nat -> [a] -> [a] 2. builtin.List.take : Nat -> [a] -> [a] @@ -85,7 +85,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -138,7 +138,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" ``` ```ucm -.> view abra.cadabra +scratch/main> view abra.cadabra cool.abra.cadabra : Text cool.abra.cadabra = "my project" @@ -146,7 +146,7 @@ lib.distributed.lib.baz.qux = "indirect dependency" lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" -.> view baz.qux +scratch/main> view baz.qux lib.distributed.baz.qux : Text lib.distributed.baz.qux = "direct dependency 2" @@ -155,12 +155,12 @@ lib.distributed.lib.baz.qux = "indirect dependency" Note that we can always still view indirect dependencies by using more name segments: ```ucm -.> view distributed.abra.cadabra +scratch/main> view distributed.abra.cadabra lib.distributed.abra.cadabra : Text lib.distributed.abra.cadabra = "direct dependency 1" -.> names distributed.lib.baz.qux +scratch/main> names distributed.lib.baz.qux Term Hash: #nhup096n2s @@ -181,7 +181,7 @@ bar = 100 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: diff --git a/unison-src/transcripts/sum-type-update-conflicts.md b/unison-src/transcripts/sum-type-update-conflicts.md index ce2993185..1abf98f3b 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.md +++ b/unison-src/transcripts/sum-type-update-conflicts.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/issues/2786 ```ucm:hide -.ns> builtins.merge +scratch/main> builtins.merge lib.builtins ``` First we add a sum-type to the codebase. @@ -13,7 +13,7 @@ structural type X = x ``` ```ucm -.ns> add +scratch/main> add ``` Now we update the type, changing the name of the constructors, _but_, we simultaneously @@ -32,5 +32,5 @@ This update should succeed since the conflicted constructor is removed in the same update that the new term is being added. ```ucm -.ns> update.old +scratch/main> update.old ``` diff --git a/unison-src/transcripts/sum-type-update-conflicts.output.md b/unison-src/transcripts/sum-type-update-conflicts.output.md index fc45a547b..493a4d940 100644 --- a/unison-src/transcripts/sum-type-update-conflicts.output.md +++ b/unison-src/transcripts/sum-type-update-conflicts.output.md @@ -19,16 +19,16 @@ structural type X = x ⍟ These new definitions are ok to `add`: structural type X - (also named builtin.Unit) + (also named lib.builtins.Unit) ``` ```ucm -.ns> add +scratch/main> add ⍟ I've added these definitions: structural type X - (also named builtin.Unit) + (also named lib.builtins.Unit) ``` Now we update the type, changing the name of the constructors, _but_, we simultaneously @@ -60,14 +60,14 @@ dependsOnX = Text.size X.x new definition: structural type X - (The old definition is also named builtin.Unit.) + (The old definition is also named lib.builtins.Unit.) ``` This update should succeed since the conflicted constructor is removed in the same update that the new term is being added. ```ucm -.ns> update.old +scratch/main> update.old ⍟ I've added these definitions: @@ -77,6 +77,6 @@ is removed in the same update that the new term is being added. ⍟ I've updated these names to your new definition: structural type X - (The old definition was also named builtin.Unit.) + (The old definition was also named lib.builtins.Unit.) ``` diff --git a/unison-src/transcripts/switch-command.md b/unison-src/transcripts/switch-command.md index c1a2bca96..13e33c858 100644 --- a/unison-src/transcripts/switch-command.md +++ b/unison-src/transcripts/switch-command.md @@ -22,8 +22,8 @@ the current project can be preceded by a forward slash (which makes it unambiguo forward slash (which makes it unambiguous). ```ucm -.> switch foo -.> switch foo/topic +scratch/main> switch foo +scratch/main> switch foo/topic foo/main> switch topic foo/main> switch /topic foo/main> switch bar/ @@ -38,11 +38,11 @@ foo/main> switch bar It's an error to try to switch to something that doesn't exist, of course. ```ucm:error -.> switch foo/no-such-branch +scratch/main> switch foo/no-such-branch ``` ```ucm:error -.> switch no-such-project +scratch/main> switch no-such-project ``` ```ucm:error diff --git a/unison-src/transcripts/switch-command.output.md b/unison-src/transcripts/switch-command.output.md index 2542da7b3..e84fefd0a 100644 --- a/unison-src/transcripts/switch-command.output.md +++ b/unison-src/transcripts/switch-command.output.md @@ -46,9 +46,9 @@ the current project can be preceded by a forward slash (which makes it unambiguo forward slash (which makes it unambiguous). ```ucm -.> switch foo +scratch/main> switch foo -.> switch foo/topic +scratch/main> switch foo/topic foo/main> switch topic @@ -74,15 +74,16 @@ foo/main> switch bar It's an error to try to switch to something that doesn't exist, of course. ```ucm -.> switch foo/no-such-branch +scratch/main> switch foo/no-such-branch foo/no-such-branch does not exist. ``` ```ucm -.> switch no-such-project +scratch/main> switch no-such-project - no-such-project does not exist. + Neither project no-such-project nor branch /no-such-project + exists. ``` ```ucm diff --git a/unison-src/transcripts/tab-completion.md b/unison-src/transcripts/tab-completion.md index c35c4ba34..c270308fa 100644 --- a/unison-src/transcripts/tab-completion.md +++ b/unison-src/transcripts/tab-completion.md @@ -5,8 +5,8 @@ Test that tab completion works as expected. ## Tab Complete Command Names ```ucm -.> debug.tab-complete vi -.> debug.tab-complete delete. +scratch/main> debug.tab-complete vi +scratch/main> debug.tab-complete delete. ``` ## Tab complete terms & types @@ -21,35 +21,43 @@ unique type subnamespace.AType = A | B ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -- Should tab complete namespaces since they may contain terms/types -.> debug.tab-complete view sub +scratch/main> debug.tab-complete view sub -- Should not complete things from child namespaces of the current query if there are other completions at this level -.> debug.tab-complete view subnamespace +scratch/main> debug.tab-complete view subnamespace -- Should complete things from child namespaces of the current query if it's dot-suffixed -.> debug.tab-complete view subnamespace. +scratch/main> debug.tab-complete view subnamespace. -- Should complete things from child namespaces of the current query if there are no more completions at this level. -.> debug.tab-complete view subnamespace2 +scratch/main> debug.tab-complete view subnamespace2 -- Should prefix-filter by query suffix -.> debug.tab-complete view subnamespace.some -.> debug.tab-complete view subnamespace.someOther +scratch/main> debug.tab-complete view subnamespace.some +scratch/main> debug.tab-complete view subnamespace.someOther +``` + +```unison:hide +absolute.term = "absolute" +``` + +```ucm +.> add -- Should tab complete absolute names -.othernamespace> debug.tab-complete view .subnamespace.some +.> debug.tab-complete view .absolute.te ``` ## Tab complete namespaces ```ucm -- Should tab complete namespaces -.> debug.tab-complete find-in sub -.> debug.tab-complete find-in subnamespace -.> debug.tab-complete find-in subnamespace. -.> debug.tab-complete io.test sub -.> debug.tab-complete io.test subnamespace -.> debug.tab-complete io.test subnamespace. +scratch/main> debug.tab-complete find-in sub +scratch/main> debug.tab-complete find-in subnamespace +scratch/main> debug.tab-complete find-in subnamespace. +scratch/main> debug.tab-complete io.test sub +scratch/main> debug.tab-complete io.test subnamespace +scratch/main> debug.tab-complete io.test subnamespace. ``` Tab Complete Delete Subcommands @@ -61,9 +69,9 @@ add b = b ``` ```ucm -.> update.old -.> debug.tab-complete delete.type Foo -.> debug.tab-complete delete.term add +scratch/main> update.old +scratch/main> debug.tab-complete delete.type Foo +scratch/main> debug.tab-complete delete.term add ``` ## Tab complete projects and branches diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 82961cfd5..c7730c17d 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -5,12 +5,12 @@ Test that tab completion works as expected. ## Tab Complete Command Names ```ucm -.> debug.tab-complete vi +scratch/main> debug.tab-complete vi view view.global -.> debug.tab-complete delete. +scratch/main> debug.tab-complete delete. delete.branch delete.namespace @@ -53,19 +53,19 @@ unique type subnamespace.AType = A | B ``` ```ucm -- Should tab complete namespaces since they may contain terms/types -.> debug.tab-complete view sub +scratch/main> debug.tab-complete view sub subnamespace. subnamespace2. -- Should not complete things from child namespaces of the current query if there are other completions at this level -.> debug.tab-complete view subnamespace +scratch/main> debug.tab-complete view subnamespace subnamespace. subnamespace2. -- Should complete things from child namespaces of the current query if it's dot-suffixed -.> debug.tab-complete view subnamespace. +scratch/main> debug.tab-complete view subnamespace. * subnamespace.AType subnamespace.AType. @@ -73,57 +73,68 @@ unique type subnamespace.AType = A | B * subnamespace.someOtherName -- Should complete things from child namespaces of the current query if there are no more completions at this level. -.> debug.tab-complete view subnamespace2 +scratch/main> debug.tab-complete view subnamespace2 subnamespace2. * subnamespace2.thing -- Should prefix-filter by query suffix -.> debug.tab-complete view subnamespace.some +scratch/main> debug.tab-complete view subnamespace.some * subnamespace.someName * subnamespace.someOtherName -.> debug.tab-complete view subnamespace.someOther +scratch/main> debug.tab-complete view subnamespace.someOther * subnamespace.someOtherName --- Should tab complete absolute names -.othernamespace> debug.tab-complete view .subnamespace.some +``` +```unison +absolute.term = "absolute" +``` - * .subnamespace.someName - * .subnamespace.someOtherName +```ucm +.> add + + ⍟ I've added these definitions: + + absolute.term : ##Text + +-- Should tab complete absolute names +.> debug.tab-complete view .absolute.te + + * .absolute.term ``` ## Tab complete namespaces ```ucm -- Should tab complete namespaces -.> debug.tab-complete find-in sub +scratch/main> debug.tab-complete find-in sub subnamespace subnamespace2 -.> debug.tab-complete find-in subnamespace +scratch/main> debug.tab-complete find-in subnamespace subnamespace subnamespace2 -.> debug.tab-complete find-in subnamespace. +scratch/main> debug.tab-complete find-in subnamespace. subnamespace.AType -.> debug.tab-complete io.test sub +scratch/main> debug.tab-complete io.test sub subnamespace. subnamespace2. -.> debug.tab-complete io.test subnamespace +scratch/main> debug.tab-complete io.test subnamespace subnamespace. subnamespace2. -.> debug.tab-complete io.test subnamespace. +scratch/main> debug.tab-complete io.test subnamespace. subnamespace.AType. * subnamespace.someName @@ -153,19 +164,19 @@ add b = b ``` ```ucm -.> update.old +scratch/main> update.old ⍟ I've added these definitions: type Foo add : a -> a -.> debug.tab-complete delete.type Foo +scratch/main> debug.tab-complete delete.type Foo * Foo Foo. -.> debug.tab-complete delete.term add +scratch/main> debug.tab-complete delete.term add * add diff --git a/unison-src/transcripts/test-command.md b/unison-src/transcripts/test-command.md index 2f95c846b..aedcb1b59 100644 --- a/unison-src/transcripts/test-command.md +++ b/unison-src/transcripts/test-command.md @@ -1,7 +1,7 @@ Merge builtins so we get enough names for the testing stuff. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` The `test` command should run all of the tests in the current directory. @@ -15,43 +15,43 @@ foo.test2 = [Ok "test2"] ``` ```ucm:hide -.> add +scratch/main> add ``` ```ucm -.> test +scratch/main> test ``` Tests should be cached if unchanged. ```ucm -.> test +scratch/main> test ``` `test` won't descend into the `lib` namespace, but `test.all` will. ```unison -testInLib : [Result] -testInLib = [Ok "testInLib"] +lib.dep.testInLib : [Result] +lib.dep.testInLib = [Ok "testInLib"] ``` ```ucm:hide -.lib> add +scratch/main> add ``` ```ucm -.> test -.> test.all +scratch/main> test +scratch/main> test.all ``` -`test` WILL run tests within `lib` if ucm is cd'd inside. +`test` WILL run tests within `lib` if specified explicitly. ```ucm -.lib> test +scratch/main> test lib.dep ``` `test` can be given a relative path, in which case it will only run tests found somewhere in that namespace. ```ucm -.> test foo +scratch/main> test foo ``` diff --git a/unison-src/transcripts/test-command.output.md b/unison-src/transcripts/test-command.output.md index a59faee54..4e2d9bafe 100644 --- a/unison-src/transcripts/test-command.output.md +++ b/unison-src/transcripts/test-command.output.md @@ -25,7 +25,7 @@ foo.test2 = [Ok "test2"] ``` ```ucm -.> test +scratch/main> test ✅ @@ -39,34 +39,34 @@ foo.test2 = [Ok "test2"] New test results: - ◉ foo.test2 test2 - ◉ test1 test1 + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 ✅ 2 test(s) passing - Tip: Use view foo.test2 to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` Tests should be cached if unchanged. ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ foo.test2 test2 - ◉ test1 test1 + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 ✅ 2 test(s) passing - Tip: Use view foo.test2 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. ```unison -testInLib : [Result] -testInLib = [Ok "testInLib"] +lib.dep.testInLib : [Result] +lib.dep.testInLib = [Ok "testInLib"] ``` ```ucm @@ -79,28 +79,28 @@ testInLib = [Ok "testInLib"] ⍟ These new definitions are ok to `add`: - testInLib : [Result] + lib.dep.testInLib : [Result] ``` ```ucm -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ foo.test2 test2 - ◉ test1 test1 + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 ✅ 2 test(s) passing - Tip: Use view foo.test2 to view the source of a test. + Tip: Use view 1 to view the source of a test. -.> test.all +scratch/main> test.all Cached test results (`help testcache` to learn more) - ◉ foo.test2 test2 - ◉ test1 test1 + 1. foo.test2 ◉ test2 + 2. test1 ◉ test1 ✅ 2 test(s) passing @@ -112,38 +112,38 @@ testInLib = [Ok "testInLib"] New test results: - ◉ lib.testInLib testInLib + 1. lib.dep.testInLib ◉ testInLib ✅ 1 test(s) passing - Tip: Use view lib.testInLib 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 ucm is cd'd inside. +`test` WILL run tests within `lib` if specified explicitly. ```ucm -.lib> test +scratch/main> test lib.dep Cached test results (`help testcache` to learn more) - ◉ testInLib testInLib + 1. lib.dep.testInLib ◉ testInLib ✅ 1 test(s) passing - Tip: Use view testInLib 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. ```ucm -.> test foo +scratch/main> test foo Cached test results (`help testcache` to learn more) - ◉ foo.test2 test2 + 1. foo.test2 ◉ test2 ✅ 1 test(s) passing - Tip: Use view foo.test2 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.md b/unison-src/transcripts/text-literals.md index 06898d145..3d3b1359a 100644 --- a/unison-src/transcripts/text-literals.md +++ b/unison-src/transcripts/text-literals.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` This transcript shows some syntax for raw text literals. @@ -37,6 +37,6 @@ lit2 = """" ``` ```ucm -.> add -.> view lit1 lit2 +scratch/main> add +scratch/main> view lit1 lit2 ``` \ No newline at end of file diff --git a/unison-src/transcripts/text-literals.output.md b/unison-src/transcripts/text-literals.output.md index efb094d98..1889ec8e7 100644 --- a/unison-src/transcripts/text-literals.output.md +++ b/unison-src/transcripts/text-literals.output.md @@ -87,14 +87,14 @@ lit2 = """" ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: lit1 : Text lit2 : Text -.> view lit1 lit2 +scratch/main> view lit1 lit2 lit1 : Text lit1 = diff --git a/unison-src/transcripts/todo-bug-builtins.md b/unison-src/transcripts/todo-bug-builtins.md index c7d88fb78..e472204d4 100644 --- a/unison-src/transcripts/todo-bug-builtins.md +++ b/unison-src/transcripts/todo-bug-builtins.md @@ -1,7 +1,7 @@ # The `todo` and `bug` builtin ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` `todo` and `bug` have type `a -> b`. They take a message or a value of type `a` and crash during runtime displaying `a` in ucm. diff --git a/unison-src/transcripts/todo.md b/unison-src/transcripts/todo.md index 097854dcc..b86a36e20 100644 --- a/unison-src/transcripts/todo.md +++ b/unison-src/transcripts/todo.md @@ -1,3 +1,11 @@ +# Nothing to do + +When there's nothing to do, `todo` says this: + +```ucm +project/main> todo +``` + # Conflicted names The todo command shows conflicted names (not demonstrated here yet because it is not easy to create them for tests, yet). diff --git a/unison-src/transcripts/todo.output.md b/unison-src/transcripts/todo.output.md index a491922c7..cfad74ec1 100644 --- a/unison-src/transcripts/todo.output.md +++ b/unison-src/transcripts/todo.output.md @@ -1,3 +1,13 @@ +# Nothing to do + +When there's nothing to do, `todo` says this: + +```ucm +project/main> todo + + You have no pending todo items. Good work! ✅ + +``` # Conflicted names The todo command shows conflicted names (not demonstrated here yet because it is not easy to create them for tests, yet). diff --git a/unison-src/transcripts/top-level-exceptions.md b/unison-src/transcripts/top-level-exceptions.md index 874998474..4caf9d717 100644 --- a/unison-src/transcripts/top-level-exceptions.md +++ b/unison-src/transcripts/top-level-exceptions.md @@ -2,13 +2,13 @@ A simple transcript to test the use of exceptions that bubble to the top level. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` FYI, here are the `Exception` and `Failure` types: ```ucm -.> view Exception Failure +scratch/main> view Exception Failure ``` Here's a sample program just to verify that the typechecker allows `run` to throw exceptions: @@ -24,9 +24,9 @@ mytest _ = [Ok "Great"] ``` ```ucm -.> run main -.> add -.> io.test mytest +scratch/main> run main +scratch/main> add +scratch/main> io.test mytest ``` Now a test to show the handling of uncaught exceptions: @@ -42,5 +42,5 @@ unique type RuntimeError = ``` ```ucm:error -.> run main2 +scratch/main> run main2 ``` diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 745e94c65..6624fbd23 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -4,7 +4,7 @@ A simple transcript to test the use of exceptions that bubble to the top level. FYI, here are the `Exception` and `Failure` types: ```ucm -.> view Exception Failure +scratch/main> view Exception Failure structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x @@ -40,26 +40,26 @@ mytest _ = [Ok "Great"] ``` ```ucm -.> run main +scratch/main> run main () -.> add +scratch/main> add ⍟ I've added these definitions: main : '{IO, Exception} () mytest : '{IO, Exception} [Result] -.> io.test mytest +scratch/main> io.test mytest New test results: - ◉ mytest Great + 1. mytest ◉ Great ✅ 1 test(s) passing - Tip: Use view mytest 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: @@ -90,7 +90,7 @@ unique type RuntimeError = ``` ```ucm -.> run main2 +scratch/main> run main2 💔💥 diff --git a/unison-src/transcripts/type-deps.md b/unison-src/transcripts/type-deps.md index 142265c78..e63b539d5 100644 --- a/unison-src/transcripts/type-deps.md +++ b/unison-src/transcripts/type-deps.md @@ -3,7 +3,7 @@ https://github.com/unisonweb/unison/pull/2821 ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` @@ -14,7 +14,7 @@ structural type Y = Y ``` ```ucm:hide -.> add +scratch/main> add ``` Now, we update `Y`, and add a new type `Z` which depends on it. @@ -26,7 +26,7 @@ structural type Y = Y Nat Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. ```ucm:error -.> add +scratch/main> add -- This shouldn't exist, because it should've been blocked. -.> view Z +scratch/main> view Z ``` diff --git a/unison-src/transcripts/type-deps.output.md b/unison-src/transcripts/type-deps.output.md index b3a18e310..ad1205e1e 100644 --- a/unison-src/transcripts/type-deps.output.md +++ b/unison-src/transcripts/type-deps.output.md @@ -36,7 +36,7 @@ structural type Y = Y Nat ``` Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`. ```ucm -.> add +scratch/main> add x These definitions failed: @@ -47,7 +47,7 @@ Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked Tip: Use `help filestatus` to learn more. -- This shouldn't exist, because it should've been blocked. -.> view Z +scratch/main> view Z ⚠️ diff --git a/unison-src/transcripts/type-modifier-are-optional.md b/unison-src/transcripts/type-modifier-are-optional.md index abce0ad0b..f0a13f59e 100644 --- a/unison-src/transcripts/type-modifier-are-optional.md +++ b/unison-src/transcripts/type-modifier-are-optional.md @@ -1,7 +1,7 @@ # Type modifiers are optional, `unique` is the default. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. diff --git a/unison-src/transcripts/unique-type-churn.md b/unison-src/transcripts/unique-type-churn.md index 904e1c480..d35b2fa09 100644 --- a/unison-src/transcripts/unique-type-churn.md +++ b/unison-src/transcripts/unique-type-churn.md @@ -9,7 +9,7 @@ unique type C = C B ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,7 +22,7 @@ unique type C = C B If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ```ucm -.> names A +scratch/main> names A ``` ```unison @@ -30,8 +30,8 @@ unique type A = A () ``` ```ucm -.> update -.> names A +scratch/main> update +scratch/main> names A ``` ```unison @@ -41,6 +41,6 @@ unique type A = A Note that `A` is back to its original hash. ```ucm -.> update -.> names A +scratch/main> update +scratch/main> names A ``` diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index bcee03f59..74076d8c6 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -24,7 +24,7 @@ unique type C = C B ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ unique type C = C B If the name stays the same, the churn is even prevented if the type is updated and then reverted to the original form. ```ucm -.> names A +scratch/main> names A Type Hash: #uj8oalgadr @@ -83,14 +83,14 @@ unique type A = A () ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names A +scratch/main> names A Type Hash: #ufo5tuc7ho @@ -124,14 +124,14 @@ unique type A = A Note that `A` is back to its original hash. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names A +scratch/main> names A Type Hash: #uj8oalgadr diff --git a/unison-src/transcripts/unitnamespace.md b/unison-src/transcripts/unitnamespace.md index 0f6838dae..c1f9f5fc5 100644 --- a/unison-src/transcripts/unitnamespace.md +++ b/unison-src/transcripts/unitnamespace.md @@ -1,10 +1,10 @@ ```unison -foo = "bar" +`()`.foo = "bar" ``` ```ucm -.`()`> add -.> find -.> find-in `()` -.> delete.namespace `()` +scratch/main> add +scratch/main> find +scratch/main> find-in `()` +scratch/main> delete.namespace `()` ``` diff --git a/unison-src/transcripts/unitnamespace.output.md b/unison-src/transcripts/unitnamespace.output.md index 9e18ea08e..a3d7b3956 100644 --- a/unison-src/transcripts/unitnamespace.output.md +++ b/unison-src/transcripts/unitnamespace.output.md @@ -1,5 +1,5 @@ ```unison -foo = "bar" +`()`.foo = "bar" ``` ```ucm @@ -12,29 +12,27 @@ foo = "bar" ⍟ These new definitions are ok to `add`: - foo : ##Text + `()`.foo : ##Text ``` ```ucm - ☝️ The namespace .`()` is empty. - -.`()`> add +scratch/main> add ⍟ I've added these definitions: - foo : ##Text + `()`.foo : ##Text -.> find +scratch/main> find 1. `()`.foo : ##Text -.> find-in `()` +scratch/main> find-in `()` 1. foo : ##Text -.> delete.namespace `()` +scratch/main> delete.namespace `()` Done. diff --git a/unison-src/transcripts/universal-cmp.md b/unison-src/transcripts/universal-cmp.md index 2364cb39c..7e41982e9 100644 --- a/unison-src/transcripts/universal-cmp.md +++ b/unison-src/transcripts/universal-cmp.md @@ -3,7 +3,7 @@ File for test cases making sure that universal equality/comparison cases exist for built-in types. Just making sure they don't crash. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -16,8 +16,8 @@ threadEyeDeez _ = ``` ```ucm -.> add -.> run threadEyeDeez +scratch/main> add +scratch/main> run threadEyeDeez ``` ```unison diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index ec03128e8..b1f07fddf 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -26,14 +26,14 @@ threadEyeDeez _ = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) -.> run threadEyeDeez +scratch/main> run threadEyeDeez (false, true) diff --git a/unison-src/transcripts/unsafe-coerce.md b/unison-src/transcripts/unsafe-coerce.md index ab3c38481..9b483f9bb 100644 --- a/unison-src/transcripts/unsafe-coerce.md +++ b/unison-src/transcripts/unsafe-coerce.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -17,7 +17,7 @@ main _ = ``` ```ucm -.> find unsafe.coerceAbilities -.> add -.> io.test main +scratch/main> find unsafe.coerceAbilities +scratch/main> add +scratch/main> io.test main ``` diff --git a/unison-src/transcripts/unsafe-coerce.output.md b/unison-src/transcripts/unsafe-coerce.output.md index 8736e6e9c..62eb29845 100644 --- a/unison-src/transcripts/unsafe-coerce.output.md +++ b/unison-src/transcripts/unsafe-coerce.output.md @@ -28,12 +28,12 @@ main _ = ``` ```ucm -.> find unsafe.coerceAbilities +scratch/main> find unsafe.coerceAbilities 1. builtin.unsafe.coerceAbilities : (a ->{e1} b) -> a -> b -.> add +scratch/main> add ⍟ I've added these definitions: @@ -41,14 +41,14 @@ main _ = fc : '{IO, Exception} Nat main : '{IO, Exception} [Result] -.> io.test main +scratch/main> io.test main New test results: - ◉ main + 1. main ◉ ✅ 1 test(s) passing - Tip: Use view main 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.md b/unison-src/transcripts/update-ignores-lib-namespace.md index 04498e48a..2db633f14 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.md @@ -3,7 +3,7 @@ the project organization convention that dependencies are put in "lib"; it's muc one's own code if the "lib" namespace is simply ignored. ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -12,7 +12,7 @@ lib.foo = 100 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 200 ``` ```ucm -.> update -.> names foo +scratch/main> update +scratch/main> names foo ``` diff --git a/unison-src/transcripts/update-ignores-lib-namespace.output.md b/unison-src/transcripts/update-ignores-lib-namespace.output.md index 5711f81a8..e7026d6f3 100644 --- a/unison-src/transcripts/update-ignores-lib-namespace.output.md +++ b/unison-src/transcripts/update-ignores-lib-namespace.output.md @@ -22,7 +22,7 @@ lib.foo = 100 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = 200 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> names foo +scratch/main> names foo Term Hash: #9ntnotdp87 diff --git a/unison-src/transcripts/update-on-conflict.md b/unison-src/transcripts/update-on-conflict.md index 21b9a656c..e36c20fdf 100644 --- a/unison-src/transcripts/update-on-conflict.md +++ b/unison-src/transcripts/update-on-conflict.md @@ -1,28 +1,27 @@ # Update on conflict +Updating conflicted definitions works fine. + ```ucm:hide -.> builtins.merge -.merged> builtins.merge +scratch/main> builtins.merge lib.builtins ``` ```unison -a.x = 1 -b.x = 2 +x = 1 +temp = 2 ``` -Cause a conflict: ```ucm -.> add -.merged> merge.old .a -.merged> merge.old .b +scratch/main> add +scratch/main> debug.alias.term.force temp x +scratch/main> delete.term temp ``` -Updating conflicted definitions works fine. - ```unison x = 3 ``` ```ucm -.merged> update +scratch/main> update +scratch/main> view x ``` diff --git a/unison-src/transcripts/update-on-conflict.output.md b/unison-src/transcripts/update-on-conflict.output.md index 6a9afd2e9..ce48e5f6c 100644 --- a/unison-src/transcripts/update-on-conflict.output.md +++ b/unison-src/transcripts/update-on-conflict.output.md @@ -1,8 +1,10 @@ # Update on conflict +Updating conflicted definitions works fine. + ```unison -a.x = 1 -b.x = 2 +x = 1 +temp = 2 ``` ```ucm @@ -15,57 +17,27 @@ b.x = 2 ⍟ These new definitions are ok to `add`: - a.x : Nat - b.x : Nat + temp : Nat + x : Nat ``` -Cause a conflict: ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: - a.x : Nat - b.x : Nat + temp : Nat + x : Nat -.merged> merge.old .a +scratch/main> debug.alias.term.force temp x - Here's what's changed in the current namespace after the - merge: - - Added definitions: - - 1. x : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. + Done. - Applying changes from patch... +scratch/main> delete.term temp -.merged> merge.old .b - - Here's what's changed in the current namespace after the - merge: - - New name conflicts: - - 1. x#gjmq673r1v : Nat - ↓ - 2. ┌ x#dcgdua2lj6 : Nat - 3. └ x#gjmq673r1v : Nat - - Tip: You can use `todo` to see if this generated any work to - do in this namespace and `test` to run the tests. Or you - can use `undo` or `reflog` to undo the results of this - merge. - - Applying changes from patch... + Done. ``` -Updating conflicted definitions works fine. - ```unison x = 3 ``` @@ -85,11 +57,16 @@ x = 3 ``` ```ucm -.merged> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. +scratch/main> view x + + x : Nat + x = 3 + ``` diff --git a/unison-src/transcripts/update-term-aliases-in-different-ways.md b/unison-src/transcripts/update-term-aliases-in-different-ways.md index fd8a8816c..e99deb63b 100644 --- a/unison-src/transcripts/update-term-aliases-in-different-ways.md +++ b/unison-src/transcripts/update-term-aliases-in-different-ways.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -23,6 +23,6 @@ bar = 7 ``` ```ucm -.> update -.> view foo bar +scratch/main> update +scratch/main> view foo bar ``` diff --git a/unison-src/transcripts/update-term-aliases-in-different-ways.output.md b/unison-src/transcripts/update-term-aliases-in-different-ways.output.md index 2d7960976..10e8303ca 100644 --- a/unison-src/transcripts/update-term-aliases-in-different-ways.output.md +++ b/unison-src/transcripts/update-term-aliases-in-different-ways.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -61,14 +61,14 @@ bar = 7 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo bar +scratch/main> view foo bar bar : Nat bar = 7 diff --git a/unison-src/transcripts/update-term-to-different-type.md b/unison-src/transcripts/update-term-to-different-type.md index 3fa5a735f..31859e3a1 100644 --- a/unison-src/transcripts/update-term-to-different-type.md +++ b/unison-src/transcripts/update-term-to-different-type.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,6 +17,6 @@ foo = +5 ``` ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-term-to-different-type.output.md b/unison-src/transcripts/update-term-to-different-type.output.md index 7f6bf57cc..b1cad29f4 100644 --- a/unison-src/transcripts/update-term-to-different-type.output.md +++ b/unison-src/transcripts/update-term-to-different-type.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -23,7 +23,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = +5 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Int foo = +5 diff --git a/unison-src/transcripts/update-term-with-alias.md b/unison-src/transcripts/update-term-with-alias.md index b3c5e9e79..e45eb8b76 100644 --- a/unison-src/transcripts/update-term-with-alias.md +++ b/unison-src/transcripts/update-term-with-alias.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 6 ``` ```ucm -.> update -.> view foo bar +scratch/main> update +scratch/main> view foo bar ``` diff --git a/unison-src/transcripts/update-term-with-alias.output.md b/unison-src/transcripts/update-term-with-alias.output.md index abf21943a..785a5e0d6 100644 --- a/unison-src/transcripts/update-term-with-alias.output.md +++ b/unison-src/transcripts/update-term-with-alias.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -56,14 +56,14 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo bar +scratch/main> view foo bar bar : Nat bar = 5 diff --git a/unison-src/transcripts/update-term-with-dependent-to-different-type.md b/unison-src/transcripts/update-term-with-dependent-to-different-type.md index c9d6388dc..b7bd1196a 100644 --- a/unison-src/transcripts/update-term-with-dependent-to-different-type.md +++ b/unison-src/transcripts/update-term-with-dependent-to-different-type.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,5 +20,5 @@ foo = +5 ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md b/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md index 1a62cebf4..c2357e31e 100644 --- a/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md +++ b/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ foo = +5 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-term-with-dependent.md b/unison-src/transcripts/update-term-with-dependent.md index d7aa6b3db..402138857 100644 --- a/unison-src/transcripts/update-term-with-dependent.md +++ b/unison-src/transcripts/update-term-with-dependent.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -11,7 +11,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -20,6 +20,6 @@ foo = 6 ``` ```ucm -.> update -.> view bar +scratch/main> update +scratch/main> view bar ``` diff --git a/unison-src/transcripts/update-term-with-dependent.output.md b/unison-src/transcripts/update-term-with-dependent.output.md index dc2d66f72..9acbb2b7b 100644 --- a/unison-src/transcripts/update-term-with-dependent.output.md +++ b/unison-src/transcripts/update-term-with-dependent.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -27,7 +27,7 @@ bar = foo + 10 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -55,7 +55,7 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -66,7 +66,7 @@ foo = 6 Done. -.> view bar +scratch/main> view bar bar : Nat bar = diff --git a/unison-src/transcripts/update-term.md b/unison-src/transcripts/update-term.md index 0fbb55357..0cdc0e86f 100644 --- a/unison-src/transcripts/update-term.md +++ b/unison-src/transcripts/update-term.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -8,7 +8,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,6 +17,6 @@ foo = 6 ``` ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-term.output.md b/unison-src/transcripts/update-term.output.md index 1a641671e..26bb87579 100644 --- a/unison-src/transcripts/update-term.output.md +++ b/unison-src/transcripts/update-term.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -23,7 +23,7 @@ foo = 5 ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -50,14 +50,14 @@ foo = 6 ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Nat foo = 6 diff --git a/unison-src/transcripts/update-test-to-non-test.md b/unison-src/transcripts/update-test-to-non-test.md index a25ad0d3e..0c2ba33f8 100644 --- a/unison-src/transcripts/update-test-to-non-test.md +++ b/unison-src/transcripts/update-test-to-non-test.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge ``` ```unison @@ -9,8 +9,8 @@ test> foo = [] After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ```ucm -.> add -.> view foo +scratch/main> add +scratch/main> view foo ``` ```unison @@ -20,6 +20,6 @@ foo = 1 After updating `foo` to not be a test, we expect `view` to not render it like a test. ```ucm -.> update -.> view foo +scratch/main> update +scratch/main> view foo ``` diff --git a/unison-src/transcripts/update-test-to-non-test.output.md b/unison-src/transcripts/update-test-to-non-test.output.md index a3a016e73..f08dd4bb9 100644 --- a/unison-src/transcripts/update-test-to-non-test.output.md +++ b/unison-src/transcripts/update-test-to-non-test.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.merge +scratch/main> builtins.merge Done. @@ -30,13 +30,13 @@ test> foo = [] After adding the test `foo`, we expect `view` to render it like a test. (Bug: It doesn't.) ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: foo : [Result] -.> view foo +scratch/main> view foo foo : [Result] foo = [] @@ -63,14 +63,14 @@ foo = 1 After updating `foo` to not be a test, we expect `view` to not render it like a test. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view foo +scratch/main> view foo foo : Nat foo = 1 diff --git a/unison-src/transcripts/update-test-watch-roundtrip.md b/unison-src/transcripts/update-test-watch-roundtrip.md index a3ea386ef..135412df6 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.md @@ -1,6 +1,6 @@ ```ucm:hide -.> builtins.merge +scratch/main> builtins.merge ``` Given a test that depends on another definition, @@ -14,7 +14,7 @@ test> mynamespace.foo.test = ``` ```ucm -.> add +scratch/main> add ``` if we change the type of the dependency, the test should show in the scratch file as a test watch. @@ -24,5 +24,5 @@ foo n = "hello, world!" ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-test-watch-roundtrip.output.md b/unison-src/transcripts/update-test-watch-roundtrip.output.md index b3db6133d..2f1959eb5 100644 --- a/unison-src/transcripts/update-test-watch-roundtrip.output.md +++ b/unison-src/transcripts/update-test-watch-roundtrip.output.md @@ -10,7 +10,7 @@ test> mynamespace.foo.test = ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -39,7 +39,7 @@ foo n = "hello, world!" ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-add-constructor.md b/unison-src/transcripts/update-type-add-constructor.md index b801106c2..1decf3015 100644 --- a/unison-src/transcripts/update-type-add-constructor.md +++ b/unison-src/transcripts/update-type-add-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index d0fb21a38..4064cbf3d 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -17,7 +17,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,18 +45,18 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat | Baz Nat Nat -.> find.verbose +scratch/main> find.verbose 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog type Foo diff --git a/unison-src/transcripts/update-type-add-field.md b/unison-src/transcripts/update-type-add-field.md index 13a388e1b..cdd41c338 100644 --- a/unison-src/transcripts/update-type-add-field.md +++ b/unison-src/transcripts/update-type-add-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 7ee979d64..6ba047164 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -16,7 +16,7 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -42,18 +42,18 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat Nat -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-add-new-record.md b/unison-src/transcripts/update-type-add-new-record.md index 0d311ec1e..a7f82df0c 100644 --- a/unison-src/transcripts/update-type-add-new-record.md +++ b/unison-src/transcripts/update-type-add-new-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.lib> builtins.merge +scratch/main> builtins.merge lib.builtins ``` ```unison @@ -7,6 +7,6 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update -.> view Foo +scratch/main> update +scratch/main> view Foo ``` diff --git a/unison-src/transcripts/update-type-add-new-record.output.md b/unison-src/transcripts/update-type-add-new-record.output.md index 8c00d6c1d..321ac28ec 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -19,14 +19,14 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat } diff --git a/unison-src/transcripts/update-type-add-record-field.md b/unison-src/transcripts/update-type-add-record-field.md index ef5aba361..d4edf079e 100644 --- a/unison-src/transcripts/update-type-add-record-field.md +++ b/unison-src/transcripts/update-type-add-record-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-add-record-field.output.md b/unison-src/transcripts/update-type-add-record-field.output.md index 3f52ad6a8..d0a7a700e 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -19,7 +19,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -57,18 +57,18 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat, baz : Int } -.> find.verbose +scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-constructor-alias.md b/unison-src/transcripts/update-type-constructor-alias.md index 2d5f97ef2..50d55af06 100644 --- a/unison-src/transcripts/update-type-constructor-alias.md +++ b/unison-src/transcripts/update-type-constructor-alias.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> alias.term Foo.Bar Foo.BarAlias +scratch/main> add +scratch/main> alias.term Foo.Bar Foo.BarAlias ``` ```unison @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. ```ucm -.> update -.> find.verbose +scratch/main> update +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index 44d683227..21cea73a9 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> alias.term Foo.Bar Foo.BarAlias +scratch/main> alias.term Foo.Bar Foo.BarAlias Done. @@ -48,14 +48,14 @@ unique type Foo = Bar Nat Nat Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-delete-constructor-with-dependent.md b/unison-src/transcripts/update-type-delete-constructor-with-dependent.md index b44cf8a7a..3c7be50a5 100644 --- a/unison-src/transcripts/update-type-delete-constructor-with-dependent.md +++ b/unison-src/transcripts/update-type-delete-constructor-with-dependent.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -14,7 +14,7 @@ foo = cases ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -23,5 +23,5 @@ unique type Foo ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md b/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md index 9966a3241..f443c3426 100644 --- a/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md +++ b/unison-src/transcripts/update-type-delete-constructor-with-dependent.output.md @@ -24,7 +24,7 @@ foo = cases ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -52,7 +52,7 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-delete-constructor.md b/unison-src/transcripts/update-type-delete-constructor.md index cf348f690..18a8295d5 100644 --- a/unison-src/transcripts/update-type-delete-constructor.md +++ b/unison-src/transcripts/update-type-delete-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -9,7 +9,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index c417d5f15..1aa01c8a5 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -18,7 +18,7 @@ unique type Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,18 +45,18 @@ unique type Foo ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-delete-record-field.md b/unison-src/transcripts/update-type-delete-record-field.md index de6396e0c..cd3520e8b 100644 --- a/unison-src/transcripts/update-type-delete-record-field.md +++ b/unison-src/transcripts/update-type-delete-record-field.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -17,7 +17,7 @@ unique type Foo = { bar : Nat } We want the field accessors to go away; but for now they are here, causing the update to fail. ```ucm:error -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-delete-record-field.output.md b/unison-src/transcripts/update-type-delete-record-field.output.md index a5b570d6d..e2691b814 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -22,7 +22,7 @@ unique type Foo = { bar : Nat, baz : Int } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -59,7 +59,7 @@ unique type Foo = { bar : Nat } We want the field accessors to go away; but for now they are here, causing the update to fail. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -70,11 +70,11 @@ We want the field accessors to go away; but for now they are here, causing the u definitions that need fixing. Once the file is compiling, try `update` again. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat, baz : Int } -.> find.verbose +scratch/main> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 type Foo diff --git a/unison-src/transcripts/update-type-missing-constructor.md b/unison-src/transcripts/update-type-missing-constructor.md index bfaafa834..5fa29c2a8 100644 --- a/unison-src/transcripts/update-type-missing-constructor.md +++ b/unison-src/transcripts/update-type-missing-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> delete.term Foo.Bar +scratch/main> add +scratch/main> delete.term Foo.Bar ``` Now we've set up a situation where the original constructor missing. @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat ``` ```ucm:error -.> view Foo -.> update +scratch/main> view Foo +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index 52ead472e..59df270a5 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> delete.term Foo.Bar +scratch/main> delete.term Foo.Bar Done. @@ -48,11 +48,11 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> view Foo +scratch/main> view Foo type Foo = #b509v3eg4k#0 Nat -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.md b/unison-src/transcripts/update-type-nested-decl-aliases.md index a51c9a2c1..03b20f6fd 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ structural type A = B.TheOtherAlias Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -22,5 +22,5 @@ only one name for each constructor. We instead get too far in the update process file to stare at. ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-nested-decl-aliases.output.md b/unison-src/transcripts/update-type-nested-decl-aliases.output.md index 0b373c88c..afddbf3de 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -21,7 +21,7 @@ structural type A = B.TheOtherAlias Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -53,7 +53,7 @@ only one name for each constructor. We instead get too far in the update process file to stare at. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-no-op-record.md b/unison-src/transcripts/update-type-no-op-record.md index 50a559819..e9ec904c9 100644 --- a/unison-src/transcripts/update-type-no-op-record.md +++ b/unison-src/transcripts/update-type-no-op-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,11 +7,11 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ``` Bug: this no-op update should (of course) succeed. ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-no-op-record.output.md b/unison-src/transcripts/update-type-no-op-record.output.md index 1a7e55eb7..8d46e420c 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -19,7 +19,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -32,7 +32,7 @@ unique type Foo = { bar : Nat } Bug: this no-op update should (of course) succeed. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.md b/unison-src/transcripts/update-type-stray-constructor-alias.md index 847a37e32..8bd4ba362 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> alias.term Foo.Bar Stray.BarAlias +scratch/main> add +scratch/main> alias.term Foo.Bar Stray.BarAlias ``` ```unison @@ -18,6 +18,6 @@ unique type Foo = Bar Nat Nat Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. ```ucm -.> update -.> find.verbose +scratch/main> update +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-stray-constructor-alias.output.md b/unison-src/transcripts/update-type-stray-constructor-alias.output.md index e9fe5f966..0e906b70d 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> alias.term Foo.Bar Stray.BarAlias +scratch/main> alias.term Foo.Bar Stray.BarAlias Done. @@ -48,14 +48,14 @@ unique type Foo = Bar Nat Nat Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> find.verbose +scratch/main> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g type Foo diff --git a/unison-src/transcripts/update-type-stray-constructor.md b/unison-src/transcripts/update-type-stray-constructor.md index 183818e56..7808f759b 100644 --- a/unison-src/transcripts/update-type-stray-constructor.md +++ b/unison-src/transcripts/update-type-stray-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,8 +7,8 @@ unique type Foo = Bar Nat ``` ```ucm -.> add -.> move.term Foo.Bar Stray.Bar +scratch/main> add +scratch/main> move.term Foo.Bar Stray.Bar ``` Now we've set up a situation where the constructor is not where it's supposed to be; it's somewhere else. @@ -20,6 +20,6 @@ unique type Foo = Bar Nat Nat Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) doesn't really exist, it's just showing up due to a pretty-printer bug. ```ucm:error -.> view Foo -.> update +scratch/main> view Foo +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index 8f72beefd..a76b034b4 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -16,13 +16,13 @@ unique type Foo = Bar Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: type Foo -.> move.term Foo.Bar Stray.Bar +scratch/main> move.term Foo.Bar Stray.Bar Done. @@ -50,11 +50,11 @@ unique type Foo = Bar Nat Nat Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) doesn't really exist, it's just showing up due to a pretty-printer bug. ```ucm -.> view Foo +scratch/main> view Foo type Foo = Stray.Bar Nat -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md index 1debc0aaf..1f2933242 100644 --- a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md +++ b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ makeFoo n = Bar (n+10) ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -21,7 +21,7 @@ Foo.Bar n = internal.Bar n ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md index a28e27e74..a00b5dde6 100644 --- a/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md +++ b/unison-src/transcripts/update-type-turn-constructor-into-smart-constructor.output.md @@ -20,7 +20,7 @@ makeFoo n = Bar (n+10) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -51,7 +51,7 @@ Foo.Bar n = internal.Bar n ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -62,11 +62,11 @@ Foo.Bar n = internal.Bar n Done. -.> view Foo +scratch/main> view Foo type Foo = internal.Bar Nat -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.md b/unison-src/transcripts/update-type-turn-non-record-into-record.md index b570aa5f7..829240ff6 100644 --- a/unison-src/transcripts/update-type-turn-non-record-into-record.md +++ b/unison-src/transcripts/update-type-turn-non-record-into-record.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -7,7 +7,7 @@ unique type Foo = Nat ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,7 +15,7 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update -.> view Foo -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md b/unison-src/transcripts/update-type-turn-non-record-into-record.output.md index f23ab09cd..fb1f2dd2c 100644 --- a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md +++ b/unison-src/transcripts/update-type-turn-non-record-into-record.output.md @@ -16,7 +16,7 @@ unique type Foo = Nat ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -48,18 +48,18 @@ unique type Foo = { bar : Nat } ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... Done. -.> view Foo +scratch/main> view Foo type Foo = { bar : Nat } -.> find.verbose +scratch/main> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 type Foo diff --git a/unison-src/transcripts/update-type-with-dependent-term.md b/unison-src/transcripts/update-type-with-dependent-term.md index 99bfcceac..300eddc69 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.md +++ b/unison-src/transcripts/update-type-with-dependent-term.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -10,7 +10,7 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -18,5 +18,5 @@ unique type Foo = Bar Nat Nat ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-with-dependent-term.output.md b/unison-src/transcripts/update-type-with-dependent-term.output.md index e8837eb52..1ab2b586b 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -20,7 +20,7 @@ incrFoo = cases Bar n -> Bar (n+1) ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -47,7 +47,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md index 7c5a5018b..1caef319d 100644 --- a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md +++ b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -16,5 +16,5 @@ unique type Foo a = Bar Nat a ``` ```ucm:error -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md index e105b39ea..edc63c214 100644 --- a/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type-to-different-kind.output.md @@ -18,7 +18,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,7 +45,7 @@ unique type Foo a = Bar Nat a ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/update-type-with-dependent-type.md b/unison-src/transcripts/update-type-with-dependent-type.md index 7dea36732..4b6e8aa2d 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.md +++ b/unison-src/transcripts/update-type-with-dependent-type.md @@ -1,5 +1,5 @@ ```ucm:hide -.> builtins.merge lib.builtin +scratch/main> builtins.merge lib.builtin ``` ```unison @@ -8,7 +8,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -16,8 +16,8 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update -.> view Foo -.> view Baz -.> find.verbose +scratch/main> update +scratch/main> view Foo +scratch/main> view Baz +scratch/main> find.verbose ``` diff --git a/unison-src/transcripts/update-type-with-dependent-type.output.md b/unison-src/transcripts/update-type-with-dependent-type.output.md index 47988e1ff..2523eed7d 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -18,7 +18,7 @@ unique type Baz = Qux Foo ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -45,7 +45,7 @@ unique type Foo = Bar Nat Nat ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... @@ -56,15 +56,15 @@ unique type Foo = Bar Nat Nat Done. -.> view Foo +scratch/main> view Foo type Foo = Bar Nat Nat -.> view Baz +scratch/main> view Baz type Baz = Qux Foo -.> find.verbose +scratch/main> find.verbose 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 type Baz diff --git a/unison-src/transcripts/update-watch.md b/unison-src/transcripts/update-watch.md index 6637515ff..013801ebb 100644 --- a/unison-src/transcripts/update-watch.md +++ b/unison-src/transcripts/update-watch.md @@ -3,5 +3,5 @@ ``` ```ucm -.> update +scratch/main> update ``` diff --git a/unison-src/transcripts/update-watch.output.md b/unison-src/transcripts/update-watch.output.md index e97d32f9e..c9c951045 100644 --- a/unison-src/transcripts/update-watch.output.md +++ b/unison-src/transcripts/update-watch.output.md @@ -19,7 +19,7 @@ ``` ```ucm -.> update +scratch/main> update Okay, I'm searching the branch for code that needs to be updated... diff --git a/unison-src/transcripts/watch-expressions.md b/unison-src/transcripts/watch-expressions.md index e17d789a5..b4f54004b 100644 --- a/unison-src/transcripts/watch-expressions.md +++ b/unison-src/transcripts/watch-expressions.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio ``` ```unison @@ -7,7 +7,7 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ``` ```unison @@ -15,8 +15,8 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add -.> test +scratch/main> add +scratch/main> test ``` ```unison diff --git a/unison-src/transcripts/watch-expressions.output.md b/unison-src/transcripts/watch-expressions.output.md index 3a12bbcac..589b70833 100644 --- a/unison-src/transcripts/watch-expressions.output.md +++ b/unison-src/transcripts/watch-expressions.output.md @@ -1,5 +1,5 @@ ```ucm -.> builtins.mergeio +scratch/main> builtins.mergeio Done. @@ -29,7 +29,7 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ⍟ I've added these definitions: @@ -56,19 +56,19 @@ test> pass = [Ok "Passed"] ``` ```ucm -.> add +scratch/main> add ⊡ Ignored previously added definitions: pass -.> test +scratch/main> test Cached test results (`help testcache` to learn more) - ◉ pass Passed + 1. pass ◉ Passed ✅ 1 test(s) passing - Tip: Use view pass to view the source of a test. + Tip: Use view 1 to view the source of a test. ``` ```unison