Replace '.' references with scratch/main

This commit is contained in:
Chris Penner 2024-06-11 15:22:09 -07:00
parent ae7cf3d0a5
commit 5ca1eb3b8d
422 changed files with 2246 additions and 5727 deletions

View File

@ -5,7 +5,7 @@ Thus, make sure the contents of this file define the contents of the cache
(e.g. don't pull `latest`.)
```ucm
.> pull @unison/base/releases/2.5.0 .base
.> builtins.mergeio
.> undo
scratch/main> pull @unison/base/releases/2.5.0 .base
scratch/main> builtins.mergeio
scratch/main> undo
```

View File

@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
```ucm:hide:error
.> this is a hack to trigger an error, in order to swallow any error on the next line.
.> we delete the project to avoid any merge conflicts or complaints from ucm.
.> delete.project runtime-tests
scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line.
scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm.
scratch/main> delete.project runtime-tests
```
```ucm:hide
.> clone ${runtime_tests_version} runtime-tests/selected
scratch/main> clone ${runtime_tests_version} runtime-tests/selected
```
```ucm

View File

@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
```ucm:hide:error
.> this is a hack to trigger an error, in order to swallow any error on the next line.
.> we delete the project to avoid any merge conflicts or complaints from ucm.
.> delete.project runtime-tests
scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line.
scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm.
scratch/main> delete.project runtime-tests
```
```ucm:hide
.> clone ${runtime_tests_version} runtime-tests/selected
scratch/main> clone ${runtime_tests_version} runtime-tests/selected
```
```ucm
@ -31,8 +31,8 @@ foo = do
```
```ucm
.> run.native foo
.> run.native foo
scratch/main> run.native foo
scratch/main> run.native foo
```
This can also only be tested by separately running this test, because

View File

@ -1,6 +1,6 @@
```ucm:hide
.> pull unison.public.base.releases.M4d base
.> pull runarorama.public.sort.data sort
scratch/main> pull unison.public.base.releases.M4d base
scratch/main> pull runarorama.public.sort.data sort
```
```unison:hide
@ -34,63 +34,63 @@ prepare = do
```
```ucm:hide
.> add
.> run prepare
scratch/main> add
scratch/main> run prepare
```
## Benchmarks
```ucm
.> load unison-src/transcripts-manual/benchmarks/each.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/each.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/listmap.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/listmap.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/listfilter.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/listfilter.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/random.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/random.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/simpleloop.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/simpleloop.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/fibonacci.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/fibonacci.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/map.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/map.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/natmap.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/natmap.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/stm.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/stm.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/tmap.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/tmap.u
scratch/main> run main
```
```ucm
.> load unison-src/transcripts-manual/benchmarks/array-sort.u
.> run main
scratch/main> load unison-src/transcripts-manual/benchmarks/array-sort.u
scratch/main> run main
```

View File

@ -3,5 +3,5 @@
Note: this makes a network call to share to get completions
```ucm
.> debug.tab-complete pull unison.pub
scratch/main> debug.tab-complete pull unison.pub
```

View File

@ -1,8 +1,8 @@
```ucm:hide
.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u
.> add
scratch/main> builtins.mergeio
scratch/main> load unison-src/transcripts-using-base/base.u
scratch/main> add
```
## Structural find and replace
@ -37,19 +37,19 @@ rule2 x = @rewrite signature Optional ==> Optional2
Let's rewrite these:
```ucm
.> rewrite rule1
.> rewrite eitherToOptional
scratch/main> rewrite rule1
scratch/main> rewrite eitherToOptional
```
```ucm:hide
.> load
.> add
scratch/main> load
scratch/main> add
```
After adding to the codebase, here's the rewritten source:
```ucm
.> view ex1 Either.mapRight rule1
scratch/main> view ex1 Either.mapRight rule1
```
Another example, showing that we can rewrite to definitions that only exist in the file:
@ -75,18 +75,18 @@ blah2 = 456
Let's apply the rewrite `woot1to2`:
```ucm
.> rewrite woot1to2
scratch/main> rewrite woot1to2
```
```ucm:hide
.> load
.> add
scratch/main> load
scratch/main> add
```
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
```ucm
.> view wootEx
scratch/main> view wootEx
```
This example shows that rewrite rules can to refer to term definitions that only exist in the file:
@ -111,15 +111,15 @@ sameFileEx =
```
```ucm:hide
.> rewrite rule
.> load
.> add
scratch/main> rewrite rule
scratch/main> load
scratch/main> add
```
After adding the rewritten form to the codebase, here's the rewritten definitions:
```ucm
.> view foo1 foo2 sameFileEx
scratch/main> view foo1 foo2 sameFileEx
```
## Capture avoidance
@ -145,13 +145,13 @@ sameFileEx =
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
```ucm
.> rewrite rule
scratch/main> rewrite rule
```
Instead, it should be an unbound free variable, which doesn't typecheck:
```ucm:error
.> load
scratch/main> load
```
In this example, the `a` is locally bound by the rule, so it shouldn't capture the `a = 39494` binding which is in scope at the point of the replacement:
@ -167,13 +167,13 @@ rule a = @rewrite
```
```ucm
.> rewrite rule
scratch/main> rewrite rule
```
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
```ucm:error
.> load
scratch/main> load
```
## Structural find
@ -183,7 +183,7 @@ eitherEx = Left ("hello", "there")
```
```ucm:hide
.> add
scratch/main> add
```
```unison:hide
@ -192,7 +192,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> ()
```
```ucm
.> sfind findEitherEx
.> sfind findEitherFailure
.> find 1-5
scratch/main> sfind findEitherEx
scratch/main> sfind findEitherFailure
scratch/main> find 1-5
```

View File

@ -2,8 +2,8 @@ This transcript executes very slowly, because the compiler has an
entire copy of base (and other stuff) within it.
```ucm:hide
.> builtins.merge
.> pull.without-history unison.public.base.trunk base
scratch/main> builtins.merge
scratch/main> pull.without-history unison.public.base.trunk base
```
```unison
@ -55,7 +55,7 @@ multiAddUp = repeat 35 '(printAddUp 3000000)
```
```ucm
.> add
.> run singleAddUp
.> run.native multiAddUp
scratch/main> add
scratch/main> run singleAddUp
scratch/main> run.native multiAddUp
```

View File

@ -1,13 +1,13 @@
This transcript verifies that the pretty-printer produces code that can be successfully parsed, for a variety of examples. Terms or types that fail to round-trip can be added to either `reparses-with-same-hash.u` or `reparses.u` as regression tests.
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
```ucm:hide
.> copy.namespace builtin a1.lib.builtin
.> copy.namespace builtin a2.lib.builtin
.> load unison-src/transcripts-round-trip/reparses-with-same-hash.u
scratch/main> copy.namespace builtin a1.lib.builtin
scratch/main> copy.namespace builtin a2.lib.builtin
scratch/main> load unison-src/transcripts-round-trip/reparses-with-same-hash.u
.a1> add
```
@ -41,12 +41,12 @@ So we can see the pretty-printed output:
This diff should be empty if the two namespaces are equivalent. If it's nonempty, the diff will show us the hashes that differ.
```ucm:error
.> diff.namespace a1 a2
scratch/main> diff.namespace a1 a2
```
```ucm:hide
.> undo
.> undo
scratch/main> undo
scratch/main> undo
```
Now check that definitions in 'reparses.u' at least parse on round trip:
@ -72,7 +72,7 @@ x = ()
```
```ucm:hide
.> move.namespace a3 a3_old
scratch/main> move.namespace a3 a3_old
.a3> copy.namespace .builtin lib.builtin
.a3> load
.a3> add
@ -83,7 +83,7 @@ x = ()
These are currently all expected to have different hashes on round trip.
```ucm
.> diff.namespace a3 a3_old
scratch/main> diff.namespace a3 a3_old
```
## Other regression tests not covered by above
@ -93,8 +93,8 @@ These are currently all expected to have different hashes on round trip.
Regression test for https://github.com/unisonweb/unison/pull/3548
```ucm:hide
.> alias.term ##Nat.+ plus
.> edit plus
.> load
.> undo
scratch/main> alias.term ##Nat.+ plus
scratch/main> edit plus
scratch/main> load
scratch/main> undo
```

View File

@ -10,9 +10,9 @@ transcripts which contain less boilerplate.
## Usage
```ucm:hide
.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u
.> add
scratch/main> builtins.mergeio
scratch/main> load unison-src/transcripts-using-base/base.u
scratch/main> add
```
The test shows that `hex (fromHex str) == str` as expected.
@ -24,7 +24,7 @@ test> hex.tests.ex1 = checks let
```
```ucm:hide
.> test
scratch/main> test
```
Lets do some basic testing of our test harness to make sure its
@ -50,6 +50,6 @@ testAutoClean _ =
```
```ucm
.> add
.> io.test testAutoClean
scratch/main> add
scratch/main> io.test testAutoClean
```

View File

@ -53,13 +53,13 @@ testAutoClean _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
testAutoClean : '{IO} [Result]
.> io.test testAutoClean
scratch/main> io.test testAutoClean
New test results:

View File

@ -1,5 +1,5 @@
This transcript is intended to make visible accidental changes to the hashing algorithm.
```ucm
.> find.verbose
scratch/main> find.verbose
```

View File

@ -1,7 +1,7 @@
This transcript is intended to make visible accidental changes to the hashing algorithm.
```ucm
.> find.verbose
scratch/main> find.verbose
1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo
<| : (i ->{g} o) -> i ->{g} o

View File

@ -54,6 +54,6 @@ testABunchOfNats _ =
```
```ucm
.> add
.> io.test testABunchOfNats
scratch/main> add
scratch/main> io.test testABunchOfNats
```

View File

@ -76,7 +76,7 @@ testABunchOfNats _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -91,7 +91,7 @@ testABunchOfNats _ =
testNat : Nat -> '{IO, Stream Result} ()
testRoundTrip : Nat -> EncDec ->{IO, Stream Result} ()
.> io.test testABunchOfNats
scratch/main> io.test testABunchOfNats
New test results:

View File

@ -153,7 +153,7 @@ swapped name link =
```
```ucm
.> add
scratch/main> add
```
```unison
@ -236,9 +236,9 @@ we gain the ability to capture output in a transcript, it can be modified
to actual show that the serialization works.
```ucm
.> add
.> io.test tests
.> io.test badLoad
scratch/main> add
scratch/main> io.test tests
scratch/main> io.test badLoad
```
```unison
@ -278,8 +278,8 @@ codeTests =
```
```ucm
.> add
.> io.test codeTests
scratch/main> add
scratch/main> io.test codeTests
```
```unison
@ -309,6 +309,6 @@ vtests _ =
```
```ucm
.> add
.> io.test vtests
scratch/main> add
scratch/main> io.test vtests
```

View File

@ -200,7 +200,7 @@ swapped name link =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -344,7 +344,7 @@ we gain the ability to capture output in a transcript, it can be modified
to actual show that the serialization works.
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -360,7 +360,7 @@ to actual show that the serialization works.
tests : '{IO} [Result]
zapper : Three Nat Nat Nat -> Request {Zap} r -> r
.> io.test tests
scratch/main> io.test tests
New test results:
@ -382,7 +382,7 @@ to actual show that the serialization works.
Tip: Use view tests to view the source of a test.
.> io.test badLoad
scratch/main> io.test badLoad
New test results:
@ -443,13 +443,13 @@ codeTests =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
codeTests : '{IO} [Result]
.> io.test codeTests
scratch/main> io.test codeTests
New test results:
@ -530,14 +530,14 @@ vtests _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
validateTest : Link.Term ->{IO} Result
vtests : '{IO} [Result]
.> io.test vtests
scratch/main> io.test vtests
New test results:

View File

@ -33,9 +33,9 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
```ucm
.> display d1
.> docs ImportantConstant
.> docs DayOfWeek
scratch/main> display d1
scratch/main> docs ImportantConstant
scratch/main> docs DayOfWeek
```
The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions.
@ -45,11 +45,11 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th
First, we'll load the `syntax.u` file which has examples of all the syntax:
```ucm
.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
```
```ucm:hide
.> add
scratch/main> add
```
Now we can review different portions of the guide.
@ -57,25 +57,25 @@ we'll show both the pretty-printed source using `view`
and the rendered output using `display`:
```ucm
.> view basicFormatting
.> display basicFormatting
.> view lists
.> display lists
.> view evaluation
.> display evaluation
.> view includingSource
.> display includingSource
.> view nonUnisonCodeBlocks
.> display nonUnisonCodeBlocks
.> view otherElements
.> display otherElements
scratch/main> view basicFormatting
scratch/main> display basicFormatting
scratch/main> view lists
scratch/main> display lists
scratch/main> view evaluation
scratch/main> display evaluation
scratch/main> view includingSource
scratch/main> display includingSource
scratch/main> view nonUnisonCodeBlocks
scratch/main> display nonUnisonCodeBlocks
scratch/main> view otherElements
scratch/main> display otherElements
```
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
```ucm
.> view doc.guide
.> display doc.guide
scratch/main> view doc.guide
scratch/main> display doc.guide
```
🌻 THE END

View File

@ -51,15 +51,15 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
```ucm
.> display d1
scratch/main> display d1
Hello there Alice!
.> docs ImportantConstant
scratch/main> docs ImportantConstant
An important constant, equal to `42`
.> docs DayOfWeek
scratch/main> docs DayOfWeek
The 7 days of the week, defined as:
@ -73,7 +73,7 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th
First, we'll load the `syntax.u` file which has examples of all the syntax:
```ucm
.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
Loading changes detected in
./unison-src/transcripts-using-base/doc.md.files/syntax.u.
@ -100,7 +100,7 @@ we'll show both the pretty-printed source using `view`
and the rendered output using `display`:
```ucm
.> view basicFormatting
scratch/main> view basicFormatting
basicFormatting : Doc2
basicFormatting =
@ -130,7 +130,7 @@ and the rendered output using `display`:
__Next up:__ {lists}
}}
.> display basicFormatting
scratch/main> display basicFormatting
# Basic formatting
@ -155,7 +155,7 @@ and the rendered output using `display`:
*Next up:* lists
.> view lists
scratch/main> view lists
lists : Doc2
lists =
@ -198,7 +198,7 @@ and the rendered output using `display`:
3. Get dressed.
}}
.> display lists
scratch/main> display lists
# Lists
@ -237,7 +237,7 @@ and the rendered output using `display`:
2. Take shower.
3. Get dressed.
.> view evaluation
scratch/main> view evaluation
evaluation : Doc2
evaluation =
@ -272,7 +272,7 @@ and the rendered output using `display`:
```
}}
.> display evaluation
scratch/main> display evaluation
# Evaluation
@ -300,7 +300,7 @@ and the rendered output using `display`:
cube : Nat -> Nat
cube x = x * x * x
.> view includingSource
scratch/main> view includingSource
includingSource : Doc2
includingSource =
@ -341,7 +341,7 @@ and the rendered output using `display`:
{{ docExample 1 do x -> sqr x }}.
}}
.> display includingSource
scratch/main> display includingSource
# Including Unison source code
@ -387,7 +387,7 @@ and the rendered output using `display`:
application, you can put it in double backticks, like
so: `sqr x`. This is equivalent to `sqr x`.
.> view nonUnisonCodeBlocks
scratch/main> view nonUnisonCodeBlocks
nonUnisonCodeBlocks : Doc2
nonUnisonCodeBlocks =
@ -420,7 +420,7 @@ and the rendered output using `display`:
```
}}
.> display nonUnisonCodeBlocks
scratch/main> display nonUnisonCodeBlocks
# Non-Unison code blocks
@ -449,7 +449,7 @@ and the rendered output using `display`:
xs.foldLeft(Nil : List[A])((acc,a) => a +: acc)
```
.> view otherElements
scratch/main> view otherElements
otherElements : Doc2
otherElements =
@ -506,7 +506,7 @@ and the rendered output using `display`:
] }}
}}
.> display otherElements
scratch/main> display otherElements
There are also asides, callouts, tables, tooltips, and more.
These don't currently have special syntax; just use the
@ -549,7 +549,7 @@ and the rendered output using `display`:
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
```ucm
.> view doc.guide
scratch/main> view doc.guide
doc.guide : Doc2
doc.guide =
@ -569,7 +569,7 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub
{{ otherElements }}
}}
.> display doc.guide
scratch/main> display doc.guide
# Unison computable documentation

View File

@ -19,13 +19,13 @@ test2 = do
```
```ucm
.> add
scratch/main> add
```
```ucm:error
.> io.test test1
scratch/main> io.test test1
```
```ucm:error
.> io.test test2
scratch/main> io.test test2
```

