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

Solutions Chapter 1 #1

Merged
merged 5 commits into from
Oct 19, 2020
Merged

Solutions Chapter 1 #1

merged 5 commits into from
Oct 19, 2020

Conversation

L7R7
Copy link
Owner

@L7R7 L7R7 commented Oct 17, 2020

Solutions for Chapter 1

cc @vrom911 @chshersh

Since I already know Haskell, some of the solutions are different than what one would expect from a beginner. Looking forward to receiving your feedback!

Copy link

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

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

Great job! 👍🏼 Congrats with finishing Chapter ONe 🥳
Keep up the great work 👌🏼

-- DON'T FORGET TO SPECIFY THE TYPE IN HERE
lastDigit n = error "lastDigit: Not implemented!"
lastDigit :: Integral n => n -> n
lastDigit = (`mod` 10) . abs
Copy link

Choose a reason for hiding this comment

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

Nice point free style 💯

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, that's elegant. However, to me the alternative with explicit arguments is sometimes easier to grasp than the point free one, especially when infix notation is used.

I guess to a certain degree it will get better if I get used to it, but probably it makes sense to not use point free style sometimes

L7R7 and others added 3 commits October 18, 2020 14:59
* Avoid name clashing with `last` from Prelude
* use `divMod`
Co-authored-by: Veronika Romashkina <[email protected]>
@L7R7
Copy link
Owner Author

L7R7 commented Oct 18, 2020

Thank you for your detailed feedback!

@vrom911
Copy link

vrom911 commented Oct 19, 2020

No problems, @L7R7 🤗
Feel free to merge this one 🚢

@L7R7 L7R7 merged commit 4755510 into master Oct 19, 2020
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.

2 participants