mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
28 lines
362 B
Markdown
28 lines
362 B
Markdown
```ucm:hide
|
|
scratch/main> 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
|
|
scratch/main> add
|
|
```
|
|
|
|
```unison
|
|
|
|
naiomi =
|
|
susan: Nat -> Nat -> ()
|
|
susan a b = ()
|
|
|
|
pam: Map Nat Nat
|
|
pam = Tip
|
|
|
|
mapWithKey susan pam
|
|
|
|
```
|