haskell / haskell/haskell-language-server

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

オープン
#450 コメント 13 件 リアクション 0 件 担当者 0 名 GitHub で見る
type: enhancement
主要言語
Haskell
スター
3k
フォーク
455
平均マージ
2日 19時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。