This project is read-only.

F# 3.0 Sample Readme

Prerequisites and Machine Setup 

This sample package requires Visual Studio 2012 RTM .

SQL Server (Optional)

Because the SQL sample requires the local database to be setup. You need to set up a local SQL database named FSharpSample with sa password = FSharpSample1234. You can use CreateFSharpSampleDatabase.sql or setup.exe to setup your database tables and populate sample data. If you decide not to setup the database, some of the samples won't be compiled into the final binary result.

If you see a security dialog about trusting type provider, please click "Yes" to trust the type provider in order to make the sample run correctly.

Web Service Access (Optional)

You need to sign up for a free account on and if you intend to run the web service samples. After you sign up on both web sites, you can replace the ADM user ID, ADM account ID, and Bing developer account information at the end of Support.Helper.fs.

Office Setup (Optional)

In order to run the office interop samples, you need to setup Word and Excel 2010 on your computer.


This program allows the user to view and execute many short blocks of code that demonstrate many of the language features for F# and some of the library functionality in FSharp.Core.dll.


  • Setup.exe - is the program to help you setup the database. This file has the same functionality as CreateFSharpSampleDatabase.sql.
  • CreateFSharpSampleDatabase.sql - is the file used to setup the database. This file has the same functionality as setup.exe. If you have already executed setup.exe, you do not have to run this SQL script again.

  • sample.fs - Defines attributes to mark samples in code and provides the functionality to build the list of samples by searching through the .fs files in the project folder for correctly attributed methods.
  • program.fs - Generates the list of samples and checks the command line arguments to determine whether to run all of the samples automatically or the display the UI for the sample browser.
  • sampleform.fs - Contains the UI code for the window that presents the list of samples to be browsed and executed.
  • Support.Helper.fs - util functions for sample package.
  • Samples.Beginners.fs - Defines samples demonstrating much of the basic functionality in F#.
  • Samples.Intermediate.fs - Defines samples demonstrating built-in data structures like Set and Map as well as more advanced object oriented constructs like interfaces.
  • Samples.LinQ.fs - LINQ query samples
  • Samples.UnitTestSample.fs - Unit test sample
  • Samples.ParallelComputation.fs - shows how F# can make parallel computation.
  • Samples.TypeProviders.SQL.fs - Type Provider samples, including SQL datbase, web service, and resource file.
  • Samples.OfficeInteropSample.fs - shows how to use F# to interact with Office applications, such as MS Word 2010.
  • Samples.TypeProviders.AzureMarketPlace.fs - Azure Data market samples
  • Samples.Others.fs - Defines samples demostrating some other topics, such as design patterns, active patterns.
  • SampleForm.resx - Resource file containing serialized icon and image data for the UI.
  • Support.DataClasses.dbmlSupport_Resource.resxSupport.Model.edmx, and Support.ExcelFile.xlsx are files used by sample code.

License: Apache License, Version 2.0


You can also access the sample by using the following link:

  • Basic and Intermediate topics

Arithmetic  Exceptions  For and While Loops  Recursion
Data Types, and more detailed information on: (1)Arrays, Hash Tables and Dictionaries  (2) Lists, Tuples and Options  (3) Sequences
Functions and Functions - Arrays, Lists, Seqs 
Equality, Comparison and Hashing
Defining Types, Defining Operator, and more advanced Defining Types and Functions samples
Disposal interface
Event to define an event. 
Extension Methods to extend current F# types 
Units of Measure usage and samples about how to write a bank system
Format output sample
General InterOp and Office Interop is about how to invoke MS Word and Excel

  • Advanced topics

Design patterns present F# way implement design patterns  
Active patterns 
Parallel and Mailbox Processor are about async and parallel process

  • Type Provider and LINQ query samples

TypeProviders.SqlDataConnection samples are about how to connect to and query SQL database
TypeProviders.ODataService samples are about how to connect to OData service
TypeProviders.Others contains other type provider samples
TypeProviders.AzureMarketPlace are samples access Azure data market
LINQ query samples shows how to use F# to do in-memory query

  • Others:

MSTest provides a sample on how to define MSTest.

Last edited Sep 12, 2012 at 6:14 AM by ttliu2000, version 10


No comments yet.