-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
Complete Chapter 1
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.
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 |
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.
Nice usage of where
! 👍🏼
| x < 10 = x | ||
| otherwise = firstDigit (div x 10) | ||
where | ||
x = abs n |
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.
Elegant solution 😍
Hey @danielboros ! |
All previous contributions are legit, but from now on it should have the label to participate. |
Thanks! Done. |
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 theMakefile
directly into my Powershell as a stop gap from not havingmake
and they all passed. Then I realized I could installmake
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