stan icon indicating copy to clipboard operation
stan copied to clipboard

[RFC] Inspection: function in `where` without type signature

Open chshersh opened this issue 5 years ago • 2 comments

Having functions in where blocks without type signatures makes code harder to understand and can lead to subtle compilation errors without a clear understanding of how to fix them. Should implement inspection for this?

chshersh avatar May 30 '20 19:05 chshersh

Maybe as an opt-in inspection? We can provide a way for users to turn on some opinionated (style) inspections.

vrom911 avatar May 30 '20 19:05 vrom911

I looked at the HIE Ast for this. There's a difference between functions in where and top-level functions. However, unfortunately, there's no difference between variables defined in let ... in and variables defined in where. So, if we implement this feature, it will warn for both: where and let in, which might be undesirable for some users... I propose to remove this issue from the milestone from now and start a discussion in GHC about changing HIE Ast representation to track this difference.

chshersh avatar Jun 06 '20 19:06 chshersh