Advanced Functional Prog.

up - next


Course 4 - Summary

  1. Application with F#.net:
    Interpretation vs. Compilation
dotnet fsi
>
  1. Everything is a function:
(fun x->x+1) 0;;
(fun x->fun y->x+y) 0 1;;
(fun x y->x+y) 0 1;;
(fun o->fun x->fun y->o x y) (+) 0 1;;
...

Nb. Binary function symbols can be written in "infix" notation (and overloaded).

  1. Only 7 keywords: fun, let_rec, match_with, type_of
// (fun pi->...) 3.14
let pi     = 3.14;;

let area   = fun r->pi*r*r;;
let area r = pi*r*r;;
area 1;;

2