View File

@ -33,7 +33,7 @@ test2 = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -42,7 +42,7 @@ test2 = do
```
```ucm
.> io.test test1
scratch/main> io.test test1
💔💥
@ -58,7 +58,7 @@ test2 = do
```
```ucm
.> io.test test2
scratch/main> io.test test2
💔💥

View File

@ -14,10 +14,11 @@ id2 x =
do an `add` or `update`, here's how your codebase would
change:
⊡ Previously added definitions will be ignored: id
⍟ These new definitions are ok to `add`:
id : x -> x
(also named
__projects._a60db36c_af90_4d99_bcd2_3b3c7a24851f.branches._4fe18976_dde6_41e4_82c0_bf3887f77467.id)
id2 : x -> x
```

View File

@ -10,5 +10,5 @@ timingApp2 _ =
```
```ucm
.> run timingApp2
scratch/main> run timingApp2
```

View File

@ -23,7 +23,7 @@ timingApp2 _ =
```
```ucm
.> run timingApp2
scratch/main> run timingApp2
()

View File

@ -6,7 +6,7 @@ meh = 9
```
```ucm
.> add
.> find meh
.> docs 1
scratch/main> add
scratch/main> find meh
scratch/main> docs 1
```

View File

@ -20,20 +20,20 @@ meh = 9
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
meh : Nat
meh.doc : Doc2
.> find meh
scratch/main> find meh
1. meh : Nat
2. meh.doc : Doc2
.> docs 1
scratch/main> docs 1
A simple doc.

View File

@ -3,7 +3,7 @@
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
```ucm
.> ls builtin.Bytes
scratch/main> ls builtin.Bytes
```
Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`.
@ -43,7 +43,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
And here's the full API:
```ucm
.> find-in builtin.crypto
scratch/main> find-in builtin.crypto
```
Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime:
@ -189,11 +189,11 @@ test> crypto.hash.numTests =
```
```ucm:hide
.> add
scratch/main> add
```
```ucm
.> test
scratch/main> test
```
## HMAC tests
@ -251,9 +251,9 @@ test> md5.tests.ex3 =
```
```ucm:hide
.> add
scratch/main> add
```
```ucm
.> test
scratch/main> test
```

