advice on minor cleanups?

All, It appears that `runHscBackendPhase` returns a tuple that include an element of type `Maybe Linkable` but that in practice is always `Nothing`. I'm thinking of removing this element from the tuple, which would also entail simplifying the type of value constructor `T_HscBackend` for the `TPhase` type. Simplifying the code seems like a good thing, but perhaps there is a reason to leave well enough alone? Please advise me. Norman

Norman Ramsey
All,
It appears that `runHscBackendPhase` returns a tuple that include an element of type `Maybe Linkable` but that in practice is always `Nothing`. I'm thinking of removing this element from the tuple, which would also entail simplifying the type of value constructor `T_HscBackend` for the `TPhase` type. Simplifying the code seems like a good thing, but perhaps there is a reason to leave well enough alone? Please advise me.
Hi Norman, In cases like this I generally just try to push the change through, open a merge request, and note my uncertainty in the merge request description, and let review and CI sort it out. Cheers, - Ben

Looking at the code, it seems like it does return an actual `Linkable` when we are in interpreted mode: runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do ... -> case backend dflags of Interpreter -> do ... return ([], final_iface, Just linkable, panic "interpreter")
participants (3)
-
Ben Gamari
-
Norman Ramsey
-
Zubin Duggal