exercism / exercism/haskell

`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’."

Offen
#1,042 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Haskell
Sterne
529
Forks
201
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.