View File

@ -3,7 +3,7 @@
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
```ucm
.> ls builtin.Bytes
scratch/main> ls builtin.Bytes
1. ++ (Bytes -> Bytes -> Bytes)
2. at (Nat -> Bytes -> Optional Nat)
@ -120,7 +120,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
And here's the full API:
```ucm
.> find-in builtin.crypto
scratch/main> find-in builtin.crypto
1. type CryptoFailure
2. Ed25519.sign.impl : Bytes
@ -312,7 +312,7 @@ test> crypto.hash.numTests =
```
```ucm
.> test
scratch/main> test
Cached test results (`help testcache` to learn more)
@ -475,7 +475,7 @@ test> md5.tests.ex3 =
```
```ucm
.> test
scratch/main> test
Cached test results (`help testcache` to learn more)

View File

@ -51,7 +51,7 @@ testMvars _ =
runTest test
```
```ucm
.> add
.> io.test testMvars
scratch/main> add
scratch/main> io.test testMvars
```

View File

@ -66,14 +66,14 @@ testMvars _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean
testMvars : '{IO} [Result]
.> io.test testMvars
scratch/main> io.test testMvars
New test results:

View File

@ -6,6 +6,6 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10
```
```ucm
.> add
scratch/main> add
.mynamespace> namespace.dependencies
```

View File

@ -6,20 +6,31 @@ mynamespace.dependsOnText = external.mynat Nat.+ 10
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
external.mynat : Nat
mynamespace.dependsOnText : Nat
☝️ The namespace .mynamespace is empty.
.mynamespace> namespace.dependencies
External dependency Dependents in .mynamespace
.builtin.Nat 1. dependsOnText
.builtin.Nat.+ 1. dependsOnText
.external.mynat 1. dependsOnText
⚠️
.mynamespace is an empty namespace.
```
🛑
The transcript failed due to an error in the stanza above. The error is:
⚠️
.mynamespace is an empty namespace.

View File

@ -33,6 +33,6 @@ test = 'let
```
```ucm
.> add
.> io.test test
scratch/main> add
scratch/main> io.test test
```

View File

@ -49,7 +49,7 @@ test = 'let
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -59,7 +59,7 @@ test = 'let
-> Optional Float
->{Stream Result} ()
.> io.test test
scratch/main> io.test test
New test results:

View File

@ -10,7 +10,7 @@ socketAccept = compose reraise socketAccept.impl
```
```ucm:hide
.> add
scratch/main> add
```
# Tests for network related builtins
@ -93,8 +93,8 @@ testDefaultPort _ =
runTest test
```
```ucm
.> add
.> io.test testDefaultPort
scratch/main> add
scratch/main> io.test testDefaultPort
```
This example demonstrates connecting a TCP client socket to a TCP server socket. A thread is started for both client and server. The server socket asks for any availalbe port (by passing "0" as the port number). The server thread then queries for the actual assigned port number, and puts that into an MVar which the client thread can read. The client thread then reads a string from the server and reports it back to the main thread via a different MVar.
@ -149,6 +149,6 @@ testTcpConnect = 'let
```
```ucm
.> add
.> io.test testTcpConnect
scratch/main> add
scratch/main> io.test testTcpConnect
```

View File

@ -107,7 +107,7 @@ testDefaultPort _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -115,7 +115,7 @@ testDefaultPort _ =
testDefaultPort : '{IO} [Result]
testExplicitHost : '{IO} [Result]
.> io.test testDefaultPort
scratch/main> io.test testDefaultPort
New test results:
@ -194,7 +194,7 @@ testTcpConnect = 'let
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -202,7 +202,7 @@ testTcpConnect = 'let
serverThread : MVar Nat -> Text -> '{IO} ()
testTcpConnect : '{IO} [Result]
.> io.test testTcpConnect
scratch/main> io.test testTcpConnect
New test results:

View File

@ -56,6 +56,6 @@ serialTests = do
```
```ucm
.> add
.> io.test serialTests
scratch/main> add
scratch/main> io.test serialTests
```

View File

@ -74,7 +74,7 @@ serialTests = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -85,7 +85,7 @@ serialTests = do
serialTests : '{IO, Exception} [Result]
shuffle : Nat -> [a] -> [a]
.> io.test serialTests
scratch/main> io.test serialTests
New test results:

View File

@ -19,8 +19,8 @@ casTest = do
```
```ucm
.> add
.> io.test casTest
scratch/main> add
scratch/main> io.test casTest
```
Promise is a simple one-shot awaitable condition.
@ -54,9 +54,9 @@ promiseConcurrentTest = do
```
```ucm
.> add
.> io.test promiseSequentialTest
.> io.test promiseConcurrentTest
scratch/main> add
scratch/main> io.test promiseSequentialTest
scratch/main> io.test promiseConcurrentTest
```
CAS can be used to write an atomic update function.
@ -70,7 +70,7 @@ atomicUpdate ref f =
```
```ucm
.> add
scratch/main> add
```
Promise can be used to write an operation that spawns N concurrent
@ -91,7 +91,7 @@ spawnN n fa =
map Promise.read (go n [])
```
```ucm
.> add
scratch/main> add
```
We can use these primitives to write a more interesting example, where
@ -123,6 +123,6 @@ fullTest = do
```
```ucm
.> add
.> io.test fullTest
scratch/main> add
scratch/main> io.test fullTest
```

View File

@ -32,13 +32,13 @@ casTest = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
casTest : '{IO} [Result]
.> io.test casTest
scratch/main> io.test casTest
New test results:
@ -95,14 +95,14 @@ promiseConcurrentTest = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
promiseConcurrentTest : '{IO} [Result]
promiseSequentialTest : '{IO} [Result]
.> io.test promiseSequentialTest
scratch/main> io.test promiseSequentialTest
New test results:
@ -114,7 +114,7 @@ promiseConcurrentTest = do
Tip: Use view promiseSequentialTest to view the source of a
test.
.> io.test promiseConcurrentTest
scratch/main> io.test promiseConcurrentTest
New test results:
@ -150,7 +150,7 @@ atomicUpdate ref f =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -189,7 +189,7 @@ spawnN n fa =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -238,13 +238,13 @@ fullTest = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
fullTest : '{IO} [Result]
.> io.test fullTest
scratch/main> io.test fullTest
New test results:

View File

@ -68,6 +68,6 @@ mkTestCase = do
```
```ucm
.> add
.> run mkTestCase
scratch/main> add
scratch/main> run mkTestCase
```

View File

@ -95,7 +95,7 @@ mkTestCase = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -115,7 +115,7 @@ mkTestCase = do
tree2 : Tree Nat
tree3 : Tree Text
.> run mkTestCase
scratch/main> run mkTestCase
()

View File

@ -16,6 +16,6 @@ mkTestCase = do
```
```ucm
.> add
.> run mkTestCase
scratch/main> add
scratch/main> run mkTestCase
```

View File

@ -33,7 +33,7 @@ mkTestCase = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -43,7 +43,7 @@ mkTestCase = do
l3 : [Char]
mkTestCase : '{IO, Exception} ()
.> run mkTestCase
scratch/main> run mkTestCase
()

View File

@ -30,6 +30,6 @@ mkTestCase = do
```
```ucm
.> add
.> run mkTestCase
scratch/main> add
scratch/main> run mkTestCase
```

