You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
De-duplicating buildInplaceUnpackedPackage and buildAndInstallUnpackedPackage #9499
It seems that there are a lot of things in common between buildInplaceUnpackedPackage and buildAndInstallUnpackedPackage, however, there is also a lot of duplication between the two.
In my opinion, it would be better to factor the common bits (not changing any behaviour... best effort) and have a single function for both (similar) use cases. The subtle bugs due to the duplication and not doing things uniformly for the two situations seems much worse than possibly incurring a regression in the behaviour change, especially going forward.
Yes, absolutely, but let's make sure we factor out common functionality (as you say) rather than jumble them toghether. I see many cases where "different things" are forced through a same code path leaving up with a bunch of case-splitting at the bottom. I.e.
f :: A -> IO ()
f = ... (a lot of duplication)
g :: B -> IO ()
g = ... (a lot of duplication)
ends up being "simplified" as
fg :: Either A B -> IO ()
fg ab = do
...
case ab of
A -> ...
B -> ...
...
case ab of
A -> ...
B -> ...
...
rather than e.g.
f :: A -> IO ()
f = do
common1
specific
common2
specific
g :: B -> IO ()
g = do
common1
specific
common2
specific
I am sure this is what you have in mind. I just needed to get this out of my chest 😂
Activity
andreabedini commentedon Dec 7, 2023
Yes, absolutely, but let's make sure we factor out common functionality (as you say) rather than jumble them toghether. I see many cases where "different things" are forced through a same code path leaving up with a bunch of case-splitting at the bottom. I.e.
ends up being "simplified" as
rather than e.g.
I am sure this is what you have in mind. I just needed to get this out of my chest 😂
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases
Refactor ProjectBuilding into Package Phases