Skip to content

About Active Patterns and Type Providers

M
Hosted By
Marc S.
About Active Patterns and Type Providers

Details

Hi all,

at this meetup, I am going to present active patterns and the new type providers mechanism of F# 3.0. In addition, Henrik will show an example of solving the Zebra Puzzle (also called “Einstein's Riddle”).

Active patterns were introduced with F# 1.9.1.8 in July, 2007, and have become a very popular language feature. They support pattern matching over arbitrary heterogeneous data, such as XML or object models from other .NET languages. Among other things, they are often used for parsing. F# is the first language to support active patterns as a built-in language feature. (Something similar exists for OCaml, but only as a a custom preprocessor macro.)

Type providers will be officially introduced (http://www.visualstudiolaunch.com/vs2012vle/splash) with F# 3.0 and Visual Studio 2012 on September 12, 2012. They allow typed access of untyped data sources, supporting autocompletion in the editor. The F# 3.0 core library contains ready-made providers for SQL data sources, OData services, web services, and more. Just two days ago, BlueMountain Capital Management LLC announced (http://techblog.bluemountaincapital.com/2012/08/01/announcing-the-f-r-type-provider/) an open source type provider for accessing statistical packages from R in F#. Type providers, combined with the already-excellent support for asynchronous and parallel processing, make F# 3.0 an optimal language for dealing with big data (http://en.wikipedia.org/wiki/Big_data). As has been the case in the past (http://tomasp.net/blog/csharp-fsharp-async-intro.aspx), the C# team is watching with interest (http://stackoverflow.com/questions/7428531/which-language-idioms-paradigms-features-make-it-hard-to-add-support-for-type-p#answer-7433367) as F# enters new territory.

The Zebra Puzzle is attributed to Einstein. He asserted that only 2 % of the population would be able to solve the puzzle. Henrik will show how it can be done succinctly in F#.

You can download the schedule of the meeting here (http://www.blogs.sigristsoftware.com/temp/fsharp_meetup_2012-09-18.pdf), including a map of the location. Henrik and I are looking forward to seeing you soon. Until then, enjoy the summer.

Marc

P. S. Please do not forget to confirm your attendance on fsharp.ch (http://fsharp.ch/). If you come for the first time, take a printout of the map with you, to make sure you find the address, as it is not shown accurately in Google maps or Bing maps.

Photo of Zurich FSharp Users group
Zurich FSharp Users
See more events