View File

@ -49,7 +49,7 @@ mkTestCase = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -61,7 +61,7 @@ mkTestCase = do
prod : [Nat] -> Nat
products : ([Nat], [Nat], [Nat]) -> Text
.> run mkTestCase
scratch/main> run mkTestCase
()

View File

@ -44,6 +44,6 @@ mkTestCase = do
```
```ucm
.> add
.> run mkTestCase
scratch/main> add
scratch/main> run mkTestCase
```

View File

@ -68,7 +68,7 @@ mkTestCase = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -84,7 +84,7 @@ mkTestCase = do
reset : '{DC r} r -> r
suspSum : [Nat] -> Delayed Nat
.> run mkTestCase
scratch/main> run mkTestCase
()

View File

@ -14,6 +14,6 @@ mkTestCase = do
```
```ucm
.> add
.> run mkTestCase
scratch/main> add
scratch/main> run mkTestCase
```

View File

@ -28,7 +28,7 @@ mkTestCase = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -36,7 +36,7 @@ mkTestCase = do
mutual0 : Nat -> Text
mutual1 : Nat -> Text
.> run mkTestCase
scratch/main> run mkTestCase
()

View File

@ -28,7 +28,7 @@ body k out v =
```
```ucm
.> add
scratch/main> add
```
Test case.
@ -67,6 +67,6 @@ tests = '(map spawn nats)
```
```ucm
.> add
.> io.test tests
scratch/main> add
scratch/main> io.test tests
```

View File

@ -44,7 +44,7 @@ body k out v =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -106,7 +106,7 @@ tests = '(map spawn nats)
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -115,7 +115,7 @@ tests = '(map spawn nats)
spawn : Nat ->{IO} Result
tests : '{IO} [Result]
.> io.test tests
scratch/main> io.test tests
New test results:

View File

@ -9,7 +9,7 @@ x = 999
```
```ucm:hide
.> add
scratch/main> add
```
Now, we update that definition and define a test-watch which depends on it.
@ -22,7 +22,7 @@ test> mytest = checks [x + 1 == 1001]
We expect this 'add' to fail because the test is blocked by the update to `x`.
```ucm:error
.> add
scratch/main> add
```
---
@ -35,5 +35,5 @@ test> useY = checks [y + 1 == 43]
This should correctly identify `y` as a dependency and add that too.
```ucm
.> add useY
scratch/main> add useY
```

View File

@ -43,7 +43,7 @@ test> mytest = checks [x + 1 == 1001]
We expect this 'add' to fail because the test is blocked by the update to `x`.
```ucm
.> add
scratch/main> add
x These definitions failed:
@ -85,7 +85,7 @@ test> useY = checks [y + 1 == 43]
This should correctly identify `y` as a dependency and add that too.
```ucm
.> add useY
scratch/main> add useY
⍟ I've added these definitions:

View File

@ -19,8 +19,8 @@ testBasicFork = 'let
See if we can get another thread to stuff a value into a MVar
```ucm:hide
.> add
.> io.test testBasicFork
scratch/main> add
scratch/main> io.test testBasicFork
```
```unison
@ -48,8 +48,8 @@ testBasicMultiThreadMVar = 'let
```
```ucm
.> add
.> io.test testBasicMultiThreadMVar
scratch/main> add
scratch/main> io.test testBasicMultiThreadMVar
```
```unison
@ -91,6 +91,6 @@ testTwoThreads = 'let
```
```ucm
.> add
.> io.test testTwoThreads
scratch/main> add
scratch/main> io.test testTwoThreads
```

View File

@ -71,14 +71,14 @@ testBasicMultiThreadMVar = 'let
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
testBasicMultiThreadMVar : '{IO} [Result]
thread1 : Nat -> MVar Nat -> '{IO} ()
.> io.test testBasicMultiThreadMVar
scratch/main> io.test testBasicMultiThreadMVar
New test results:
@ -145,7 +145,7 @@ testTwoThreads = 'let
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -154,7 +154,7 @@ testTwoThreads = 'let
(also named thread1)
testTwoThreads : '{IO} [Result]
.> io.test testTwoThreads
scratch/main> io.test testTwoThreads
New test results:

View File

@ -12,7 +12,7 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----"
```
```ucm:hide
.> add
scratch/main> add
```
# Using an alternative certificate store
@ -32,8 +32,8 @@ what_should_work _ = this_should_work ++ this_should_not_work
```
```ucm
.> add
.> io.test what_should_work
scratch/main> add
scratch/main> io.test what_should_work
```
Test handshaking a client/server a local TCP connection using our
@ -191,8 +191,8 @@ testCNReject _ =
```
```ucm
.> add
.> io.test testConnectSelfSigned
.> io.test testCAReject
.> io.test testCNReject
scratch/main> add
scratch/main> io.test testConnectSelfSigned
scratch/main> io.test testCAReject
scratch/main> io.test testCNReject
```

View File

@ -43,7 +43,7 @@ what_should_work _ = this_should_work ++ this_should_not_work
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -51,7 +51,7 @@ what_should_work _ = this_should_work ++ this_should_not_work
this_should_work : [Result]
what_should_work : ∀ _. _ -> [Result]
.> io.test what_should_work
scratch/main> io.test what_should_work
New test results:
@ -238,7 +238,7 @@ testCNReject _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -251,7 +251,7 @@ testCNReject _ =
-> '{IO, Exception} Text
testConnectSelfSigned : '{IO} [Result]
.> io.test testConnectSelfSigned
scratch/main> io.test testConnectSelfSigned
New test results:
@ -262,7 +262,7 @@ testCNReject _ =
Tip: Use view testConnectSelfSigned to view the source of a
test.
.> io.test testCAReject
scratch/main> io.test testCAReject
New test results:
@ -272,7 +272,7 @@ testCNReject _ =
Tip: Use view testCAReject to view the source of a test.
.> io.test testCNReject
scratch/main> io.test testCNReject
New test results:

View File

@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
```ucm
.> find Utf8
scratch/main> find Utf8
```
ascii characters are encoded as single bytes (in the range 0-127).

View File

@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
```ucm
.> find Utf8
scratch/main> find Utf8
1. builtin.Text.toUtf8 : Text -> Bytes
2. Text.fromUtf8 : Bytes ->{Exception} Text

View File

@ -1,6 +1,6 @@
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
Some random ability stuff to ensure things work.
@ -23,5 +23,5 @@ ha = cases
```
```ucm
.> add
scratch/main> add
```

View File

@ -32,7 +32,7 @@ ha = cases
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:

View File

@ -15,6 +15,6 @@ term2 _ = ()
```
```ucm
.> add
.> names term1
scratch/main> add
scratch/main> names term1
```

View File

@ -31,7 +31,7 @@ term2 _ = ()
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -40,7 +40,7 @@ term2 _ = ()
term1 : '{Bar, Foo} ()
term2 : '{Bar, Foo} ()
.> names term1
scratch/main> names term1
Term
Hash: #8hum58rlih

View File

@ -3,7 +3,7 @@
## Basic usage
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison
@ -20,26 +20,26 @@ is2even = '(even 2)
it errors if there isn't a previous run
```ucm:error
.> add.run foo
scratch/main> add.run foo
```
```ucm
.> run is2even
scratch/main> run is2even
```
it errors if the desired result name conflicts with a name in the
unison file
```ucm:error
.> add.run is2even
scratch/main> add.run is2even
```
otherwise, the result is successfully persisted
```ucm
.> add.run foo.bar.baz
scratch/main> add.run foo.bar.baz
```
```ucm
.> view foo.bar.baz
scratch/main> view foo.bar.baz
```
## It resolves references within the unison file
@ -56,8 +56,8 @@ main _ = y
```
```ucm
.> run main
.> add.run result
scratch/main> run main
scratch/main> add.run result
```
## It resolves references within the codebase
@ -68,7 +68,7 @@ inc x = x + 1
```
```ucm
.> add inc
scratch/main> add inc
```
```unison
@ -77,9 +77,9 @@ main _ x = inc x
```
```ucm
.> run main
.> add.run natfoo
.> view natfoo
scratch/main> run main
scratch/main> add.run natfoo
scratch/main> view natfoo
```
## It captures scratch file dependencies at run time
@ -91,7 +91,7 @@ main = 'y
```
```ucm
.> run main
scratch/main> run main
```
@ -101,8 +101,8 @@ x = 50
this saves 2 to xres, rather than 100
```ucm
.> add.run xres
.> view xres
scratch/main> add.run xres
scratch/main> view xres
```
## It fails with a message if add cannot complete cleanly
@ -112,8 +112,8 @@ main = '5
```
```ucm:error
.> run main
.> add.run xres
scratch/main> run main
scratch/main> add.run xres
```
## It works with absolute names
@ -123,7 +123,7 @@ main = '5
```
```ucm
.> run main
.> add.run .an.absolute.name
.> view .an.absolute.name
scratch/main> run main
scratch/main> add.run .an.absolute.name
scratch/main> view .an.absolute.name
```

View File

@ -31,7 +31,7 @@ is2even = '(even 2)
it errors if there isn't a previous run
```ucm
.> add.run foo
scratch/main> add.run foo
⚠️
@ -40,7 +40,7 @@ it errors if there isn't a previous run
```
```ucm
.> run is2even
scratch/main> run is2even
true
@ -48,7 +48,7 @@ it errors if there isn't a previous run
it errors if the desired result name conflicts with a name in the
unison file
```ucm
.> add.run is2even
scratch/main> add.run is2even
⚠️
@ -58,7 +58,7 @@ unison file
```
otherwise, the result is successfully persisted
```ucm
.> add.run foo.bar.baz
scratch/main> add.run foo.bar.baz
⍟ I've added these definitions:
@ -66,7 +66,7 @@ otherwise, the result is successfully persisted
```
```ucm
.> view foo.bar.baz
scratch/main> view foo.bar.baz
foo.bar.baz : Boolean
foo.bar.baz = true
@ -101,11 +101,11 @@ main _ = y
```
```ucm
.> run main
scratch/main> run main
a b -> a Nat.+ b Nat.+ z 10
.> add.run result
scratch/main> add.run result
⍟ I've added these definitions:
@ -134,7 +134,7 @@ inc x = x + 1
```
```ucm
.> add inc
scratch/main> add inc
⍟ I've added these definitions:
@ -160,17 +160,17 @@ main _ x = inc x
```
```ucm
.> run main
scratch/main> run main
inc
.> add.run natfoo
scratch/main> add.run natfoo
⍟ I've added these definitions:
natfoo : Nat -> Nat
.> view natfoo
scratch/main> view natfoo
natfoo : Nat -> Nat
natfoo = inc
@ -200,7 +200,7 @@ main = 'y
```
```ucm
.> run main
scratch/main> run main
2
@ -224,13 +224,13 @@ x = 50
```
this saves 2 to xres, rather than 100
```ucm
.> add.run xres
scratch/main> add.run xres
⍟ I've added these definitions:
xres : Nat
.> view xres
scratch/main> view xres
xres : Nat
xres = 2
@ -256,11 +256,11 @@ main = '5
```
```ucm
.> run main
scratch/main> run main
5
.> add.run xres
scratch/main> add.run xres
x These definitions failed:
@ -290,19 +290,21 @@ main = '5
```
```ucm
.> run main
scratch/main> run main
5
.> add.run .an.absolute.name
scratch/main> add.run .an.absolute.name
⍟ I've added these definitions:
.an.absolute.name : Nat
.> view .an.absolute.name
scratch/main> view .an.absolute.name
.an.absolute.name : Nat
.an.absolute.name = 5
.__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name :
Nat
.__projects._0fa2644c_1cf9_43bb_ab82_9f0beaab9ab1.branches._264fbcac_777c_4007_b589_01035cad230a.an.absolute.name =
5
```

View File

@ -1,5 +1,5 @@
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
```unison:hide
@ -10,6 +10,6 @@ foo = []
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
```ucm
.> add
.> view foo
scratch/main> add
scratch/main> view foo
```

View File

@ -6,13 +6,13 @@ foo = []
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
foo : [Result]
.> view foo
scratch/main> view foo
foo : [Result]
foo : [Result]

View File

@ -3,7 +3,7 @@
Let's set up some definitions to start:
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison
@ -17,7 +17,7 @@ structural type Y = Two Nat Nat
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
```ucm
.> add
scratch/main> add
```
Let's add an alias for `1` and `One`:
@ -32,7 +32,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`.
Also, `Z` is an alias for `X`.
```ucm
.> add
scratch/main> add
```
Let's update something that has an alias (to a value that doesn't have a name already):
@ -45,7 +45,7 @@ structural type X = Three Nat Nat Nat
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
```ucm
.> update
scratch/main> update
```
Update it to something that already exists with a different name:
@ -58,6 +58,6 @@ structural type X = Two Nat Nat
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
```ucm
.> update
scratch/main> update
```

View File

@ -29,7 +29,7 @@ structural type Y = Two Nat Nat
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -67,7 +67,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`.
Also, `Z` is an alias for `X`.
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -104,7 +104,7 @@ structural type X = Three Nat Nat Nat
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
```ucm
.> update
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
@ -143,7 +143,7 @@ structural type X = Two Nat Nat
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
```ucm
.> update
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...

View File

@ -1,5 +1,5 @@
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison:hide:all
List.adjacentPairs : [a] -> [(a, a)]
@ -102,7 +102,7 @@ The `alias.many` command can be used to copy definitions from the current namesp
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
```
.> help alias.many
scratch/main> help alias.many
alias.many (or copy)
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
@ -113,8 +113,8 @@ The names that will be used in the target namespace are the names you specify, r
Let's try it!
```ucm
.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
.> find-in mylib
scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
scratch/main> find-in mylib
```
Thanks, `alias.many`!

View File

@ -1,8 +1,8 @@
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
```
.> help alias.many
```scratch
/main> help alias.many
alias.many (or copy)
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
@ -14,56 +14,57 @@ The names that will be used in the target namespace are the names you specify, r
Let's try it!
```ucm
.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
Here's what changed in .mylib :
Added definitions:
1. stuff.List.adjacentPairs : [a] -> [(a, a)]
2. stuff.List.all : (a ->{g} Boolean)
-> [a]
->{g} Boolean
3. stuff.List.any : (a ->{g} Boolean)
-> [a]
->{g} Boolean
4. stuff.List.chunk : Nat -> [a] -> [[a]]
5. stuff.List.chunksOf : Nat -> [a] -> [[a]]
6. stuff.List.dropWhile : (a ->{g} Boolean)
-> [a]
->{g} [a]
7. stuff.List.first : [a] -> Optional a
8. stuff.List.init : [a] -> Optional [a]
9. stuff.List.intersperse : a -> [a] -> [a]
10. stuff.List.isEmpty : [a] -> Boolean
11. stuff.List.last : [a] -> Optional a
12. stuff.List.replicate : Nat -> a -> [a]
13. stuff.List.splitAt : Nat -> [a] -> ([a], [a])
14. stuff.List.tail : [a] -> Optional [a]
15. stuff.List.takeWhile : (a ->{𝕖} Boolean)
-> [a]
->{𝕖} [a]
Tip: You can use `undo` or `reflog` to undo this change.
Nothing changed in .mylib .
.> find-in mylib
1. stuff.List.adjacentPairs : [a] -> [(a, a)]
2. stuff.List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean
3. stuff.List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean
4. stuff.List.chunk : Nat -> [a] -> [[a]]
5. stuff.List.chunksOf : Nat -> [a] -> [[a]]
6. stuff.List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
7. stuff.List.first : [a] -> Optional a
8. stuff.List.init : [a] -> Optional [a]
9. stuff.List.intersperse : a -> [a] -> [a]
10. stuff.List.isEmpty : [a] -> Boolean
11. stuff.List.last : [a] -> Optional a
12. stuff.List.replicate : Nat -> a -> [a]
13. stuff.List.splitAt : Nat -> [a] -> ([a], [a])
14. stuff.List.tail : [a] -> Optional [a]
15. stuff.List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
⚠️
The following names were not found in the codebase. Check your spelling.
stuff.List.adjacentPairs
stuff.List.all
stuff.List.any
stuff.List.chunk
stuff.List.chunksOf
stuff.List.dropWhile
stuff.List.first
stuff.List.init
stuff.List.intersperse
stuff.List.isEmpty
stuff.List.last
stuff.List.replicate
stuff.List.splitAt
stuff.List.tail
stuff.List.takeWhile
```
Thanks, `alias.many!
```ucm
scratch/main> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylibscratch/main> find-in mylib
```
🛑
The transcript failed due to an error in the stanza above. The error is:
⚠️
The following names were not found in the codebase. Check your spelling.
stuff.List.adjacentPairs
stuff.List.all
stuff.List.any
stuff.List.chunk
stuff.List.chunksOf
stuff.List.dropWhile
stuff.List.first
stuff.List.init
stuff.List.intersperse
stuff.List.isEmpty
stuff.List.last
stuff.List.replicate
stuff.List.splitAt
stuff.List.tail
stuff.List.takeWhile

View File

@ -1,6 +1,6 @@
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
This tests a variable related bug in the ANF compiler.
@ -29,6 +29,6 @@ foo _ =
```
```ucm
.> add
scratch/main> add
```

View File

@ -45,7 +45,7 @@ foo _ =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:

View File

@ -1,9 +1,9 @@
# Unit tests for Any.unsafeExtract
```ucm:hide
.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u
.> add
scratch/main> builtins.mergeio
scratch/main> load unison-src/transcripts-using-base/base.u
scratch/main> add
```
Any.unsafeExtract is a way to extract the value contained in an Any. This is unsafe because it allows the programmer to coerce a value into any type, which would cause undefined behaviour if used to coerce a value to the wrong type.
@ -19,5 +19,5 @@ test> Any.unsafeExtract.works =
```
```ucm
.> add
scratch/main> add
```

View File

@ -32,7 +32,7 @@ test> Any.unsafeExtract.works =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:

View File

@ -1,7 +1,7 @@
# Doc rendering
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
```unison:hide
@ -82,11 +82,11 @@ term = 42
```
```ucm:hide
.> add
scratch/main> add
```
```ucm
.> display term.doc
scratch/main> display term.doc
```
```api

View File

@ -78,7 +78,7 @@ term = 42
```
```ucm
.> display term.doc
scratch/main> display term.doc
# Heading
@ -149,795 +149,10 @@ term = 42
```api
GET /api/non-project-code/getDefinition?names=term
{
"missingDefinitions": [],
"termDefinitions": {
"#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8": {
"bestTermName": "term",
"defnTermTag": "Plain",
"signature": [
{
"annotation": {
"contents": "##Nat",
"tag": "TypeReference"
},
"segment": "Nat"
}
],
"termDefinition": {
"contents": [
{
"annotation": {
"contents": "term",
"tag": "HashQualifier"
},
"segment": "term"
},
{
"annotation": {
"tag": "TypeAscriptionColon"
},
"segment": " :"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"contents": "##Nat",
"tag": "TypeReference"
},
"segment": "Nat"
},
{
"annotation": null,
"segment": "\n"
},
{
"annotation": {
"contents": "term",
"tag": "HashQualifier"
},
"segment": "term"
},
{
"annotation": {
"tag": "BindingEquals"
},
"segment": " ="
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"tag": "NumericLiteral"
},
"segment": "42"
}
],
"tag": "UserObject"
},
"termDocs": [
[
"doc",
"#kjfaflbrgl89j2uq4ruubejakm6s02cp3m61ufu7rv7tkbd4nmkvcn1fciue53v0msir9t7ds111ab9er8qfa06gsa9ddfrdfgc99mo",
{
"contents": [
{
"contents": [
{
"contents": "Heading",
"tag": "Word"
}
],
"tag": "Paragraph"
},
[
{
"contents": [
{
"contents": [
{
"contents": "Heading",
"tag": "Word"
},
{
"contents": "2",
"tag": "Word"
}
],
"tag": "Paragraph"
},
[
{
"contents": [
{
"contents": "Term",
"tag": "Word"
},
{
"contents": "Link:",
"tag": "Word"
},
{
"contents": {
"contents": [
{
"annotation": {
"contents": "#k5gpql9cbdfau6lf1aja24joc3sfctvjor8esu8bemn0in3l148otb0t3vebgqrt6qml302h62bbfeftg65gec1v8ouin5m6v2969d8",
"tag": "TermReference"
},
"segment": "otherTerm"
}
],
"tag": "Link"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Type",
"tag": "Word"
},
{
"contents": "Link:",
"tag": "Word"
},
{
"contents": {
"contents": [
{
"annotation": {
"contents": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg",
"tag": "TypeReference"
},
"segment": "Maybe"
}
],
"tag": "Link"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Term",
"tag": "Word"
},
{
"contents": "source:",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
{
"contents": [
"#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
{
"contents": [
[
{
"annotation": {
"contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
"tag": "TermReference"
},
"segment": "term"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"tag": "TypeAscriptionColon"
},
"segment": ": "
},
{
"annotation": {
"contents": "##Nat",
"tag": "TypeReference"
},
"segment": "Nat"
}
],
[
{
"annotation": {
"contents": "term",
"tag": "HashQualifier"
},
"segment": "term"
},
{
"annotation": {
"tag": "TypeAscriptionColon"
},
"segment": " :"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"contents": "##Nat",
"tag": "TypeReference"
},
"segment": "Nat"
},
{
"annotation": null,
"segment": "\n"
},
{
"annotation": {
"contents": "term",
"tag": "HashQualifier"
},
"segment": "term"
},
{
"annotation": {
"tag": "BindingEquals"
},
"segment": " ="
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"tag": "NumericLiteral"
},
"segment": "42"
}
]
],
"tag": "UserObject"
}
],
"tag": "Term"
}
],
"tag": "Source"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Term",
"tag": "Word"
},
{
"contents": "signature:",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
[
{
"annotation": {
"contents": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
"tag": "TermReference"
},
"segment": "term"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"tag": "TypeAscriptionColon"
},
"segment": ": "
},
{
"annotation": {
"contents": "##Nat",
"tag": "TypeReference"
},
"segment": "Nat"
}
]
],
"tag": "Signature"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": [
{
"contents": "List",
"tag": "Word"
},
{
"contents": "item",
"tag": "Word"
}
],
"tag": "Paragraph"
}
],
"tag": "BulletedList"
},
{
"contents": [
1,
[
{
"contents": [
{
"contents": "Numbered",
"tag": "Word"
},
{
"contents": "list",
"tag": "Word"
},
{
"contents": "item",
"tag": "Word"
}
],
"tag": "Paragraph"
}
]
],
"tag": "NumberedList"
},
{
"contents": [
{
"contents": ">",
"tag": "Word"
},
{
"contents": "Block",
"tag": "Word"
},
{
"contents": "quote",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Code",
"tag": "Word"
},
{
"contents": "block",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Inline",
"tag": "Word"
},
{
"contents": "code:",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
{
"annotation": {
"tag": "NumericLiteral"
},
"segment": "1"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"contents": "##Nat.+",
"tag": "TermReference"
},
"segment": "Nat.+"
},
{
"annotation": null,
"segment": " "
},
{
"annotation": {
"tag": "NumericLiteral"
},
"segment": "2"
}
],
"tag": "Example"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": "\"doesn't typecheck\" + 1",
"tag": "Word"
},
"tag": "Code"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": [
{
"contents": [
{
"contents": "Link",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": {
"contents": "https://unison-lang.org",
"tag": "Word"
},
"tag": "Group"
}
],
"tag": "NamedLink"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png)",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
{
"contents": "Bold",
"tag": "Word"
}
],
"tag": "Paragraph"
},
"tag": "Bold"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
{
"contents": "Italic",
"tag": "Word"
}
],
"tag": "Paragraph"
},
"tag": "Bold"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
{
"contents": "Strikethrough",
"tag": "Word"
}
],
"tag": "Paragraph"
},
"tag": "Strikethrough"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Horizontal",
"tag": "Word"
},
{
"contents": "rule",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "---",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Table",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Header",
"tag": "Word"
},
{
"contents": "1",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Header",
"tag": "Word"
},
{
"contents": "2",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "--------",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "--------",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Cell",
"tag": "Word"
},
{
"contents": "1",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Cell",
"tag": "Word"
},
{
"contents": "2",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Cell",
"tag": "Word"
},
{
"contents": "3",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
},
{
"contents": "Cell",
"tag": "Word"
},
{
"contents": "4",
"tag": "Word"
},
{
"contents": "|",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Video",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": {
"contents": [
[
{
"mediaSourceMimeType": null,
"mediaSourceUrl": "test.mp4"
}
],
{
"poster": "test.png"
}
],
"tag": "Video"
},
"tag": "Special"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "Transclusion/evaluation:",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": [
{
"contents": [
{
"contents": "This",
"tag": "Word"
},
{
"contents": "doc",
"tag": "Word"
},
{
"contents": "should",
"tag": "Word"
},
{
"contents": "be",
"tag": "Word"
},
{
"contents": "embedded.",
"tag": "Word"
}
],
"tag": "Paragraph"
},
{
"contents": [
{
"contents": "message",
"tag": "Word"
}
],
"tag": "Paragraph"
}
],
"tag": "UntitledSection"
}
],
"tag": "Paragraph"
}
]
],
"tag": "Section"
}
]
],
"tag": "Section"
}
]
],
"termNames": [
"term"
]
}
},
"missingDefinitions": [
"term"
],
"termDefinitions": {},
"typeDefinitions": {}
}
```

View File

@ -8,7 +8,7 @@ joey.yaml.zz = 45
```
```ucm
.> add
scratch/main> add
```
```api

View File

@ -24,7 +24,7 @@ joey.yaml.zz = 45
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -43,7 +43,7 @@ GET /api/non-project-code/find?query=http
"result": {
"segments": [
{
"contents": "ross.",
"contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.",
"tag": "Gap"
},
{
@ -56,14 +56,14 @@ GET /api/non-project-code/find?query=http
}
]
},
"score": 156
"score": 170
},
{
"contents": {
"bestFoundTermName": "y",
"namedTerm": {
"termHash": "#emomp74i93h6ps0b5sukke0tci0ooba3f9jk21qm919a7act9u7asani84c0mqbdk4lcjrdvr9olpedp23p6df78r4trqlg0cciadc8",
"termName": "ross.httpClient.y",
"termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.ross.httpClient.y",
"termTag": "Plain",
"termType": [
{
@ -84,7 +84,7 @@ GET /api/non-project-code/find?query=http
"result": {
"segments": [
{
"contents": "joey.",
"contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.",
"tag": "Gap"
},
{
@ -97,14 +97,14 @@ GET /api/non-project-code/find?query=http
}
]
},
"score": 156
"score": 170
},
{
"contents": {
"bestFoundTermName": "z",
"namedTerm": {
"termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo",
"termName": "joey.httpServer.z",
"termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z",
"termTag": "Plain",
"termType": [
{
@ -129,7 +129,7 @@ GET /api/non-project-code/find?query=Server
"result": {
"segments": [
{
"contents": "joey.http",
"contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.http",
"tag": "Gap"
},
{
@ -142,14 +142,14 @@ GET /api/non-project-code/find?query=Server
}
]
},
"score": 223
"score": 230
},
{
"contents": {
"bestFoundTermName": "z",
"namedTerm": {
"termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo",
"termName": "joey.httpServer.z",
"termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z",
"termTag": "Plain",
"termType": [
{
@ -174,7 +174,7 @@ GET /api/non-project-code/find?query=lesys
"result": {
"segments": [
{
"contents": "rachel.fi",
"contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.fi",
"tag": "Gap"
},
{
@ -187,14 +187,14 @@ GET /api/non-project-code/find?query=lesys
}
]
},
"score": 175
"score": 185
},
{
"contents": {
"bestFoundTermName": "x",
"namedTerm": {
"termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
"termName": "rachel.filesystem.x",
"termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.rachel.filesystem.x",
"termTag": "Plain",
"termType": [
{
@ -218,6 +218,10 @@ GET /api/non-project-code/find?query=joey.http
{
"result": {
"segments": [
{
"contents": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.",
"tag": "Gap"
},
{
"contents": "joey.http",
"tag": "Match"
@ -228,14 +232,14 @@ GET /api/non-project-code/find?query=joey.http
}
]
},
"score": 300
"score": 333
},
{
"contents": {
"bestFoundTermName": "z",
"namedTerm": {
"termHash": "#a84tg4er4kfl9k2p250vp2o1dsp5kmn9a7q8g2bo723qbtbf9sagrl28fa4q0j5f2cv4alsjik6rf487ss646qt95gbm3dd13k7e1fo",
"termName": "joey.httpServer.z",
"termName": "__projects._983a1040_9f2f_4979_bf00_f26b89b303cc.branches._4c0f994b_5a4c_4130_a3ac_7534cb682e97.joey.httpServer.z",
"termTag": "Plain",
"termType": [
{

View File

@ -1,9 +1,9 @@
# List Projects And Branches Test
```ucm:hide
.> project.create-empty project-one
.> project.create-empty project-two
.> project.create-empty project-three
scratch/main> project.create-empty project-one
scratch/main> project.create-empty project-two
scratch/main> project.create-empty project-three
project-one/main> branch branch-one
project-one/main> branch branch-two
project-one/main> branch branch-three

View File

@ -12,6 +12,9 @@ GET /api/projects
},
{
"projectName": "project-two"
},
{
"projectName": "scratch"
}
]
-- Should list projects starting with project-t

View File

@ -1,7 +1,7 @@
# Namespace Details Test
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
```unison
@ -14,7 +14,7 @@ Here's a *README*!
```
```ucm
.> add
scratch/main> add
```
```api

View File

@ -25,7 +25,7 @@ Here's a *README*!
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -39,43 +39,7 @@ Here's a *README*!
GET /api/non-project-code/namespaces/nested.names
{
"fqn": "nested.names",
"hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o",
"readme": {
"contents": [
{
"contents": "Here's",
"tag": "Word"
},
{
"contents": "a",
"tag": "Word"
},
{
"contents": {
"contents": [
{
"contents": {
"contents": [
{
"contents": "README",
"tag": "Word"
}
],
"tag": "Paragraph"
},
"tag": "Bold"
},
{
"contents": "!",
"tag": "Word"
}
],
"tag": "Join"
},
"tag": "Group"
}
],
"tag": "Paragraph"
}
"hash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg",
"readme": null
}
```

View File

@ -1,7 +1,7 @@
# Namespace list api
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
```unison
@ -12,7 +12,7 @@ nested.names.readme = {{ I'm a readme! }}
```
```ucm
.> add
scratch/main> add
```
```api

View File

@ -23,7 +23,7 @@ nested.names.readme = {{ I'm a readme! }}
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -35,100 +35,14 @@ nested.names.readme = {{ I'm a readme! }}
```api
GET /api/non-project-code/list?namespace=nested.names
{
"namespaceListingChildren": [
{
"contents": {
"termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o",
"termName": "readme",
"termTag": "Doc",
"termType": [
{
"annotation": {
"contents": "#ej86si0ur1",
"tag": "HashQualifier"
},
"segment": "#ej86si0ur1"
}
]
},
"tag": "TermObject"
},
{
"contents": {
"termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
"termName": "x",
"termTag": "Plain",
"termType": [
{
"annotation": {
"contents": "##Nat",
"tag": "HashQualifier"
},
"segment": "##Nat"
}
]
},
"tag": "TermObject"
},
{
"contents": {
"namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0",
"namespaceName": "x",
"namespaceSize": 1
},
"tag": "Subnamespace"
}
],
"namespaceListingChildren": [],
"namespaceListingFQN": "nested.names",
"namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0"
"namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg"
}
GET /api/non-project-code/list?namespace=names&relativeTo=nested
{
"namespaceListingChildren": [
{
"contents": {
"termHash": "#ddmmatmmiqsts2ku0i02kntd0s7rvcui4nn1cusio8thp9oqhbtilvcnhen52ibv43kr5q83f5er5q9h56s807k17tnelnrac7cch8o",
"termName": "readme",
"termTag": "Doc",
"termType": [
{
"annotation": {
"contents": "#ej86si0ur1",
"tag": "HashQualifier"
},
"segment": "#ej86si0ur1"
}
]
},
"tag": "TermObject"
},
{
"contents": {
"termHash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
"termName": "x",
"termTag": "Plain",
"termType": [
{
"annotation": {
"contents": "##Nat",
"tag": "HashQualifier"
},
"segment": "##Nat"
}
]
},
"tag": "TermObject"
},
{
"contents": {
"namespaceHash": "#n1egracfeljprftoktbjcase2hs4f4p8idbhs5ujipl42agld1810hrq9t7p7ped16aagni2cm1fjcjhho770jh80ipthhmg0cnsur0",
"namespaceName": "x",
"namespaceSize": 1
},
"tag": "Subnamespace"
}
],
"namespaceListingChildren": [],
"namespaceListingFQN": "nested.names",
"namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0"
"namespaceListingHash": "#sg60bvjo91fsoo7pkh9gejbn0qgc95vra87ap6l5d35ri0lkaudl7bs12d71sf3fh6p23teemuor7mk1i9n567m50ibakcghjec5ajg"
}
```

View File

@ -1,7 +1,7 @@
# Definition Summary APIs
```ucm:hide
.> builtins.mergeio
scratch/main> builtins.mergeio
```
@ -25,9 +25,9 @@ structural ability Stream s where
```
```ucm:hide
.> add
.> alias.type ##Nat Nat
.> alias.term ##IO.putBytes.impl.v3 putBytesImpl
scratch/main> add
scratch/main> alias.type ##Nat Nat
scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl
```
## Term Summary APIs

View File

@ -3,7 +3,7 @@
Should block an `add` if it requires an update on an in-file dependency.
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison
@ -11,7 +11,7 @@ x = 1
```
```ucm
.> add
scratch/main> add
```
Update `x`, and add a new `y` which depends on the update
@ -24,5 +24,5 @@ y = x + 1
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
```ucm:error
.> add y
scratch/main> add y
```

View File

@ -20,7 +20,7 @@ x = 1
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
@ -55,7 +55,7 @@ y = x + 1
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
```ucm
.> add y
scratch/main> add y
x These definitions failed:

View File

@ -1,7 +1,7 @@
## Blocks and scoping
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
### Names introduced by a block shadow names introduced in outer scopes

View File

@ -1,7 +1,7 @@
Regression test for https://github.com/unisonweb/unison/pull/2819
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison
@ -12,7 +12,7 @@ hangExample =
```
```ucm
.> add
.> view hangExample
scratch/main> add
scratch/main> view hangExample
```

View File

@ -21,13 +21,13 @@ hangExample =
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
hangExample : Boolean
.> view hangExample
scratch/main> view hangExample
hangExample : Boolean
hangExample =

View File

@ -1,8 +1,8 @@
The `branch` command creates a new branch.
```ucm:hide
.> project.create-empty foo
.> project.create-empty bar
scratch/main> project.create-empty foo
scratch/main> project.create-empty bar
```
First, we'll just create a loose code namespace with a term in it for later.
@ -33,22 +33,22 @@ foo/main> branch /main /topic8
foo/main> branch /main foo/topic9
foo/main> branch foo/main topic10
foo/main> branch foo/main /topic11
.> branch foo/main foo/topic12
scratch/main> branch foo/main foo/topic12
foo/main> branch bar/topic
bar/main> branch foo/main topic2
bar/main> branch foo/main /topic3
.> branch foo/main bar/topic4
scratch/main> branch foo/main bar/topic4
.some.loose.code> branch foo/topic13
foo/main> branch .some.loose.code topic14
foo/main> branch .some.loose.code /topic15
.> branch .some.loose.code foo/topic16
scratch/main> branch .some.loose.code foo/topic16
foo/main> branch.empty empty1
foo/main> branch.empty /empty2
foo/main> branch.empty foo/empty3
.> branch.empty foo/empty4
scratch/main> branch.empty foo/empty4
```
The `branch` command can create branches named `releases/drafts/*` (because why not).

View File

@ -103,7 +103,7 @@ foo/main> branch foo/main /topic11
Tip: To merge your work back into the main branch, first
`switch /main` then `merge /topic11`.
.> branch foo/main foo/topic12
scratch/main> branch foo/main foo/topic12
Done. I've created the topic12 branch based off of main.
@ -122,7 +122,7 @@ bar/main> branch foo/main /topic3
Done. I've created the bar/topic3 branch based off foo/main.
.> branch foo/main bar/topic4
scratch/main> branch foo/main bar/topic4
Done. I've created the bar/topic4 branch based off foo/main.
@ -141,7 +141,7 @@ foo/main> branch .some.loose.code /topic15
Done. I've created the foo/topic15 branch from the namespace
.some.loose.code.
.> branch .some.loose.code foo/topic16
scratch/main> branch .some.loose.code foo/topic16
Done. I've created the foo/topic16 branch from the namespace
.some.loose.code.
@ -164,7 +164,7 @@ foo/main> branch.empty foo/empty3
Tip: Use `merge /somebranch` to initialize this branch.
.> branch.empty foo/empty4
scratch/main> branch.empty foo/empty4
Done. I've created an empty branch foo/empty4.

View File

@ -1,7 +1,7 @@
```ucm:hide
.> builtins.merge
.> project.create-empty p0
.> project.create-empty p1
scratch/main> builtins.merge
scratch/main> project.create-empty p0
scratch/main> project.create-empty p1
```
```unison

View File

@ -1,5 +1,5 @@
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
```unison

View File

@ -1,15 +1,15 @@
```ucm:hide
.> builtins.mergeio
.> load unison-src/transcripts-using-base/doc.md.files/syntax.u
scratch/main> builtins.mergeio
scratch/main> load unison-src/transcripts-using-base/doc.md.files/syntax.u
```
We can display the guide before and after adding it to the codebase:
```ucm
.> display doc.guide
.> add
.> display doc.guide
scratch/main> display doc.guide
scratch/main> add
scratch/main> display doc.guide
```
But we can't display this due to a decompilation problem.
@ -19,10 +19,10 @@ rendered = Pretty.get (docFormatConsole doc.guide)
```
```ucm
.> display rendered
.> add
.> display rendered
.> undo
scratch/main> display rendered
scratch/main> add
scratch/main> display rendered
scratch/main> undo
```
And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic.

View File

@ -2,7 +2,7 @@
We can display the guide before and after adding it to the codebase:
```ucm
.> display doc.guide
scratch/main> display doc.guide
# Unison computable documentation
@ -200,7 +200,7 @@ We can display the guide before and after adding it to the codebase:
rendered table.
Some text More text Zounds!
.> add
scratch/main> add
⍟ I've added these definitions:
@ -213,7 +213,7 @@ We can display the guide before and after adding it to the codebase:
otherElements : Doc2
sqr : Nat -> Nat
.> display doc.guide
scratch/main> display doc.guide
# Unison computable documentation
@ -432,7 +432,7 @@ rendered = Pretty.get (docFormatConsole doc.guide)
```
```ucm
.> display rendered
scratch/main> display rendered
# Unison computable documentation
@ -630,13 +630,13 @@ rendered = Pretty.get (docFormatConsole doc.guide)
rendered table.
Some text More text Zounds!
.> add
scratch/main> add
⍟ I've added these definitions:
rendered : Annotated () (Either SpecialForm ConsoleText)
.> display rendered
scratch/main> display rendered
# Unison computable documentation
@ -834,13 +834,17 @@ rendered = Pretty.get (docFormatConsole doc.guide)
rendered table.
Some text More text Zounds!
.> undo
scratch/main> undo
Here are the changes I undid
Added definitions:
1. rendered : Annotated () (Either SpecialForm ConsoleText)
1. __projects._141465a8_cfb4_456f_aefa_25b7a6062af2.branches._d233d31d_8101_4a8e_b332_9cd3a64f71e9.rendered : Annotated
( )
(Either
SpecialForm
ConsoleText)
```
And then this sometimes generates a GHC crash "strange closure error" but doesn't seem deterministic.

View File

@ -1,12 +1,12 @@
# Unit tests for builtin functions
```ucm:hide
.> builtins.mergeio
.> load unison-src/transcripts-using-base/base.u
.> add
scratch/main> builtins.mergeio
scratch/main> load unison-src/transcripts-using-base/base.u
scratch/main> add
```
This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail.
This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail.
## `Int` functions
@ -88,7 +88,7 @@ test> Int.tests.conversions =
```
```ucm:hide
.> add
scratch/main> add
```
## `Nat` functions
@ -163,7 +163,7 @@ test> Nat.tests.conversions =
```
```ucm:hide
.> add
scratch/main> add
```
## `Boolean` functions
@ -190,7 +190,7 @@ test> Boolean.tests.notTable =
```
```ucm:hide
.> add
scratch/main> add
```
## `Text` functions
@ -288,7 +288,7 @@ test> Text.tests.indexOfEmoji =
```
```ucm:hide
.> add
scratch/main> add
```
## `Bytes` functions
@ -352,7 +352,7 @@ test> Bytes.tests.indexOf =
```
```ucm:hide
.> add
scratch/main> add
```
## `List` comparison
@ -371,7 +371,7 @@ test> checks [
```
```ucm:hide
.> add
scratch/main> add
```
Other list functions
@ -392,7 +392,7 @@ test> Any.test2 = checks [(not (Any "hi" == Any 42))]
```
```ucm:hide
.> add
scratch/main> add
```
## Sandboxing functions
@ -419,7 +419,7 @@ openFile]
```
```ucm:hide
.> add
scratch/main> add
```
```unison
@ -436,8 +436,8 @@ openFilesIO = do
```
```ucm
.> add
.> io.test openFilesIO
scratch/main> add
scratch/main> io.test openFilesIO
```
## Universal hash functions
@ -450,7 +450,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive
```
```ucm:hide
.> add
scratch/main> add
```
## Run the tests
@ -458,5 +458,5 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive
Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing.
```ucm
.> test
scratch/main> test
```

View File

@ -1,6 +1,6 @@
# Unit tests for builtin functions
This transcript defines unit tests for builtin functions. There's a single `.> test` execution at the end that will fail the transcript with a nice report if any of the tests fail.
This transcript defines unit tests for builtin functions. There's a single `scratch/main> test` execution at the end that will fail the transcript with a nice report if any of the tests fail.
## `Int` functions
@ -480,13 +480,13 @@ openFilesIO = do
```
```ucm
.> add
scratch/main> add
⍟ I've added these definitions:
openFilesIO : '{IO} [Result]
.> io.test openFilesIO
scratch/main> io.test openFilesIO
New test results:
@ -535,7 +535,7 @@ test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Unive
Now that all the tests have been added to the codebase, let's view the test report. This will fail the transcript (with a nice message) if any of the tests are failing.
```ucm
.> test
scratch/main> test
Cached test results (`help testcache` to learn more)

View File

@ -1,6 +1,6 @@
```ucm:hide
.> builtins.merge
scratch/main> builtins.merge
```
This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2,3,4]`:

Some files were not shown because too many files have changed in this diff Show More