Re:The Ergonomics of Type Checking (2016)
by neilparikh on Saturday October 28, 2017 @02:53PM
(#15576254)
Haskell has a flag called -fdefer-type-errors (https://downloads.haskell.org/~ghc/7.6.1/docs/html/users_gui...) that gets you pretty close to the experience of ignoring errors you don't care about right now.
[ Parent
| on HN ]
You can do something similar with Eclipse's compiler for Java, JDT, which features [1]:
An incremental Java compiler. Implemented as an Eclipse builder, it is based on technology evolved from VisualAge for Java compiler. In particular, it allows to run and debug code which still contains unresolved errors.
That means that you can write something like:
private void describe(String string) {
if (string.isEmpty()) empty();
else nonempty(string);
}
private void empty() {
System.out.println("empty");
}
private void nonempty(String string) {
System.out.println("contains " + string.size() + " characters");
}
Then you can still run the code and call describe, but if execution reaches nonempty, you get a runtime error telling you about the compilation problem.It's one of the few things from Eclipse i miss when using IntelliJ.
Re:The Ergonomics of Type Checking (2016)
by exceptione on Saturday October 28, 2017 @06:33PM
(#15577023)
I can't see a problem with nonempty, am I stupid?
Re:The Ergonomics of Type Checking (2016)
by Thiez on Saturday October 28, 2017 @07:53PM
(#15577305)
A `String` in Java has a `.length()`, not a `.size()`.
Apologies! I meant to include a comment pointing out the error (as Thiez writes, it should be length, not size), but that somehow didn't make it into the comment as published. I blame my sub-editors, can't find the staff these days.