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

Complete Chapter 1 #1

Merged
merged 3 commits into from
Oct 3, 2020
Merged

Complete Chapter 1 #1

merged 3 commits into from
Oct 3, 2020

Conversation

danielboros
Copy link
Owner

@danielboros danielboros commented Oct 1, 2020

Sorry for the dup PR. I think I accidentally opened it against the main repo. Oops. 😨

Solutions for Chapter 1

Thanks for the effort in putting this together! I'm liking it so far.

I'm running on Windows on my work laptop so I just copied and pasted the cabal test commands from the Makefile directly into my Powershell as a stop gap from not having make and they all passed. Then I realized I could install make with Chocolatey (same as the official way of installing Haskell on Windows) and that worked OK for running the various targets. Just FYI since there weren't any Windows instructions.

I had to do this to deal with a GHC 8.10.2 issue on Windows which prevented the test suite from building correctly. Probably should have just used Linux...

cc @vrom911 @chshersh

Daniel Boros added 2 commits October 1, 2020 16:28
Complete Chapter 1
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.

Congrats with successful finishing of Chapter 1 🥳
Amazing job!
And you nailed the advanced task 👏🏼

Thanks a lot for sharing the experience on Windows! That is very valuable. We would add some of the notes of yours in README, so others on Windows would be aware of the issues! (And it should be totally fine to make this course on Windows, at least we would try to make it work! No need to grab Linux for that 😄 )

lastDigit n = error "lastDigit: Not implemented!"
lastDigit :: Int -> Int
lastDigit n = mod x 10
where x = abs n
Copy link

Choose a reason for hiding this comment

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

Nice usage of where! 👍🏼

src/Chapter1.hs Outdated Show resolved Hide resolved
src/Chapter1.hs Show resolved Hide resolved
| x < 10 = x
| otherwise = firstDigit (div x 10)
where
x = abs n
Copy link

Choose a reason for hiding this comment

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

Elegant solution 😍

@vrom911
Copy link

vrom911 commented Oct 3, 2020

Hey @danielboros !
I think that this PR is ready to merge 🚀 Well done!

@chshersh
Copy link

chshersh commented Oct 3, 2020

⚠️ By the way, per new rules of the Hacktoberfest event, you would need to add the hacktoberfest topic to this fork repo:

All previous contributions are legit, but from now on it should have the label to participate.

@danielboros
Copy link
Owner Author

⚠️ By the way, per new rules of the Hacktoberfest event, you would need to add the hacktoberfest topic to this fork repo:

* https://hacktoberfest.digitalocean.com/hacktoberfest-update

All previous contributions are legit, but from now on it should have the label to participate.

Thanks! Done.

@danielboros danielboros merged commit 982540b into master Oct 3, 2020
@danielboros danielboros deleted the Chapter1 branch October 3, 2020 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants