-
Notifications
You must be signed in to change notification settings - Fork 12
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
Week1 #62
Week1 #62
Conversation
Also switched to using Test.Hspec.
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.
Because we are trying to produce production level code in Haskell, I added some nits about styling. Hopefully this helps.
Good work!
padList (x:xs) = (x:0:padList xs) | ||
|
||
doubleEveryOther :: [Integer] -> [Integer] | ||
doubleEveryOther = reverse . doubleEveryOtherRev . reverse |
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.
Given we are going to sum the digits after double every other digits from the right, do we need to reverse the list back?
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.
Hmm, if the only goal is to finish validate
, then I suppose there is no point in reversing the list back. For the sake of this exercise though, if the list is returned in reverse it doesn't satisfy the requirements.
I'll merge this for now and if you want to address the comments, you can create another PR. |
* upstream/master: Week1 (fp-works#62) Daniel M Week 4 (fp-works#61) Exercise 3: More folds! (fp-works#60) Week 4 Ex 2,3 (fp-works#58) init week5 week4 ex 2,3,4 (fp-works#54) Wei Ning - CIS194 Week4 Homework (fp-works#59) [Week4]: Task1 (fp-works#56) Daniel M Week 3 (fp-works#57) Week 3 Ex 3 + Week 4 Ex 1 (fp-works#55) Task2 (fp-works#50)
* upstream/master: Week 5 ex 2 to 6 (fp-works#76) week 5: use applicative and composition styles (fp-works#75) W5steve (fp-works#73) Week5 (fp-works#71) fix symbol alignment style (fp-works#74) Week2 fix (fp-works#72) Week 5 ex 1 with updates to Parser and StackVM (fp-works#68) Week3 (fp-works#66) improve skips in week3 ex 1 (fp-works#69) steve week 5 (fp-works#63) Week2 (fp-works#65) Improve week1 homework based on feedback in fp-works#62 (fp-works#64)
latecomer catching up with homework