Re:My most common code review suggestions
by dep_b on Thursday December 07, 2017 @08:34AM
(#15869824)
That's what it was called, sorry I was citing from the top of my head. I don't find the name Units of Measure a bit confusing as it seems to imply that it's only use is scientific units while there are plenty of use cases outside of that realm.
A SandwichCount should not be confused with a BurgerCount!
Unit of Measure in practice: [<Measure>] type cm [<Measure>] type ml = cm^3 // a millilitre is 1 cm cubed
To the point in the article about using types to convey meaning, as I commented elsewhere, you want F#s awesome type aliasing and single-case discriminated unions :)
Type aliasing:
Single Case Discriminated Unions: