-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should ghcup config add-release-channel
build a set rather than a list?
#751
Comments
Order matters. What wold be the expected behavior for:
Will we remove the first or last A? |
Either one, depending in which order Does |
They are tried in order. So which one gets removed? |
Is this a quiz or what? I am the professor here! |
I'm saying I have no idea what the expected behavior is. So this can't be done, unless we figure that out and have a precise specification how it's supposed to work. Order matters |
Any new insights? |
Well, I would have to understand the code how the release-channels are used once they are added. This should determine their semantics. I am very puzzled about this interaction, it seems you just don't know the semantics of release channel collections. At the same time, I assumed you wrote ghcup mostly single-handedly. But as I said, I have no insight into the code. Maybe this release channel collection is just shipped off to some third party tool that does not give away the semantics either. In any case, if order matters, I don't understand the current specs:
If order matters, "Add" is an unspecified operation. You would have to say where it is added: at the front, at the end, in alphabetical order, etc. But this said, you might have more important things to look after. I just stumbled over it and thought I bring attention to it. My curiosity came from |
ghcup-hs/lib/GHCup/Download.hs Lines 133 to 141 in 31e83ca
I'm puzzled how you came to this conclusion. I asked you what you think the expected semantics are. You were unable to hash out what they are. Which I'm unable too. I explained to you that currently order matters. See the code above.
https://github.com/haskell/ghcup-hs/graphs/contributors
It is append. |
Ok, if you ask me like this: I expect "later overwrites earlier". This is LIFO (stack). So adding A,B,A is the same as adding B,A. |
Overwrites what? |
Mmh, no progress, so let me switch to mathematical language: My model is that of the ghcup configuration being a state We shall also consider ghcup commands We consider extensional equality of states, so two states are equal if they lead to equal results if involved in the same ghcup command in any kind of world. "Equal results" are not equal worlds but predicates We are now interested in the question whether there is a non-trivial quotient on configuration action sequences If this is the case, then the current representation of states |
I don't care about the maths. This is a simple question: what is overwritten? There are multiple ways to do this with wide ranging consequences. The ghcup metadata are nested maps: Lines 103 to 109 in 31e83ca
If we do e.g. 1, the pre-release channel would have to duplicate the base channel otherwise it would drop all non-prerelease versions. Overwriting versions (2.) is somewhat similar to how e.g. gentoo overlays work. |
I'm inclined to error out on duplicates. The user can supply |
done |
Great, thanks! |
Not sure we settled the maths though 😂 |
Another time... |
Should
ghcup config add-release-channel
build a set rather than a list, or at least a nublist (if order matters)?After hitting
ghcup config add-release-channel ...
twice, I am seeing:The text was updated successfully, but these errors were encountered: