-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Assorted typos, suggestions, misc. for Part I #80
Comments
Apologies for putting this all under one issue no. I'd made the list as I was going through the book and only now realised there was a git repo. Going forward I will raise issues individually. |
No worries! Thanks very much for your help! I'm doing bug fixes on the I'll edit the original issue description to include checkboxes and work through it. If there's anything I can't fix immediately, I'll raise another issue. |
Hi @lJoublanc. Thanks very much - I've done a first pass on your points in 5454487. There's loads of good feedback in there! I've put some comments below where I either had further questions, wanted to elaborate further, or disagreed with a point and wanted to explain why:
I'm not sure I agree with this one. IMO the natural zero for an order from, say, Amazon, is to not buy anything: 0 quantity, 0 price.
The diagram looks ok to me, but it's probably down to interpretation. Is your issue the number of circles and stars in the lists on the left, middle, and right? I've kind of mixed some metaphors here. On the one hand, the number of items in the list icon is supposed to be insignificant: three icons are meant to simply represent "a list of some length". However, I've often found in training sessions that people get confused between the List[B] returned by the flatMap function and the List[B] returned by flatMap itself. I removed a star from the former of the two to clarify that the two lists are not the same. But now it looks like the number of stars has a significance, so I guess I should add a fourth star to the right to indicate that the lists can get longer. What do you think?
This looks suspiciously like a binary compatibility issue. Make sure you're using compatible versions of Scala and Cats. I'll add a section to the start of the book on versions, but I don't think it'll help with your situation here.
My solution here was actually completely wrong. It is possible to make this method tail-recursive---it's just tricky to write. You have to use a
I can't see this one. I think it's gone in the latest text. I could be mistaken, though. |
Hi Dave,
This is a perfect example - yes, mathematically this makes sense - but have you tried entering an order for zero items on amazon ..? Anyway not a big deal, I just thought it would be better suited to a Semigroup example.
Yes exactly, this is what was confusing me. Now that you've explained it, I agree with you. As you said, it's a matter of interpretation. Re: the future sequencing issue, It's probably my setup. I think I may also have had fs2 in my dependencies, pulling in a different version of cats altogether ...! Re: tailRecM, the explanation you've added seems much clearer to me now, as you've elaborated on whether it needs to be tail recursive or not, and given both examples. Can't wait to see the final version! |
Thanks again! Glad the book is improving!
I'm not sure I agree with this one. IMO the natural zero for an order from,
say, Amazon, is to not buy anything: 0 quantity, 0 price.
This is a perfect example - yes, mathematically this makes sense - but
have you tried entering an order for zero items on amazon ..?
Ah gotcha. I understand now! Sorry I didn't see that before.
The diagram looks ok to me, but it's probably down to interpretation. Is
your issue the number of circles and stars in the lists on the left,
middle, and right?
Yes exactly, this is what was confusing me. Now that you've explained it,
I agree with you. As you said, it's a matter of interpretation.
Cool. I think it's confusing too. I'll either tweak the diagram or add a
note.
Re: the future sequencing issue, It's probably my setup. I think I may also
have had fs2 in my dependencies, pulling in a different version of cats
altogether ...!
Re: tailRecM, the explanation you've added seems much clearer to me now,
as you've elaborated on whether it needs to be tail recursive or not, and
given both examples.
Great stuff. tailRecM is a fairly new addition to Cats and I'm only just
getting to grips with it.
Can't wait to see the final version!
It's getting closer! Soon I hope!
|
May I close this off? I think most of the remaining unaddressed issues don't exist any more as the text has changed considerably. |
Absolutely. Sorry for my tardiness in replying. Sometime soon I'll reserve a few days to go through all these books and close off as many issues as I can. |
Part I
Order
doesnt make much sense.Welcome to Scala 2.12.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101)
Left
tailRecM
is not tail-recursive, will it still be stack-safe? Explain this.The text was updated successfully, but these errors were encountered: