The Don Syme type provider

by Pezi 21. February 2014 07:21

Someone asked me what the secret type provider I am working on is.  I neglected to tell them, and instead joked that it would be the Don Syme type provider.  Later I reflected that the idea had actually been a stroke of genius, so just knocked this together in 20 of your English minutes – the Don Syme fact provider!  It will produce an endless stream of true facts about the mystery man known as the Father of F#.  Get it from my github here.

image

 image

image

Tags:

F# | type providers

The MineSweeper Type Provider

by Pezi 2. February 2014 05:06

Being able to play Mine Sweeper inside your IDE via intellisense, that is what you have always wanted right?  Well, I’m always willing to lend a hand!  With this fantastic new type provider you can pretend you are working when really you are avoiding mines.   To get started simply clone and build the provider from here.  Reference your new shiny type provider library from a script file and create a type alias and then an instance of it like so:

image

The three parameters you can pass determine the grid width, height and amount of mines.

Navigate to the “Start” property of your instance to begin the game. Intellisense will show a representation of the grid state on the top property marked “# Mine Field” and an additional property for each available move in the format of X:Y

image

To play the game simply navigate to the property that represents the tile you would like to reveal.

image

Unfortunately once again it seems that Microsoft simply didn’t have this kind of thing in mind when they were designing intellisense, and it isn’t very happy about making the text line up nicely.  I have tried my best for it to not get too difficult.

Disclaimer:  Development managers, I am not responsible for any loss of productivity from your staff  that this type provider may cause.

EDIT:  Props to Phil Trelford for the original minesweeper code from fssnip, which is largely intact here with a few modifications.

Tags:

F# | type providers