don't need builtins.mergeio when using base

This commit is contained in:
Arya Irani 2024-04-14 20:20:36 -04:00
parent b052524f52
commit ab75cc89cf
21 changed files with 29 additions and 91 deletions

View File

@ -1,13 +1,9 @@
Tests a former error due to bad calling conventions on delay.impl
```ucm:hide
.> builtins.mergeio
```
```unison
timingApp2 : '{IO, Exception} ()
timingApp2 _ =
timingApp2 _ =
printLine "Hello"
delay 10
printLine "World"

View File

@ -3,7 +3,7 @@ Tests a former error due to bad calling conventions on delay.impl
```unison
timingApp2 : '{IO, Exception} ()
timingApp2 _ =
timingApp2 _ =
printLine "Hello"
delay 10
printLine "World"

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
This file tests some obscure issues involved with abilities and over-applied
functions.
@ -15,7 +11,7 @@ Stream.map : (a -> b) -> '{Stream a} r -> '{Stream b} r
Stream.map f stream = handle !stream with Stream.map.handler f
Stream.map.handler : (a -> b) -> Request {Stream a} r -> '{Stream b} r
Stream.map.handler f = cases
Stream.map.handler f = cases
{Stream.emit a -> resume} -> 'let
Stream.emit (f a)
Stream.map f resume ()
@ -27,12 +23,12 @@ increment n = 1 + n
> Stream.toList (Stream.map increment (Stream.fromList [1,2,3]))
> let
s1 = do emit 10
s1 = do emit 10
emit 20
emit 30
emit 40
s2 = Stream.map (a -> a * 10) s1
Stream.toList s2
Stream.toList s2
```
```unison

View File

@ -11,7 +11,7 @@ Stream.map : (a -> b) -> '{Stream a} r -> '{Stream b} r
Stream.map f stream = handle !stream with Stream.map.handler f
Stream.map.handler : (a -> b) -> Request {Stream a} r -> '{Stream b} r
Stream.map.handler f = cases
Stream.map.handler f = cases
{Stream.emit a -> resume} -> 'let
Stream.emit (f a)
Stream.map f resume ()
@ -23,12 +23,12 @@ increment n = 1 + n
> Stream.toList (Stream.map increment (Stream.fromList [1,2,3]))
> let
s1 = do emit 10
s1 = do emit 10
emit 20
emit 30
emit 40
s2 = Stream.map (a -> a * 10) s1
Stream.toList s2
Stream.toList s2
```
```ucm
@ -57,7 +57,7 @@ increment n = 1 + n
[2, 3, 4]
22 | s1 = do emit 10
22 | s1 = do emit 10
[100, 200, 300, 400]

View File

@ -1,8 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
arrayList v n = do
use ImmutableByteArray read8

View File

@ -1,4 +1,3 @@
```unison
arrayList v n = do
use ImmutableByteArray read8

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.merge
```
Test case for a variable capture problem during let floating. The
encloser wasn't accounting for variables bound by matches.
@ -17,20 +13,20 @@ x _ = ()
works x = x + 1
run : '{Issue t} () -> '{Stream Text} ()
run s =
run s =
go = cases
{ one x -> resume } ->
{ one x -> resume } ->
emit "one"
handle resume !x with go
{ two x -> resume } ->
{ two x -> resume } ->
emit "two"
handle resume !x with go
{ three x -> resume } ->
{ three x -> resume } ->
emit "three"
handle resume !x with go
{ _ } -> emit "done"
do handle !s with go
> Stream.toList <| run do
Issue.one do
Issue.two do

View File

@ -13,20 +13,20 @@ x _ = ()
works x = x + 1
run : '{Issue t} () -> '{Stream Text} ()
run s =
run s =
go = cases
{ one x -> resume } ->
{ one x -> resume } ->
emit "one"
handle resume !x with go
{ two x -> resume } ->
{ two x -> resume } ->
emit "two"
handle resume !x with go
{ three x -> resume } ->
{ three x -> resume } ->
emit "three"
handle resume !x with go
{ _ } -> emit "done"
do handle !s with go
> Stream.toList <| run do
Issue.one do
Issue.two do

