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

Added Satellite exercise #1210

Merged
merged 4 commits into from
Feb 20, 2024
Merged

Conversation

tofische
Copy link
Contributor

Added a new Haskell practice exercise Satellite 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 Feb 16, 2024
Comment on lines +510 to +512
"topics": [
"maybe"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

@ErikSchierboom I am not familiar with this feature, so I cannot judge this.

Copy link
Member

Choose a reason for hiding this comment

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

Topics are deprecated and are not used by the website. They are allowed to be in the config.json as they used to be used and they could be useful to help determine the practices and prerequisites fields.

@MatthijsBlom
Copy link
Contributor

Hmm. This exercise is about binary trees, but Data.Tree.Tree is a rose tree. Should we be more precise and use some dedicated BinaryTree type instead?

@tofische
Copy link
Contributor Author

tofische commented Feb 16, 2024

Hmm. This exercise is about binary trees, but Data.Tree.Tree is a rose tree. Should we be more precise and use some dedicated BinaryTree type instead?

I agree with you, but I couldn't find a ready-to-use binary tree in any common package. I didn't want to use some exotic package, and I also didn't want to let the students to create their own tree implementation.

The closest I could find is https://hackage.haskell.org/package/tree-traversals-0.1.2.0/docs/Data-BinaryTree.html - what do you think about the usage of this package?

@ErikSchierboom
Copy link
Member

I agree with you, but I couldn't find a ready-to-use binary tree in any common package. I didn't want to use some exotic package, and I also didn't want to let the students to create their own tree implementation.

It is possible to pre-define the tree type in a separate file and include it in the files.editor key in the .meta/config.json file. That way, the file is downloaded when using the CLI and shown as read-only when using the online editor.

@MatthijsBlom
Copy link
Contributor

MatthijsBlom commented Feb 16, 2024

Neat!

If we add a pre-defined type in this way we should probably add a note about it in instructions.append.md.

-- Which type to choose?

data BinaryTree a = Leaf   | Node a (BinaryTree a) (BinaryTree a)
-- or
data BinaryTree a = Leaf a | Node a (BinaryTree a) (BinaryTree a)

@tofische
Copy link
Contributor Author

Neat!

If we add a pre-defined type in this way we should probably add a note about it in instructions.append.md.

-- Which type to choose?

data BinaryTree a = Leaf   | Node a (BinaryTree a) (BinaryTree a)
-- or
data BinaryTree a = Leaf a | Node a (BinaryTree a) (BinaryTree a)

I have to admit that I'm not keen on the idea of providing a custom-made basic data structure - one of the purposes of the exercises is to point people towards suitable existing libraries. At least for me it was a big benefit that I got from the Exercism, so I don't want to withhold it from others.

What are the arguments against using Data.BinaryTree?

@MatthijsBlom
Copy link
Contributor

What are the arguments against using Data.BinaryTree?

To me: that it is not small. Many rose trees are not binary trees. Haskell allows and encourages expressing one's intent precisely. Defining new types even for single use is not unusual.

@tofische
Copy link
Contributor Author

What are the arguments against using Data.BinaryTree?

To me: that it is not small. Many rose trees are not binary trees. Haskell allows and encourages expressing one's intent precisely. Defining new types even for single use is not unusual.

Are we talking about the same thing? Source of Data.BinaryTree:

data BinaryTree a = Leaf | Branch (BinaryTree a) a (BinaryTree a)
  deriving (Show, Functor, Eq)

@MatthijsBlom
Copy link
Contributor

No, sorry. I thought we were talking about Data.Tree from containers.

tree-traversals seems not a commonly used package. In any case it would have to be added to the test runner. I have no definite opinion on whether we should use it.

@tofische
Copy link
Contributor Author

No, sorry. I thought we were talking about Data.Tree from containers.

tree-traversals seems not a commonly used package. In any case it would have to be added to the test runner. I have no definite opinion on whether we should use it.

This is a valid argument.

@ErikSchierboom
Copy link
Member

tree-traversals seems not a commonly used package. In any case it would have to be added to the test runner. I have no definite opinion on whether we should use it.

When possible, we'd prefer not to add libraries to the test runner.

one of the purposes of the exercises is to point people towards suitable existing libraries

I'd argue that this isn't generally true, although it can be in individual cases. Our idea is that students solve things without using libraries, as Exercism is all about teaching fluency in a language, but not necessarily everything that goes with it (like tooling and libraries).

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!

Comment on lines +510 to +512
"topics": [
"maybe"
]
Copy link
Member

Choose a reason for hiding this comment

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

Topics are deprecated and are not used by the website. They are allowed to be in the config.json as they used to be used and they could be useful to help determine the practices and prerequisites fields.

@ErikSchierboom ErikSchierboom merged commit c6c05c3 into exercism:main Feb 20, 2024
3 checks passed
@tofische tofische deleted the satellite-exercise branch February 20, 2024 17:17
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