Advanced Functional Prog.

back - up - next


Course 4 - Summary

  1. Only 7 keywords: fun, let_rec, match_with, type_of
    Modeling Stack(s):
type Stack = NewStack | Push of int*Stack;;

let s = Push (3,Push(2,Push(1,NewStack)));;

Nb. F# is a multi-paradigm programming language !
Example of imperative features:

let mutable s = NewStack;;
s <- Push (1,s);;
s <- Push (2,s);;
s <- Push (3,s);;

4