mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
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.
56 lines
1.0 KiB
Markdown
56 lines
1.0 KiB
Markdown
``` 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
|
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
do an `add` or `update`, here's how your codebase would
|
|
change:
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
type Map k v
|
|
mapWithKey : (k ->{e} a ->{e} b) -> Map k a ->{e} Map k b
|
|
|
|
```
|
|
``` ucm
|
|
scratch/main> add
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
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
|
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
do an `add` or `update`, here's how your codebase would
|
|
change:
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
naiomi : Map Nat ()
|
|
|
|
```
|