„Optimize away” `parseFileContentsWithExts`?

Aperta
#86 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Haskell
Stelle
0
Fork
1
Merge medio
2g 19h
PR unite (30g)
7

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fmidue/haskell-template-task

Tutte le issue di fmidue/haskell-template-task

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.