„Optimize away” `parseFileContentsWithExts`?

オープン
#86 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
領域
tooling

調査の方向性

Start with the parseFileContentsWithExts call sites in src/Haskell/Template/Task.hs (around lines 746-760) and the file-based parsing in raw/embedded/src/TestHarness.hs (around lines 208-227), and compare them with the in-memory parse usages. Check the transitive callers and whether #83 and #68 already remove some of them. Done means the issue's questions are answered for each call site, with redundant parsing removed and the test suite still passing.

索引モデルが issue の本文から書いたものです。

説明

At least after #83 and #68, some parsing work will probably be redundant.

Some (transitive) uses of parseFileContentsWithExts will likely have disappeared.

Others might be considered double work, since certain modules are already parsed with haskell-src-exts for other purposes than the nameModules-function.

Indeed, it is not very clear why parseFileContentsWithExts is currently used, parsing files, instead of parsing strings in memory as the parse function is doing for a lot of purposes: https://github.com/fmidue/haskell-template-task/blob/e4c0868c4ed8bd2606824ba7732a727d7ca3940a/src/Haskell/Template/Task.hs#L746-L760

Maybe it has to do with intricacies of dealing with extensions (in the package’s string parsing functions vs. its file parsing functions), given the comments at https://hackage-content.haskell.org/package/haskell-src-exts-1.24.0/docs/Language-Haskell-Exts-Parser.html#t:ParseMode.

Separately, the usages in https://github.com/fmidue/haskell-template-task/blob/e4c0868c4ed8bd2606824ba7732a727d7ca3940a/raw/embedded/src/TestHarness.hs#L208-L227 should be revisited. Do we really need to do file IO there, parsing the submission on disk? Haven’t we, at that point, already parsed the submission in memory anyway, for the TemplateMatch check at the very least?

主要言語
Haskell
スター
0
フォーク
1
平均マージ
2日 19時間
マージ済み PR(30日)
7

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fmidue/haskell-template-task のほかの issue

fmidue/haskell-template-task の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。