haskell / haskell/haskell-language-server

[new plugin] Add explicit export lists to each module using the minimal import lists

未关闭
#450 13 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
type: enhancement
主要语言
Haskell
星标
3k
派生
455
平均合并
2 天 19 小时
30 天内合并 PR
11

描述

GHC has a `-ddump-minimal-imports` flag. Would it be possible to use the ghcide apparatus to write a new app to apply the minimal imports (optionally ignoring Prelude, perhaps) generated automatically?

For bonus points, it should also be possible to use the set of minimal imports across a project to add explicit export lists to each module using the minimal import lists.

Of course, weeder does some of this at the module level, but not the module contents level.

Presumably, this would help faster compilation and provide GHC with better optimization opportunities.

Undoubtedly the automatically-generated results would need hand tweaking, but I think that it might be a great help to some older code bases that have developed a certain amount of cruft that this sort of analysis could help improve. Doing it by hand, with a shell script or two would be one approach, but it would be good to have something a bit more robust (eg, preserving comments).

Perhaps someone has already done this.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。