<div dir="ltr">Martin Foster (aka. EvilTerran) suggested an interesting idea, and I decided it was too nice to ignore/be forgotten inside Martin's head... So I'd like to try and suggest it.<br><br>Type wildcards that allow partially specifying types, e.g:<br>
<br>f :: _ -> String<br>f x = show x<br><br>This will instruct the type-inferrer to "fill out" the wild-card part only (e.g: Show a => a).<br><br>This feature can be used for a couple of benefits:<br><br>A. It allows hard-coding part of a type, rather than the all-or-nothing situation we have now (I want to force a single parameter to be more specific, but I'd still prefer to infer the whole type).<br>
<br>B. Without scoped type variables, there are currently situations you cannot provide a type signature at all. This may mean that you cannot resolve type ambiguities in some cases, or make types more specific for some purpose. A type wild-card, in addition to scoped type variables, will allow to only specify the part we want.<br>
<br>C. Its a nice way to kill the -Wall warnings about missing type declarations, if you want to:<br><br>f :: _<br>f = "I am explicitly asking to infer this type, rather than specifying it"<br><br>Eyal<br><br></div>