View File

@ -1,9 +1,5 @@
# Hashing and HMAC builtins
```ucm:hide
.> builtins.merge
```
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

View File

@ -1,9 +1,5 @@
# namespace.dependencies command
```ucm:hide
.external> builtins.merge
```
```unison:hide
external.mynat = 1
mynamespace.dependsOnText = external.mynat Nat.+ 10

View File

@ -1,10 +1,3 @@
>
```ucm:hide
.> builtins.merge
.> load unison-src/transcripts-using-base/base.u
.> add
```
```unison
testNat: Nat -> Optional Int -> Optional Float -> {Stream Result}()

View File

@ -1,4 +1,3 @@
>
```unison
testNat: Nat -> Optional Int -> Optional Float -> {Stream Result}()
testNat n expectInt expectFloat =

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
directory = "unison-src/transcripts-using-base/serialized-cases/"
@ -15,7 +11,7 @@ gen seed k =
c = 1442695040888963407
a = 6364136223846793005
(mod seed k, a * seed + c)
shuffle : Nat -> [a] -> [a]
shuffle =
pick acc seed = cases
@ -24,7 +20,7 @@ shuffle =
(k, seed) -> match (take k l, drop k l) with
(pre, x +: post) -> pick (acc :+ x) seed (pre ++ post)
(pre, []) -> pick acc seed pre
pick []
runTestCase : Text ->{Exception,IO} (Text, Test.Result)
@ -51,7 +47,7 @@ runTestCase name =
then Fail (name ++ " legacy mismatch")
else Ok name
(name, result)
serialTests : '{IO,Exception} [Test.Result]
serialTests = do
l = !availableCases

View File

@ -11,7 +11,7 @@ gen seed k =
c = 1442695040888963407
a = 6364136223846793005
(mod seed k, a * seed + c)
shuffle : Nat -> [a] -> [a]
shuffle =
pick acc seed = cases
@ -20,7 +20,7 @@ shuffle =
(k, seed) -> match (take k l, drop k l) with
(pre, x +: post) -> pick (acc :+ x) seed (pre ++ post)
(pre, []) -> pick acc seed pre
pick []
runTestCase : Text ->{Exception,IO} (Text, Test.Result)
@ -47,7 +47,7 @@ runTestCase name =
then Fail (name ++ " legacy mismatch")
else Ok name
(name, result)
serialTests : '{IO,Exception} [Test.Result]
serialTests = do
l = !availableCases

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
structural type Tree a = Leaf | Node (Tree a) a (Tree a)
@ -9,9 +5,9 @@ foldMap : r -> (r -> r -> r) -> (a -> r) -> Tree a -> r
foldMap z m f =
walk = cases
Leaf -> z
Node l x r -> m (walk l) (m (f x) (walk r))
Node l x r -> m (walk l) (m (f x) (walk r))
walk
walk
tree0 : Tree Nat
tree0 =

View File

@ -5,9 +5,9 @@ foldMap : r -> (r -> r -> r) -> (a -> r) -> Tree a -> r
foldMap z m f =
walk = cases
Leaf -> z
Node l x r -> m (walk l) (m (f x) (walk r))
Node l x r -> m (walk l) (m (f x) (walk r))
walk
walk
tree0 : Tree Nat
tree0 =

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
l1 = [1.0,2.0,3.0]
l2 = [+1,+2,+3]

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
structural ability Exit a where
exit : a -> b

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
structural ability DC r where
shift : ((a -> r) -> r) -> a

View File

@ -1,7 +1,3 @@
```ucm:hide
.> builtins.mergeio
```
```unison
mutual0 = cases

View File

@ -2,10 +2,6 @@
https://github.com/unisonweb/unison/issues/2195
```ucm:hide
.> builtins.merge
```
We add a simple definition.
```unison:hide