ndmitchell / hlint

Haskell source code suggestions
Other
1.47k stars 196 forks source link

Detect redundant ScopedTypeVariables extensions #715

Open yairchu opened 5 years ago

yairchu commented 5 years ago

This might be somewhat complicated, but if keeping track of foralled variables in scope during parsing, one may detect when those are never used in their scopes.

ndmitchell commented 5 years ago

I'm not a fan of this idea since scanning for which forall'd variables are contained in an expression both sounds expensive and using forall as a matter of style is sometimes done. I also think that ScopedTypeVariables has other subtle effects, but I'm not sure on that.