2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2020-10-21 22:36:51 +03:00
|
|
|
|
|
|
|
Done.
|
|
|
|
|
|
|
|
```
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2020-10-21 22:36:51 +03:00
|
|
|
-- List.map : (a -> b) -> [a] -> [b]
|
2020-10-22 03:57:58 +03:00
|
|
|
List.map f =
|
2020-10-21 22:36:51 +03:00
|
|
|
go acc = cases
|
|
|
|
[] -> acc
|
|
|
|
h +: t -> go (acc :+ f h) t
|
|
|
|
go []
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2020-10-21 22:36:51 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2020-10-21 22:36:51 +03:00
|
|
|
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`:
|
|
|
|
|
2021-06-08 21:50:04 +03:00
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
2020-10-21 22:36:51 +03:00
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2020-10-21 22:36:51 +03:00
|
|
|
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
|
2021-06-08 21:50:04 +03:00
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
2020-10-21 22:36:51 +03:00
|
|
|
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> view List.map
|
2020-10-21 22:36:51 +03:00
|
|
|
|
2021-06-08 21:50:04 +03:00
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
2020-10-22 03:57:58 +03:00
|
|
|
List.map f =
|
2020-10-21 22:36:51 +03:00
|
|
|
go acc = cases
|
|
|
|
[] -> acc
|
|
|
|
h +: t -> go (acc :+ f h) t
|
|
|
|
go []
|
|
|
|
|
|
|
|
```
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2020-10-22 03:57:58 +03:00
|
|
|
List.map2 : (g -> g2) -> [g] -> [g2]
|
|
|
|
List.map2 f =
|
|
|
|
unused = "just to give this a different hash"
|
|
|
|
go acc = cases
|
|
|
|
[] -> acc
|
|
|
|
h +: t -> go (acc :+ f h) t
|
|
|
|
go []
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2020-10-22 03:57:58 +03:00
|
|
|
|
2023-12-22 14:55:24 +03:00
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
2020-10-22 03:57:58 +03:00
|
|
|
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`:
|
|
|
|
|
2021-06-08 21:50:04 +03:00
|
|
|
List.map2 : (g ->{h} g2) -> [g] ->{h} [g2]
|
2020-10-22 03:57:58 +03:00
|
|
|
|
|
|
|
```
|