<div dir="ltr"><div>Hello,</div><div><br></div><div>I propose to enable -XTypeHoles in GHC by default.</div><div><br></div><div>Unlike other -X* flags, holes do not really change meaning of the program, they only change error messages. Instead of "_x not in scope", we effectively get "_x not in scope, its expected type is a -> a". You get it only if you precede the identifier not in scope with underscore, so in some sense you declare the intention of using holes.</div>
<div><br></div><div>Two possible issues:</div><div><br></div><div>(a) If you use -fdefer-type-errors, then a program might compile, while previously it did not. However, we should facilitate compiling with defer-type-errors, so I don't think this is a disadvantage.</div>
<div><br></div><div>(b) The identifier _ becomes both a pattern and a hole by default, which might confuse new users.</div><div>Reply: I have never seen anyone ask why code such as "Just _ -> _" does not work.</div>
<div><br></div><div>IMO the productivity boost by having holes by default outweighs those two objections. I am open to hearing any other possible issues others might find.</div><div><br></div><div>The change is trivial implementation-wise; add Opt_TypeHoles to the list in languageExtensions Nothing in DynFlags.</div>
<div><br></div><div>-KG</div></div>