Sunday, July 19, 2009 2:45 PM
by
RickM
Discoveries This Week 07/19/2009
With the impending release of Visual Studio 2010, the F# Community continues to wind up. This week we have finally gotten our F# User Group Videos up. In addition, we also have a wide ranging selection of fresh F# content including Units of Measure, XML parsing, WPF Games and Pattern Matching.
Note: As the server is currently moving to a new location, our site may be temporarily down. If you encounter an error, please try again later.
This past week we’ve managed to get up video from a bunch of our past FSUG talks. Original F# video content here from such famed speakers as Richard Hale Shaw and Amanda Laucher.
The conciseness of the language makes it an ideal candidate for scientific DSLs where such units of measure are important, but as we can see from this example, it could even apply to the general physics of game play.
In this post, Matthew elegantly displays the beauty of Units of Measure outside of it’s standard scientific computation context. If you are in the Boston area, be sure to catch him speak at our next F# user group meeting on August 3rd.
Making use of the active pattern in the code has made it much easier to work with than passing around a sequence of tuples as I was doing previously. It has also made it easy to exit from the program early if there is a problem with the data inputted.
I find XML parsing to be one of the most consistently painful programming tasks. No matter what constructs seem to be added to the .NET platform, differences between the declarative and imperative seem to become most obvious when the two paradigms collide.
However in this case, I found Mark’s approach to XML parsing via reactive patterns refreshing. I also like his test-first approach. He is one of few bloggers I have seen practicing anything close to true TDD.
While playing around with the F# September CTP over the last week, I made a short, <300 lines, implementation of the Mastermind board game using some Windows Presentation Foundation (WPF) controls.
Seeing game or simulation implementations in F# never ceases to amaze me. In this case, what would be a moderately large project in C# is not even 300 lines of F#. Phillip’s Mastermind is also interesting in that it demonstrates how seamlessly WPF integrates with F#.
In this video, programming writer, Gordon Hogenson explains and gives examples of patterns in F# and explains the use of the match expression to control branching based on patterns in data.
I don’t believe I have seen Gordon speak in the past and enjoyed this talk very much. He does a great job at presenting pattern matching in a way which is very accessible to the every day C# programmer.