Use the name TypedHoles :
> let fx = _g . _h x $ x Found hole '_g' with type: b0 -> c Where: 'b0' is an ambiguous type variable 'c' is a rigid type variable bound by the inferred type of f :: s -> c at <interactive>:2:5 Relevant bindings include x :: s (bound at <interactive>:2:7) f :: s -> c (bound at <interactive>:2:5) In the first argument of '(.)', namely '_g' In the expression: _g . _h x In the expression: _g . _h x $ x Found hole '_h' with type: s -> s -> b0 Where: 'b0' is an ambiguous type variable 's' is a rigid type variable bound by the inferred type of f :: s -> c at <interactive>:2:5 Relevant bindings include x :: s (bound at <interactive>:2:7) f :: s -> c (bound at <interactive>:2:5) In the expression: _h In the second argument of '(.)', namely '_h x' In the expression: _g . _h x
So this gives you _g :: b0 -> c and _h :: s -> s -> b0 with the context x :: s and f :: s -> c . A type checker can call these types most of the time (this is the point of TypedHoles ), and you can give them names. If you want, you can define all your functions with _ as the first character of the character name, and then use your editor to replace _(.+)\b with \1 . If you want to bypass the convention about the object using _name for the record field, just hover 2 underscores on the hole name.
This will still not allow you to compile the code, but if you use it in conjunction with -fdefer-type-errors , they will appear as warnings instead, allowing you to create type errors at runtime.
source share