We're all familiar with the argument about why String
is final in java.
However, I was wondering why javaslang's CharSeq is final too.
Given javaslang's FP inspirations and the fact that Haskell allows type synonyms, I would have thought this would be a good opportunity to make CharSeq
non-final with maybe the methods as final.
A non-final CharSeq
would then allow me to extend it with an empty body to create a good approximation of type synonyms. This would avoid the boilerplate of the tiny type pattern for cases where the additional type safety is desired.
I'm sure there is a good reason why this is not the design, which is why I am asking here.
UPDATED 16-Dec-2016: I've raised an enhancement request with the javaslang team on github as issue #1764.