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

Add Word Search exercise #1223

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

tofische
Copy link
Contributor

Added a new Haskell practice exercise Word Search based on the available problem specification.

Copy link

Hello. Thanks for opening a PR on Exercism 🙂

We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in.

You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch.

If you're interested in learning more about this auto-responder, please read this blog post.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Mar 27, 2024
Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. @MatthijsBlom ?

@MatthijsBlom
Copy link
Contributor

I'm debating what the ideal / a good signature would be. Keeping in mind both idiomaticity and interestingness/scenario diversity.

search :: Grid -> Needles -> Output

Should Grid be a single (\n-separated) String, a list of (line) Strings, a 2d Array of Chars, ...?

I'm fine with Needles ~ [Word], and Word ~ String isn't too bad.

The tests do not cover cases in which the same word occurs several times, so Output could be a Map.


What do you two think about putting the datas into an editor file?

@tofische
Copy link
Contributor Author

tofische commented Mar 27, 2024

I'm debating what the ideal / a good signature would be. Keeping in mind both idiomaticity and interestingness/scenario diversity.

search :: Grid -> Needles -> Output

Should Grid be a single (\n-separated) String, a list of (line) Strings, a 2d Array of Chars, ...?

I'm fine with Needles ~ [Word], and Word ~ String isn't too bad.

The conversion between a single String and a list of Strings is trivial, and I deliberately avoided some more complicated data structure in order not to restrict the creativity of the students - very often they build up their solution based on the given data type instead of converting the data so some more appropriate representation (as also my example solution does ;-) ). I'm however open - if they are any advantages in using another data type, I'll implement the change.

The tests do not cover cases in which the same word occurs several times, so Output could be a Map.

This is a valid point, but does the increase in the attractiveness of the problem justify additional complexity? The difference is in searching the first occurrence or searching all occurrences. I doubt it, but the example solution finds all occurrences (as a List, not a Map) and only then converts to Maybe.

What do you two think about putting the datas into an editor file?

I'm sorry, I don't understand what you mean.

@ErikSchierboom
Copy link
Member

This is a valid point, but does the increase in the attractiveness of the problem justify additional complexity? The difference is in searching the first occurrence or searching all occurrences. I doubt it, but the example solution finds all occurrences (as a List, not a Map) and only then converts to Maybe.

I don't think these puzzles ever have a word occuring multiple times, so I would be fine not accounting for that fact.

@tofische
Copy link
Contributor Author

tofische commented Apr 9, 2024

One check has failed, but I don't know how to correct it (if I can correct it at all) - do you know what can be done now?

@ErikSchierboom ErikSchierboom merged commit 45c6c83 into exercism:main Apr 10, 2024
6 of 8 checks passed
@ErikSchierboom
Copy link
Member

Nothing to do with this PR. Ci is broken

@tofische tofische deleted the word-search-exercise branch April 11, 2024 19:22
@ErikSchierboom
Copy link
Member

I've finally been able to fix CI and it turns out this exercise is broken: https://github.com/exercism/haskell/actions/runs/8720539792/job/23922275342?pr=1235 Would you mind looking into it @tofische?

@tofische tofische restored the word-search-exercise branch April 17, 2024 12:40
@tofische
Copy link
Contributor Author

I've finally been able to fix CI and it turns out this exercise is broken: https://github.com/exercism/haskell/actions/runs/8720539792/job/23922275342?pr=1235 Would you mind looking into it @tofische?

Done (on the same branch). Do I have to create a new PR?

@ErikSchierboom
Copy link
Member

Yes please.

@tofische
Copy link
Contributor Author

#1236

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

Successfully merging this pull request may close these issues.

3 participants