Skip to content
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

robot-name practice exercise: Consider adding random to dependencies, to avoid "Could not load module ‘System.Random’ / It is a member of the hidden package ‘random-1.1’." #1042

Open
petertseng opened this issue Jan 25, 2022 · 0 comments

Comments

@petertseng
Copy link
Member

petertseng commented Jan 25, 2022

If the student submits a solution using System.Random but not package.yaml, the error would be:

Could not load module ‘System.Random’
It is a member of the hidden package ‘random-1.1’.
Perhaps you need to add ‘random’ to the build-depends in your .cabal file.

There are a few possibilities:

  • We could expect that the student should submit the package.yaml that includes random under dependencies, just like how we expect that if students use any dependencies they submit package.yaml. This is the status quo. If this is the decision, the action is to close this issue and do nothing more.
  • Or we could add random to https://github.com/exercism/haskell/blob/main/exercises/practice/robot-name/package.yaml, presuming that every student who wants to solve this exercise will use it. This is a fine presumption because you might still get something that passes the tests without using random if you assign IDs sequentially, though you'd sort of be going against the spirit of the tests. If this is the decision, the action is to submit such a PR, which I would approve as long as it sufficiently summarises the above reasoning ("you might still get something that passe the tests without using random if...") and links to this issue using a word in https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue.

If you are viewing this issue and are unsure what decision to make, be assured that you have my support if you choose to make a PR that implements the latter, and that the latter is my current recommendation.

Perhaps there should be some exercise where we explicitly teach students about the necessity of submitting package.yaml when using packages, but that is sounding like a concept exercise to me.

@petertseng petertseng changed the title robot-name practice exercise: Consider adding random to dependencies robot-name practice exercise: Consider adding random to dependencies, to avoid "Could not load module ‘System.Random’ / It is a member of the hidden package ‘random-1.1’." Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant