Which warnings are seen as best practice to be enabled in the ocaml world?
Should the set of enabled warnings by default be changed in the light of them being errors now?
Would it be a good idea to introduce some kind of “warning presets” additionally / instead of listing separate warning numbers to dis-/enable in bsconfig. Meaning to not list warning numbers but just write “all” / “default” / “none”. The obvious tradeoff being another “abstraction layer” and difference to ocaml vs usability for newcomers.
Oh that reminds me, I have been meaning to follow up with you on -48 (optional argument erasure). I found some code in my project where making use of erasure produced JS that was bad enough to make me immediately re-enable the warning and undo the change.
I will dig through my notes soon and see if I can post some example code
OK so it was an edge case and I’ll probably re-evaluate turning off warning 48 again soon. I can’t easily recreate this with sample code, but the problem is a function with optional arguments that returns a function.
It’s a three argument function, the first is optional. With a unit argument, the JS is:
return makeFunction(undefined, a, b, undefined)
Removing the unit argument at the end produces:
var arg = b;
return function (eta) {
return Curry._1(makeFunction(undefined, a, arg), eta);
};
But I’m sure I can find a way around this mess (returning an uncurried function might do it).