Welcome and Getting Started with F#

  • Thread starter Thread starter Dan Quirk - MSFT
  • Start date Start date
D

Dan Quirk - MSFT

Guest
Welcome to the F# MSDN forum. Here are some helpful resources to get started:​

Microsoft F# Developer Center


Quick Links

Community

Blogs

Videos:

Good Books:

Samples

Hello World Samples:


Sample 1, Sample 2, Sample 3, Sample 4, Fibonacci Numbers, Download Stock Quotes

Code Sample:


// C# :
// using System;
open System
// say hello wrold
printfn
"Hello, World! What is your name, user?"
// C# :
// var name = Console.ReadLine();
let name = Console.ReadLine()
// C# :
// public delegate void SaySomethingDelegate(string toWho);
// SaySomethingDelegatesayHello =
// who => Console.WriteLine("Hello, {0}!", who);
let sayHello who = printfn "Hello, %s!" who
// hi
sayHello name

// you can using .NET Framework classes and methods:
let sayHelloDotNet who =
Console.WriteLine(
"Hello from F# via .Net, " + name + "!")
// hello again!
sayHelloDotNet name

// let's count Fibonacci
let rec fib i =
match i with
|
1 | 2 -> 1
| i -> fib(i
-1) + fib(i-2)

// result
printfn
"%i" (fib 20)


Note that there is also a "getting started" small sample as a 'tutorial' project template inside Visual Studio.

Tools needed:

Visual Studio:


If you want F# integrated into Visual Studio, then you either need a non-express version of VS2008, or the VS2008 shell (integrated mode; this component is also a free download, linked from the F# download page), or the VS2010 integrated shell (free download). Then install the CTP MSI.

Or, of course, get a full version of VS2010, where F# is built-in.

MonoDevelop:


You can find lots of information about using F# within MonoDevelop here. The F# compiler and fsi.exe are now part of the Mono distribution.

Source: http://stackoverflow.com/questions/734525/getting-started-with-f/734536#734536

Continue reading...
 
Back
Top