haskell
haskell copied to clipboard
Port test suite so it supports Data.Text
In #780, exercises that might be applicable for teaching the Data.Text
module were found. In some of those cases, the test suite was extended with OverloadedStrings
so that both String
and Text
solutions work, and an example solution was provided. For a notable example of this, one of the early exercises, Bob, had an example added, its test suite updated, and had the following hint added. (See 28cc7d5fb44ff858938d435f9b42339f63742e44.)
This issue contains the remaining exercises for which Data.Text
may be applicable. Contributors are free to pick an exercise they're comfortable with, (1) make an example solution, (2) make the test suite compatible with multiple string types, (3) add a hint, and optionally (4) make Data.Text
the default in the stub file.
List of exercises that don't yet support Data.Text
but could:
- [ ]
rotational-cipher
: Easy. - [x]
raindrops
: Easy. - [x]
diamond
: Easy. - [x]
twelve-days
: Easy. - [ ]
atbash-cipher
: Easy. - [ ]
run-length-encoding
: Doable. - [ ]
ocr-numbers
: Doable. - [ ]
rail-fence-cipher
: Doable. - [ ]
luhn
: Easy, but hardly relevant as the exercise mainly consists of working on integers. - [x]
series
: Easy. Test suite already containsOverloadedStrings
and already hasByteString -> Seq (Seq a)
. So aData.Text
example is probably not necessary unless the stub should encourage something other thanString
by default.
I've looked at the example solution(s) for each of these and made a quick estimate where "Easy" means that it would be quick to translate this to Data.Text
by finding equivalent combinators, and "Doable" means that the contributor probably needs to learn (part of) the algorithm in the exercise to port it. The estimation was made very quickly and subjectively, so your mileage may vary.
I can add Data.Text
support to diamond
. I am working my way through the exercises and I don't want to contibute to ones I haven't completed. That being said, the next closest exercises are raindrops
and twelve-days
.
@barrymoo: That sounds good! Since you're adding property-based tests for Diamond in #843 right now, I would recommend that you either (1) wait with adding Data.Text
support until after, and submit a separate PR, or (2) add support for Data.Text
in a feature branch forked from master
, submit a separate PR, and once this is merged, rebase #843 onto it.
I would recommend (1) because it involves fewer merge conflicts.
I will work on twelve-days
next.
Could you consider wordy
as well?
TIA
Yes
On Mon, 29 Nov 2021 at 07.16, Cyber Oliveira @.***> wrote:
Could you consider wordy as well?
TIA
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exercism/haskell/issues/841#issuecomment-981323044, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMNPZHPY7KAQ5N4Y3QXZDUOMLE7ANCNFSM4ITRWYSA .