Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Tao Liu: F# Design Patterns

13 minutes, 23 seconds


Right click “Save as…”

Tao Liu, an engineer on the F# team, explains (and demonstrates) the importance and value of design patterns for F#. Many programmers who work on large or complex software systems are accustomed to employing design patterns in the development of these systems.  For experienced C# developers wanting to add F# to their toolchain for large scale software development, design patterns play a very important role. Historically, there have been little to no formal design patterns for F#. This is no longer the case. Tune in.

Further reading and sample code employing design patterns in F# 3.0:



Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • nimnim


  • JaneJane

    It's looks good!

  • Great presentation! Have been waiting for this long time. 

  • nice GI function on design pattern. Smiley

  • Woo!

  • HeatherHeather

    Wonderful topic. Now more convinced F# is ready for a main stream language. Love the cat/dog sample. Powerful language.

  • this talk makes me think F# is something for real world app. Nice talk.

  • @Heather: +1

  • @nim:nice nice

  •  finally have a nice F# design pattern talk
  • victorvictor

    new F# design pattern, example helps understand a lot.
    thanks @@

  • nice talk about F# and design patterns.

  • harryharry

    terrific F# topic enabling the language much appealing. wonderful pattern for the functional language!

  • I just fell in love with generic explicit member constraints.

  • DazedAndConfusedDazedAnd​Confused

    Nice little video, and it grabbed me, but can't make up my mind if i like the idea. Tao mentiones that some people don't think functional programming needs design patterns, but he thinks they are useful - so i'm sure he has a deeper understanding than just what he discussed. The points i'd raise are:
    - The patterns raised are Patterns of Reusable **Object Oriented** Software. So they show how to use the OO side of F# - using it's language features - not really F#'s functional features.
    - These mostly pertain to statically typed OO. e.g Ruby and other dynamically typed languages don't need an explicit visitor pattern - or many other patterns. So if this set don't really belong in dynamically typed languages - do they belong in a multi-paradigm functional language ?
    - C++ - multiparadigm - and look at how long it has taken for people to catch on to the functional derived STL. Not until Boost and Lambdas did most c++ programmmers venture into algorithms - i.e functional - territory.
    - Most programmers i know barely write OO code - it's procedural with classes. But then it's hard to write OO code when your talking for example to a WCF services that are in pretty much procedural.
    - I really thought Axum or spec# might shake this up a bit - really make people think about using the right language for the task at hand - but I guess they are too different for now.

    As a programmer in a time of lots of change (fun) i would love to see some clarification of how to use all these varied techniques and languages well - I'm just wary of multiparadigm confuzzling !

  • DazedAndConfusedDazedAnd​Confused

    It was remiss of me to rant about these patterns without at least providing some backup to my point of view

    http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue3/Functional_Programming_vs_Object_Oriented_Programming - and specifically look at
    5 OO and FP Styles Contrasted

    This link is haskell oriented, but really i think it highlights OO and functional styles being almost opposed. Big brains like Dr Lammel could probably discuss this, and i think it ties in with the expression problem. Charles - after the fantastic expression/type class series - any chance of interviewing Dr Ralf again about OOHaskell and combined OO / Functional F# languages ?

    Simple question - guess i'm a bit of an idiom..... err i mean idiot
    "Help me Obi Wan Kenobi ! If i were to write a enterprise app in F# when should i even use an object (record type with members/mutable data) ?" In ViewModels (e.g for binding too), for interop with c#,

  • ChristChrist

    Great, examples make things easily to understand. Thanks

  • WeiWei

    Wonderful! Microsoft is working hard to make designers' life easier. Now, "F" does not only mean facebook. Good job Tao and F# team.

  • A very timely presentation. Now I believe more F# is suitable as a language for commercial applications.

  • BellaBella

    Very nice!

  • AndrewAndrew

    very nice demo for F# design patterns.

  • JieJie

    Nice job!

  • Wonderful! Now, "F" does not only mean facebook. Good job Tao and F# team.

  • Adam SpeightAdam​Speight2008 The Bandito Coder

    Do the generic explicit member constraints, permit a form of generic operators? If we know the actual method used by the operator to perform the operation.

  • Jack LuJack Lu

    Vice nice presentation. Excellent topoc!

  • cocococo


  • maymay

    Very nice!

  • SandySandy

    Great presentation and demo!

  • Big Smile

  • Very nice presentation. I am more convinced to use F# for commercial applications.

  • Recently did a poc with F# and Solver Foundation for an optimization model for part purchasing.

    The model's input data comes in multiple Excel files.

    F# came in really handy for the complex data manipulation that was required to take the source data and feed it to the solver foundation model.

    Data manipulation is one of the areas where functional languages do exceptionally well. Such processing would have been untenable with Java (and even C# despite LINQ).

    Suffice is to say that the PoC is very well received and has already saved the company mega bucks.

  • WinInsiderWinInsider Mike, MCAD

    Following and using F# allows to stay on forefront of new language developments... async workflows, generic invoke, TypeProviders... domain exploration, and so much more... keep up the amazing features coming...  I have used F# for prototyping financial calculations for a bank; really extremely pleasant development experience.

  • RachelRachel

    Wonderful topic and nice demo for F# design patterns.

  • Recommended by one of my team members, great demo on F# and agree with the above comments about commercial use F#, it is time to use F# to our product.


  • Big Smile Great demo !

  • LisaLisa


  • Great, examples make things easily to understand.

  • Hello,

    First of all, thanks, F#-team is making a great job. And these kind of videos are good to get a great language some attention.

    But I have some small critics to these samples... Samples teach programmers so they shouldn't teach bad things. They should teach best practices, not tricks or hacks.

    Tricks are good to know also... But maybe these samples could be divided to two sections: 1. howto, 2. tricks.

    1. Why to teach programmers to use mutable state so much? There is a very good reason why mutable state is not default in F#.

    2. Why using inline keyword in samples? Inline is usually just for interactive. Msdn says this: "you should avoid using inline functions for optimization unless you have tried all other optimization techniques". So why do we need this in basic samples? http://msdn.microsoft.com/en-us/library/dd548047.aspx

    I'm F#-programmer, and one of those who thinks that Design Patterns are common "best practice" ways to manage object-oriented problems that doesn't exist in functional language.


  • Wonderful presentation, need more deep materials like this.

  • Very nice.

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.