Advanced Functional Prog.
back - up - next
Course 4 - Summary
- Only 7 keywords:
fun
, let_rec
, match_with
, type_of
Recursive functions/datatypes
let rec sum n =
match n with
| 0 -> 0
| _ -> n+(sum (n-1));;
sum 10;;
Generalization (higher-order funtions)
let rec reduceInt v f n =
match n with
| 0 -> v
| _ -> f n (reduceInt v f (n-1));;
reduceInt 0 (+) 10;;
reduceInt 1 (*) 10;;
reduceInt [] (fun x xs->x::xs) 10;;
...
3
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp