darcs

Patch 2443 Prim.V1: inline isInDirectory and isSupe... (and 3 more)

Title Prim.V1: inline isInDirectory and isSupe... (and 3 more)
Superseder Nosy List bfrk
Related Issues
Status needs-review Assigned To
Milestone

Created on 2025-01-06.11:43:28 by bfrk, last changed 2025-01-06.11:53:53 by bfrk.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt bfrk, 2025-01-06.11:43:26 text/x-darcs-patch
prim_v1_-inline-isindirectory-and-issuperdir.dpatch bfrk, 2025-01-06.11:43:27 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg24149 (view) Author: bfrk Date: 2025-01-06.11:43:27
4 patches for repository https://darcs.net/screened:

patch 9869d614ff789fa57d554ad1996e85d99e6fc116
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Apr 22 08:51:13 CEST 2022
  * Prim.V1: inline isInDirectory and isSuperdir

patch cbcc171edd595d725ac377141d488d7688451e7b
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Apr 22 08:57:38 CEST 2022
  * Prim.V1: simplify some commute cases

  These simplifications are due to f == g => f `isPrefix` g. This refactor is
  pure boolean logic.

patch 91387a15fe3b42aa70c3f91d2b45fac0d4613114
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Apr 22 09:10:22 CEST 2022
  * Prim.V1: in commuteFiledir use guard style for all clauses

  Again a pure refactor for readability.

patch 55d1c8720e84d9d169cdb70f0614e10cdb808393
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Apr 26 11:58:58 CEST 2022
  * Prim.V1: list all cases explicitly

  This removes the Perhaps data type, speedyCommute, and
  everythingElseCommute, and renames cleverCommute to invertCommute.

  The complication introduced by the Perhaps data type with an extra Unknown
  constructor was only there to save a few case distinctions. Listing them
  explicitly is clearer and adds only a few lines of code which can be easily
  seen to be correct as they are all generically implemented in terms of
  invertCommute, exactly as before. The questionable speedyCommute is no
  longer used: it doesn't actually optimize anything since it merely
  duplicates parts of the first case of commuteFileDir. Finally, moving the
  two extra cases for ChangePref patches from everythingElseCommute into
  commuteFileDir allows us to avoid any fall-through wildcard case, making the
  code more robust and proving that all cases are handled. The extra cases for
  commuteFP (instead of a single fall-through case) are also meant to improve
  clarity and robustness; their common implementation (failed) follows
  logically from the combination of how the former cleverCommute and toMaybe
  functions handled Unknown results.
Attachments
msg24150 (view) Author: bfrk Date: 2025-01-06.11:53:53
I am willing to split the last patch into simpler parts for easier review, if required.
History
Date User Action Args
2025-01-06 11:43:28bfrkcreate
2025-01-06 11:44:05bfrksetstatus: needs-screening -> needs-review
2025-01-06 11:53:53bfrksetmessages: + msg24150