diff --git a/Algo/Séminaire/Chapter 3 - Case analysis.md b/Algo/Séminaire/Chapter 3 - Case analysis.md index 2aa4738..3f49d9a 100644 --- a/Algo/Séminaire/Chapter 3 - Case analysis.md +++ b/Algo/Séminaire/Chapter 3 - Case analysis.md @@ -149,3 +149,16 @@ val avg : int -> int -> int = ``` > 💭 We read that like "let avg the function that to a associate the function that to b associate a+b divided by two" +**For the match function** +```Ocaml +# let f x = watch x with + | 0 -> 18 + | 1 -> 24 + | _ -> x*x ;; +# let f = function + | 0 -> 18 + | 1 -> 24 + | _ -> x * x;; +``` + +### Filtering several values