BT

InfoQ Homepage News F# 3.0 – LINQ + Type Providers = Information Rich Programming

F# 3.0 – LINQ + Type Providers = Information Rich Programming

Bookmarks

Microsoft recently announced a developer preview release of F# 3.0 – new features include LINQ-support through Query expressions and a Type Provider System along with a set of built-in providers that allow succinct programming against a variety of data sources.

Information Rich Programming features in F# 3.0 lets you program directly against databases, web services, web data feeds and data brokers. For instance, you will now be able to do this -

[<Generate>]
type Northwind = ODataService<"http://services.odata.org/Northwind/Northwind.svc/">
let db = Northwind.GetDataContext()

query { for cat in db.Categories do
select (cat.CategoryID, cat.CategoryName, cat.Description) }
|> Seq.iter (fun (id, name, description) –>
printfn "ID: %d\nCategory: %s\nDescription: %s\n" id name description)

There are already Type Providers for commonly accessed data source types - OData Services, Database connections, Database Schema, Data specified by the Entity Data Model, Web services and Resource files. Also the Type System is open and pluggable which will allow developers as well as third parties to create their own providers.

A brief of what else new -

  • Auto-Implemented Properties to allow properties without backend stores
  • Parameter Help and Enhanced Intellisense
  • Library Support for nullable types, including conversion operators and arithmetic operators
  • Units of measure types for the International System of Units (SI). This was formerly in the F# PowerPack but has been promoted to the F# Core Library.

You can read details in the MSDN documentation. You can also download the F# Sample pack from CodePlex to see these features in action.

F# is a multi-paradigm programming language, targeting the .NET Framework, that encompasses functional programming as well as imperative and object-oriented programming disciplines.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.