Functional Programming & Proofs

back - next

Complement: FP is great for data processing !

Try to understand "intuitively" what the following code do.

  1. Infinity doesn't exist in computer science...
open System.IO;;
[-3.0..0.1..3.0]
|> List.map (fun x->(x,x*(x+1.0)))
|> List.map (fun (x,y)->string x+","+string y+"\n")
|> List.fold (+) ""
|> fun r -> File.WriteAllText("function.csv",r);;