Active Patterns (F#)

Download this episode

Download Video


In this video, programming writer, Gordon Hogenson, continues the discussion of patterns by talking about active patterns, which you can use to customize and extend F#’s pattern matching capabilities. Active patterns are an amazingly flexible language feature, and in this video we just scratch the surface of what can be done with them.  You can learn more in the topic: Active Patterns.


Gordon would also like to thank Chris Smith and Brian McNamara, of the F# team, for giving him some ideas for how to use active patterns.  Some similar examples to those in the video are discussed in F# team blog postings, such as in Chris Smith’s blog posting on active patterns.  For those interested in exploring further, you can read a paper on active patterns by Don Syme, James Margetson, and Gregory Nemerov.


Kathleen McGrath
Visual Studio User Education



Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      Excellent video!  A good followup would be to show active patterns in use with a real world problem. A walkthrough of the F# Optimization DSL for the Solver Foundation or of the underlying concepts used to build the ODSL would be my request.  We have converted a moderately complex AMPL/CPLEX model to F#/ODSL for testing purposes.  More F# videos would be appreciated!

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.