More test cases.

This commit is contained in:
Dan Doel 2022-02-11 17:42:39 -05:00
parent d649ad4b3d
commit be901d5dab
2 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,38 @@
```ucm:hide
.> builtins.merge
```
```unison
unique type Map k v = Tip | Bin Nat k v (Map k v) (Map k v)
mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b
mapWithKey f m = Tip
```
```ucm
.> add
```
```unison
naiomi =
susan: Nat ->{} Nat -> ()
susan a b = ()
pam: Map Nat Nat
pam = Tip
mapWithKey susan pam
```
```ucm
.> add
.> edit naiomi
.> undo
```
```ucm
.> load scratch.u
.> add
```

View File

@ -0,0 +1,103 @@
```unison
unique type Map k v = Tip | Bin Nat k v (Map k v) (Map k v)
mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b
mapWithKey f m = Tip
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
unique type Map k v
mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b
```
```ucm
.> add
⍟ I've added these definitions:
unique type Map k v
mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b
```
```unison
naiomi =
susan: Nat ->{} Nat -> ()
susan a b = ()
pam: Map Nat Nat
pam = Tip
mapWithKey susan pam
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
naiomi : Map Nat ()
```
```ucm
.> add
⍟ I've added these definitions:
naiomi : Map Nat ()
.> edit naiomi
☝️
I added these definitions to the top of
/home/dolio/Programming/unison/bugfixing/scratch.u
naiomi : Map Nat ()
naiomi =
susan : Nat -> Nat -> ()
susan a b = ()
pam : Map Nat Nat
pam = Tip
mapWithKey susan pam
You can edit them there, then do `update` to replace the
definitions currently in this namespace.
.> undo
Here are the changes I undid
Added definitions:
1. naiomi : Map Nat ()
```
```ucm
.> load scratch.u
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
naiomi : Map Nat ()
.> add
⍟ I've added these definitions:
naiomi : Map Nat ()
```