You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the solution of exercise 1 of atom Design by Contract, you use foldLeft which you don't cover in your book (<shouty mode/>: DON'T DO THAT!). I suggest using: def sumDigits(s:String):Int= s.map( c => c.asDigit ).reduce( (result,i) => i + result)
The text was updated successfully, but these errors were encountered:
Wanted to let you know I appreciate all your comments and will (eventually) address them all. I've been working on another book for the last couple of years and have a couple of other projects piled up so it could be awhile. But I've noticed the activity and appreciate your contributions.
In the solution of exercise 1 of atom Design by Contract, you use foldLeft which you don't cover in your book (<shouty mode/>: DON'T DO THAT!). I suggest using:
def sumDigits(s:String):Int= s.map( c => c.asDigit ).reduce( (result,i) => i + result)
The text was updated successfully, but these errors were encountered: