mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 10:35:57 +03:00
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still pretty-print ourselves will match the bulk of them that `cmark` produces.
This commit is contained in:
parent
1dc181b99a
commit
0031542faf
@ -27,7 +27,7 @@ main = do
|
||||
_ -> ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -43,7 +43,7 @@ main = do
|
||||
resume : Request {g, Break} x -> x
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -423,14 +423,14 @@ run verbosity dir stanzas codebase runtime sbRuntime nRuntime config ucmVersion
|
||||
liftIO (writeIORef allowErrors errOk)
|
||||
-- Open a ucm block which will contain the output from UCM
|
||||
-- after processing the UnisonFileChanged event.
|
||||
liftIO (output "```ucm\n")
|
||||
liftIO (output "``` ucm\n")
|
||||
-- Close the ucm block after processing the UnisonFileChanged event.
|
||||
atomically . Q.enqueue cmdQueue $ Nothing
|
||||
let sourceName = fromMaybe "scratch.u" filename
|
||||
liftIO $ updateVirtualFile sourceName txt
|
||||
pure $ Left (UnisonFileChanged sourceName txt)
|
||||
API apiRequests -> do
|
||||
liftIO (output "```api\n")
|
||||
liftIO (output "``` api\n")
|
||||
liftIO (for_ apiRequests apiRequest)
|
||||
liftIO (output "```")
|
||||
awaitInput
|
||||
@ -438,7 +438,7 @@ run verbosity dir stanzas codebase runtime sbRuntime nRuntime config ucmVersion
|
||||
liftIO (writeIORef hidden hide)
|
||||
liftIO (writeIORef allowErrors errOk)
|
||||
liftIO (writeIORef hasErrors False)
|
||||
liftIO (output "```ucm")
|
||||
liftIO (output "``` ucm")
|
||||
traverse_ (atomically . Q.enqueue cmdQueue . Just) cmds
|
||||
atomically . Q.enqueue cmdQueue $ Nothing
|
||||
awaitInput
|
||||
|
@ -1,4 +1,4 @@
|
||||
```ucm
|
||||
``` ucm
|
||||
test-html-docs/main> builtins.mergeio lib.builtins
|
||||
|
||||
Done.
|
||||
@ -15,7 +15,7 @@ some.ns.pretty.deeply.nested = 2
|
||||
some.outside = 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -33,7 +33,7 @@ some.outside = 3
|
||||
some.outside.doc : Doc2
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
test-html-docs/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -29,7 +29,7 @@ rule2 x = @rewrite signature Optional ==> Optional2
|
||||
|
||||
Let's rewrite these:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> rewrite rule1
|
||||
|
||||
☝️
|
||||
@ -110,7 +110,7 @@ rule2 x = @rewrite signature Optional ==> Optional2
|
||||
|
||||
After adding to the codebase, here's the rewritten source:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view ex1 Either.mapRight rule1
|
||||
|
||||
Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b
|
||||
@ -156,7 +156,7 @@ blah2 = 456
|
||||
|
||||
Let's apply the rewrite `woot1to2`:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> rewrite woot1to2
|
||||
|
||||
☝️
|
||||
@ -192,7 +192,7 @@ blah2 = 456
|
||||
|
||||
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view wootEx
|
||||
|
||||
wootEx : Nat ->{Woot2} Nat
|
||||
@ -224,7 +224,7 @@ sameFileEx =
|
||||
|
||||
After adding the rewritten form to the codebase, here's the rewritten definitions:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view foo1 foo2 sameFileEx
|
||||
|
||||
foo1 : Nat
|
||||
@ -265,7 +265,7 @@ sameFileEx =
|
||||
|
||||
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> rewrite rule
|
||||
|
||||
☝️
|
||||
@ -299,7 +299,7 @@ sameFileEx =
|
||||
|
||||
Instead, it should be an unbound free variable, which doesn't typecheck:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> load
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
@ -330,7 +330,7 @@ rule a = @rewrite
|
||||
term 233 ==> a
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> rewrite rule
|
||||
|
||||
☝️
|
||||
@ -356,7 +356,7 @@ rule a =
|
||||
|
||||
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> load
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
@ -386,7 +386,7 @@ findEitherEx x = @rewrite term Left ("hello", x) ==> Left ("hello" Text.++ x)
|
||||
findEitherFailure = @rewrite signature a . Either Failure a ==> ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> sfind findEitherEx
|
||||
|
||||
🔎
|
||||
|
@ -4,7 +4,7 @@ This transcript verifies that the pretty-printer produces code that can be succe
|
||||
x = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -19,7 +19,7 @@ x = ()
|
||||
```
|
||||
So we can see the pretty-printed output:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.a1> edit 1-1000
|
||||
|
||||
☝️
|
||||
@ -770,7 +770,7 @@ a |> f = f a
|
||||
|
||||
This diff should be empty if the two namespaces are equivalent. If it's nonempty, the diff will show us the hashes that differ.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace a1 a2
|
||||
|
||||
The namespaces are identical.
|
||||
@ -784,7 +784,7 @@ This just makes 'roundtrip.u' the latest scratch file.
|
||||
x = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.a3> edit 1-5000
|
||||
|
||||
☝️
|
||||
@ -819,7 +819,7 @@ sloppyDocEval =
|
||||
|
||||
These are currently all expected to have different hashes on round trip.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace a3 a3_old
|
||||
|
||||
Updates:
|
||||
|
@ -39,7 +39,7 @@ testAutoClean _ =
|
||||
Left (Failure _ t _) -> results :+ (Fail t)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -52,7 +52,7 @@ testAutoClean _ =
|
||||
testAutoClean : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -1,6 +1,6 @@
|
||||
This transcript is intended to make visible accidental changes to the hashing algorithm.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> find.verbose
|
||||
|
||||
1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo
|
||||
|
@ -53,7 +53,7 @@ testABunchOfNats _ =
|
||||
(runTest (testNat 0))
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -75,7 +75,7 @@ testABunchOfNats _ =
|
||||
testRoundTrip : Nat -> EncDec ->{IO, Stream Result} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -151,7 +151,7 @@ swapped name link =
|
||||
rejected ("swapped " ++ name) rco
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -198,7 +198,7 @@ swapped name link =
|
||||
->{Throw Text} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -315,7 +315,7 @@ badLoad _ =
|
||||
Left _ -> [Fail "Exception"]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -342,7 +342,7 @@ This simply runs some functions to make sure there isn't a crash. Once
|
||||
we gain the ability to capture output in a transcript, it can be modified
|
||||
to actual show that the serialization works.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -428,7 +428,7 @@ codeTests =
|
||||
]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -441,7 +441,7 @@ codeTests =
|
||||
codeTests : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -514,7 +514,7 @@ vtests _ =
|
||||
]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -528,7 +528,7 @@ vtests _ =
|
||||
vtests : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -28,7 +28,7 @@ The 7 days of the week, defined as:
|
||||
unique type time.DayOfWeek = Sun | Mon | Tue | Wed | Thu | Fri | Sat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -50,7 +50,7 @@ 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
|
||||
``` ucm
|
||||
scratch/main> display d1
|
||||
|
||||
Hello there Alice!
|
||||
@ -72,7 +72,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
|
||||
``` ucm
|
||||
scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
|
||||
|
||||
Loading changes detected in
|
||||
@ -99,7 +99,7 @@ Now we can review different portions of the guide.
|
||||
we'll show both the pretty-printed source using `view`
|
||||
and the rendered output using `display`:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view basicFormatting
|
||||
|
||||
basicFormatting : Doc2
|
||||
@ -548,7 +548,7 @@ 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
|
||||
``` ucm
|
||||
scratch/main> view doc.guide
|
||||
|
||||
doc.guide : Doc2
|
||||
|
@ -18,7 +18,7 @@ test2 = do
|
||||
[Ok "test2"]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -32,7 +32,7 @@ test2 = do
|
||||
test2 : '{IO, Exception} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -41,7 +41,7 @@ scratch/main> add
|
||||
test2 : '{IO, Exception} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> io.test test1
|
||||
|
||||
💔💥
|
||||
@ -57,7 +57,7 @@ scratch/main> io.test test1
|
||||
##raise
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> io.test test2
|
||||
|
||||
💔💥
|
||||
|
@ -11,7 +11,7 @@ Async.parMap f as =
|
||||
List.map await tasks
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -24,7 +24,7 @@ wat = handleTrivial testAction -- Somehow this completely forgets about Excepti
|
||||
> handleTrivial testAction
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -8,7 +8,7 @@ timingApp2 _ =
|
||||
printLine "World"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -21,7 +21,7 @@ timingApp2 _ =
|
||||
timingApp2 : '{IO, Exception} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run timingApp2
|
||||
|
||||
()
|
||||
|
@ -31,7 +31,7 @@ increment n = 1 + n
|
||||
Stream.toList s2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -82,7 +82,7 @@ foo _ =
|
||||
> h foo 337
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -126,7 +126,7 @@ hmm =
|
||||
> hmm
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -13,7 +13,7 @@ arrayList v n = do
|
||||
> Scope.run '(catch (arrayList 7 8))
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -5,7 +5,7 @@ A simple doc.
|
||||
meh = 9
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -19,7 +19,7 @@ meh = 9
|
||||
meh.doc : Doc2
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -35,7 +35,7 @@ run s =
|
||||
()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -22,7 +22,7 @@ go = do
|
||||
foreach forkIt [thunk]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -56,7 +56,7 @@ fancyTryEval : '{g, IO, Exception} a ->{g, IO, Exception} a
|
||||
fancyTryEval = reraise << catchAll.impl
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -2,7 +2,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
|
||||
``` ucm
|
||||
scratch/main> ls builtin.Bytes
|
||||
|
||||
1. ++ (Bytes -> Bytes -> Bytes)
|
||||
@ -74,7 +74,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
|
||||
> ex5
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -119,7 +119,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
|
||||
```
|
||||
And here's the full API:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> find-in builtin.crypto
|
||||
|
||||
1. type CryptoFailure
|
||||
@ -159,7 +159,7 @@ Note that the universal versions of `hash` and `hmac` are currently unimplemente
|
||||
> hash Sha3_256 (fromHex "3849238492")
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -311,7 +311,7 @@ test> crypto.hash.numTests =
|
||||
checks (List.map t (range 0 20))
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> test
|
||||
|
||||
Cached test results (`help testcache` to learn more)
|
||||
@ -378,7 +378,7 @@ test> hmac_sha2_512.tests.ex2 =
|
||||
"164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -441,7 +441,7 @@ test> md5.tests.ex3 =
|
||||
"e4d909c290d0fb1ca068ffaddf22cbd0"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -473,7 +473,7 @@ test> md5.tests.ex3 =
|
||||
✅ Passed Passed
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> test
|
||||
|
||||
Cached test results (`help testcache` to learn more)
|
||||
|
@ -50,7 +50,7 @@ testMvars _ =
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -64,7 +64,7 @@ testMvars _ =
|
||||
testMvars : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -31,7 +31,7 @@ test = 'let
|
||||
runTest testABunchOfNats
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -48,7 +48,7 @@ test = 'let
|
||||
->{Stream Result} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -90,7 +90,7 @@ testDefaultPort _ =
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -105,7 +105,7 @@ testDefaultPort _ =
|
||||
testExplicitHost : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -177,7 +177,7 @@ testTcpConnect = 'let
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -192,7 +192,7 @@ testTcpConnect = 'let
|
||||
testTcpConnect : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -55,7 +55,7 @@ serialTests = do
|
||||
List.map snd (bSort (List.map runTestCase cs))
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -73,7 +73,7 @@ serialTests = do
|
||||
shuffle : Nat -> [a] -> [a]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -18,7 +18,7 @@ casTest = do
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -31,7 +31,7 @@ casTest = do
|
||||
casTest : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -80,7 +80,7 @@ promiseConcurrentTest = do
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -94,7 +94,7 @@ promiseConcurrentTest = do
|
||||
promiseSequentialTest : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -134,7 +134,7 @@ atomicUpdate ref f =
|
||||
if Ref.cas ref ticket value then () else atomicUpdate ref f
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -147,7 +147,7 @@ atomicUpdate ref f =
|
||||
atomicUpdate : Ref {IO} a -> (a -> a) ->{IO} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -173,7 +173,7 @@ spawnN n fa =
|
||||
map Promise.read (go n [])
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -186,7 +186,7 @@ spawnN n fa =
|
||||
spawnN : Nat -> '{IO} a ->{IO} [a]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -222,7 +222,7 @@ fullTest = do
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -235,7 +235,7 @@ fullTest = do
|
||||
fullTest : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -67,7 +67,7 @@ mkTestCase = do
|
||||
saveTestCase "case-00" "v4" f tup
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -94,7 +94,7 @@ mkTestCase = do
|
||||
tree3 : Tree Text
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -15,7 +15,7 @@ mkTestCase = do
|
||||
saveTestCase "case-01" "v4" combines (l1, l2, l3)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -32,7 +32,7 @@ mkTestCase = do
|
||||
mkTestCase : '{IO, Exception} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -29,7 +29,7 @@ mkTestCase = do
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -48,7 +48,7 @@ mkTestCase = do
|
||||
products : ([Nat], [Nat], [Nat]) -> Text
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -43,7 +43,7 @@ mkTestCase = do
|
||||
saveTestCase "case-03" "v4" finish trip
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -67,7 +67,7 @@ mkTestCase = do
|
||||
suspSum : [Nat] -> Delayed Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -12,7 +12,7 @@ mkTestCase = do
|
||||
saveTestCase "case-04" "v4" mutual1 5
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -27,7 +27,7 @@ mkTestCase = do
|
||||
mutual1 : Nat -> Text
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -28,7 +28,7 @@ body k out v =
|
||||
atomically '(TVar.write out (Some n))
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -44,7 +44,7 @@ body k out v =
|
||||
loop : '{IO} Nat -> Nat -> Nat ->{IO} Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -90,7 +90,7 @@ tests : '{io2.IO} [Result]
|
||||
tests = '(map spawn nats)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -106,7 +106,7 @@ tests = '(map spawn nats)
|
||||
tests : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -15,7 +15,7 @@ x = 1000
|
||||
test> mytest = checks [x + 1 == 1001]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -42,7 +42,7 @@ test> mytest = checks [x + 1 == 1001]
|
||||
```
|
||||
We expect this 'add' to fail because the test is blocked by the update to `x`.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
x These definitions failed:
|
||||
@ -61,7 +61,7 @@ y = 42
|
||||
test> useY = checks [y + 1 == 43]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -84,7 +84,7 @@ test> useY = checks [y + 1 == 43]
|
||||
```
|
||||
This should correctly identify `y` as a dependency and add that too.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add useY
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -16,7 +16,7 @@ testBasicFork = 'let
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -56,7 +56,7 @@ testBasicMultiThreadMVar = 'let
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -70,7 +70,7 @@ testBasicMultiThreadMVar = 'let
|
||||
thread1 : Nat -> MVar Nat -> '{IO} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -127,7 +127,7 @@ testTwoThreads = 'let
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -143,7 +143,7 @@ testTwoThreads = 'let
|
||||
testTwoThreads : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -27,7 +27,7 @@ this_should_not_work=match (decodeCert.impl (toUtf8 not_a_cert) with
|
||||
what_should_work _ = this_should_work ++ this_should_not_work
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -42,7 +42,7 @@ what_should_work _ = this_should_work ++ this_should_not_work
|
||||
what_should_work : ∀ _. _ -> [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -217,7 +217,7 @@ testCNReject _ =
|
||||
runTest test
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -237,7 +237,7 @@ testCNReject _ =
|
||||
testConnectSelfSigned : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -2,7 +2,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
|
||||
``` ucm
|
||||
scratch/main> find Utf8
|
||||
|
||||
1. builtin.Text.toUtf8 : Text -> Bytes
|
||||
@ -21,7 +21,7 @@ ascii = "ABCDE"
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -51,7 +51,7 @@ greek = "ΑΒΓΔΕ"
|
||||
> toUtf8 greek
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -86,7 +86,7 @@ greek = "ΑΒΓΔΕ"
|
||||
test> greekTest = checkRoundTrip greek
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -121,7 +121,7 @@ greek_bytes = Bytes.fromList [206, 145, 206, 146, 206, 147, 206, 148, 206]
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -16,7 +16,7 @@ ha = cases
|
||||
{ four i -> c } -> handle c (j k l -> i+j+k+l) with ha
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -30,7 +30,7 @@ ha = cases
|
||||
ha : Request {A} r -> r
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -14,7 +14,7 @@ term2 : () ->{Bar, Foo} ()
|
||||
term2 _ = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -30,7 +30,7 @@ term2 _ = ()
|
||||
term2 : '{Bar, Foo} ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -10,7 +10,7 @@ unique ability Channels where
|
||||
send : a -> {Channels} ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -23,7 +23,7 @@ unique ability Channels where
|
||||
ability Channels
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -46,7 +46,7 @@ thing : '{Channels} ()
|
||||
thing _ = send 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -67,7 +67,7 @@ thing _ = send 1
|
||||
```
|
||||
These should fail with a term/ctor conflict since we exclude the ability from the update.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update.old patch Channels.send
|
||||
|
||||
x These definitions failed:
|
||||
@ -102,7 +102,7 @@ thing : '{Channels} ()
|
||||
thing _ = send 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -121,7 +121,7 @@ thing _ = send 1
|
||||
```
|
||||
These updates should succeed since `Channels` is a dependency.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update.old.preview patch Channels.send
|
||||
|
||||
I found and typechecked these definitions in scratch.u. If you
|
||||
@ -152,7 +152,7 @@ scratch/main> update.old.preview patch thing
|
||||
```
|
||||
We should also be able to successfully update the whole thing.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update.old
|
||||
|
||||
⊡ Ignored previously added definitions: Channels
|
||||
@ -169,7 +169,7 @@ scratch/main> update.old
|
||||
X.x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -182,7 +182,7 @@ X.x = 1
|
||||
X.x : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main2> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -195,7 +195,7 @@ structural ability X where
|
||||
x : ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -214,7 +214,7 @@ structural ability X where
|
||||
```
|
||||
This should fail with a ctor/term conflict.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main2> add
|
||||
|
||||
x These definitions failed:
|
||||
|
@ -13,7 +13,7 @@ is2even : 'Boolean
|
||||
is2even = '(even 2)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -30,7 +30,7 @@ is2even = '(even 2)
|
||||
```
|
||||
it errors if there isn't a previous run
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add.run foo
|
||||
|
||||
⚠️
|
||||
@ -39,7 +39,7 @@ scratch/main> add.run foo
|
||||
something before attempting to save it.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run is2even
|
||||
|
||||
true
|
||||
@ -48,7 +48,7 @@ scratch/main> run is2even
|
||||
it errors if the desired result name conflicts with a name in the
|
||||
unison file
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add.run is2even
|
||||
|
||||
⚠️
|
||||
@ -59,7 +59,7 @@ scratch/main> add.run is2even
|
||||
```
|
||||
otherwise, the result is successfully persisted
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add.run foo.bar.baz
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -67,7 +67,7 @@ scratch/main> add.run foo.bar.baz
|
||||
foo.bar.baz : Boolean
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view foo.bar.baz
|
||||
|
||||
foo.bar.baz : Boolean
|
||||
@ -87,7 +87,7 @@ main : '{IO, Exception} (Nat -> Nat -> Nat)
|
||||
main _ = y
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -102,7 +102,7 @@ main _ = y
|
||||
z : Nat -> Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run main
|
||||
|
||||
a b -> a Nat.+ b Nat.+ z 10
|
||||
@ -122,7 +122,7 @@ inc : Nat -> Nat
|
||||
inc x = x + 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -135,7 +135,7 @@ inc x = x + 1
|
||||
inc : Nat -> Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add inc
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -148,7 +148,7 @@ main : '(Nat -> Nat)
|
||||
main _ x = inc x
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -161,7 +161,7 @@ main _ x = inc x
|
||||
main : '(Nat -> Nat)
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run main
|
||||
|
||||
inc
|
||||
@ -186,7 +186,7 @@ y = x + x
|
||||
main = 'y
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -201,7 +201,7 @@ main = 'y
|
||||
y : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run main
|
||||
|
||||
2
|
||||
@ -211,7 +211,7 @@ scratch/main> run main
|
||||
x = 50
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -226,7 +226,7 @@ x = 50
|
||||
```
|
||||
this saves 2 to xres, rather than 100
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add.run xres
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -245,7 +245,7 @@ scratch/main> view xres
|
||||
main = '5
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -258,7 +258,7 @@ main = '5
|
||||
main : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> run main
|
||||
|
||||
5
|
||||
@ -279,7 +279,7 @@ scratch/main> add.run xres
|
||||
main = '5
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -292,7 +292,7 @@ main = '5
|
||||
main : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> run main
|
||||
|
||||
5
|
||||
|
@ -5,7 +5,7 @@ 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
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -10,7 +10,7 @@ structural type X = One Nat
|
||||
structural type Y = Two Nat Nat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -28,7 +28,7 @@ structural type Y = Two Nat Nat
|
||||
```
|
||||
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -47,7 +47,7 @@ z = 1
|
||||
structural type Z = One Nat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -66,7 +66,7 @@ structural type Z = One Nat
|
||||
Expected: `z` is now `1`. UCM tells you that this definition is also called `x`.
|
||||
Also, `Z` is an alias for `X`.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -84,7 +84,7 @@ x = 3
|
||||
structural type X = Three Nat Nat Nat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -103,7 +103,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
|
||||
``` ucm
|
||||
scratch/main> update
|
||||
|
||||
Okay, I'm searching the branch for code that needs to be
|
||||
@ -123,7 +123,7 @@ x = 2
|
||||
structural type X = Two Nat Nat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -142,7 +142,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
|
||||
``` ucm
|
||||
scratch/main> update
|
||||
|
||||
Okay, I'm searching the branch for code that needs to be
|
||||
|
@ -10,7 +10,7 @@ The names that will be used in the target namespace are the names you specify, r
|
||||
|
||||
Let's try it\!
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib
|
||||
|
||||
Here's what changed in mylib :
|
||||
|
@ -1,6 +1,6 @@
|
||||
`alias.term` makes a new name for a term.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> alias.term lib.builtins.bug foo
|
||||
|
||||
Done.
|
||||
@ -13,7 +13,7 @@ project/main> ls
|
||||
```
|
||||
It won't create a conflicted name, though.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> alias.term lib.builtins.todo foo
|
||||
|
||||
⚠️
|
||||
@ -21,7 +21,7 @@ project/main> alias.term lib.builtins.todo foo
|
||||
A term by that name already exists.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> ls
|
||||
|
||||
1. foo (a -> b)
|
||||
@ -30,7 +30,7 @@ project/main> ls
|
||||
```
|
||||
You can use `debug.alias.term.force` for that.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> debug.alias.term.force lib.builtins.todo foo
|
||||
|
||||
Done.
|
||||
|
@ -1,6 +1,6 @@
|
||||
`alias.type` makes a new name for a type.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> alias.type lib.builtins.Nat Foo
|
||||
|
||||
Done.
|
||||
@ -13,7 +13,7 @@ project/main> ls
|
||||
```
|
||||
It won't create a conflicted name, though.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> alias.type lib.builtins.Int Foo
|
||||
|
||||
⚠️
|
||||
@ -21,7 +21,7 @@ project/main> alias.type lib.builtins.Int Foo
|
||||
A type by that name already exists.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> ls
|
||||
|
||||
1. Foo (builtin type)
|
||||
@ -30,7 +30,7 @@ project/main> ls
|
||||
```
|
||||
You can use `debug.alias.type.force` for that.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> debug.alias.type.force lib.builtins.Int Foo
|
||||
|
||||
Done.
|
||||
|
@ -23,7 +23,7 @@ foo _ =
|
||||
> !foo
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -43,7 +43,7 @@ foo _ =
|
||||
5
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -11,7 +11,7 @@ test> Any.unsafeExtract.works =
|
||||
]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -31,7 +31,7 @@ test> Any.unsafeExtract.works =
|
||||
✅ Passed Passed
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -77,7 +77,7 @@ Transclusion/evaluation:
|
||||
term = 42
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> display term.doc
|
||||
|
||||
# Heading
|
||||
@ -146,7 +146,7 @@ scratch/main> display term.doc
|
||||
message
|
||||
|
||||
```
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/scratch/branches/main/getDefinition?names=term
|
||||
{
|
||||
"missingDefinitions": [],
|
||||
|
@ -7,7 +7,7 @@ joey.httpServer.z = 44
|
||||
joey.yaml.zz = 45
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -23,7 +23,7 @@ joey.yaml.zz = 45
|
||||
ross.httpClient.y : ##Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -34,7 +34,7 @@ scratch/main> add
|
||||
ross.httpClient.y : ##Nat
|
||||
|
||||
```
|
||||
```api
|
||||
``` api
|
||||
-- Namespace segment prefix search
|
||||
GET /api/projects/scratch/branches/main/find?query=http
|
||||
[
|
||||
|
@ -5,7 +5,7 @@ nested.names.x.doc = {{ Documentation }}
|
||||
nested.names.x = 42
|
||||
```
|
||||
|
||||
```api
|
||||
``` api
|
||||
-- Should NOT find names by suffix
|
||||
GET /api/projects/scratch/branches/main/getDefinition?names=x
|
||||
{
|
||||
@ -216,7 +216,7 @@ doctest.otherstuff.thing = "A different thing"
|
||||
|
||||
Only docs for the term we request should be returned, even if there are other term docs with the same suffix.
|
||||
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest
|
||||
{
|
||||
"missingDefinitions": [],
|
||||
@ -334,7 +334,7 @@ GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doc
|
||||
}
|
||||
```If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list.
|
||||
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest
|
||||
{
|
||||
"missingDefinitions": [],
|
||||
|
@ -1,6 +1,6 @@
|
||||
# List Projects And Branches Test
|
||||
|
||||
```api
|
||||
``` api
|
||||
-- Should list all projects
|
||||
GET /api/projects
|
||||
[
|
||||
|
@ -9,7 +9,7 @@ Here's a *README*!
|
||||
}}
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -24,7 +24,7 @@ Here's a *README*!
|
||||
nested.names.x.doc : Doc2
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -34,7 +34,7 @@ scratch/main> add
|
||||
nested.names.x.doc : Doc2
|
||||
|
||||
```
|
||||
```api
|
||||
``` api
|
||||
-- Should find names by suffix
|
||||
GET /api/projects/scratch/branches/main/namespaces/nested.names
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ nested.names.x = 42
|
||||
nested.names.readme = {{ I'm a readme! }}
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ nested.names.readme = {{ I'm a readme! }}
|
||||
nested.names.x.doc : Doc2
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -32,7 +32,7 @@ scratch/main> add
|
||||
nested.names.x.doc : Doc2
|
||||
|
||||
```
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/scratch/branches/main/list?namespace=nested.names
|
||||
{
|
||||
"namespaceListingChildren": [
|
||||
|
@ -21,7 +21,7 @@ structural ability Stream s where
|
||||
|
||||
## Term Summary APIs
|
||||
|
||||
```api
|
||||
``` api
|
||||
-- term
|
||||
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat
|
||||
{
|
||||
@ -669,7 +669,7 @@ GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.
|
||||
}
|
||||
```## Type Summary APIs
|
||||
|
||||
```api
|
||||
``` api
|
||||
-- data
|
||||
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ Should block an `add` if it requires an update on an in-file dependency.
|
||||
x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -19,7 +19,7 @@ x = 1
|
||||
x : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -34,7 +34,7 @@ x = 10
|
||||
y = x + 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -54,7 +54,7 @@ y = x + 1
|
||||
```
|
||||
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add y
|
||||
|
||||
x These definitions failed:
|
||||
|
@ -15,7 +15,7 @@ ex thing =
|
||||
> ex "hello"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -48,7 +48,7 @@ ex thing =
|
||||
> ex "hello"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -83,7 +83,7 @@ ex thing =
|
||||
> ex (x -> x * 100)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -115,7 +115,7 @@ ex thing =
|
||||
> ex (x -> x * 100)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -154,7 +154,7 @@ ex n =
|
||||
ping 42
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -181,7 +181,7 @@ ex n =
|
||||
ping 0
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -205,7 +205,7 @@ ex n =
|
||||
pong
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -223,7 +223,7 @@ ex n =
|
||||
loop
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -240,7 +240,7 @@ ex n =
|
||||
!loop
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -269,7 +269,7 @@ ex n =
|
||||
zap1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -293,7 +293,7 @@ ex n =
|
||||
zap1 "pluto"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -322,7 +322,7 @@ ex n =
|
||||
ping 42
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -349,7 +349,7 @@ ex n =
|
||||
ping 42
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -7,7 +7,7 @@ hangExample =
|
||||
&& ("a long piece of text to hang the line" == "")
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -20,7 +20,7 @@ hangExample =
|
||||
hangExample : Boolean
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -6,7 +6,7 @@ First, we'll create a term to include in the branches.
|
||||
someterm = 18
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> builtins.merge lib.builtins
|
||||
|
||||
Done.
|
||||
@ -23,7 +23,7 @@ Now, the `branch` demo:
|
||||
`branch` can create a branch from a different branch in the same project, from a different branch in a different
|
||||
project. It can also create an empty branch.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch topic1
|
||||
|
||||
Done. I've created the topic1 branch based off of main.
|
||||
@ -151,7 +151,7 @@ scratch/main> branch.empty foo/empty4
|
||||
```
|
||||
The `branch` command can create branches named `releases/drafts/*` (because why not).
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch releases/drafts/1.2.3
|
||||
|
||||
Done. I've created the releases/drafts/1.2.3 branch based off
|
||||
@ -165,7 +165,7 @@ foo/main> switch /releases/drafts/1.2.3
|
||||
```
|
||||
The `branch` command can't create branches named `releases/*` nor `releases/drafts/*`.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch releases/1.2.3
|
||||
|
||||
Branch names like releases/1.2.3 are reserved for releases.
|
||||
|
@ -3,7 +3,7 @@ foo = 5
|
||||
foo.bar = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -17,7 +17,7 @@ foo.bar = 1
|
||||
foo.bar : ##Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
p0/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -31,7 +31,7 @@ bonk = 5
|
||||
donk.bonk = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -47,7 +47,7 @@ donk.bonk = 1
|
||||
(also named foo.bar)
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
p1/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -8,7 +8,7 @@ bonk x =
|
||||
x
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
We can display the guide before and after adding it to the codebase:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> display doc.guide
|
||||
|
||||
# Unison computable documentation
|
||||
@ -417,7 +417,7 @@ But we can't display this due to a decompilation problem.
|
||||
rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -430,7 +430,7 @@ rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
rendered : Annotated () (Either SpecialForm ConsoleText)
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> display rendered
|
||||
|
||||
# Unison computable documentation
|
||||
@ -850,7 +850,7 @@ rendered = Pretty.get (docFormatConsole doc.guide)
|
||||
> rendered
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
The `builtins.merge` command adds the known builtins to the specified subnamespace within the current namespace.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> builtins.merge builtins
|
||||
|
||||
Done.
|
||||
|
@ -363,7 +363,7 @@ test> Any.test1 = checks [(Any "hi" == Any "hi")]
|
||||
test> Any.test2 = checks [(not (Any "hi" == Any 42))]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -415,7 +415,7 @@ test> Sandbox.test3 = checks [validateSandboxed [termLink openFile.impl]
|
||||
openFile]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -468,7 +468,7 @@ openFilesIO = do
|
||||
]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -481,7 +481,7 @@ openFilesIO = do
|
||||
openFilesIO : '{IO} [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -508,7 +508,7 @@ Just exercises the function
|
||||
test> Universal.murmurHash.tests = checks [Universal.murmurHash [1,2,3] == Universal.murmurHash [1,2,3]]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -536,7 +536,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
|
||||
``` ucm
|
||||
scratch/main> test
|
||||
|
||||
Cached test results (`help testcache` to learn more)
|
||||
|
@ -4,7 +4,7 @@ This should render as `Bytes.fromList [1,2,3,4]`, not `##Bytes.fromSequence [1,2
|
||||
> Bytes.fromList [1,2,3,4]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -5,7 +5,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763
|
||||
(+-+) x y = x * y
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -18,7 +18,7 @@ Regression test for https://github.com/unisonweb/unison/issues/763
|
||||
+-+ : Nat -> Nat -> Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -4,7 +4,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei
|
||||
(-) = builtin.Nat.sub
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -17,7 +17,7 @@ See [this ticket](https://github.com/unisonweb/unison/issues/873); the point bei
|
||||
- : Nat -> Nat -> Int
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -29,7 +29,7 @@ scratch/main> add
|
||||
baz x = x - 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -5,7 +5,7 @@ structural type Zoink a b c = Zoink a b c
|
||||
> [ Zoink [0,1,2,3,4,5] [6,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,3] () ]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -3,7 +3,7 @@ f : (() -> a) -> Nat
|
||||
f x = 42
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
Demonstrating `create.author`:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> create.author alicecoder "Alice McGee"
|
||||
|
||||
Added definitions:
|
||||
|
@ -8,7 +8,7 @@ pong : 'Nat
|
||||
pong _ = !ping + 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ pong _ = !ping + 2
|
||||
pong : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -36,7 +36,7 @@ ping : 'Nat
|
||||
ping _ = !pong + 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -50,7 +50,7 @@ ping _ = !pong + 3
|
||||
ping : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update
|
||||
|
||||
Okay, I'm searching the branch for code that needs to be
|
||||
|
@ -8,7 +8,7 @@ pong : 'Nat
|
||||
pong _ = !ping + 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ pong _ = !ping + 2
|
||||
pong : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -36,7 +36,7 @@ ping : 'Nat
|
||||
ping _ = 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -50,7 +50,7 @@ ping _ = 3
|
||||
ping : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update
|
||||
|
||||
Okay, I'm searching the branch for code that needs to be
|
||||
|
@ -8,7 +8,7 @@ pong : 'Nat
|
||||
pong _ = !ping + 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ pong _ = !ping + 2
|
||||
pong : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -36,7 +36,7 @@ ping : Nat
|
||||
ping = 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -50,7 +50,7 @@ ping = 3
|
||||
ping : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update.old
|
||||
|
||||
⍟ I've updated these names to your new definition:
|
||||
|
@ -8,7 +8,7 @@ pong : 'Nat
|
||||
pong _ = !ping + 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ pong _ = !ping + 2
|
||||
pong : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -39,7 +39,7 @@ clang : 'Nat
|
||||
clang _ = !pong + 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -57,7 +57,7 @@ clang _ = !pong + 3
|
||||
ping : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> update.old ping
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -8,7 +8,7 @@ pong : 'Nat
|
||||
pong _ = !inner.ping + 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ pong _ = !inner.ping + 2
|
||||
pong : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -39,7 +39,7 @@ inner.ping : 'Nat
|
||||
inner.ping _ = !pong + 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -53,7 +53,7 @@ inner.ping _ = !pong + 3
|
||||
inner.ping : 'Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
☝️ The namespace .inner is empty.
|
||||
|
||||
.inner> update.old
|
||||
|
@ -12,7 +12,7 @@ ability Ask a where
|
||||
ask : a
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -9,7 +9,7 @@ structural type a.x.Foo = Foo | Bar
|
||||
structural type a.b.Baz = Boo
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -27,7 +27,7 @@ structural type a.b.Baz = Boo
|
||||
a.x.three : ##Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -14,7 +14,7 @@ http.z = 8
|
||||
|
||||
Our `app1` project includes the text library twice and the http library twice as direct dependencies.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/app1> fork text lib.text_v1
|
||||
|
||||
Done.
|
||||
@ -42,7 +42,7 @@ scratch/app1> delete.namespace http
|
||||
```
|
||||
As such, we see two copies of `a` and two copies of `x` via these direct dependencies.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/app1> names a
|
||||
|
||||
Term
|
||||
@ -63,7 +63,7 @@ scratch/app1> names x
|
||||
Our `app2` project includes the `http` library twice as direct dependencies, and once as an indirect dependency via `webutil`.
|
||||
It also includes the `text` library twice as indirect dependencies via `webutil`
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/app2> fork http lib.http_v1
|
||||
|
||||
Done.
|
||||
@ -96,7 +96,7 @@ scratch/app2> delete.namespace text
|
||||
Now we see two copies of `x` via direct dependencies on `http`, and one copy of `a` via indirect dependency on `text` via `webutil`.
|
||||
We see neither the second indirect copy of `a` nor the indirect copy of `x` via webutil because we already have names for them.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/app2> names a
|
||||
|
||||
Term
|
||||
|
@ -1,4 +1,4 @@
|
||||
```ucm
|
||||
``` ucm
|
||||
diffs/main> builtins.merge
|
||||
|
||||
Done.
|
||||
@ -12,7 +12,7 @@ term =
|
||||
type Type = Type Nat
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -26,7 +26,7 @@ type Type = Type Nat
|
||||
term : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
diffs/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -50,7 +50,7 @@ term =
|
||||
type Type a = Type a Text
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -65,7 +65,7 @@ type Type a = Type a Text
|
||||
term : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
diffs/new> update
|
||||
|
||||
Okay, I'm searching the branch for code that needs to be
|
||||
@ -76,7 +76,7 @@ diffs/new> update
|
||||
```
|
||||
Diff terms
|
||||
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=term&newTerm=term
|
||||
{
|
||||
"diff": {
|
||||
@ -560,7 +560,7 @@ GET /api/projects/diffs/diff/terms?oldBranchRef=main&newBranchRef=new&oldTerm=te
|
||||
}
|
||||
```Diff types
|
||||
|
||||
```api
|
||||
``` api
|
||||
GET /api/projects/diffs/diff/types?oldBranchRef=main&newBranchRef=new&oldType=Type&newType=Type
|
||||
{
|
||||
"diff": {
|
||||
|
@ -10,7 +10,7 @@ sub.dependency = 123
|
||||
dependent = dependency + 99
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -24,7 +24,7 @@ dependent = dependency + 99
|
||||
sub.dependency : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
myproject/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -12,7 +12,7 @@ dependents.usage2 = dependencies.term1 * dependencies.term2
|
||||
|
||||
Deleting a namespace with no external dependencies should succeed.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace no_dependencies
|
||||
|
||||
Done.
|
||||
@ -20,7 +20,7 @@ scratch/main> delete.namespace no_dependencies
|
||||
```
|
||||
Deleting a namespace with external dependencies should fail and list all dependents.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace dependencies
|
||||
|
||||
⚠️
|
||||
@ -41,7 +41,7 @@ scratch/main> delete.namespace dependencies
|
||||
```
|
||||
Deleting a namespace with external dependencies should succeed when using `delete.namespace.force`
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace.force dependencies
|
||||
|
||||
Done.
|
||||
@ -61,7 +61,7 @@ scratch/main> delete.namespace.force dependencies
|
||||
```
|
||||
I should be able to view an affected dependency by number
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view 2
|
||||
|
||||
dependents.usage2 : Nat
|
||||
@ -72,7 +72,7 @@ scratch/main> view 2
|
||||
```
|
||||
Deleting the root namespace should require confirmation if not forced.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace .
|
||||
|
||||
⚠️
|
||||
@ -94,7 +94,7 @@ scratch/main> history .
|
||||
```
|
||||
Deleting the root namespace shouldn't require confirmation if forced.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace.force .
|
||||
|
||||
Okay, I deleted everything except the history. Use `undo` to
|
||||
|
@ -1,7 +1,7 @@
|
||||
Deleting the branch you are on takes you to its parent (though this is impossible to see in a transcript, since we set
|
||||
your working directory with each command).
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch topic
|
||||
|
||||
Done. I've created the topic branch based off of main.
|
||||
@ -14,7 +14,7 @@ foo/topic> delete.branch /topic
|
||||
```
|
||||
A branch need not be preceded by a forward slash.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch topic
|
||||
|
||||
Done. I've created the topic branch based off of main.
|
||||
@ -27,7 +27,7 @@ foo/topic> delete.branch topic
|
||||
```
|
||||
You can precede the branch name by a project name.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> branch topic
|
||||
|
||||
Done. I've created the topic branch based off of main.
|
||||
@ -40,7 +40,7 @@ scratch/main> delete.branch foo/topic
|
||||
```
|
||||
You can delete the only branch in a project.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> delete.branch /main
|
||||
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
# delete.project
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> project.create-empty foo
|
||||
|
||||
🎉 I've created the project foo.
|
||||
|
@ -1,4 +1,4 @@
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete foo
|
||||
|
||||
⚠️
|
||||
@ -12,7 +12,7 @@ foo = 1
|
||||
structural type Foo = Foo ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -5,7 +5,7 @@ The delete command can delete both terms and types.
|
||||
First, let's make sure it complains when we try to delete a name that doesn't
|
||||
exist.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> delete.verbose foo
|
||||
|
||||
⚠️
|
||||
@ -22,7 +22,7 @@ foo = 1
|
||||
structural type Foo = Foo ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -62,7 +62,7 @@ foo = 1
|
||||
bar = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
☝️ The namespace .a is empty.
|
||||
|
||||
.a> add
|
||||
@ -79,7 +79,7 @@ bar = 2
|
||||
```
|
||||
A delete should remove both versions of the term.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> delete.verbose a.foo
|
||||
|
||||
Removed definitions:
|
||||
@ -106,7 +106,7 @@ structural type Foo = Foo ()
|
||||
structural type Bar = Bar
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.a> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -149,7 +149,7 @@ foo = 1
|
||||
structural type foo = Foo ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -175,7 +175,7 @@ b = "b"
|
||||
c = "c"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -204,7 +204,7 @@ b = "b"
|
||||
c = "c"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -242,7 +242,7 @@ We can delete a type and its constructors
|
||||
structural type Foo = Foo ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -273,7 +273,7 @@ c = 3
|
||||
d = a + b + c
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -306,7 +306,7 @@ g = 13 + f
|
||||
h = e + f + g
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -338,7 +338,7 @@ incrementFoo = cases
|
||||
(Foo n) -> n + 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -366,7 +366,7 @@ g = 13 + f
|
||||
h = e + f + g
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -391,7 +391,7 @@ ping _ = 1 Nat.+ !pong
|
||||
pong _ = 4 Nat.+ !ping
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -16,7 +16,7 @@ inside.q x = x + p * p
|
||||
inside.r = d
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> debug.file
|
||||
|
||||
type inside.M#h37a56c5ep
|
||||
@ -35,7 +35,7 @@ This will help me make progress in some situations when UCM is being deficient o
|
||||
|
||||
But wait, there's more. I can check the dependencies and dependents of a definition:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -14,7 +14,7 @@ ex1 tup =
|
||||
c + d
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -28,7 +28,7 @@ ex1 tup =
|
||||
ex1 : (a, b, (Nat, Nat)) -> Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -58,7 +58,7 @@ ex2 tup = match tup with
|
||||
(a, b, (c,d)) -> c + d
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -82,7 +82,7 @@ ex4 =
|
||||
"Doesn't typecheck"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -116,7 +116,7 @@ ex5a _ = match (99 + 1, "hi") with
|
||||
_ -> "impossible"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -130,7 +130,7 @@ ex5a _ = match (99 + 1, "hi") with
|
||||
ex5a : 'Text
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -162,7 +162,7 @@ ex6 x = match x with
|
||||
|
||||
For clarity, the pretty-printer leaves this alone, even though in theory it could be written `(x,y) = x; x + y`:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -6,7 +6,7 @@ b2.fslkdjflskdjflksjdf = 23
|
||||
b2.abc = 23
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -22,7 +22,7 @@ b2.abc = 23
|
||||
Done.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace b1 b2
|
||||
|
||||
Resolved name conflicts:
|
||||
@ -78,7 +78,7 @@ structural type A a = A ()
|
||||
structural ability X a1 a2 where x : ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
☝️ The namespace .ns1 is empty.
|
||||
|
||||
.ns1> add
|
||||
@ -108,7 +108,7 @@ structural ability X a1 a2 where x : ()
|
||||
```
|
||||
Here's what we've done so far:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace nothing ns1
|
||||
|
||||
⚠️
|
||||
@ -116,7 +116,7 @@ Here's what we've done so far:
|
||||
The namespace .nothing is empty. Was there a typo?
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace ns1 ns2
|
||||
|
||||
The namespaces are identical.
|
||||
@ -126,7 +126,7 @@ Here's what we've done so far:
|
||||
junk = "asldkfjasldkfj"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.ns1> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -151,7 +151,7 @@ f = 6
|
||||
unique type Y a b = Y a b
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.ns2> update.old
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -287,7 +287,7 @@ unique type Y a b = Y a b
|
||||
bdependent = "banana"
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.ns3> update.old
|
||||
|
||||
⍟ I've updated these names to your new definition:
|
||||
@ -321,7 +321,7 @@ a = 333
|
||||
b = a + 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
☝️ The namespace .nsx is empty.
|
||||
|
||||
.nsx> add
|
||||
@ -344,7 +344,7 @@ b = a + 1
|
||||
a = 444
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.nsy> update.old
|
||||
|
||||
⍟ I've updated these names to your new definition:
|
||||
@ -356,7 +356,7 @@ a = 444
|
||||
a = 555
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
.nsz> update.old
|
||||
|
||||
⍟ I've updated these names to your new definition:
|
||||
@ -376,7 +376,7 @@ a = 555
|
||||
Done.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.> diff.namespace nsx nsw
|
||||
|
||||
New name conflicts:
|
||||
@ -416,7 +416,7 @@ a = 555
|
||||
x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -429,7 +429,7 @@ x = 1
|
||||
x : ##Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
☝️ The namespace .hashdiff is empty.
|
||||
|
||||
.hashdiff> add
|
||||
@ -443,7 +443,7 @@ x = 1
|
||||
y = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -456,7 +456,7 @@ y = 2
|
||||
y : ##Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
.hashdiff> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -9,7 +9,7 @@ foo n =
|
||||
n + 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -22,7 +22,7 @@ foo n =
|
||||
foo : Nat -> Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view foo
|
||||
|
||||
foo : Nat -> Nat
|
||||
@ -38,7 +38,7 @@ Note that `@` and `:]` must be escaped within docs.
|
||||
escaping = [: Docs look [: like \@this \:] :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -51,7 +51,7 @@ escaping = [: Docs look [: like \@this \:] :]
|
||||
escaping : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view escaping
|
||||
|
||||
escaping : Doc
|
||||
@ -70,7 +70,7 @@ commented = [:
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -83,7 +83,7 @@ commented = [:
|
||||
commented : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view commented
|
||||
|
||||
commented : Doc
|
||||
@ -105,7 +105,7 @@ Handling of indenting in docs between the parser and pretty-printer is a bit fid
|
||||
doc1 = [: hi :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -118,7 +118,7 @@ doc1 = [: hi :]
|
||||
doc1 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc1
|
||||
|
||||
doc1 : Doc
|
||||
@ -137,7 +137,7 @@ doc2 = [: hello
|
||||
and the rest. :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -150,7 +150,7 @@ doc2 = [: hello
|
||||
doc2 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc2
|
||||
|
||||
doc2 : Doc
|
||||
@ -176,7 +176,7 @@ Note that because of the special treatment of the first line mentioned above, wh
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -189,7 +189,7 @@ Note that because of the special treatment of the first line mentioned above, wh
|
||||
doc3 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc3
|
||||
|
||||
doc3 : Doc
|
||||
@ -223,7 +223,7 @@ doc4 = [: Here's another example of some paragraphs.
|
||||
- Apart from this one. :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -236,7 +236,7 @@ doc4 = [: Here's another example of some paragraphs.
|
||||
doc4 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc4
|
||||
|
||||
doc4 : Doc
|
||||
@ -258,7 +258,7 @@ doc5 = [: - foo
|
||||
and the rest. :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -271,7 +271,7 @@ doc5 = [: - foo
|
||||
doc5 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc5
|
||||
|
||||
doc5 : Doc
|
||||
@ -290,7 +290,7 @@ doc6 = [:
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -303,7 +303,7 @@ doc6 = [:
|
||||
doc6 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view doc6
|
||||
|
||||
doc6 : Doc
|
||||
@ -323,7 +323,7 @@ empty = [::]
|
||||
expr = foo 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -337,7 +337,7 @@ expr = foo 1
|
||||
expr : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view empty
|
||||
|
||||
empty : Doc
|
||||
@ -384,7 +384,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -397,7 +397,7 @@ para line lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem ipsum dolo
|
||||
test1 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view test1
|
||||
|
||||
test1 : Doc
|
||||
@ -466,7 +466,7 @@ reg1363 = [: `@List.take foo` bar
|
||||
baz :]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -479,7 +479,7 @@ reg1363 = [: `@List.take foo` bar
|
||||
reg1363 : Doc
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view reg1363
|
||||
|
||||
reg1363 : Doc
|
||||
@ -496,7 +496,7 @@ test2 = [:
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -511,7 +511,7 @@ test2 = [:
|
||||
```
|
||||
View is fine.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view test2
|
||||
|
||||
test2 : Doc
|
||||
@ -523,7 +523,7 @@ scratch/main> view test2
|
||||
```
|
||||
But note it's not obvious how display should best be handling this. At the moment it just does the simplest thing:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> display test2
|
||||
|
||||
Take a look at this:
|
||||
|
@ -25,7 +25,7 @@ docs.example4 = {{A doc that links to the {type Labels} type}}
|
||||
|
||||
Now we check that each doc links to the object of the correct name:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> display docs.example1
|
||||
|
||||
A doc that links to the abilityPatterns term
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Unison documentation is written in Unison. Documentation is a value of the following type:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view lib.builtins.Doc
|
||||
|
||||
type lib.builtins.Doc
|
||||
@ -26,7 +26,7 @@ Can link to definitions like @List.drop or @List
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -58,7 +58,7 @@ List.take.ex1 = take 0 [1,2,3,4,5]
|
||||
List.take.ex2 = take 2 [1,2,3,4,5]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -72,7 +72,7 @@ List.take.ex2 = take 2 [1,2,3,4,5]
|
||||
List.take.ex2 : [Nat]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -100,7 +100,7 @@ List.take.doc = [:
|
||||
:]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -115,7 +115,7 @@ List.take.doc = [:
|
||||
```
|
||||
Let's add it to the codebase.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -125,7 +125,7 @@ scratch/main> add
|
||||
```
|
||||
We can view it with `docs`, which shows the `Doc` value that is associated with a definition.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> docs List.take
|
||||
|
||||
`List.take n xs` returns the first `n` elements of `xs`. (No
|
||||
@ -150,7 +150,7 @@ scratch/main> docs List.take
|
||||
```
|
||||
Note that if we view the source of the documentation, the various references are *not* expanded.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> view List.take
|
||||
|
||||
builtin lib.builtins.List.take :
|
||||
|
@ -109,7 +109,7 @@ Inline '' text literal with 1 space of padding '' in the middle of a sentence.
|
||||
|
||||
Format it to check that everything pretty-prints in a valid way.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> debug.format
|
||||
|
||||
```
|
||||
|
@ -81,7 +81,7 @@ Table
|
||||
}}
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> debug.doc-to-markdown fulldoc
|
||||
|
||||
Heres some text with a soft line break
|
||||
@ -174,7 +174,7 @@ unique type MyUniqueType = MyUniqueType
|
||||
structural type MyStructuralType = MyStructuralType
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -8,7 +8,7 @@ lib.new.foo = 19
|
||||
mything = lib.old.foo + lib.old.foo
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -24,7 +24,7 @@ mything = lib.old.foo + lib.old.foo
|
||||
mything : Nat
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
foo/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -10,7 +10,7 @@ Stream.send : a -> ()
|
||||
Stream.send _ = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -33,7 +33,7 @@ X.x : a -> ()
|
||||
X.x _ = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -55,7 +55,7 @@ structural ability X where
|
||||
x : ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -76,7 +76,7 @@ X.x.set = ()
|
||||
X.x = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -109,7 +109,7 @@ structural type X = Z
|
||||
X = ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -124,7 +124,7 @@ X = ()
|
||||
X : ()
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
@ -7,7 +7,7 @@ x = 1
|
||||
x = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -26,7 +26,7 @@ x = 1
|
||||
x = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -47,7 +47,7 @@ Record.x.set = 2
|
||||
Record.x.modify = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -85,7 +85,7 @@ structural ability AnAbility where
|
||||
AnAbility.thing = 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -19,7 +19,7 @@ sigOkay = match signature with
|
||||
> sigOkay
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> builtins.merge
|
||||
|
||||
Done.
|
||||
@ -16,7 +16,7 @@ mytest = [Ok "ok"]
|
||||
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in /private/tmp/scratch.u.
|
||||
|
||||
@ -31,7 +31,7 @@ mytest = [Ok "ok"]
|
||||
mytest : [Result]
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -71,7 +71,7 @@ foo = 123
|
||||
test> mytest = [Ok "ok"]
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> edit missing
|
||||
|
||||
⚠️
|
||||
|
@ -17,7 +17,7 @@ lib.project.ignoreMe = 30
|
||||
unique type Foo = { bar : Nat, baz : Nat }
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -44,7 +44,7 @@ unique type Foo = { bar : Nat, baz : Nat }
|
||||
toplevel : Text
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
@ -68,7 +68,7 @@ project/main> add
|
||||
```
|
||||
`edit.namespace` edits the whole namespace (minus the top-level `lib`).
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> edit.namespace
|
||||
|
||||
☝️
|
||||
@ -110,7 +110,7 @@ toplevel = "hi"
|
||||
|
||||
`edit.namespace` can also accept explicit paths
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
project/main> edit.namespace nested simple
|
||||
|
||||
☝️
|
||||
|
@ -6,13 +6,13 @@ mynamespace.x = 1
|
||||
|
||||
The deleted namespace shouldn't appear in `ls` output.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> ls
|
||||
|
||||
nothing to show
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> find.verbose
|
||||
|
||||
☝️
|
||||
@ -29,7 +29,7 @@ scratch/main> find.verbose
|
||||
namespace.
|
||||
|
||||
```
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> find mynamespace
|
||||
|
||||
☝️
|
||||
@ -50,7 +50,7 @@ scratch/main> find mynamespace
|
||||
|
||||
The history of the namespace should be empty.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> history mynamespace
|
||||
|
||||
☝️ The namespace mynamespace is empty.
|
||||
@ -67,7 +67,7 @@ stuff.thing = 2
|
||||
|
||||
I should be allowed to fork over a deleted namespace
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> fork stuff deleted
|
||||
|
||||
Done.
|
||||
@ -75,7 +75,7 @@ scratch/main> fork stuff deleted
|
||||
```
|
||||
The history from the `deleted` namespace should have been overwritten by the history from `stuff`.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> history stuff
|
||||
|
||||
Note: The most recent namespace hash is immediately below this
|
||||
@ -105,7 +105,7 @@ moveme.y = 2
|
||||
I should be able to move a namespace over-top of a deleted namespace.
|
||||
The history should be that of the moved namespace.
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> delete.namespace moveoverme
|
||||
|
||||
Done.
|
||||
|
@ -6,7 +6,7 @@ Not even `Nat` or `+`\!
|
||||
|
||||
BEHOLD\!\!\!
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> ls
|
||||
|
||||
nothing to show
|
||||
@ -14,7 +14,7 @@ scratch/main> ls
|
||||
```
|
||||
Technically, the definitions all exist, but they have no names. `builtins.merge` brings them into existence, under the current namespace:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> builtins.merge lib.builtins
|
||||
|
||||
Done.
|
||||
@ -26,7 +26,7 @@ scratch/main> ls lib
|
||||
```
|
||||
And for a limited time, you can get even more builtin goodies:
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
scratch/main> builtins.mergeio lib.builtinsio
|
||||
|
||||
Done.
|
||||
|
@ -10,7 +10,7 @@ Some basic errors of literals.
|
||||
x = 1. -- missing some digits after the decimal
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -26,7 +26,7 @@ x = 1. -- missing some digits after the decimal
|
||||
x = 1e -- missing an exponent
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -42,7 +42,7 @@ x = 1e -- missing an exponent
|
||||
x = 1e- -- missing an exponent
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -58,7 +58,7 @@ x = 1e- -- missing an exponent
|
||||
x = 1E+ -- missing an exponent
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -76,7 +76,7 @@ x = 1E+ -- missing an exponent
|
||||
x = 0xoogabooga -- invalid hex chars
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -92,7 +92,7 @@ x = 0xoogabooga -- invalid hex chars
|
||||
x = 0o987654321 -- 9 and 8 are not valid octal char
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -108,7 +108,7 @@ x = 0o987654321 -- 9 and 8 are not valid octal char
|
||||
x = 0xsf -- odd number of hex chars in a bytes literal
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -124,7 +124,7 @@ x = 0xsf -- odd number of hex chars in a bytes literal
|
||||
x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -142,7 +142,7 @@ x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal
|
||||
foo = else -- not matching if
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -156,7 +156,7 @@ foo = else -- not matching if
|
||||
foo = then -- unclosed
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -170,7 +170,7 @@ foo = then -- unclosed
|
||||
foo = with -- unclosed
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -187,7 +187,7 @@ foo = with -- unclosed
|
||||
foo = match 1 with
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -205,7 +205,7 @@ foo = match 1 with
|
||||
2 -- no right-hand-side
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -229,7 +229,7 @@ foo = cases
|
||||
3 -> ()
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -252,7 +252,7 @@ x = match Some a with
|
||||
2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -280,7 +280,7 @@ x = match Some a with
|
||||
-> 3
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -302,7 +302,7 @@ x = match Some a with
|
||||
| true -> 2
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -324,7 +324,7 @@ x = match Some a with
|
||||
>
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -340,7 +340,7 @@ x = match Some a with
|
||||
use.keyword.in.namespace = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
@ -357,7 +357,7 @@ use.keyword.in.namespace = 1
|
||||
a ! b = 1
|
||||
```
|
||||
|
||||
```ucm
|
||||
``` ucm
|
||||
|
||||
Loading changes detected in scratch.u.
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user