vault backup: 2023-09-11 23:41:53
This commit is contained in:
@ -133,6 +133,8 @@ val f : int -> int = <fun>
|
||||
# let succ x = x +1;;
|
||||
val succ: int -> int = <fun>
|
||||
|
||||
(* these two functions are equivalent *)
|
||||
|
||||
# let succ = function x -> x + 1;;
|
||||
val succ: int -> int = <fun>
|
||||
```
|
||||
@ -151,7 +153,7 @@ val avg : int -> int -> int = <fun>
|
||||
|
||||
**For the match function**
|
||||
```Ocaml
|
||||
# let f x = watch x with
|
||||
# let f x = match x with
|
||||
| 0 -> 18
|
||||
| 1 -> 24
|
||||
| _ -> x*x ;;
|
||||
|
Reference in New Issue
Block a user