javac bug with regards to coding standards.
clinuxrulz opened this issue · comments
For this one:
Methods should be "general" in their the arguments (e.g. using Function rather than F1 if possible) and "specific" in their return type (e.g. instead of __<List.µ,T> a method should return List<T>).
If you try to apply a lot of stuff together say ap2(ap8(apply8(...
and your using a mixture of __<List.µ,T>
and List<T>
, then the compiler will take O(2^n) to unify the types where n is the number of parameters. I reported this problem to oracle about a year ago, and they have done nothing about it. So I'd recommend sticking to just __<List.µ,T>
in typeclass instance code.
I've personally experienced the difference between taking 2 minutes to compile 1 java file, and then reduced it to 5 seconds by sticking to __
style.
Actually I think I noticed it using Monad.sequence
.
I.E.
List.monad.sequence(List.of(
(__<List.µ,Integer>)List.of(1),
List.of(1),
(__<List.µ,Integer>)List.of(1),
List.of(1),
(__<List.µ,Integer>)List.of(1),
List.of(1),
(__<List.µ,Integer>)List.of(1),
List.of(1)
));
And each time you add a parameter the compilation time doubles.
Since the automatic code (default interface method) is forced to use __
, the I just tend to use that style always for typeclass instance methods.
I didn't know this, and I can't think of a good solution. So please disregard that point until Oracle gets its **** done.
Actually, sorry. Please disregard this issue. I could not reproduce this bug in jdk1.8.0_91
. Maybe it really has been fixed already.