stan
stan copied to clipboard
[RFC] Inspection: function in `where` without type signature
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?
Maybe as an opt-in inspection? We can provide a way for users to turn on some opinionated (style) inspections.
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.