Recursive deletion is currently done for ~/.ghcup/ghc/<ver>/. We could instead record all files and have a proper deletion.
What to do with ~/.ghcup/bin files is another question, especially when XDG dirs are enabled (we don't have a guarantee we won't delete non-ghcup installed files if there are name clashes).
This could easily grow in complexity though, because we don't want to turn ghcup into a package manager.
After thinking about it - maybe the PATH expansion is indeed the way, since Stack installs in the same folder, but that probably is up to user, but also as a result would complicate GHCUP handling.
PATH expansion is already drastic and a default workaround, there are already too much package managers that extend the PATH, so one more or less - there is no difference, and PATH expansion seems to be the way package managers overcome issues.
What I see that is more beneficial to give people - is saving the config state in the XDG_USER_CONFIG and support the recreation of the state. So people can backup or share the config - and restore/receive config and arrive at the same/similar configuration.
BTW, ~/.local/bin is not an XDG specification - it is a people-born spin on it. I think XDG creators knew what they are doing - they probably understood that executable placement would be solved/most simply to solve with PATH rewriting in the foreseeable time.
So ~/.local/bin is not XDG spec in any case shape or form, and on request, you can point people into that, and that it is most probably deliberate.
What I see that is more beneficial to give people - is saving the config state in the XDG_USER_CONFIG and support the recreation of the state. So people can backup or share the config - and restore/receive config and arrive at the same/similar configuration.
I really don't know what that means. But ghcup won't recreate anything like nix.
So ~/.local/bin is not XDG spec in any case shape or form, and on request, you can point people into that, and that it is most probably deliberate.
There is a PR. See the link in my first post.
My concern is that ghcup makes assumptions about binary names. I haven't reviewed all of it, but if you had a file ~/.local/bin/foo-ghc-10 that was from a completely different program, I couldn't say of the top of my head whether it will confuse ghcup or not.