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 https://datamarket.azure.com/account/info and https://www.bingmapsportal.com/application/index/1034110 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.dbml, Support_Resource.resx, Support.Model.edmx, and Support.ExcelFile.xlsx are files used by sample code.
You can also access the sample by using the following link:
- Basic and Intermediate topics
For and While Loops
Data Types, and more detailed information on: (1)Arrays,
Hash Tables and Dictionaries (2)
Lists, Tuples and Options (3)
Functions - Arrays, Lists, Seqs
Equality, Comparison and Hashing
Defining Operator, and more advanced
Defining Types and Functions samples
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
Office Interop is about how to invoke MS Word and Excel
Design patterns present F# way implement design patterns
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
MSTest provides a sample on how to define MSTest.