-
-
Notifications
You must be signed in to change notification settings - Fork 199
Add Approaches for Space Age #1144
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
Conversation
6ddcafe to
a71f520
Compare
| - The compiler is able to check that you handle all possible cases. | ||
| If you overlook some cases and use guards, the compiler will not help you. | ||
| But if you are pattern matching it will! | ||
| - When you use pattern matching, the compiler can use its understanding of your code to apply code transformations that improve performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you use pattern matching, the compiler can use its understanding of your code to apply code transformations that improve performance.
I suggest linking to another resource that explains the code transformation that it applies. As someone starting to learn Haskell, I curious to what and how Haskell do the code transformations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would be nice. However, I know of no (good) such resources off the top of my head. I'll look for a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to find any and do not wish to delay merging for this, but would definitely welcome a PR in the future.
|
@ErikSchierboom Do you have comments? @petertseng As far as I'm concerned this is ready to be merged. |
ErikSchierboom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the contents! I just have one comment on which file should contain the contents.
exercises/practice/space-age/.approaches/where-clause/content.md
Outdated
Show resolved
Hide resolved
|
|
||
|
|
||
| [learning-resources]: | ||
| https://exercism.org/docs/tracks/haskell/learning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing space to be removed
| https://exercism.org/docs/tracks/haskell/learning | |
| https://exercism.org/docs/tracks/haskell/learning |
| Please consult your other learning resources. | ||
| The track docs include an article on [Haskell learning resources][learning-resources]. | ||
|
|
||
| Pattern matching with `case` has benefits over using guards: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be readily apparent to a learner that "using guards" refers to the above solution that includes | planet == "Mercury"? If it is already apparent, that was my only question about this pull request, so I think it is ready.
If it would not be apparent and needs to be made that way, mentioning guards somewhere around the sentence that reads "this is an anti-pattern" would make it clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I have changed
- This is an [anti-pattern][wikipedia-anti-pattern].
+ Using guards like this is an [anti-pattern][wikipedia-anti-pattern].
petertseng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, in that case, let's go then. Thank you for your work and perseverance.
No description provided.