Advanced Functional Prog.
back - up - next
Course 4 - Summary
- Only 7 keywords:
fun
, let_rec
, match_with
, type_of
2nd stack function:
let rec evenStack s =
match s with
| NewStack -> NewStack
| Push (v,s') -> match (v%2)=0 with
| true -> Push (v,evenStack s')
| _ -> evenStack s';;
evenStack s;;
Generalization (filter
):
let rec filterStack p s =
match s with
| NewStack -> NewStack
| Push (v,s') -> match (p v) with
| true -> Push (v,filterStack p s')
| _ -> filterStack p s';;
filterStack (fun x -> (x%2)=0) s;;
6
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