Hacker News new | ask | show | jobs
by lolinder 552 days ago
Meanwhile in Haskell they introduced typed holes in order to allow you to compile more types of programs that aren't yet fully finished.

I'm all for preventing this kind of thing from making it into the main branch, but a compiler error by its nature blocks compilation, which forces weird shenanigans like commenting out lines of code or adding arbitrary meaningless uses. Why is that better than a compiler warning (made mandatory in CI)?

1 comments

Yeah, in C, you at least add the unused attribute and can grep for it. In some languages that do not support "_" prefix or the attribute meaning unused, you have to comment out parts. It is really annoying and I think it is worse.

In some C code where I have to suppress an unused variable warning (for example to a pthread callback), I just do (void)arg at the top of the function.