First class language in Visual Studio 2010 using F#

Posted by Aamir Hasan on ASP.net Weblogs See other posts from ASP.net Weblogs or by Aamir Hasan
Published on Tue, 23 Mar 2010 07:56:00 GMT Indexed on 2010/03/23 8:03 UTC
Read the original article Hit count: 379

Filed under:
|

 F# is a strongly-typed language like C#.It is light weight syntax just like Python.It give you math-like feel.

let data = (1,2,3)

 

let rotations (x, y, z) =

    [ (x, y, z);

      (z, x, y);

      (y, z, x) ]

 

let derivative f x =

    let p1 = f (x - 0.05)

    let p2 = f (x + 0.05)

    (p2 - p1) / 0.1

 

let f x = 2.0*x*x - 6.0*x + 3.0

 

let df = derivative f

 

System.Console.WriteLine("The derivative of f at x=4 is {0}", df 4.0)

 

This program will print: “The derivative of f at x=4 is 10

That’s a quick look at just a few of the exciting features of F#.  For more on F#, visit the F# Development Center on MSDN.

 

© ASP.net Weblogs or respective owner

Related posts about F#

Related posts about .NET