vault backup: 2023-10-06 16:00:48
This commit is contained in:
@ -117,3 +117,22 @@ val length : 'a list -> int = <fun>
|
||||
```
|
||||
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
|
||||
A[l] --> |h::t| B[m < h ? ]
|
||||
|
||||
B --> C[m<-h] & D[keep m]
|
||||
|
||||
A --> |"[]"| E[m]
|
||||
```
|
||||
|
||||
## Build/modify a list
|
||||
### Construction method
|
||||
```Ocaml
|
||||
# let rec what = function
|
||||
0 -> []
|
||||
| n -> n::what(n-1);;
|
||||
val what : int -> int list = <fun>
|
||||
|
||||
# what 3;;
|
||||
|
Reference in New Issue
Block a user