The other day I was trying to think how I could group together discriminated
union values in a way to let me later determine if values were
mutually-exclusive. For a simple discriminated union, I came up with a pretty
simple solution: store a Map<SomeUnion, SomeUnion list>
. Each key in …
Tagged FSharp
.NET and F#: Where functions are functions, except when they're not
Functions in .NET and F# in particular have some oddities that I've run into and can be a bit annoying at times. At least partially for my own benefit, I'm documenting my finds here while I remember them.
So in F#, if you want to define a function that adds …
Union Values in WPF
This morning I convered an enumeration from some VB code into a union in F#. This enum had been created so that I could create a generic "tab" view and view-model in WPF, and could easily tell each instance what tab it was to be. Unfortunately, I began receiving an …
Custom attributes on F#'s Discriminated Union cases
Working on a project, I found myself wanting to match different discriminated union cases with text for output. Normally I write this out as a discriminated union with a separate function that uses pattern matches to determine which value to return, but I'd really like to attach the text directly …
F# and WPF
In certain projects, it may be deemed appropriate to utilize both F# and WPF. Visual Studio has a large number of issues that make this difficult, not the least of which is that it simply doesn't support creating a WPF project with F# out-of-the-box. What follows is a guide based …