![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Sometimes I need to take a version number - something like 5 or 6.4 or 2.25.1 - and see whether it's newer or older than another version number, or maybe just take a list of version numbers like this and put them in order.
The projects I'm working on usually have at least a bit of F# code, or a dependency on an F# library (even if most of the code is C#), and once I've taken the dependency on FSharp.Core, I might as well use it to create an equatable, sortable, and immutable "version number" type.
This might be absolute favorite line of code:
type ProductVersion = { components: int list }
( Read more... )