vault backup: 2023-10-25 17:32:47
This commit is contained in:
parent
fef0e7e66d
commit
3486bf7f0f
@ -36,5 +36,13 @@ val map : ('a -> 'b) -> 'a list -> 'b list = <fun>
|
||||
```
|
||||
# let rec for_all p = function
|
||||
| [] -> true
|
||||
| e::t -> if p e && for_all p t;;
|
||||
| e::t -> p e && for_all p t;;
|
||||
val for_all: ('a -> bool) -> 'a list -> bool = <fun>
|
||||
```
|
||||
|
||||
## Ex 2.3
|
||||
```
|
||||
# let rec exists p = function
|
||||
| [] -> true
|
||||
| e::t -> p e || for_all p t;;
|
||||
val exists
|
||||
|
Loading…
x
Reference in New Issue
Block a user