From 07eed387b7c0bb984cdd1f616541005ff997ce5d Mon Sep 17 00:00:00 2001 From: unorsk Date: Fri, 22 Dec 2023 08:51:39 +0000 Subject: [PATCH 1/9] automatically run ormolu --- unison-cli/src/Unison/Codebase/Editor/HandleInput.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs b/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs index 907df00f38..b12f86af79 100644 --- a/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs +++ b/unison-cli/src/Unison/Codebase/Editor/HandleInput.hs @@ -84,6 +84,7 @@ import Unison.Codebase.Editor.HandleInput.Projects (handleProjects) import Unison.Codebase.Editor.HandleInput.Pull (doPullRemoteBranch, mergeBranchAndPropagateDefaultPatch, propagatePatch) import Unison.Codebase.Editor.HandleInput.Push (handleGist, handlePushRemoteBranch) import Unison.Codebase.Editor.HandleInput.ReleaseDraft (handleReleaseDraft) +import Unison.Codebase.Editor.HandleInput.Run (handleRun) import Unison.Codebase.Editor.HandleInput.RuntimeUtils qualified as RuntimeUtils import Unison.Codebase.Editor.HandleInput.TermResolution (resolveCon, resolveMainRef, resolveTermRef) import Unison.Codebase.Editor.HandleInput.Tests qualified as Tests @@ -204,7 +205,6 @@ import Unison.Var (Var) import Unison.Var qualified as Var import Unison.WatchKind qualified as WK import Witch (unsafeFrom) -import Unison.Codebase.Editor.HandleInput.Run (handleRun) ------------------------------------------------------------------------------------------------------------------------ -- Main loop From 3c9629b78d1c05269f212a45d7fe6d172fbb9d4e Mon Sep 17 00:00:00 2001 From: unorsk Date: Fri, 29 Dec 2023 12:03:47 +0000 Subject: [PATCH 2/9] automatically run ormolu --- unison-cli/src/Unison/CommandLine/OutputMessages.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unison-cli/src/Unison/CommandLine/OutputMessages.hs b/unison-cli/src/Unison/CommandLine/OutputMessages.hs index e1d177c4c5..30bebb1441 100644 --- a/unison-cli/src/Unison/CommandLine/OutputMessages.hs +++ b/unison-cli/src/Unison/CommandLine/OutputMessages.hs @@ -2921,7 +2921,7 @@ renderEditConflicts ppe Patch {..} = do then "deprecated and also replaced with" else "replaced with" ) - `P.hang` P.lines replacements + `P.hang` P.lines replacements formatTermEdits :: (Reference.TermReference, Set TermEdit.TermEdit) -> Numbered Pretty @@ -2936,7 +2936,7 @@ renderEditConflicts ppe Patch {..} = do then "deprecated and also replaced with" else "replaced with" ) - `P.hang` P.lines replacements + `P.hang` P.lines replacements formatConflict :: Either (Reference, Set TypeEdit.TypeEdit) From c99c3a5bf87a87324489c31aa9298b081ea9b010 Mon Sep 17 00:00:00 2001 From: andrii <25188+unorsk@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:27:35 +0100 Subject: [PATCH 3/9] use unique as default type modifier (when no modifier specified) --- .../src/Unison/Syntax/DeclParser.hs | 34 +++++++++++++++---- .../src/Unison/Syntax/DeclPrinter.hs | 3 +- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/parser-typechecker/src/Unison/Syntax/DeclParser.hs b/parser-typechecker/src/Unison/Syntax/DeclParser.hs index 07e4c1b272..172509e7b9 100644 --- a/parser-typechecker/src/Unison/Syntax/DeclParser.hs +++ b/parser-typechecker/src/Unison/Syntax/DeclParser.hs @@ -93,9 +93,18 @@ resolveUnresolvedModifier unresolvedModifier var = UnresolvedModifier'Structural -> pure (DD.Structural <$ unresolvedModifier) UnresolvedModifier'UniqueWithGuid guid -> pure (DD.Unique guid <$ unresolvedModifier) UnresolvedModifier'UniqueWithoutGuid guid0 -> do - ParsingEnv {uniqueTypeGuid} <- ask - guid <- fromMaybe guid0 <$> lift (lift (uniqueTypeGuid (Name.unsafeFromVar var))) - pure (DD.Unique guid <$ unresolvedModifier) + unique <- resolveUniqueModifier var guid0 + pure $ unique <$ unresolvedModifier + +resolveUniqueModifier :: (Monad m, Var v) => v -> Text -> P v m DD.Modifier +resolveUniqueModifier var guid0 = do + ParsingEnv {uniqueTypeGuid} <- ask + guid <- fromMaybe guid0 <$> lift (lift (uniqueTypeGuid (Name.unsafeFromVar var))) + pure $ DD.Unique guid + +defaultUniqueModifier :: (Monad m, Var v) => v -> P v m DD.Modifier +defaultUniqueModifier var = + uniqueName 32 >>= resolveUniqueModifier var -- unique[someguid] type Blah = ... modifier :: (Monad m, Var v) => P v m (Maybe (L.Token UnresolvedModifier)) @@ -132,7 +141,7 @@ dataDeclaration :: Maybe (L.Token UnresolvedModifier) -> P v m (v, DataDeclaration v Ann, Accessors v) dataDeclaration maybeUnresolvedModifier = do - keywordTok <- fmap void (reserved "type") <|> openBlockWith "type" + _ <- fmap void (reserved "type") <|> openBlockWith "type" (name, typeArgs) <- (,) <$> TermParser.verifyRelativeVarName prefixDefinitionName @@ -181,7 +190,13 @@ dataDeclaration maybeUnresolvedModifier = do closingAnn :: Ann closingAnn = last (ann eq : ((\(_, _, t) -> ann t) <$> constructors)) case maybeUnresolvedModifier of - Nothing -> P.customFailure $ MissingTypeModifier ("type" <$ keywordTok) name + Nothing -> do + modifier <- defaultUniqueModifier (L.payload name) + pure + ( L.payload name, + DD.mkDataDecl' modifier closingAnn typeArgVs constructors, + accessors + ) Just unresolvedModifier -> do modifier <- resolveUnresolvedModifier unresolvedModifier (L.payload name) pure @@ -196,7 +211,7 @@ effectDeclaration :: Maybe (L.Token UnresolvedModifier) -> P v m (v, EffectDeclaration v Ann) effectDeclaration maybeUnresolvedModifier = do - keywordTok <- fmap void (reserved "ability") <|> openBlockWith "ability" + _ <- fmap void (reserved "ability") <|> openBlockWith "ability" name <- TermParser.verifyRelativeVarName prefixDefinitionName typeArgs <- many (TermParser.verifyRelativeVarName prefixDefinitionName) let typeArgVs = L.payload <$> typeArgs @@ -208,7 +223,12 @@ effectDeclaration maybeUnresolvedModifier = do last $ ann blockStart : ((\(_, _, t) -> ann t) <$> constructors) case maybeUnresolvedModifier of - Nothing -> P.customFailure $ MissingTypeModifier ("ability" <$ keywordTok) name + Nothing -> do + modifier <- defaultUniqueModifier (L.payload name) + pure + ( L.payload name, + DD.mkEffectDecl' modifier closingAnn typeArgVs constructors + ) Just unresolvedModifier -> do modifier <- resolveUnresolvedModifier unresolvedModifier (L.payload name) pure diff --git a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs index 9b3011bba9..26fef94b59 100644 --- a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs +++ b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs @@ -199,8 +199,7 @@ fieldNames env r name dd = do prettyModifier :: DD.Modifier -> Pretty SyntaxText prettyModifier DD.Structural = fmt S.DataTypeModifier "structural" -prettyModifier (DD.Unique _uid) = - fmt S.DataTypeModifier "unique" -- <> ("[" <> P.text uid <> "] ") +prettyModifier (DD.Unique _uid) = mempty -- don't print anything since 'unique' is the default prettyDataHeader :: (Var v) => HQ.HashQualified Name -> DD.DataDeclaration v a -> Pretty SyntaxText From 4456c95c7ae64ab7eeab57a2317e50fedf543e7d Mon Sep 17 00:00:00 2001 From: andrii <25188+unorsk@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:42:12 +0100 Subject: [PATCH 4/9] Fixing test for type modifiers, updating trnscripts --- .../all-base-hashes.output.md | 80 +++++++++---------- .../binary-encoding-nats.output.md | 4 +- .../transcripts-using-base/doc.output.md | 11 +-- .../transcripts-using-base/fix2297.output.md | 12 +-- unison-src/transcripts/abilities.output.md | 4 +- ...ability-order-doesnt-affect-hash.output.md | 8 +- ...ability-term-conflicts-on-update.output.md | 8 +- unison-src/transcripts/alias-many.output.md | 46 +++++------ .../transcripts/deleteReplacements.output.md | 20 ++--- .../transcripts/diff-namespace.output.md | 10 +-- unison-src/transcripts/docs.output.md | 2 +- unison-src/transcripts/find-by-type.output.md | 2 +- .../transcripts/fix-big-list-crash.output.md | 2 +- unison-src/transcripts/fix1696.output.md | 8 +- unison-src/transcripts/fix1844.output.md | 4 +- unison-src/transcripts/fix2049.output.md | 4 +- unison-src/transcripts/fix2254.output.md | 6 +- unison-src/transcripts/fix2268.output.md | 4 +- unison-src/transcripts/fix2344.output.md | 2 +- unison-src/transcripts/fix2350.output.md | 2 +- unison-src/transcripts/fix2353.output.md | 4 +- unison-src/transcripts/fix2378.output.md | 6 +- unison-src/transcripts/fix2628.output.md | 2 +- unison-src/transcripts/fix2712.output.md | 4 +- unison-src/transcripts/fix2840.output.md | 6 +- unison-src/transcripts/fix3196.output.md | 2 +- unison-src/transcripts/fix3759.output.md | 6 +- unison-src/transcripts/fix4415.output.md | 4 +- unison-src/transcripts/fix4424.output.md | 4 +- unison-src/transcripts/fix4482.output.md | 2 +- unison-src/transcripts/higher-rank.output.md | 6 +- .../transcripts/kind-inference.output.md | 16 ++-- .../ls-pretty-print-scope-bug.output.md | 8 +- unison-src/transcripts/move-all.output.md | 10 +-- .../transcripts/move-namespace.output.md | 6 +- .../transcripts/name-selection.output.md | 46 +++++------ .../pattern-match-coverage.output.md | 30 +++---- unison-src/transcripts/propagate.output.md | 10 +-- unison-src/transcripts/records.output.md | 12 +-- .../transcripts/resolution-failures.output.md | 8 +- unison-src/transcripts/suffixes.output.md | 4 +- .../transcripts/tab-completion.output.md | 6 +- .../top-level-exceptions.output.md | 4 +- ...uired.md => type-modifier-are-optional.md} | 10 +-- ...d => type-modifier-are-optional.output.md} | 36 ++++----- .../transcripts/unique-type-churn.output.md | 16 ++-- .../transcripts/universal-cmp.output.md | 4 +- .../update-type-add-constructor.output.md | 10 +-- .../update-type-add-field.output.md | 10 +-- .../update-type-add-new-record.output.md | 4 +- .../update-type-add-record-field.output.md | 10 +-- .../update-type-constructor-alias.output.md | 8 +- ...elete-constructor-with-dependent.output.md | 8 +- .../update-type-delete-constructor.output.md | 10 +-- .../update-type-delete-record-field.output.md | 12 +-- .../update-type-missing-constructor.output.md | 8 +- .../update-type-nested-decl-aliases.output.md | 8 +- .../update-type-no-op-record.output.md | 4 +- ...ate-type-stray-constructor-alias.output.md | 8 +- .../update-type-stray-constructor.output.md | 8 +- ...nstructor-into-smart-constructor.output.md | 8 +- ...type-turn-non-record-into-record.output.md | 10 +-- .../update-type-with-dependent-term.output.md | 8 +- ...dependent-type-to-different-kind.output.md | 14 ++-- .../update-type-with-dependent-type.output.md | 18 ++--- 65 files changed, 332 insertions(+), 345 deletions(-) rename unison-src/transcripts/{type-modifier-required.md => type-modifier-are-optional.md} (58%) rename unison-src/transcripts/{type-modifier-required.output.md => type-modifier-are-optional.output.md} (51%) 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 e46f81d1c9..3c027adfa9 100644 --- a/unison-src/transcripts-using-base/all-base-hashes.output.md +++ b/unison-src/transcripts-using-base/all-base-hashes.output.md @@ -29,7 +29,7 @@ This transcript is intended to make visible accidental changes to the hashing al bSplit : [(a, b)] -> a -> ([(a, b)], [(a, b)]) 9. -- #1j3e8vsn97qrprjr69ls6llab601sdh577uuvtu8pafmngf59suakbjr7asheadidcj3red140fnmdagsv9ihhdar1mc05ig28jtfr0 - unique type builtin.ANSI.Color + type builtin.ANSI.Color 10. -- #1j3e8vsn97qrprjr69ls6llab601sdh577uuvtu8pafmngf59suakbjr7asheadidcj3red140fnmdagsv9ihhdar1mc05ig28jtfr0#0 builtin.ANSI.Color.Black : Color @@ -89,7 +89,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Any.unsafeExtract : Any -> a 29. -- #345f3nptqq1c1ped6gq8578kb2bhp1jejnqborsn6fq59rpe1rren3ogia9o9u8oc339vll953inma8pocc686ooknaitud8i5m27vg - unique type builtin.Author + type builtin.Author 30. -- #345f3nptqq1c1ped6gq8578kb2bhp1jejnqborsn6fq59rpe1rren3ogia9o9u8oc339vll953inma8pocc686ooknaitud8i5m27vg#0 builtin.Author.Author : GUID -> Text -> Author @@ -345,7 +345,7 @@ This transcript is intended to make visible accidental changes to the hashing al ->{Exception} Either [Link.Term] [Link.Term] 109. -- #ldqsht5qvddaabskcad3idka4nqkv6lfncrp0s0o4rqbbnk1qvq269bueu7qobhvaf7gpluqtpn9bgp9u69jsntv0u6o4qtbktnfrs0 - unique type builtin.ConsoleText + type builtin.ConsoleText 110. -- #ldqsht5qvddaabskcad3idka4nqkv6lfncrp0s0o4rqbbnk1qvq269bueu7qobhvaf7gpluqtpn9bgp9u69jsntv0u6o4qtbktnfrs0#5 builtin.ConsoleText.Background : Color @@ -371,7 +371,7 @@ This transcript is intended to make visible accidental changes to the hashing al -> ConsoleText 116. -- #pgornst1pqaea8qmf8ckbtvrm7f6hn49djhffgebajmo12faf4jku63ftc9fp0r4k58e0qcdi77g08f34b2ihvsu97s48du6mfn7vko - unique type builtin.CopyrightHolder + type builtin.CopyrightHolder 117. -- #pgornst1pqaea8qmf8ckbtvrm7f6hn49djhffgebajmo12faf4jku63ftc9fp0r4k58e0qcdi77g08f34b2ihvsu97s48du6mfn7vko#0 builtin.CopyrightHolder.CopyrightHolder : GUID @@ -464,7 +464,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Debug.watch : Text -> a -> a 141. -- #p65rcethk26an850aaaceojremfu054hqllhoip1mt9s22584j9r62o08qo9t0pri7ssgu9m7f0rfp4nujhulgbmo41tkgl182quhd8 - unique type builtin.Doc + type builtin.Doc 142. -- #baiqeiovdrs4ju0grn5q5akq64k4kuhgifqno52smkkttqg31jkgm3qa9o3ohe54fgpiigd1tj0an7rfveopfg622sjj9v9g44n27go builtin.Doc.++ : Doc2 -> Doc2 -> Doc2 @@ -488,7 +488,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc.Source : Link -> Doc 149. -- #ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0 - unique type builtin.Doc2 + type builtin.Doc2 150. -- #ej86si0ur1lsjade71dojr25phk9bbom9rdks6dltolos5tjivakujcriqe02npba53n9gd7tkh8bmv08ttjb9t35lq2ch5heshqcs0#27 builtin.Doc2.Anchor : Text -> Doc2 -> Doc2 @@ -524,7 +524,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Folded : Boolean -> Doc2 -> Doc2 -> Doc2 161. -- #h3gajooii4tsdseghcbcsq4qq7c33mtb71u5npg35b06mgv7v654g0n55gpq212umfmq7nvi11o28m1v13r5fto5g8ium3ee4qk1i68 - unique type builtin.Doc2.FrontMatter + type builtin.Doc2.FrontMatter 162. -- #h3gajooii4tsdseghcbcsq4qq7c33mtb71u5npg35b06mgv7v654g0n55gpq212umfmq7nvi11o28m1v13r5fto5g8ium3ee4qk1i68#0 builtin.Doc2.FrontMatter.FrontMatter : [(Text, Text)] @@ -546,7 +546,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Join : [Doc2] -> Doc2 167. -- #lpf7g5c2ct61mci2okedmug8o0i2j0rhpealc05r2musapmn15cina6dsqdvis234evvb2bo09l2p8v5qhh0me7gi1j37nqqp47qvto - unique type builtin.Doc2.LaTeXInline + type builtin.Doc2.LaTeXInline 168. -- #lpf7g5c2ct61mci2okedmug8o0i2j0rhpealc05r2musapmn15cina6dsqdvis234evvb2bo09l2p8v5qhh0me7gi1j37nqqp47qvto#0 builtin.Doc2.LaTeXInline.LaTeXInline : Text @@ -556,7 +556,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Linebreak : Doc2 170. -- #ut0tds116gr0soc9p6nroaalqlq423u1mao3p4jjultjmok3vbck69la7rs26duptji5v5hscijpek4hotu4krbfah8np3sntr87gb0 - unique type builtin.Doc2.MediaSource + type builtin.Doc2.MediaSource 171. -- #ut0tds116gr0soc9p6nroaalqlq423u1mao3p4jjultjmok3vbck69la7rs26duptji5v5hscijpek4hotu4krbfah8np3sntr87gb0#0 builtin.Doc2.MediaSource.MediaSource : Text @@ -611,7 +611,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Special : SpecialForm -> Doc2 184. -- #e46kdnv67raqhc4m3jnitkh3o9seq3q5mtlqnvobjlqnnd2tk7nui54b6grui7eql62fne4fo3ndetmeb23oj5es85habha5f6saoi0 - unique type builtin.Doc2.SpecialForm + type builtin.Doc2.SpecialForm 185. -- #e46kdnv67raqhc4m3jnitkh3o9seq3q5mtlqnvobjlqnnd2tk7nui54b6grui7eql62fne4fo3ndetmeb23oj5es85habha5f6saoi0#4 builtin.Doc2.SpecialForm.Embed : Any -> SpecialForm @@ -667,7 +667,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Style : Text -> Doc2 -> Doc2 198. -- #sv2cta4p4th10h7tpurvr0t6s3cbahlevvmpadk01v32e39kse8aicdvfsm2dbk6ltc68ht788jvkfhk6ol2mch7eubngtug019e8fg - unique type builtin.Doc2.Svg + type builtin.Doc2.Svg 199. -- #sv2cta4p4th10h7tpurvr0t6s3cbahlevvmpadk01v32e39kse8aicdvfsm2dbk6ltc68ht788jvkfhk6ol2mch7eubngtug019e8fg#0 builtin.Doc2.Svg.Svg : Text -> Svg @@ -676,7 +676,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.Table : [[Doc2]] -> Doc2 201. -- #s0an21vospbdlsbddiskuvt3ngbf00n78sip2o1mnp4jgp16i7sursbm14bf8ap7osphqbis2lduep3i29b7diu8sf03f8tlqd7rgcg - unique type builtin.Doc2.Term + type builtin.Doc2.Term 202. -- #42hub6f3fn0p5fk8t5bb2njhbgg5dj75vtqijvins6h45pkorakbu3g8h312ghu98ee4h75tb61fti192ckpk9cpdle9hsr8pdthkjo builtin.Doc2.term : '{g} a -> Doc2.Term @@ -691,7 +691,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Doc2.UntitledSection : [Doc2] -> Doc2 206. -- #794fndq1941e2khqv5uh7fmk9es2g4fkp8pr48objgs6blc1pqsdt2ab4o79noril2l7s70iu2eimn1smpd8t40j4g18btian8a2pt0 - unique type builtin.Doc2.Video + type builtin.Doc2.Video 207. -- #46er7fsgre91rer0mpk6vhaa2vie19i0piubvtnfmt3vq7odcjfr6tlf0mc57q4jnij9rkolpekjd6dpqdotn41guk9lp9qioa88m58 builtin.Doc2.Video.config : Video -> [(Text, Text)] @@ -870,7 +870,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Float.truncate : Float -> Int 260. -- #hqectlr3gt02r6r984b3627eg5bq3d82lab5q18e3ql09u1ka8dblf5k50ae0q0d8gk87udqd7b6767q86gogdt8ghpdiq77gk6blr8 - unique type builtin.GUID + type builtin.GUID 261. -- #hqectlr3gt02r6r984b3627eg5bq3d82lab5q18e3ql09u1ka8dblf5k50ae0q0d8gk87udqd7b6767q86gogdt8ghpdiq77gk6blr8#0 builtin.GUID.GUID : Bytes -> GUID @@ -1039,13 +1039,13 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Int.xor : Int -> Int -> Int 308. -- #s6ijmhqkkaus51chjgahogc7sdrqj9t66i599le2k7ts6fkl216f997hbses3mqk6a21vaj3cm1mertbldn0g503jt522vfo4rfv720 - unique type builtin.io2.ArithmeticFailure + type builtin.io2.ArithmeticFailure 309. -- #6dtvam7msqc64dimm8p0d8ehdf0330o4qbd2fdafb11jj1c2rg4ke3jdcmbgo6s4pf2jgm0vb76jeavv4ba6ht71t74p963a1miekag - unique type builtin.io2.ArrayFailure + type builtin.io2.ArrayFailure 310. -- #dc6n5ebu839ik3b6ohmnqm6p0cifn7o94em1g41mjp4ae0gmv3b4rupba499lbasfrp4bqce9u4hd6518unlbg8vk993c0q6rigos98 - unique type builtin.io2.BufferMode + type builtin.io2.BufferMode 311. -- #dc6n5ebu839ik3b6ohmnqm6p0cifn7o94em1g41mjp4ae0gmv3b4rupba499lbasfrp4bqce9u4hd6518unlbg8vk993c0q6rigos98#2 builtin.io2.BufferMode.BlockBuffering : BufferMode @@ -1090,7 +1090,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin type builtin.io2.Clock.internals.TimeSpec 323. -- #r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8 - unique type builtin.io2.Failure + type builtin.io2.Failure 324. -- #r29dja8j9dmjjp45trccchaata8eo1h6d6haar1eai74pq1jt4m7u3ldhlq79f7phfo57eq4bau39vqotl2h63k7ff1m5sj5o9ajuf8#0 builtin.io2.Failure.Failure : Type @@ -1099,7 +1099,7 @@ This transcript is intended to make visible accidental changes to the hashing al -> Failure 325. -- #jhnlob35huv3rr7jg6aa4gtd8okhprla7gvlq8io429qita8vj7k696n9jvp4b8ct9i2pc1jodb8ap2bipqtgp138epdgfcth7vqvt8 - unique type builtin.io2.FileMode + type builtin.io2.FileMode 326. -- #jhnlob35huv3rr7jg6aa4gtd8okhprla7gvlq8io429qita8vj7k696n9jvp4b8ct9i2pc1jodb8ap2bipqtgp138epdgfcth7vqvt8#2 builtin.io2.FileMode.Append : FileMode @@ -1360,7 +1360,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.io2.IO.tryEval : '{IO} a ->{IO, Exception} a 391. -- #h4smnou0l3fg4dn92g2r88j0imfvufjerkgbuscvvmaprv12l22nk6sff3c12edlikb2vfg3vfdj4b23a09q4lvtk75ckbe4lsmtuc0 - unique type builtin.io2.IOError + type builtin.io2.IOError 392. -- #h4smnou0l3fg4dn92g2r88j0imfvufjerkgbuscvvmaprv12l22nk6sff3c12edlikb2vfg3vfdj4b23a09q4lvtk75ckbe4lsmtuc0#0 builtin.io2.IOError.AlreadyExists : IOError @@ -1387,10 +1387,10 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.io2.IOError.UserError : IOError 400. -- #6ivk1e38hh0l9gcl8fn4mhf8bmak3qaji36vevg5e1n16ju5i4cl9u5gmqi7u16b907rd98gd60pouma892efbqt2ri58tmu99hp77g - unique type builtin.io2.IOFailure + type builtin.io2.IOFailure 401. -- #574pvphqahl981k517dtrqtq812m05h3hj6t2bt9sn3pknenfik1krscfdb6r66nf1sm7g3r1r56k0c6ob7vg4opfq4gihi8njbnhsg - unique type builtin.io2.MiscFailure + type builtin.io2.MiscFailure 402. -- ##MVar builtin type builtin.io2.MVar @@ -1468,13 +1468,13 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.io2.Ref.Ticket.read : Ticket a -> a 423. -- #vph2eas3lf2gi259f3khlrspml3id2l8u0ru07kb5fd833h238jk4iauju0b6decth9i3nao5jkf5eej1e1kovgmu5tghhh8jq3i7p8 - unique type builtin.io2.RuntimeFailure + type builtin.io2.RuntimeFailure 424. -- ##sandboxLinks builtin.io2.sandboxLinks : Link.Term ->{IO} [Link.Term] 425. -- #1bca3hq98sfgr6a4onuon1tsda69cdjggq8pkmlsfola6492dbrih5up6dv18ptfbqeocm9q6parf64pj773p7p19qe76238o4trc40 - unique type builtin.io2.SeekMode + type builtin.io2.SeekMode 426. -- #1bca3hq98sfgr6a4onuon1tsda69cdjggq8pkmlsfola6492dbrih5up6dv18ptfbqeocm9q6parf64pj773p7p19qe76238o4trc40#0 builtin.io2.SeekMode.AbsoluteSeek : SeekMode @@ -1489,7 +1489,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin type builtin.io2.Socket 430. -- #121tku5rfh21t247v1cakhd6ir44fakkqsm799rrfp5qcjdls4nvdu4r3nco80stdd86tdo2hhh0ulcpoaofnrnkjun04kqnfmjqio8 - unique type builtin.io2.StdHandle + type builtin.io2.StdHandle 431. -- #121tku5rfh21t247v1cakhd6ir44fakkqsm799rrfp5qcjdls4nvdu4r3nco80stdd86tdo2hhh0ulcpoaofnrnkjun04kqnfmjqio8#2 builtin.io2.StdHandle.StdErr : StdHandle @@ -1510,13 +1510,13 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.io2.STM.retry : '{STM} a 437. -- #cggbdfff21ac5uedf4qvn4to83clinvhsovrila35u7f7e73g4l6hoj8pjmjnk713a8luhnn4bi1j9ai1nl0can1un66hvg230eog9g - unique type builtin.io2.STMFailure + type builtin.io2.STMFailure 438. -- ##ThreadId builtin type builtin.io2.ThreadId 439. -- #ggh649864d9bfnk90n7kgtj7dflddc4kn8osu7u7mub8p7l8biid8dgtungj4u005h7karbgupfpum9jp94spks3ma1sgh39bhirv38 - unique type builtin.io2.ThreadKilledFailure + type builtin.io2.ThreadKilledFailure 440. -- ##Tls builtin type builtin.io2.Tls @@ -1620,7 +1620,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin type builtin.io2.Tls.Version 465. -- #r3gag1btclr8iclbdt68irgt8n1d1vf7agv5umke3dgdbl11acj6easav6gtihanrjnct18om07638rne9ej06u2bkv2v4l36knm2l0 - unique type builtin.io2.TlsFailure + type builtin.io2.TlsFailure 466. -- ##TVar builtin type builtin.io2.TVar @@ -1654,19 +1654,19 @@ This transcript is intended to make visible accidental changes to the hashing al ->{IO} Either [Link.Term] [Link.Term] 475. -- #c23jofurcegj93796o0karmkcm6baifupiuu1rtkniu74avn6a4r1n66ga5rml5di7easkgn4iak800u3tnb6kfisbrv6tcfgkb13a8 - unique type builtin.IsPropagated + type builtin.IsPropagated 476. -- #c23jofurcegj93796o0karmkcm6baifupiuu1rtkniu74avn6a4r1n66ga5rml5di7easkgn4iak800u3tnb6kfisbrv6tcfgkb13a8#0 builtin.IsPropagated.IsPropagated : IsPropagated 477. -- #q6snodsh7i7u6k7gtqj73tt7nv6htjofs5f37vg2v3dsfk6hau71fs5mcv0hq3lqg111fsvoi92mngm08850aftfgh65uka9mhqvft0 - unique type builtin.IsTest + type builtin.IsTest 478. -- #q6snodsh7i7u6k7gtqj73tt7nv6htjofs5f37vg2v3dsfk6hau71fs5mcv0hq3lqg111fsvoi92mngm08850aftfgh65uka9mhqvft0#0 builtin.IsTest.IsTest : IsTest 479. -- #68haromionghg6cvojngjrgc7t0ob658nkk8b20fpho6k6ltjtf6rfmr4ia1omige97hk34lu21qsj933vl1dkpbna7evbjfkh71r9g - unique type builtin.License + type builtin.License 480. -- #knhl4mlkqf0mt877flahlbas2ufb7bub8f11vi9ihh9uf7r6jqaglk7rm6912q1vml50866ddl0qfa4o6d7o0gomchaoae24m0u2nk8 builtin.License.copyrightHolders : License @@ -1715,13 +1715,13 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.License.years.set : [Year] -> License -> License 490. -- #uj652rrb45urfnojgt1ssqoji7iiibu27uhrc1sfl68lm54hbr7r1dpgppsv0pvf0oile2uk2h2gn1h4vgng30fga66idihhen14qc0 - unique type builtin.LicenseType + type builtin.LicenseType 491. -- #uj652rrb45urfnojgt1ssqoji7iiibu27uhrc1sfl68lm54hbr7r1dpgppsv0pvf0oile2uk2h2gn1h4vgng30fga66idihhen14qc0#0 builtin.LicenseType.LicenseType : Doc -> LicenseType 492. -- #f4b37niu61dc517c32h3os36ig34fgnt7inaaoqdbecmscchthi14gdo0vj3eee1ru746ibvl9vnmm1pglrv3125qnhsbc0i1tqtic0 - unique type builtin.Link + type builtin.Link 493. -- ##Link.Term builtin type builtin.Link.Term @@ -2023,7 +2023,7 @@ This transcript is intended to make visible accidental changes to the hashing al structural type builtin.Pretty txt 576. -- #fqfaur9v9v4fks5d0c74ouitpjp121c3fbu2l9t05km8otjcj43gk453vu668pg54rte6qmh4v3uao6vbfpntrtaq057jgni1jk8fj8 - unique type builtin.Pretty.Annotated w txt + type builtin.Pretty.Annotated w txt 577. -- #fqfaur9v9v4fks5d0c74ouitpjp121c3fbu2l9t05km8otjcj43gk453vu668pg54rte6qmh4v3uao6vbfpntrtaq057jgni1jk8fj8#1 builtin.Pretty.Annotated.Append : w @@ -2134,7 +2134,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin type builtin.Request 603. -- #bga77hj5p43epjosu36iero5ulpm7hqrct1slj5ivdcajsr52ksjam8d5smq2965netv9t43o3g0amgva26qoatt4qth29khkuds2t0 - unique type builtin.RewriteCase a b + type builtin.RewriteCase a b 604. -- #bga77hj5p43epjosu36iero5ulpm7hqrct1slj5ivdcajsr52ksjam8d5smq2965netv9t43o3g0amgva26qoatt4qth29khkuds2t0#0 builtin.RewriteCase.RewriteCase : a @@ -2142,13 +2142,13 @@ This transcript is intended to make visible accidental changes to the hashing al -> RewriteCase a b 605. -- #qcot4bpj2skgnui8hoignn6fl2gnn2nfrur451ft2egd5n1ndu6ti4uu7r1mvtc8r4p7iielfijk2mb7md9tt2m2rdvaikah4oluf7o - unique type builtin.Rewrites a + type builtin.Rewrites a 606. -- #qcot4bpj2skgnui8hoignn6fl2gnn2nfrur451ft2egd5n1ndu6ti4uu7r1mvtc8r4p7iielfijk2mb7md9tt2m2rdvaikah4oluf7o#0 builtin.Rewrites.Rewrites : a -> Rewrites a 607. -- #nu6eab37fl81lb5hfcainu83hph0ksqjsjgjbqvc3t8o13djtt5511qfa6tuggc5c3re06c5p6eto5o2cqme0jdlo31nnd13npqigjo - unique type builtin.RewriteSignature a b + type builtin.RewriteSignature a b 608. -- #nu6eab37fl81lb5hfcainu83hph0ksqjsjgjbqvc3t8o13djtt5511qfa6tuggc5c3re06c5p6eto5o2cqme0jdlo31nnd13npqigjo#0 builtin.RewriteSignature.RewriteSignature : (a @@ -2157,7 +2157,7 @@ This transcript is intended to make visible accidental changes to the hashing al -> RewriteSignature a b 609. -- #bvffhraos4oatd3qmedt676dqul9c1oj8r4cqns36lsrue84kl0ote15iqbbmgu8joek3gce1h2raqas5b9nnvs2d79l9mrpmmi2sf0 - unique type builtin.RewriteTerm a b + type builtin.RewriteTerm a b 610. -- #bvffhraos4oatd3qmedt676dqul9c1oj8r4cqns36lsrue84kl0ote15iqbbmgu8joek3gce1h2raqas5b9nnvs2d79l9mrpmmi2sf0#0 builtin.RewriteTerm.RewriteTerm : a @@ -2327,7 +2327,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.syntax.docWord : Text -> Doc2 660. -- #aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0 - unique type builtin.Test.Result + type builtin.Test.Result 661. -- #aql7qk3iud6vs4cvu43aimopoosgk0fnipibdkc3so13adencmibgfn0u5c01r0adei55nkl3ttsjhl8gbj7tr4gnpj63g64ftbq6s0#0 builtin.Test.Result.Fail : Text -> Result @@ -2511,7 +2511,7 @@ This transcript is intended to make visible accidental changes to the hashing al builtin.Value.value : a -> Value 720. -- #dem6aglnj8cppfrnq9qipl7geo5pim3auo9cmv1rhh5la9edalj19sspbpm1pd4vh0plokdh6qfo48gs034dqlg0s7j9fhr9p9ndtpo - unique type builtin.Year + type builtin.Year 721. -- #dem6aglnj8cppfrnq9qipl7geo5pim3auo9cmv1rhh5la9edalj19sspbpm1pd4vh0plokdh6qfo48gs034dqlg0s7j9fhr9p9ndtpo#0 builtin.Year.Year : Nat -> Year 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 0648296e03..773d53a245 100644 --- a/unison-src/transcripts-using-base/binary-encoding-nats.output.md +++ b/unison-src/transcripts-using-base/binary-encoding-nats.output.md @@ -64,7 +64,7 @@ testABunchOfNats _ = ⍟ These new definitions are ok to `add`: - unique type EncDec + type EncDec BE16 : EncDec BE32 : EncDec BE64 : EncDec @@ -81,7 +81,7 @@ testABunchOfNats _ = ⍟ I've added these definitions: - unique type EncDec + type EncDec BE16 : EncDec BE32 : EncDec BE64 : EncDec diff --git a/unison-src/transcripts-using-base/doc.output.md b/unison-src/transcripts-using-base/doc.output.md index ac966b95af..892687f38b 100644 --- a/unison-src/transcripts-using-base/doc.output.md +++ b/unison-src/transcripts-using-base/doc.output.md @@ -38,7 +38,7 @@ unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ⍟ These new definitions are ok to `add`: - unique type time.DayOfWeek + type time.DayOfWeek ImportantConstant : Nat ImportantConstant.doc : Doc2 d1 : Doc2 @@ -63,14 +63,7 @@ You can preview what docs will look like when rendered to the console using the The 7 days of the week, defined as: - unique type DayOfWeek - = Sun - | Mon - | Tue - | Wed - | Thu - | Fri - | Sat + type DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat ``` The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions. diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index a381f4afb0..3cc7b62dfe 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -29,13 +29,13 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti Loading changes detected in scratch.u. - I expected to see `structural` or `unique` at the start of - this line: + I found a value of type: Either Failure Unit + where I expected to find: Unit - 1 | ability Trivial where + 15 | printText "hi!" + 16 | trivial - Learn more about when to use `structural` vs `unique` in the - Unison Docs: - https://www.unison-lang.org/learn/language-reference/unique-types/ + Hint: Actions within a block must have type Unit. + Use _ = to ignore a result. ``` diff --git a/unison-src/transcripts/abilities.output.md b/unison-src/transcripts/abilities.output.md index f9e873b6a1..c90d76a45d 100644 --- a/unison-src/transcripts/abilities.output.md +++ b/unison-src/transcripts/abilities.output.md @@ -27,7 +27,7 @@ ha = cases ⍟ These new definitions are ok to `add`: - unique ability A + ability A ha : Request {A} r -> r ``` @@ -36,7 +36,7 @@ ha = cases ⍟ I've added these definitions: - unique ability A + ability A ha : Request {A} r -> r ``` diff --git a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md index e686d0402d..879dc0c624 100644 --- a/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md +++ b/unison-src/transcripts/ability-order-doesnt-affect-hash.output.md @@ -24,8 +24,8 @@ term2 _ = () ⍟ These new definitions are ok to `add`: - unique ability Bar - unique ability Foo + ability Bar + ability Foo term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () @@ -35,8 +35,8 @@ term2 _ = () ⍟ I've added these definitions: - unique ability Bar - unique ability Foo + ability Bar + ability Foo term1 : '{Bar, Foo} () term2 : '{Bar, Foo} () 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 1f7a7d7c7e..e69635fcfe 100644 --- a/unison-src/transcripts/ability-term-conflicts-on-update.output.md +++ b/unison-src/transcripts/ability-term-conflicts-on-update.output.md @@ -20,7 +20,7 @@ unique ability Channels where ⍟ These new definitions are ok to `add`: - unique ability Channels + ability Channels ``` ```ucm @@ -30,7 +30,7 @@ unique ability Channels where ⍟ I've added these definitions: - unique ability Channels + ability Channels ``` Now we update the ability, changing the name of the constructor, _but_, we simultaneously @@ -64,7 +64,7 @@ thing _ = send 1 ⍟ These names already exist. You can `update` them to your new definition: - unique ability Channels + ability Channels ``` These should fail with a term/ctor conflict since we exclude the ability from the update. @@ -88,7 +88,7 @@ These should fail with a term/ctor conflict since we exclude the ability from th ⍟ I've updated these names to your new definition: - unique ability Channels + ability Channels ``` If however, `Channels.send` and `thing` _depend_ on `Channels`, updating them should succeed since it pulls in the ability as a dependency. diff --git a/unison-src/transcripts/alias-many.output.md b/unison-src/transcripts/alias-many.output.md index 60ce7ba186..12e90e1559 100644 --- a/unison-src/transcripts/alias-many.output.md +++ b/unison-src/transcripts/alias-many.output.md @@ -114,7 +114,7 @@ Let's try it! 90. Debug.toText : a -> Optional (Either Text Text) 91. Debug.trace : Text -> a -> () 92. Debug.watch : Text -> a -> a - 93. unique type Doc + 93. type Doc 94. Doc.Blob : Text -> Doc 95. Doc.Evaluate : Term -> Doc 96. Doc.Join : [Doc] -> Doc @@ -235,9 +235,9 @@ Let's try it! 187. Int.trailingZeros : Int -> Nat 188. Int.truncate0 : Int -> Nat 189. Int.xor : Int -> Int -> Int - 190. unique type io2.ArithmeticFailure - 191. unique type io2.ArrayFailure - 192. unique type io2.BufferMode + 190. type io2.ArithmeticFailure + 191. type io2.ArrayFailure + 192. type io2.BufferMode 193. io2.BufferMode.BlockBuffering : BufferMode 194. io2.BufferMode.LineBuffering : BufferMode 195. io2.BufferMode.NoBuffering : BufferMode @@ -257,9 +257,9 @@ Let's try it! 203. io2.Clock.internals.threadCPUTime : '{IO} Either Failure TimeSpec 204. builtin type io2.Clock.internals.TimeSpec - 205. unique type io2.Failure + 205. type io2.Failure 206. io2.Failure.Failure : Type -> Text -> Any -> Failure - 207. unique type io2.FileMode + 207. type io2.FileMode 208. io2.FileMode.Append : FileMode 209. io2.FileMode.Read : FileMode 210. io2.FileMode.ReadWrite : FileMode @@ -380,7 +380,7 @@ Let's try it! 270. io2.IO.systemTime.impl : '{IO} Either Failure Nat 271. io2.IO.systemTimeMicroseconds : '{IO} Int 272. io2.IO.tryEval : '{IO} a ->{IO, Exception} a - 273. unique type io2.IOError + 273. type io2.IOError 274. io2.IOError.AlreadyExists : IOError 275. io2.IOError.EOF : IOError 276. io2.IOError.IllegalOperation : IOError @@ -389,8 +389,8 @@ Let's try it! 279. io2.IOError.ResourceBusy : IOError 280. io2.IOError.ResourceExhausted : IOError 281. io2.IOError.UserError : IOError - 282. unique type io2.IOFailure - 283. unique type io2.MiscFailure + 282. type io2.IOFailure + 283. type io2.MiscFailure 284. builtin type io2.MVar 285. io2.MVar.isEmpty : MVar a ->{IO} Boolean 286. io2.MVar.new : a ->{IO} MVar a @@ -416,23 +416,23 @@ Let's try it! 302. io2.Ref.readForCas : Ref {IO} a ->{IO} Ticket a 303. builtin type io2.Ref.Ticket 304. io2.Ref.Ticket.read : Ticket a -> a - 305. unique type io2.RuntimeFailure + 305. type io2.RuntimeFailure 306. io2.sandboxLinks : Term ->{IO} [Term] - 307. unique type io2.SeekMode + 307. type io2.SeekMode 308. io2.SeekMode.AbsoluteSeek : SeekMode 309. io2.SeekMode.RelativeSeek : SeekMode 310. io2.SeekMode.SeekFromEnd : SeekMode 311. builtin type io2.Socket - 312. unique type io2.StdHandle + 312. type io2.StdHandle 313. io2.StdHandle.StdErr : StdHandle 314. io2.StdHandle.StdIn : StdHandle 315. io2.StdHandle.StdOut : StdHandle 316. builtin type io2.STM 317. io2.STM.atomically : '{STM} a ->{IO} a 318. io2.STM.retry : '{STM} a - 319. unique type io2.STMFailure + 319. type io2.STMFailure 320. builtin type io2.ThreadId - 321. unique type io2.ThreadKilledFailure + 321. type io2.ThreadKilledFailure 322. builtin type io2.Tls 323. builtin type io2.Tls.Cipher 324. builtin type io2.Tls.ClientConfig @@ -479,7 +479,7 @@ Let's try it! 344. builtin type io2.Tls.SignedCert 345. io2.Tls.terminate.impl : Tls ->{IO} Either Failure () 346. builtin type io2.Tls.Version - 347. unique type io2.TlsFailure + 347. type io2.TlsFailure 348. builtin type io2.TVar 349. io2.TVar.new : a ->{STM} TVar a 350. io2.TVar.newIO : a ->{IO} TVar a @@ -491,11 +491,11 @@ Let's try it! 356. io2.Value.validateSandboxed : [Term] -> Value ->{IO} Either [Term] [Term] - 357. unique type IsPropagated + 357. type IsPropagated 358. IsPropagated.IsPropagated : IsPropagated - 359. unique type IsTest + 359. type IsTest 360. IsTest.IsTest : IsTest - 361. unique type Link + 361. type Link 362. builtin type Link.Term 363. Link.Term : Term -> Link 364. Link.Term.toText : Term -> Text @@ -628,15 +628,15 @@ Let's try it! 444. Ref.read : Ref g a ->{g} a 445. Ref.write : Ref g a -> a ->{g} () 446. builtin type Request - 447. unique type RewriteCase a b + 447. type RewriteCase a b 448. RewriteCase.RewriteCase : a -> b -> RewriteCase a b - 449. unique type Rewrites a + 449. type Rewrites a 450. Rewrites.Rewrites : a -> Rewrites a - 451. unique type RewriteSignature a b + 451. type RewriteSignature a b 452. RewriteSignature.RewriteSignature : (a -> b -> ()) -> RewriteSignature a b - 453. unique type RewriteTerm a b + 453. type RewriteTerm a b 454. RewriteTerm.RewriteTerm : a -> b -> RewriteTerm a b 455. builtin type Scope 456. Scope.array : Nat ->{Scope s} MutableArray (Scope s) a @@ -655,7 +655,7 @@ Let's try it! 463. SeqView.VElem : a -> b -> SeqView a b 464. SeqView.VEmpty : SeqView a b 465. Socket.toText : Socket -> Text - 466. unique type Test.Result + 466. type Test.Result 467. Test.Result.Fail : Text -> Result 468. Test.Result.Ok : Text -> Result 469. builtin type Text diff --git a/unison-src/transcripts/deleteReplacements.output.md b/unison-src/transcripts/deleteReplacements.output.md index b534f3f3cc..b0e6289e27 100644 --- a/unison-src/transcripts/deleteReplacements.output.md +++ b/unison-src/transcripts/deleteReplacements.output.md @@ -83,7 +83,7 @@ unique[a] type Foo = Foo ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -91,7 +91,7 @@ unique[a] type Foo = Foo ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison @@ -109,7 +109,7 @@ unique[b] type Foo = Foo | Bar ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -117,7 +117,7 @@ unique[b] type Foo = Foo | Bar ⍟ I've updated these names to your new definition: - unique type Foo + type Foo .> view.patch @@ -153,7 +153,7 @@ unique[aa] type bar = Foo ⍟ These new definitions are ok to `add`: - unique type bar + type bar bar : ##Nat ``` @@ -162,7 +162,7 @@ unique[aa] type bar = Foo ⍟ I've added these definitions: - unique type bar + type bar bar : ##Nat ``` @@ -181,7 +181,7 @@ unique[bb] type bar = Foo | Bar ⍟ These names already exist. You can `update` them to your new definition: - unique type bar + type bar ``` ```ucm @@ -189,7 +189,7 @@ unique[bb] type bar = Foo | Bar ⍟ I've updated these names to your new definition: - unique type bar + type bar .> view.patch @@ -278,7 +278,7 @@ unique type qux = Qux ⍟ These new definitions are ok to `add`: - unique type qux + type qux ``` ```ucm @@ -286,7 +286,7 @@ unique type qux = Qux ⍟ I've added these definitions: - unique type qux + type qux .> delete.term-replacement qux diff --git a/unison-src/transcripts/diff-namespace.output.md b/unison-src/transcripts/diff-namespace.output.md index ea87bb6058..73e2e41829 100644 --- a/unison-src/transcripts/diff-namespace.output.md +++ b/unison-src/transcripts/diff-namespace.output.md @@ -213,7 +213,7 @@ unique type Y a b = Y a b ⍟ I've added these definitions: - unique type Y a b + type Y a b d : Nat e : Nat f : Nat @@ -256,7 +256,7 @@ unique type Y a b = Y a b Added definitions: - 12. unique type Y a b + 12. type Y a b 13. Y.Y : a -> b -> Y a b 14. d : Nat 15. e : Nat @@ -301,7 +301,7 @@ unique type Y a b = Y a b Added definitions: - 12. unique type Y a b + 12. type Y a b 13. Y.Y : a -> b -> Y a b 14. ┌ d : Nat 15. └ d' : Nat @@ -359,7 +359,7 @@ unique type Y a b = Y a b Added definitions: - 14. unique type Y a b + 14. type Y a b 15. Y.Y : a -> b -> Y a b 16. ┌ d : Nat 17. └ d' : Nat @@ -407,7 +407,7 @@ unique type Y a b = Y a b Added definitions: - 14. unique type Y a b + 14. type Y a b 15. Y.Y : a -> b -> Y a b 16. ┌ d : Nat 17. └ d' : Nat diff --git a/unison-src/transcripts/docs.output.md b/unison-src/transcripts/docs.output.md index ebe841f3f9..6280d7c107 100644 --- a/unison-src/transcripts/docs.output.md +++ b/unison-src/transcripts/docs.output.md @@ -5,7 +5,7 @@ Unison documentation is written in Unison. Documentation is a value of the follo ```ucm .> view builtin.Doc - unique type builtin.Doc + type builtin.Doc = Blob Text | Link Link | Source Link diff --git a/unison-src/transcripts/find-by-type.output.md b/unison-src/transcripts/find-by-type.output.md index 916857b524..0577051f92 100644 --- a/unison-src/transcripts/find-by-type.output.md +++ b/unison-src/transcripts/find-by-type.output.md @@ -17,7 +17,7 @@ baz = cases ⍟ I've added these definitions: - unique type A + type A bar : Text -> A baz : A -> Text foo : A diff --git a/unison-src/transcripts/fix-big-list-crash.output.md b/unison-src/transcripts/fix-big-list-crash.output.md index 9f25f705b9..1d14e77d7b 100644 --- a/unison-src/transcripts/fix-big-list-crash.output.md +++ b/unison-src/transcripts/fix-big-list-crash.output.md @@ -18,7 +18,7 @@ x = [(R,1005),(U,563),(R,417),(U,509),(L,237),(U,555),(R,397),(U,414),(L,490),(U ⍟ These new definitions are ok to `add`: - unique type Direction + type Direction x : [(Direction, Nat)] ``` diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index c8219e3276..0657c81ca8 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -21,13 +21,9 @@ dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") Loading changes detected in scratch.u. - I expected to see `structural` or `unique` at the start of - this line: + The expression in red needs the {Zoot} ability, but this location does not have access to any abilities. - 1 | ability Ask where ask : Nat + 13 | dialog = Ask.provide 'zoot '("Awesome number: " ++ Nat.toText Ask.ask ++ "!") - Learn more about when to use `structural` vs `unique` in the - Unison Docs: - https://www.unison-lang.org/learn/language-reference/unique-types/ ``` diff --git a/unison-src/transcripts/fix1844.output.md b/unison-src/transcripts/fix1844.output.md index 33bb4a26bd..571daa8b9a 100644 --- a/unison-src/transcripts/fix1844.output.md +++ b/unison-src/transcripts/fix1844.output.md @@ -21,8 +21,8 @@ snoc k aN = match k with ⍟ These new definitions are ok to `add`: structural type One a - unique type Woot a b c - unique type Z + type Woot a b c + type Z snoc : One a -> aN -> Woot (One a) (One aN) ##Nat Now evaluating any watch expressions (lines starting with diff --git a/unison-src/transcripts/fix2049.output.md b/unison-src/transcripts/fix2049.output.md index 5cfb243198..db7ef61068 100644 --- a/unison-src/transcripts/fix2049.output.md +++ b/unison-src/transcripts/fix2049.output.md @@ -58,8 +58,8 @@ Fold.Stream.fold = ⍟ These new definitions are ok to `add`: - unique type Fold g a b - unique type Fold' g a b x + type Fold g a b + type Fold' g a b x structural ability Stream a Fold.Stream.fold : Fold g a b -> '{g, Stream a} r diff --git a/unison-src/transcripts/fix2254.output.md b/unison-src/transcripts/fix2254.output.md index 5419e28057..3eca13318f 100644 --- a/unison-src/transcripts/fix2254.output.md +++ b/unison-src/transcripts/fix2254.output.md @@ -40,7 +40,7 @@ We'll make our edits in a fork of the `a` namespace: ⍟ I've added these definitions: - unique type A a b c d + type A a b c d structural type NeedsA a b f : A Nat Nat Nat Nat -> Nat f2 : A Nat Nat Nat Nat -> Nat @@ -70,11 +70,11 @@ Let's do the update now, and verify that the definitions all look good and there ⍟ I've updated these names to your new definition: - unique type A a b c d + type A a b c d .a2> view A NeedsA f f2 f3 g - unique type A a b c d + type A a b c d = B b | D d | E a d diff --git a/unison-src/transcripts/fix2268.output.md b/unison-src/transcripts/fix2268.output.md index c742b78fd2..bfb65920fd 100644 --- a/unison-src/transcripts/fix2268.output.md +++ b/unison-src/transcripts/fix2268.output.md @@ -25,8 +25,8 @@ test _ = ⍟ These new definitions are ok to `add`: - unique ability A - unique ability B + ability A + ability B test : '{B} Nat ``` diff --git a/unison-src/transcripts/fix2344.output.md b/unison-src/transcripts/fix2344.output.md index 82ca8fbf4b..6d0ae41c4f 100644 --- a/unison-src/transcripts/fix2344.output.md +++ b/unison-src/transcripts/fix2344.output.md @@ -27,7 +27,7 @@ sneezy dee _ = ⍟ These new definitions are ok to `add`: - unique ability Nate + ability Nate sneezy : (Nat ->{d} a) -> '{d, Nate} a ``` diff --git a/unison-src/transcripts/fix2350.output.md b/unison-src/transcripts/fix2350.output.md index 98d884780c..d8f6bf43b1 100644 --- a/unison-src/transcripts/fix2350.output.md +++ b/unison-src/transcripts/fix2350.output.md @@ -35,7 +35,7 @@ save a = !(save.impl a) ⍟ These new definitions are ok to `add`: - unique ability Storage d g + ability Storage d g save : a ->{g, Storage d g} d a ``` diff --git a/unison-src/transcripts/fix2353.output.md b/unison-src/transcripts/fix2353.output.md index 933a0dbda9..74c9da016f 100644 --- a/unison-src/transcripts/fix2353.output.md +++ b/unison-src/transcripts/fix2353.output.md @@ -21,8 +21,8 @@ pure.run a0 a = ⍟ These new definitions are ok to `add`: - unique ability Async t g - unique ability Exception + ability Async t g + ability Exception pure.run : a -> (∀ t. '{Async t g} a) ->{g, Exception} a ``` diff --git a/unison-src/transcripts/fix2378.output.md b/unison-src/transcripts/fix2378.output.md index 3282c9d01b..5acef2316d 100644 --- a/unison-src/transcripts/fix2378.output.md +++ b/unison-src/transcripts/fix2378.output.md @@ -49,9 +49,9 @@ x _ = Ex.catch '(C.pure.run '(A.pure.run ex)) ⍟ These new definitions are ok to `add`: - unique ability A t g - unique ability C c - unique ability Ex + ability A t g + ability C c + ability Ex A.pure.run : (∀ t. '{g, A t g} a) ->{g, Ex} a C.pure.run : (∀ c. '{g, C c} r) ->{g, Ex} r Ex.catch : '{g, Ex} a ->{g} Either () a diff --git a/unison-src/transcripts/fix2628.output.md b/unison-src/transcripts/fix2628.output.md index 8faf5b36cb..64b45ed29b 100644 --- a/unison-src/transcripts/fix2628.output.md +++ b/unison-src/transcripts/fix2628.output.md @@ -9,7 +9,7 @@ unique type foo.bar.baz.MyRecord = { ⍟ I've added these definitions: - unique type foo.bar.baz.MyRecord + type foo.bar.baz.MyRecord foo.bar.baz.MyRecord.value : MyRecord -> Nat foo.bar.baz.MyRecord.value.modify : (Nat ->{g} Nat) -> MyRecord diff --git a/unison-src/transcripts/fix2712.output.md b/unison-src/transcripts/fix2712.output.md index 07dc8a9369..08cdb89a30 100644 --- a/unison-src/transcripts/fix2712.output.md +++ b/unison-src/transcripts/fix2712.output.md @@ -15,7 +15,7 @@ mapWithKey f m = Tip ⍟ These new definitions are ok to `add`: - unique type Map k v + type Map k v mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b ``` @@ -24,7 +24,7 @@ mapWithKey f m = Tip ⍟ I've added these definitions: - unique type Map k v + type Map k v mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b ``` diff --git a/unison-src/transcripts/fix2840.output.md b/unison-src/transcripts/fix2840.output.md index a8c8f1ea95..c47df9a2c7 100644 --- a/unison-src/transcripts/fix2840.output.md +++ b/unison-src/transcripts/fix2840.output.md @@ -7,9 +7,9 @@ First, a few \[hidden] definitions necessary for typechecking a simple Doc2. ⍟ I've added these definitions: - unique type Doc2 - unique type Doc2.SpecialForm - unique type Doc2.Term + type Doc2 + type Doc2.SpecialForm + type Doc2.Term structural type Optional a (also named builtin.Optional) syntax.docParagraph : [Doc2] -> Doc2 diff --git a/unison-src/transcripts/fix3196.output.md b/unison-src/transcripts/fix3196.output.md index a5c1b13506..3a5e2944d1 100644 --- a/unison-src/transcripts/fix3196.output.md +++ b/unison-src/transcripts/fix3196.output.md @@ -38,7 +38,7 @@ w2 = cases W -> W ⍟ These new definitions are ok to `add`: structural type W es - unique ability Zoot + ability Zoot ex : '{Zoot} r w1 : W {Zoot} w2 : W {g} -> W {g} diff --git a/unison-src/transcripts/fix3759.output.md b/unison-src/transcripts/fix3759.output.md index 56a11ad8ea..d4f1d9b2a1 100644 --- a/unison-src/transcripts/fix3759.output.md +++ b/unison-src/transcripts/fix3759.output.md @@ -58,9 +58,9 @@ blah.frobnicate = "Yay!" ⍟ These new definitions are ok to `add`: - unique ability Blah - unique type Oog.Foo - unique type Something + ability Blah + type Oog.Foo + type Something Something.state : Something -> Text Something.state.modify : (Text ->{g} Text) -> Something diff --git a/unison-src/transcripts/fix4415.output.md b/unison-src/transcripts/fix4415.output.md index 0cd2354230..b6d881fa2a 100644 --- a/unison-src/transcripts/fix4415.output.md +++ b/unison-src/transcripts/fix4415.output.md @@ -14,7 +14,7 @@ unique type sub.Foo = ⍟ These new definitions are ok to `add`: - unique type Foo - unique type sub.Foo + type Foo + type sub.Foo ``` diff --git a/unison-src/transcripts/fix4424.output.md b/unison-src/transcripts/fix4424.output.md index daf48abcb3..bb00ce7303 100644 --- a/unison-src/transcripts/fix4424.output.md +++ b/unison-src/transcripts/fix4424.output.md @@ -13,8 +13,8 @@ countCat = cases ⍟ I've added these definitions: - unique type Cat.Dog - unique type Rat.Dog + type Cat.Dog + type Rat.Dog countCat : Cat.Dog -> Rat.Dog ``` diff --git a/unison-src/transcripts/fix4482.output.md b/unison-src/transcripts/fix4482.output.md index dbf01eaa6a..ed0f69da0d 100644 --- a/unison-src/transcripts/fix4482.output.md +++ b/unison-src/transcripts/fix4482.output.md @@ -31,7 +31,7 @@ mybar = bar + bar I'll now fetch the latest version of the base Unison library... - Downloaded 12786 entities. + Downloaded 12813 entities. 🎨 Type `ui` to explore this project's code in your browser. 🔭 Discover libraries at https://share.unison-lang.org diff --git a/unison-src/transcripts/higher-rank.output.md b/unison-src/transcripts/higher-rank.output.md index 119645c918..a64a48ae39 100644 --- a/unison-src/transcripts/higher-rank.output.md +++ b/unison-src/transcripts/higher-rank.output.md @@ -77,7 +77,7 @@ Functor.blah = cases Functor f -> ⍟ These new definitions are ok to `add`: - unique type Functor f + type Functor f Functor.blah : Functor f -> () Functor.map : Functor f -> (∀ a b. (a -> b) -> f a -> f b) @@ -121,8 +121,8 @@ Loc.transform2 nt = cases Loc f -> ⍟ These new definitions are ok to `add`: - unique type Loc - unique ability Remote t + type Loc + ability Remote t Loc.blah : Loc -> () Loc.transform : (∀ t a. '{Remote t} a -> '{Remote t} a) -> Loc diff --git a/unison-src/transcripts/kind-inference.output.md b/unison-src/transcripts/kind-inference.output.md index ee4dd35313..73fb41d2d1 100644 --- a/unison-src/transcripts/kind-inference.output.md +++ b/unison-src/transcripts/kind-inference.output.md @@ -52,8 +52,8 @@ unique type Pong = Pong (Ping Optional) ⍟ These new definitions are ok to `add`: - unique type Ping a - unique type Pong + type Ping a + type Pong ``` Catch the conflict on the kind of `a` in `Ping a`. `Ping` restricts @@ -91,8 +91,8 @@ unique ability Pong a where ⍟ These new definitions are ok to `add`: - unique type Ping a - unique ability Pong a + type Ping a + ability Pong a ``` Catch conflict between mutually recursive type and ability @@ -130,8 +130,8 @@ unique type S = S (T Nat) ⍟ These new definitions are ok to `add`: - unique type S - unique type T a + type S + type T a ``` Delay kind defaulting until all components are processed. Here `S` @@ -153,8 +153,8 @@ unique type S = S (T Optional) ⍟ These new definitions are ok to `add`: - unique type S - unique type T a + type S + type T a ``` Catch invalid instantiation of `T`'s `a` parameter in `S` diff --git a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md index 481e8a6864..567a176b64 100644 --- a/unison-src/transcripts/ls-pretty-print-scope-bug.output.md +++ b/unison-src/transcripts/ls-pretty-print-scope-bug.output.md @@ -12,7 +12,7 @@ unique type Foo = Foo ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -22,7 +22,7 @@ unique type Foo = Foo ⍟ I've added these definitions: - unique type Foo + type Foo .> fork .a.b .c.d.f @@ -45,7 +45,7 @@ unique type Foo = Foo ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -53,7 +53,7 @@ unique type Foo = Foo ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison diff --git a/unison-src/transcripts/move-all.output.md b/unison-src/transcripts/move-all.output.md index 4fb0b402b2..b86f0f8e9e 100644 --- a/unison-src/transcripts/move-all.output.md +++ b/unison-src/transcripts/move-all.output.md @@ -21,8 +21,8 @@ unique type Foo.T = T ⍟ These new definitions are ok to `add`: - unique type Foo - unique type Foo.T + type Foo + type Foo.T Foo : Nat Foo.termInA : Nat @@ -32,8 +32,8 @@ unique type Foo.T = T ⍟ I've added these definitions: - unique type Foo - unique type Foo.T + type Foo + type Foo.T Foo : Nat Foo.termInA : Nat @@ -54,7 +54,7 @@ unique type Foo.T = T1 | T2 ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo.T + type Foo.T Foo.termInA : Nat (also named Foo) diff --git a/unison-src/transcripts/move-namespace.output.md b/unison-src/transcripts/move-namespace.output.md index 3aeaa6665b..966ae35a7b 100644 --- a/unison-src/transcripts/move-namespace.output.md +++ b/unison-src/transcripts/move-namespace.output.md @@ -19,7 +19,7 @@ unique type a.T = T ⍟ These new definitions are ok to `add`: - unique type a.T + type a.T a.termInA : Nat ``` @@ -30,7 +30,7 @@ unique type a.T = T ⍟ I've added these definitions: - unique type a.T + type a.T a.termInA : Nat ``` @@ -50,7 +50,7 @@ unique type a.T = T1 | T2 ⍟ These names already exist. You can `update` them to your new definition: - unique type a.T + type a.T a.termInA : Nat ``` diff --git a/unison-src/transcripts/name-selection.output.md b/unison-src/transcripts/name-selection.output.md index 44b5c92e94..cb39617de3 100644 --- a/unison-src/transcripts/name-selection.output.md +++ b/unison-src/transcripts/name-selection.output.md @@ -93,36 +93,36 @@ d = c + 10 Added definitions: 7. builtin type builtin.Any - 8. unique type builtin.io2.ArithmeticFailure - 9. unique type builtin.io2.ArrayFailure + 8. type builtin.io2.ArithmeticFailure + 9. type builtin.io2.ArrayFailure 10. builtin type builtin.Boolean - 11. unique type builtin.io2.BufferMode + 11. type builtin.io2.BufferMode 12. builtin type builtin.Bytes 13. builtin type builtin.Char 14. builtin type builtin.io2.Tls.Cipher 15. builtin type builtin.Char.Class 16. builtin type builtin.io2.Tls.ClientConfig 17. builtin type builtin.Code - 18. unique type builtin.Doc + 18. type builtin.Doc 19. structural type builtin.Either a b 20. structural ability builtin.Exception - 21. unique type builtin.io2.Failure - 22. unique type builtin.io2.FileMode + 21. type builtin.io2.Failure + 22. type builtin.io2.FileMode 23. builtin type builtin.Float 24. builtin type builtin.io2.Handle 25. builtin type builtin.crypto.HashAlgorithm 26. builtin ability builtin.io2.IO - 27. unique type builtin.io2.IOError - 28. unique type builtin.io2.IOFailure + 27. type builtin.io2.IOError + 28. type builtin.io2.IOFailure 29. builtin type builtin.ImmutableArray 30. builtin type builtin.ImmutableByteArray 31. builtin type builtin.Int - 32. unique type builtin.IsPropagated - 33. unique type builtin.IsTest - 34. unique type builtin.Link + 32. type builtin.IsPropagated + 33. type builtin.IsTest + 34. type builtin.Link 35. builtin type builtin.List 36. builtin type builtin.io2.MVar - 37. unique type builtin.io2.MiscFailure + 37. type builtin.io2.MiscFailure 38. builtin type builtin.MutableArray 39. builtin type builtin.MutableByteArray 40. builtin type builtin.Nat @@ -133,30 +133,30 @@ d = c + 10 45. builtin type builtin.io2.Promise 46. builtin type builtin.Ref 47. builtin type builtin.Request - 48. unique type builtin.Test.Result - 49. unique type builtin.RewriteCase a b - 50. unique type builtin.RewriteSignature a b - 51. unique type builtin.RewriteTerm a b - 52. unique type builtin.Rewrites a - 53. unique type builtin.io2.RuntimeFailure + 48. type builtin.Test.Result + 49. type builtin.RewriteCase a b + 50. type builtin.RewriteSignature a b + 51. type builtin.RewriteTerm a b + 52. type builtin.Rewrites a + 53. type builtin.io2.RuntimeFailure 54. builtin ability builtin.io2.STM - 55. unique type builtin.io2.STMFailure + 55. type builtin.io2.STMFailure 56. builtin ability builtin.Scope - 57. unique type builtin.io2.SeekMode + 57. type builtin.io2.SeekMode 58. structural type builtin.SeqView a b 59. builtin type builtin.io2.Tls.ServerConfig 60. builtin type builtin.io2.Tls.SignedCert 61. builtin type builtin.io2.Socket - 62. unique type builtin.io2.StdHandle + 62. type builtin.io2.StdHandle 63. builtin type builtin.io2.TVar 64. builtin type builtin.Link.Term 65. builtin type builtin.Text 66. builtin type builtin.io2.ThreadId - 67. unique type builtin.io2.ThreadKilledFailure + 67. type builtin.io2.ThreadKilledFailure 68. builtin type builtin.io2.Ref.Ticket 69. builtin type builtin.io2.Clock.internals.TimeSpec 70. builtin type builtin.io2.Tls - 71. unique type builtin.io2.TlsFailure + 71. type builtin.io2.TlsFailure 72. structural type builtin.Tuple a b 73. builtin type builtin.Link.Type 74. structural type builtin.Unit diff --git a/unison-src/transcripts/pattern-match-coverage.output.md b/unison-src/transcripts/pattern-match-coverage.output.md index 700cf2917a..0a0b290c99 100644 --- a/unison-src/transcripts/pattern-match-coverage.output.md +++ b/unison-src/transcripts/pattern-match-coverage.output.md @@ -114,7 +114,7 @@ test = cases ⍟ These new definitions are ok to `add`: - unique type V + type V test : Optional (Optional V) -> () ``` @@ -547,7 +547,7 @@ test = cases ⍟ These new definitions are ok to `add`: - unique type V + type V test : [V] -> () ``` @@ -645,7 +645,7 @@ unit2t = cases ⍟ These new definitions are ok to `add`: - unique type T + type T unit2t : 'T ``` @@ -654,7 +654,7 @@ unit2t = cases ⍟ I've added these definitions: - unique type T + type T unit2t : 'T ``` @@ -701,7 +701,7 @@ evil = bug "" ⍟ These new definitions are ok to `add`: - unique type V + type V evil : 'V ``` @@ -710,7 +710,7 @@ evil = bug "" ⍟ I've added these definitions: - unique type V + type V evil : 'V ``` @@ -743,7 +743,7 @@ unique type SomeType = A ⍟ These new definitions are ok to `add`: - unique type SomeType + type SomeType ``` ```ucm @@ -751,7 +751,7 @@ unique type SomeType = A ⍟ I've added these definitions: - unique type SomeType + type SomeType ``` ```unison @@ -771,7 +771,7 @@ get x = match x with ⍟ These new definitions are ok to `add`: - unique type R + type R get : R -> SomeType ``` @@ -789,7 +789,7 @@ unique type R = { someType : SomeType } ⍟ These new definitions are ok to `add`: - unique type R + type R R.someType : R -> SomeType R.someType.modify : (SomeType ->{g} SomeType) -> R ->{g} R R.someType.set : SomeType -> R -> R @@ -853,7 +853,7 @@ result f = handle !f with cases ⍟ These names already exist. You can `update` them to your new definition: - unique type T + type T ``` ```unison @@ -1197,7 +1197,7 @@ result f = ⍟ These new definitions are ok to `add`: - unique ability Give a + ability Give a result : '{e, Give V} r ->{e} r ``` @@ -1225,7 +1225,7 @@ result f = ⍟ These new definitions are ok to `add`: - unique ability Give a + ability Give a result : '{e, Give V} r ->{e} r ``` @@ -1312,8 +1312,8 @@ result f = ⍟ These new definitions are ok to `add`: - unique ability GiveA a - unique ability GiveB a + ability GiveA a + ability GiveB a result : '{e, GiveA V, GiveB V} r ->{e} r ``` diff --git a/unison-src/transcripts/propagate.output.md b/unison-src/transcripts/propagate.output.md index e008cc8bca..e6763b001d 100644 --- a/unison-src/transcripts/propagate.output.md +++ b/unison-src/transcripts/propagate.output.md @@ -21,7 +21,7 @@ fooToInt _ = +42 ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo fooToInt : Foo -> Int ``` @@ -34,13 +34,13 @@ And then we add it. ⍟ I've added these definitions: - unique type Foo + type Foo fooToInt : Foo -> Int .subpath> find.verbose 1. -- #khopi9b7o8afgva63q9riun664i1p24ricqjbnelo7eipmnsccu3s49v78u9sd3psdfkbllbk183n4e4apco3db99k3v8fehhaasbqo - unique type Foo + type Foo 2. -- #khopi9b7o8afgva63q9riun664i1p24ricqjbnelo7eipmnsccu3s49v78u9sd3psdfkbllbk183n4e4apco3db99k3v8fehhaasbqo#0 Foo.Foo : Foo @@ -73,7 +73,7 @@ unique type Foo = Foo | Bar ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` and update the codebase to use the new type `Foo`... @@ -83,7 +83,7 @@ and update the codebase to use the new type `Foo`... ⍟ I've updated these names to your new definition: - unique type Foo + type Foo ``` ... it should automatically propagate the type to `fooToInt`. diff --git a/unison-src/transcripts/records.output.md b/unison-src/transcripts/records.output.md index f4bc2b1e8a..994735a58e 100644 --- a/unison-src/transcripts/records.output.md +++ b/unison-src/transcripts/records.output.md @@ -9,7 +9,7 @@ unique type Record1 = { a : Text } ```ucm .> view Record1 - unique type Record1 = { a : Text } + type Record1 = { a : Text } ``` ## Record with 2 fields @@ -21,7 +21,7 @@ unique type Record2 = { a : Text, b : Int } ```ucm .> view Record2 - unique type Record2 = { a : Text, b : Int } + type Record2 = { a : Text, b : Int } ``` ## Record with 3 fields @@ -33,7 +33,7 @@ unique type Record3 = { a : Text, b : Int, c : Nat } ```ucm .> view Record3 - unique type Record3 = { a : Text, b : Int, c : Nat } + type Record3 = { a : Text, b : Int, c : Nat } ``` ## Record with many fields @@ -53,7 +53,7 @@ unique type Record4 = ```ucm .> view Record4 - unique type Record4 + type Record4 = { a : Text, b : Int, c : Nat, @@ -78,7 +78,7 @@ If you `view` or `edit` it, it _should_ be treated as a record type, but it does ```ucm .> view RecordWithUserType - unique type RecordWithUserType + type RecordWithUserType = { a : Text, b : Record4, c : UserType } ``` @@ -103,7 +103,7 @@ unique type Record5 = ⍟ These new definitions are ok to `add`: - unique type Record5 + type Record5 Record5.a : Record5 -> Text Record5.a.modify : (Text ->{g} Text) -> Record5 diff --git a/unison-src/transcripts/resolution-failures.output.md b/unison-src/transcripts/resolution-failures.output.md index 716cd838e6..af7a5f9b48 100644 --- a/unison-src/transcripts/resolution-failures.output.md +++ b/unison-src/transcripts/resolution-failures.output.md @@ -32,8 +32,8 @@ two.ambiguousTerm = "term two" ⍟ These new definitions are ok to `add`: - unique type one.AmbiguousType - unique type two.AmbiguousType + type one.AmbiguousType + type two.AmbiguousType one.ambiguousTerm : ##Text two.ambiguousTerm : ##Text @@ -43,8 +43,8 @@ two.ambiguousTerm = "term two" ⍟ I've added these definitions: - unique type one.AmbiguousType - unique type two.AmbiguousType + type one.AmbiguousType + type two.AmbiguousType one.ambiguousTerm : ##Text two.ambiguousTerm : ##Text diff --git a/unison-src/transcripts/suffixes.output.md b/unison-src/transcripts/suffixes.output.md index 73b4724ee0..83719211c6 100644 --- a/unison-src/transcripts/suffixes.output.md +++ b/unison-src/transcripts/suffixes.output.md @@ -166,7 +166,7 @@ bar = 100 ⍟ I've added these definitions: - unique type A + type A bar : Nat foo.a : Nat @@ -198,7 +198,7 @@ fn = cases ⍟ These new definitions are ok to `add`: - unique type B + type B fn : B -> Text foo.baz.qux.bar : Text zoink.a : Text diff --git a/unison-src/transcripts/tab-completion.output.md b/unison-src/transcripts/tab-completion.output.md index 0d2ed20936..67f7092460 100644 --- a/unison-src/transcripts/tab-completion.output.md +++ b/unison-src/transcripts/tab-completion.output.md @@ -49,7 +49,7 @@ unique type subnamespace.AType = A | B ⍟ These new definitions are ok to `add`: - unique type subnamespace.AType + type subnamespace.AType othernamespace.someName : ##Nat subnamespace.someName : ##Nat subnamespace.someOtherName : ##Nat @@ -153,7 +153,7 @@ add b = b ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo add : a -> a ``` @@ -162,7 +162,7 @@ add b = b ⍟ I've added these definitions: - unique type Foo + type Foo add : a -> a .> debug.tab-complete delete.type Foo diff --git a/unison-src/transcripts/top-level-exceptions.output.md b/unison-src/transcripts/top-level-exceptions.output.md index 80b765c227..2a1241f915 100644 --- a/unison-src/transcripts/top-level-exceptions.output.md +++ b/unison-src/transcripts/top-level-exceptions.output.md @@ -9,7 +9,7 @@ FYI, here are the `Exception` and `Failure` types: structural ability builtin.Exception where raise : Failure ->{builtin.Exception} x - unique type builtin.io2.Failure + type builtin.io2.Failure = Failure Type Text Any ``` @@ -84,7 +84,7 @@ unique type RuntimeError = ⍟ These new definitions are ok to `add`: - unique type RuntimeError + type RuntimeError error : Text -> a ->{Exception} x main2 : '{Exception} r diff --git a/unison-src/transcripts/type-modifier-required.md b/unison-src/transcripts/type-modifier-are-optional.md similarity index 58% rename from unison-src/transcripts/type-modifier-required.md rename to unison-src/transcripts/type-modifier-are-optional.md index 1b47bf78e7..01401a4505 100644 --- a/unison-src/transcripts/type-modifier-required.md +++ b/unison-src/transcripts/type-modifier-are-optional.md @@ -1,18 +1,18 @@ -# Type modifiers are required +# Type modifiers are optional, `unique` shoud be used as default ```ucm:hide .> builtins.merge ``` -Types needs to be prefixed with either `unique` or `structural`: +Types do not need to be prefixed with either `unique` or `structural`: -```unison:error +```unison type Abc = Abc ``` -Abilities needs to be prefixed with either `unique` or `structural`: +Abilities do not need to be prefixed with either `unique` or `structural`: -```unison:error +```unison ability MyAbility where const : a ``` diff --git a/unison-src/transcripts/type-modifier-required.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md similarity index 51% rename from unison-src/transcripts/type-modifier-required.output.md rename to unison-src/transcripts/type-modifier-are-optional.output.md index 846bf7d78f..52e938a6e7 100644 --- a/unison-src/transcripts/type-modifier-required.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -1,6 +1,6 @@ -# Type modifiers are required +# Type modifiers are optional, `unique` shoud be used as default -Types needs to be prefixed with either `unique` or `structural`: +Types do not need to be prefixed with either `unique` or `structural`: ```unison type Abc = Abc @@ -10,17 +10,16 @@ type Abc = Abc Loading changes detected in scratch.u. - I expected to see `structural` or `unique` at the start of - this line: - - 1 | type Abc = Abc + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: - Learn more about when to use `structural` vs `unique` in the - Unison Docs: - https://www.unison-lang.org/learn/language-reference/unique-types/ + ⍟ These new definitions are ok to `add`: + + type Abc ``` -Abilities needs to be prefixed with either `unique` or `structural`: +Abilities do not need to be prefixed with either `unique` or `structural`: ```unison ability MyAbility where const : a @@ -30,14 +29,13 @@ ability MyAbility where const : a Loading changes detected in scratch.u. - I expected to see `structural` or `unique` at the start of - this line: - - 1 | ability MyAbility where const : a + I found and typechecked these definitions in scratch.u. If you + do an `add` or `update`, here's how your codebase would + change: - Learn more about when to use `structural` vs `unique` in the - Unison Docs: - https://www.unison-lang.org/learn/language-reference/unique-types/ + ⍟ These new definitions are ok to `add`: + + ability MyAbility ``` There should be no errors when `unique` or `structural` is provided: @@ -61,8 +59,8 @@ unique ability MyAbilityU where const : a structural type AbcS (also named builtin.Unit) - unique type AbcU + type AbcU structural ability MyAbilityS - unique ability MyAbilityU + ability MyAbilityU ``` diff --git a/unison-src/transcripts/unique-type-churn.output.md b/unison-src/transcripts/unique-type-churn.output.md index 038ec36de5..bcee03f59e 100644 --- a/unison-src/transcripts/unique-type-churn.output.md +++ b/unison-src/transcripts/unique-type-churn.output.md @@ -18,9 +18,9 @@ unique type C = C B ⍟ These new definitions are ok to `add`: - unique type A - unique type B - unique type C + type A + type B + type C ``` ```ucm @@ -28,9 +28,9 @@ unique type C = C B ⍟ I've added these definitions: - unique type A - unique type B - unique type C + type A + type B + type C ``` ```unison @@ -79,7 +79,7 @@ unique type A = A () ⍟ These names already exist. You can `update` them to your new definition: - unique type A + type A ``` ```ucm @@ -118,7 +118,7 @@ unique type A = A ⍟ These names already exist. You can `update` them to your new definition: - unique type A + type A ``` Note that `A` is back to its original hash. diff --git a/unison-src/transcripts/universal-cmp.output.md b/unison-src/transcripts/universal-cmp.output.md index b926c656d0..ec03128e87 100644 --- a/unison-src/transcripts/universal-cmp.output.md +++ b/unison-src/transcripts/universal-cmp.output.md @@ -21,7 +21,7 @@ threadEyeDeez _ = ⍟ These new definitions are ok to `add`: - unique type A + type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) ``` @@ -30,7 +30,7 @@ threadEyeDeez _ = ⍟ I've added these definitions: - unique type A + type A threadEyeDeez : ∀ _. _ ->{IO} (Boolean, Boolean) .> run threadEyeDeez diff --git a/unison-src/transcripts/update-type-add-constructor.output.md b/unison-src/transcripts/update-type-add-constructor.output.md index 8b9840e9ad..d0fb21a382 100644 --- a/unison-src/transcripts/update-type-add-constructor.output.md +++ b/unison-src/transcripts/update-type-add-constructor.output.md @@ -13,7 +13,7 @@ unique type Foo ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -21,7 +21,7 @@ unique type Foo ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison @@ -41,7 +41,7 @@ unique type Foo ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -54,12 +54,12 @@ unique type Foo .> view Foo - unique type Foo = Bar Nat | Baz Nat Nat + type Foo = Bar Nat | Baz Nat Nat .> find.verbose 1. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog - unique type Foo + type Foo 2. -- #2sffq4apsq1cts53njcunj63fa8ohov4eqn77q14s77ajicajh4g28sq5s5ai33f2k6oh6o67aarnlpu7u7s4la07ag2er33epalsog#0 Foo.Bar : Nat -> Foo diff --git a/unison-src/transcripts/update-type-add-field.output.md b/unison-src/transcripts/update-type-add-field.output.md index 1c25ba8aec..7ee979d64e 100644 --- a/unison-src/transcripts/update-type-add-field.output.md +++ b/unison-src/transcripts/update-type-add-field.output.md @@ -12,7 +12,7 @@ unique type Foo = Bar Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Bar Nat ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison @@ -38,7 +38,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -51,12 +51,12 @@ unique type Foo = Bar Nat Nat .> view Foo - unique type Foo = Bar Nat Nat + type Foo = Bar Nat Nat .> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - unique type Foo + type Foo 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo diff --git a/unison-src/transcripts/update-type-add-new-record.output.md b/unison-src/transcripts/update-type-add-new-record.output.md index 0d5ad37704..8c00d6c1de 100644 --- a/unison-src/transcripts/update-type-add-new-record.output.md +++ b/unison-src/transcripts/update-type-add-new-record.output.md @@ -12,7 +12,7 @@ unique type Foo = { bar : Nat } ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -28,6 +28,6 @@ unique type Foo = { bar : Nat } .> view Foo - unique type Foo = { bar : Nat } + type Foo = { bar : Nat } ``` diff --git a/unison-src/transcripts/update-type-add-record-field.output.md b/unison-src/transcripts/update-type-add-record-field.output.md index 17d6c5b5c6..3f52ad6a82 100644 --- a/unison-src/transcripts/update-type-add-record-field.output.md +++ b/unison-src/transcripts/update-type-add-record-field.output.md @@ -12,7 +12,7 @@ unique type Foo = { bar : Nat } ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -23,7 +23,7 @@ unique type Foo = { bar : Nat } ⍟ I've added these definitions: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -50,7 +50,7 @@ unique type Foo = { bar : Nat, baz : Int } ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -66,12 +66,12 @@ unique type Foo = { bar : Nat, baz : Int } .> view Foo - unique type Foo = { bar : Nat, baz : Int } + type Foo = { bar : Nat, baz : Int } .> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 - unique type Foo + type Foo 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 Foo.bar : Foo -> Nat diff --git a/unison-src/transcripts/update-type-constructor-alias.output.md b/unison-src/transcripts/update-type-constructor-alias.output.md index e800feacb8..d0d8dcfff9 100644 --- a/unison-src/transcripts/update-type-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-constructor-alias.output.md @@ -12,7 +12,7 @@ unique type Foo = Bar Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Bar Nat ⍟ I've added these definitions: - unique type Foo + type Foo .> alias.term Foo.Bar Foo.BarAlias @@ -42,7 +42,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. @@ -58,7 +58,7 @@ Bug: we leave `Foo.BarAlias` in the namespace with a nameless decl. .> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - unique type Foo + type Foo 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo 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 dab8c1b9ff..2b5a2754cd 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 @@ -19,7 +19,7 @@ foo = cases ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo foo : Foo -> Nat ``` @@ -28,7 +28,7 @@ foo = cases ⍟ I've added these definitions: - unique type Foo + type Foo foo : Foo -> Nat ``` @@ -48,7 +48,7 @@ unique type Foo ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -64,7 +64,7 @@ unique type Foo Bar n -> n Baz n m -> n Nat.+ m - unique type Foo = Bar Nat + type Foo = Bar Nat Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try diff --git a/unison-src/transcripts/update-type-delete-constructor.output.md b/unison-src/transcripts/update-type-delete-constructor.output.md index 1756ddac0f..c417d5f15c 100644 --- a/unison-src/transcripts/update-type-delete-constructor.output.md +++ b/unison-src/transcripts/update-type-delete-constructor.output.md @@ -14,7 +14,7 @@ unique type Foo ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -22,7 +22,7 @@ unique type Foo ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison @@ -41,7 +41,7 @@ unique type Foo ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -54,12 +54,12 @@ unique type Foo .> view Foo - unique type Foo = Bar Nat + type Foo = Bar Nat .> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - unique type Foo + type Foo 2. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60#0 Foo.Bar : Nat -> Foo diff --git a/unison-src/transcripts/update-type-delete-record-field.output.md b/unison-src/transcripts/update-type-delete-record-field.output.md index 3ecf4b96b8..0396df833a 100644 --- a/unison-src/transcripts/update-type-delete-record-field.output.md +++ b/unison-src/transcripts/update-type-delete-record-field.output.md @@ -12,7 +12,7 @@ unique type Foo = { bar : Nat, baz : Int } ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -26,7 +26,7 @@ unique type Foo = { bar : Nat, baz : Int } ⍟ I've added these definitions: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -50,7 +50,7 @@ unique type Foo = { bar : Nat } ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -75,7 +75,7 @@ We want the field accessors to go away; but for now they are here, causing the u Foo.baz.modify : (Int ->{g} Int) -> Foo ->{g} Foo Foo.baz.modify f = cases Foo bar baz -> Foo bar (f baz) - unique type Foo = { bar : Nat } + type Foo = { bar : Nat } Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try @@ -83,12 +83,12 @@ We want the field accessors to go away; but for now they are here, causing the u .> view Foo - unique type Foo = { bar : Nat, baz : Int } + type Foo = { bar : Nat, baz : Int } .> find.verbose 1. -- #05gh1dur4778dauh9slaofprc5356n47qpove0c1jl0birt2fcu301js8auu5vfr5bjfga9j8ikuk07ll9fu1gj3ehrp3basguhsd58 - unique type Foo + type Foo 2. -- #77mi33dv8ac2s90852khi35km5gsamhnpada8mai0k36obbttgg17qld719ospcs1ht9ctolg3pjsqs6qjnl3hfmu493rgsher73sc0 Foo.bar : Foo -> Nat diff --git a/unison-src/transcripts/update-type-missing-constructor.output.md b/unison-src/transcripts/update-type-missing-constructor.output.md index e9f75186bb..52ead472eb 100644 --- a/unison-src/transcripts/update-type-missing-constructor.output.md +++ b/unison-src/transcripts/update-type-missing-constructor.output.md @@ -12,7 +12,7 @@ unique type Foo = Bar Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Bar Nat ⍟ I've added these definitions: - unique type Foo + type Foo .> delete.term Foo.Bar @@ -44,13 +44,13 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm .> view Foo - unique type Foo = #b509v3eg4k#0 Nat + type Foo = #b509v3eg4k#0 Nat .> 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 02cb85fb69..3085452672 100644 --- a/unison-src/transcripts/update-type-nested-decl-aliases.output.md +++ b/unison-src/transcripts/update-type-nested-decl-aliases.output.md @@ -17,7 +17,7 @@ structural type A = B.TheOtherAlias Foo structural type A structural type A.B - unique type Foo + type Foo ``` ```ucm @@ -27,7 +27,7 @@ structural type A = B.TheOtherAlias Foo structural type A structural type A.B - unique type Foo + type Foo ``` ```unison @@ -45,7 +45,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` Bug: this update doesn't do the right thing; we simply don't properly update all of the names because @@ -93,7 +93,7 @@ Long story short, we should reject this update as it violates the "decl coherenc A.OneAlias, A.B.OneAlias : Foo -> A 6. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - unique type Foo + type Foo 7. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo 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 27539dd990..1a7e55eb74 100644 --- a/unison-src/transcripts/update-type-no-op-record.output.md +++ b/unison-src/transcripts/update-type-no-op-record.output.md @@ -12,7 +12,7 @@ unique type Foo = { bar : Nat } ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo @@ -23,7 +23,7 @@ unique type Foo = { bar : Nat } ⍟ I've added these definitions: - unique type Foo + type Foo Foo.bar : Foo -> Nat Foo.bar.modify : (Nat ->{g} Nat) -> Foo ->{g} Foo Foo.bar.set : Nat -> Foo -> Foo 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 2f6d797634..62c24c3ec7 100644 --- a/unison-src/transcripts/update-type-stray-constructor-alias.output.md +++ b/unison-src/transcripts/update-type-stray-constructor-alias.output.md @@ -12,7 +12,7 @@ unique type Foo = Bar Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Bar Nat ⍟ I've added these definitions: - unique type Foo + type Foo .> alias.term Foo.Bar Stray.BarAlias @@ -42,7 +42,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. @@ -58,7 +58,7 @@ Bug: we leave `Stray.BarAlias` in the namespace with a nameless decl. .> find.verbose 1. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - unique type Foo + type Foo 2. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo diff --git a/unison-src/transcripts/update-type-stray-constructor.output.md b/unison-src/transcripts/update-type-stray-constructor.output.md index 011d4fe5b2..8f72beefd3 100644 --- a/unison-src/transcripts/update-type-stray-constructor.output.md +++ b/unison-src/transcripts/update-type-stray-constructor.output.md @@ -12,7 +12,7 @@ unique type Foo = Bar Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Bar Nat ⍟ I've added these definitions: - unique type Foo + type Foo .> move.term Foo.Bar Stray.Bar @@ -44,7 +44,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) doesn't really exist, it's just showing up due to a pretty-printer bug. @@ -52,7 +52,7 @@ Note that the constructor name shown here (implied to be called `Foo.Stray.Bar`) ```ucm .> view Foo - unique type Foo = Stray.Bar Nat + type Foo = Stray.Bar Nat .> update 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 4890bbdc37..a28e27e747 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 @@ -15,7 +15,7 @@ makeFoo n = Bar (n+10) ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo makeFoo : Nat -> Foo ``` @@ -24,7 +24,7 @@ makeFoo n = Bar (n+10) ⍟ I've added these definitions: - unique type Foo + type Foo makeFoo : Nat -> Foo ``` @@ -64,12 +64,12 @@ Foo.Bar n = internal.Bar n .> view Foo - unique type Foo = internal.Bar Nat + type Foo = internal.Bar Nat .> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - unique type Foo + type Foo 2. -- #36rn6jqt1k5jccb3c7vagp3jam74dngr92kgcntqhs6dbkua54verfert2i6hsku6uitt9s2jvt1msric0tgemal52d5apav6akn25o Foo.Bar : Nat -> Foo diff --git a/unison-src/transcripts/update-type-turn-non-record-into-record.output.md b/unison-src/transcripts/update-type-turn-non-record-into-record.output.md index 00ea2a292b..f23ab09cd5 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 @@ -12,7 +12,7 @@ unique type Foo = Nat ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo ``` ```ucm @@ -20,7 +20,7 @@ unique type Foo = Nat ⍟ I've added these definitions: - unique type Foo + type Foo ``` ```unison @@ -44,7 +44,7 @@ unique type Foo = { bar : Nat } ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -57,12 +57,12 @@ unique type Foo = { bar : Nat } .> view Foo - unique type Foo = { bar : Nat } + type Foo = { bar : Nat } .> find.verbose 1. -- #b509v3eg4kehsg29g6pvrogeb71ue32nm2fj9284n4i7lprsr7u9a7g6s695d09du0fsfti6rrsk1s62q5thpr1jjkqb3us3s0lrd60 - unique type Foo + type Foo 2. -- #ovhevqfin94qhq5fu0mujfi20mbpvg5mh4vsfklrohp84cch4lhvrn5p29cnbsqfm92l7bt8c1vpjooh72a0psbddvvten4gq2sipag Foo.bar : Foo -> Nat diff --git a/unison-src/transcripts/update-type-with-dependent-term.output.md b/unison-src/transcripts/update-type-with-dependent-term.output.md index 2024652431..4be8707271 100644 --- a/unison-src/transcripts/update-type-with-dependent-term.output.md +++ b/unison-src/transcripts/update-type-with-dependent-term.output.md @@ -15,7 +15,7 @@ incrFoo = cases Bar n -> Bar (n+1) ⍟ These new definitions are ok to `add`: - unique type Foo + type Foo incrFoo : Foo -> Foo ``` @@ -24,7 +24,7 @@ incrFoo = cases Bar n -> Bar (n+1) ⍟ I've added these definitions: - unique type Foo + type Foo incrFoo : Foo -> Foo ``` @@ -43,7 +43,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -57,7 +57,7 @@ unique type Foo = Bar Nat Nat incrFoo : Foo -> Foo incrFoo = cases Bar n -> Bar (n Nat.+ 1) - unique type Foo = Bar Nat Nat + type Foo = Bar Nat Nat Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try 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 e6a10542eb..6852004699 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 @@ -13,8 +13,8 @@ unique type Baz = Qux Foo ⍟ These new definitions are ok to `add`: - unique type Baz - unique type Foo + type Baz + type Foo ``` ```ucm @@ -22,8 +22,8 @@ unique type Baz = Qux Foo ⍟ I've added these definitions: - unique type Baz - unique type Foo + type Baz + type Foo ``` ```unison @@ -41,7 +41,7 @@ unique type Foo a = Bar Nat a ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo a + type Foo a ``` ```ucm @@ -52,9 +52,9 @@ unique type Foo a = Bar Nat a That's done. Now I'm making sure everything typechecks... - unique type Baz = Qux Foo + type Baz = Qux Foo - unique type Foo a = Bar Nat a + type Foo a = Bar Nat a Typechecking failed. I've updated your scratch file with the definitions that need fixing. Once the file is compiling, try 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 cd3380e7b9..47988e1ffd 100644 --- a/unison-src/transcripts/update-type-with-dependent-type.output.md +++ b/unison-src/transcripts/update-type-with-dependent-type.output.md @@ -13,8 +13,8 @@ unique type Baz = Qux Foo ⍟ These new definitions are ok to `add`: - unique type Baz - unique type Foo + type Baz + type Foo ``` ```ucm @@ -22,8 +22,8 @@ unique type Baz = Qux Foo ⍟ I've added these definitions: - unique type Baz - unique type Foo + type Baz + type Foo ``` ```unison @@ -41,7 +41,7 @@ unique type Foo = Bar Nat Nat ⍟ These names already exist. You can `update` them to your new definition: - unique type Foo + type Foo ``` ```ucm @@ -58,22 +58,22 @@ unique type Foo = Bar Nat Nat .> view Foo - unique type Foo = Bar Nat Nat + type Foo = Bar Nat Nat .> view Baz - unique type Baz = Qux Foo + type Baz = Qux Foo .> find.verbose 1. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08 - unique type Baz + type Baz 2. -- #34msh9satlfog576493eo9pkjn6aj7d8fj6jfheglvgr5s39iptb81649bpkad1lqraheqb8em9ms551k01oternhknc4m7jicgtk08#0 Baz.Qux : Foo -> Baz 3. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g - unique type Foo + type Foo 4. -- #8fk6k0j208th1ia4vnjtoc5fomd6le540prec255svg71bcfga9dofrvoq1d7v6010d6b6em4q51p8st5c5juhrev72cnnel8ko3o1g#0 Foo.Bar : Nat -> Nat -> Foo From a27159cb6a8de86f8e72b65f37b4f86e10d2214a Mon Sep 17 00:00:00 2001 From: andrii <25188+unorsk@users.noreply.github.com> Date: Thu, 4 Jan 2024 12:22:03 +0100 Subject: [PATCH 5/9] A comment for pretty-printing unique types with uid --- parser-typechecker/src/Unison/Syntax/DeclPrinter.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs index 26fef94b59..06c0c63b13 100644 --- a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs +++ b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs @@ -200,6 +200,8 @@ fieldNames env r name dd = do prettyModifier :: DD.Modifier -> Pretty SyntaxText prettyModifier DD.Structural = fmt S.DataTypeModifier "structural" prettyModifier (DD.Unique _uid) = mempty -- don't print anything since 'unique' is the default + -- leaving this comment for the historical record so the syntax for uid is not forgotten + -- fmt S.DataTypeModifier "unique" -- <> ("[" <> P.text uid <> "] ") prettyDataHeader :: (Var v) => HQ.HashQualified Name -> DD.DataDeclaration v a -> Pretty SyntaxText From 8bf585a8577114a2716ffc3f551de156743221eb Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Fri, 5 Jan 2024 14:56:38 -1000 Subject: [PATCH 6/9] update type-modifier-are-optional transcript --- .../transcripts/type-modifier-are-optional.md | 25 +++----- .../type-modifier-are-optional.output.md | 57 ++++--------------- 2 files changed, 20 insertions(+), 62 deletions(-) diff --git a/unison-src/transcripts/type-modifier-are-optional.md b/unison-src/transcripts/type-modifier-are-optional.md index 01401a4505..abce0ad0b8 100644 --- a/unison-src/transcripts/type-modifier-are-optional.md +++ b/unison-src/transcripts/type-modifier-are-optional.md @@ -1,26 +1,17 @@ -# Type modifiers are optional, `unique` shoud be used as default +# Type modifiers are optional, `unique` is the default. ```ucm:hide .> builtins.merge ``` -Types do not need to be prefixed with either `unique` or `structural`: +Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. ```unison -type Abc = Abc -``` - -Abilities do not need to be prefixed with either `unique` or `structural`: +type Abc = Abc +unique type Def = Def +structural type Ghi = Ghi -```unison -ability MyAbility where const : a +ability MyAbility where const : a +unique ability MyAbilityU where const : a +structural ability MyAbilityS where const : a ``` - -There should be no errors when `unique` or `structural` is provided: - -```unison -structural type AbcS = AbcS -unique type AbcU = AbcU -structural ability MyAbilityS where const : a -unique ability MyAbilityU where const : a -``` \ No newline at end of file diff --git a/unison-src/transcripts/type-modifier-are-optional.output.md b/unison-src/transcripts/type-modifier-are-optional.output.md index 52e938a6e7..88b7844127 100644 --- a/unison-src/transcripts/type-modifier-are-optional.output.md +++ b/unison-src/transcripts/type-modifier-are-optional.output.md @@ -1,28 +1,15 @@ -# Type modifiers are optional, `unique` shoud be used as default +# Type modifiers are optional, `unique` is the default. -Types do not need to be prefixed with either `unique` or `structural`: +Types and abilities may be prefixed with either `unique` or `structural`. When left unspecified, `unique` is assumed. ```unison -type Abc = Abc -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - type Abc +type Abc = Abc +unique type Def = Def +structural type Ghi = Ghi -``` -Abilities do not need to be prefixed with either `unique` or `structural`: - -```unison -ability MyAbility where const : a +ability MyAbility where const : a +unique ability MyAbilityU where const : a +structural ability MyAbilityS where const : a ``` ```ucm @@ -35,31 +22,11 @@ ability MyAbility where const : a ⍟ These new definitions are ok to `add`: - ability MyAbility - -``` -There should be no errors when `unique` or `structural` is provided: - -```unison -structural type AbcS = AbcS -unique type AbcU = AbcU -structural ability MyAbilityS where const : a -unique ability MyAbilityU where const : a -``` - -```ucm - - Loading changes detected in scratch.u. - - I found and typechecked these definitions in scratch.u. If you - do an `add` or `update`, here's how your codebase would - change: - - ⍟ These new definitions are ok to `add`: - - structural type AbcS + type Abc + type Def + structural type Ghi (also named builtin.Unit) - type AbcU + ability MyAbility structural ability MyAbilityS ability MyAbilityU From 40ec9404b548f298418a206cd5033e72a1a01dfb Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Fri, 5 Jan 2024 14:58:47 -1000 Subject: [PATCH 7/9] fix fix1696 and fix2297 transcripts these had broken in the past when we made the modifier mandatory and nobody noticed until now --- unison-src/transcripts-using-base/fix2297.md | 4 ++-- unison-src/transcripts-using-base/fix2297.output.md | 4 ++-- unison-src/transcripts/fix1696.md | 4 ++-- unison-src/transcripts/fix1696.output.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unison-src/transcripts-using-base/fix2297.md b/unison-src/transcripts-using-base/fix2297.md index 2ecd676850..f4d1c0d57c 100644 --- a/unison-src/transcripts-using-base/fix2297.md +++ b/unison-src/transcripts-using-base/fix2297.md @@ -2,12 +2,12 @@ This tests a case where a function was somehow discarding abilities. ```unison:error -ability Trivial where +structural ability Trivial where trivial : () -- This handler SHOULD leave any additional effects alone and unhandled handleTrivial : '{e, Trivial} a -> {e} a -handleTrivial action = +handleTrivial action = h : Request {Trivial} a -> a h = cases {trivial -> resume} -> handle !resume with h diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index 3cc7b62dfe..34fde626b0 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -2,12 +2,12 @@ This tests a case where a function was somehow discarding abilities. ```unison -ability Trivial where +structural ability Trivial where trivial : () -- This handler SHOULD leave any additional effects alone and unhandled handleTrivial : '{e, Trivial} a -> {e} a -handleTrivial action = +handleTrivial action = h : Request {Trivial} a -> a h = cases {trivial -> resume} -> handle !resume with h diff --git a/unison-src/transcripts/fix1696.md b/unison-src/transcripts/fix1696.md index 043b1b60b9..c80b41a731 100644 --- a/unison-src/transcripts/fix1696.md +++ b/unison-src/transcripts/fix1696.md @@ -4,9 +4,9 @@ ``` ```unison:error -ability Ask where ask : Nat +structural ability Ask where ask : Nat -unique ability Zoot where +ability Zoot where zoot : Nat Ask.provide : '{Zoot} Nat -> '{Ask} r -> r diff --git a/unison-src/transcripts/fix1696.output.md b/unison-src/transcripts/fix1696.output.md index 0657c81ca8..c0a9ccce85 100644 --- a/unison-src/transcripts/fix1696.output.md +++ b/unison-src/transcripts/fix1696.output.md @@ -1,8 +1,8 @@ ```unison -ability Ask where ask : Nat +structural ability Ask where ask : Nat -unique ability Zoot where +ability Zoot where zoot : Nat Ask.provide : '{Zoot} Nat -> '{Ask} r -> r From 951b6ae76bd156d8dc471cc2bddecaf91c22a4e9 Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Fri, 5 Jan 2024 15:08:52 -1000 Subject: [PATCH 8/9] fix fix2297 this had broken in the past when we made discarding non-Unit values explicit and nobody noticed until now --- unison-src/transcripts-using-base/fix2297.md | 4 ++-- .../transcripts-using-base/fix2297.output.md | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/unison-src/transcripts-using-base/fix2297.md b/unison-src/transcripts-using-base/fix2297.md index f4d1c0d57c..26c2108d2a 100644 --- a/unison-src/transcripts-using-base/fix2297.md +++ b/unison-src/transcripts-using-base/fix2297.md @@ -15,8 +15,8 @@ handleTrivial action = handle !action with h testAction : '{Exception, IO, Trivial} () -testAction _ = - printText "hi!" +testAction = do + printLine "hi!" trivial wat : () diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index 34fde626b0..542e8ac84b 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -15,8 +15,8 @@ handleTrivial action = handle !action with h testAction : '{Exception, IO, Trivial} () -testAction _ = - printText "hi!" +testAction = do + printLine "hi!" trivial wat : () @@ -29,13 +29,9 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti Loading changes detected in scratch.u. - I found a value of type: Either Failure Unit - where I expected to find: Unit - - 15 | printText "hi!" - 16 | trivial - - Hint: Actions within a block must have type Unit. - Use _ = to ignore a result. + The expression in red needs the {Exception} ability, but this location does not have access to any abilities. + + 19 | wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO + ``` From 70eee30e4a77c760d5eac8264712ca0b8772450b Mon Sep 17 00:00:00 2001 From: Arya Irani Date: Fri, 5 Jan 2024 15:34:37 -1000 Subject: [PATCH 9/9] whitespace changes in transcripts?? --- unison-src/transcripts-using-base/fix2297.output.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unison-src/transcripts-using-base/fix2297.output.md b/unison-src/transcripts-using-base/fix2297.output.md index 542e8ac84b..70f0fa13df 100644 --- a/unison-src/transcripts-using-base/fix2297.output.md +++ b/unison-src/transcripts-using-base/fix2297.output.md @@ -30,8 +30,8 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti Loading changes detected in scratch.u. The expression in red needs the {Exception} ability, but this location does not have access to any abilities. - + 19 | wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO - + ```