Yeah I realize there are more efficient aliases, but even so - just defaulting immutable data structures with only primitive types in them to cretae reference types feels like a massive foot gun performance wise. I couldn't imagine doing C# without value types, so for F# where things are usually more immutable, it has to be painful if e.g. a normal point(x,y) record is a class...
Re:What's New in F# 4.1? [video]
by justneedvodka on Friday December 09, 2016 @07:04PM
(#13143007)
You could use a struct, record, or tuple for a point. I've done all of these before.
Yes, and now they can be done right (as CLR structs)! It's just odd that this took until now.
I suppose it just shows that those of us that are using .NET to do "C++ work" (always CPU and GC bound, almost never IO bound) are pretty few...
Generally speaking, it's better to use Units of Measure[0] when you want some compile-time semantics around numeric literals, as these don't incur the performance penalty of creating a class.
[0]: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/lang...