ShuggyCoUk":1hzi0ya4 said:
they really and truly do go out of their way to not ensure immutability,
Honest question. would doing something like
this help?
It would, but F# is, IMO,
too functional to be practical. One of the nice things about Scala is that, where appropriate, you can more or less write imperative Java. F# makes that a lot harder.
The bitch of it is that the design of the .NET BCL precludes really adding a set of immutable classes in a meaningful way. I mean, IList<T> actually has an IsReadOnly property, because, as we all know, OO is too goddamn hard! I guess IList<T> and IMutableList<T> were apparently too difficult of a concept. But the most infuriating part is that since they've derped along the way they are, the mistakes can't really be changed in user code without writing a whole second set of classes that don't play nice with the BCL classes and
argh.
EDIT: Actually that's not completely true, you could write a Guava-esque library and implicitly cast stuff into BCL-land, but that'd be obnoxious to work with.