exercism / elm-test-runner

GNU Affero General Public License v3.0
3 stars 5 forks source link

Add List.Extra package #48

Closed ceddlyburge closed 1 year ago

ceddlyburge commented 1 year ago

The Zebra Puzzle exercise is commonly solved using permutations of a list, which is something that is already available in List.Extra.

However, this package isn't available to students, as the test runner doesn't support it, which means that they have to create the permutation code themselves, which isn't really part of the exercise, and is a fairly large additional burden.

Usage of List.Extra is quite common in Elm, and it has many other packages that are useful.

We may also want to add some of the other *.Extra packages as part of this issue

mpizenberg commented 1 year ago

What about including the permutation functions in a provided read-only file? There has been a lot of maintenance issues lately with the packages under elm-community. To the point Evan was wondering if it shouldn’t be dropped entirely. They also change quite regularly so I’d worry getting into situations where we haven’t updated a *-extra package and people expect to be able to use them.

mpizenberg commented 1 year ago

Alternatively, we could have our own exercism/elm-list-extra package where we package functions relevant to the exercism elm track

ceddlyburge commented 1 year ago

Hi @mpizenberg , I didn't know about the maintenance issues, I have never had any issues with the .extra packages, so assumed that they were pretty stable.

I feel like it would be good to introduce students to them, I think most elm projects will use at least one of them.

Creating an exercism specific package makes sense, although it does seem like some extra work.

So maybe providing the permutations function in the Zebra Puzzle exercise is easier?

mpizenberg commented 1 year ago

what are the thoughts of other @exercism/elm maintainers on these 4 options?

  1. keep as is
  2. provide relevant extra functions in read-only files with exercises that need them
  3. have our own exercism/elm-extra package
  4. add *-extra packages to the list of available packages for all exercises
jiegillet commented 1 year ago

Sorry for the slow response :)

1. keep as is

That's where my vote goes. When I solved zebra-puzzle, part of the fun was to re-implement the permutation function, and if people don't want to do that, they can always copy/paste the function they want from source. I once implemented a whole parser in Elixir just for an exercise, it was great fun. I solve the same one easily in Elm with elm/parser, it wasn't quite the same ;)

2. provide relevant extra functions in read-only files with exercises that need them

How will we know which function are required? There might be a clever solution using something else that we will keep someone from finding because we are pushing our way of thinking.

3. have our own exercism/elm-extra package

Sounds like a lot of maintaining work :p

4. add *-extra packages to the list of available packages for all exercises

Maybe. But again, I've solved all of Elm's exercises and only a couple of times did I wish to have access to these. And when I did, I copy/pasted the 10 lines I needed.

ceddlyburge commented 1 year ago

Maybe we could mention that these packages exist in exercises where it might be relevant, so that students can copy paste from them if they want? And they would also then become aware of the packages, which is a useful part of learning Elm ...

jiegillet commented 1 year ago

I fully agree with that. We can append instructions whenever needed. Or, thinking way outside the box, we could have a concept exercise about it and have them find the perfect .Extra function for the job :)

mpizenberg commented 1 year ago

A concept exercice dedicated to help students discover relevant packages and resources is a good idea!

This combine with relevant info at the exercice level is a good compromise IMO. I personally prefer that over adding the -extra packages to the whitelist

ceddlyburge commented 1 year ago

Ok, so how about we create an issue for that concept exercise and add something to the instructions of the zebra puzzle exercise?

And maybe record this decision somewhere. Not sure where, maybe we could start a decisions log, or use architectural decision records, or something like that?

mpizenberg commented 1 year ago

Yes, I'm also in favor of all this. I remember vaguely trying to add some architectural decisions either in the readme or in some guide to write concept exercise. Might be wrong. But crystalizing some of these decisions in one "track-architecture" document is a good idea

ceddlyburge commented 1 year ago

Ok, I've created the issue for the new concept https://github.com/exercism/elm/issues/576

And the pull request for updating the zebra puzzle and updating the instructions https://github.com/exercism/elm/pull/575

@jiegillet @mpizenberg

mpizenberg commented 1 year ago

Thanks @ceddlyburge !