vault backup: 2023-10-27 14:35:01
This commit is contained in:
parent
0a8d8cab37
commit
0fac88d66f
14
.obsidian/workspace.json
vendored
14
.obsidian/workspace.json
vendored
@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"currentTab": 2
|
"currentTab": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Code CAML.md",
|
"file": "Algo/Courses/Chapter 7 - High Order (exercises).md",
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
"extraContext": false,
|
"extraContext": false,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@ -128,7 +128,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outgoing-link",
|
"type": "outgoing-link",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Code CAML.md",
|
"file": "Algo/Courses/Chapter 7 - High Order (exercises).md",
|
||||||
"linksCollapsed": false,
|
"linksCollapsed": false,
|
||||||
"unlinkedCollapsed": true
|
"unlinkedCollapsed": true
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outline",
|
"type": "outline",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Code CAML.md"
|
"file": "Algo/Courses/Chapter 7 - High Order (exercises).md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -182,14 +182,14 @@
|
|||||||
"command-palette:Open command palette": false
|
"command-palette:Open command palette": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "fb961d7dbdf1ec74",
|
"active": "26919eaeae9a8f38",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Algo/Courses/Chapter 7 - High Order (exercises).md",
|
"Algo/CM/CM du 04 octobre.md",
|
||||||
"Code CAML.md",
|
"Code CAML.md",
|
||||||
|
"Algo/Courses/Chapter 7 - High Order (exercises).md",
|
||||||
"Algo/Courses/Chapter 6 - Lists (Exercises).md",
|
"Algo/Courses/Chapter 6 - Lists (Exercises).md",
|
||||||
"Algo/Courses/Chapter 6 - Lists.md",
|
"Algo/Courses/Chapter 6 - Lists.md",
|
||||||
"Algo/Séminaire/Chapter 5 - Recursivity.md",
|
"Algo/Séminaire/Chapter 5 - Recursivity.md",
|
||||||
"Algo/CM/CM du 04 octobre.md",
|
|
||||||
"Algo/CM/CM du 27 septembre.md",
|
"Algo/CM/CM du 27 septembre.md",
|
||||||
"Algo/Séminaire/Chapter 3 - Case analysis.md",
|
"Algo/Séminaire/Chapter 3 - Case analysis.md",
|
||||||
"Algo/Séminaire/Chapter 2 - Functions.md",
|
"Algo/Séminaire/Chapter 2 - Functions.md",
|
||||||
|
@ -57,3 +57,21 @@ val exists: (bool -> bool) -> bool list -> bool = <fun>
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Ex 2.5
|
## Ex 2.5
|
||||||
|
```Ocaml
|
||||||
|
# let rec filter p : function
|
||||||
|
| [] -> []
|
||||||
|
| e::t -> if p e then
|
||||||
|
e::filter p t
|
||||||
|
else filter p t;;
|
||||||
|
val filter: ('a -> bool) -> 'a list -> 'a
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ex 2.6
|
||||||
|
```Ocaml
|
||||||
|
let rec partition p l =
|
||||||
|
match l with
|
||||||
|
| [] -> ([], [])
|
||||||
|
| h==t> let (l1, l2) = partition p t in
|
||||||
|
if p h then (h::l1,l2)
|
||||||
|
else (l1, h::l2);;
|
||||||
|
val partition : ('a -> bool) -> 'a list -> 'a list * 'a list = <fun>
|
Loading…
x
Reference in New Issue
Block a user