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.
69 lines
1.2 KiB
Markdown
69 lines
1.2 KiB
Markdown
``` ucm
|
|
scratch/main> builtins.merge
|
|
|
|
Done.
|
|
|
|
```
|
|
``` unison
|
|
-- List.map : (a -> b) -> [a] -> [b]
|
|
List.map f =
|
|
go acc = cases
|
|
[] -> acc
|
|
h +: t -> go (acc :+ f h) t
|
|
go []
|
|
```
|
|
|
|
``` 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`:
|
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
|
|
|
```
|
|
``` ucm
|
|
scratch/main> add
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
|
|
|
scratch/main> view List.map
|
|
|
|
List.map : (i ->{g} o) -> [i] ->{g} [o]
|
|
List.map f =
|
|
go acc = cases
|
|
[] -> acc
|
|
h +: t -> go (acc :+ f h) t
|
|
go []
|
|
|
|
```
|
|
``` unison
|
|
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 []
|
|
```
|
|
|
|
``` 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`:
|
|
|
|
List.map2 : (g ->{h} g2) -> [g] ->{h} [g2]
|
|
|
|
```
|