vault backup: 2023-10-25 17:52:21
This commit is contained in:
parent
c5a1ad6716
commit
f521e9413d
@ -46,3 +46,14 @@ val for_all: ('a -> bool) -> 'a list -> bool = <fun>
|
|||||||
| [] -> true
|
| [] -> true
|
||||||
| e::t -> p e || for_all p t;;
|
| e::t -> p e || for_all p t;;
|
||||||
val exists: ('a -> bool) -> 'a list -> bool = <fun>
|
val exists: ('a -> bool) -> 'a list -> bool = <fun>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ex 2.4
|
||||||
|
```
|
||||||
|
# let rec find p = function
|
||||||
|
| [] -> true
|
||||||
|
| e::t -> if p e then e else find p t;;
|
||||||
|
val exists: (bool -> bool) -> bool list -> bool = <fun>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Ex 2.5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user