-
Notifications
You must be signed in to change notification settings - Fork 105
Added solutions for chapter 1, exercise 1 to 5 and chapter 2 exercise 1 to 3 #6
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
Added solutions for chapter 1, exercise 1 to 5 and chapter 2 exercise 1 to 3 #6
Conversation
Actually, blocked by this line (ch. 2 ex. 4):
It looks like it's something simple, but I only found Producer/Consumer implementations with Akka so far. Can you give some hint to the problem, please? |
|
||
object CH1Solutions extends App{ | ||
|
||
def compose[A, B, C](g: B => C, f: A => B): A => C = g compose f |
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.
We should also add the alternative solution g(f(x))
.
I recommend that we keep the exercises for each chapter in separate packages, just like the chapter examples:
The exercises themselves should be in separate files, for example |
(I can also do the refactoring to separate files for you, if you want) |
Sure! The producer/consumer pattern is not specific to Akka and the actor model. It is a more general pattern in which one computation produces some values, and another computation takes those values and does something with them. Here, the consumer depends on the values created by the producer, and cannot proceed until they become available. In this exercise, you need to:
Which one is the consumer, and which is the producer here? |
Thanks for taking time reviewing the solutions! I just updated the PR with regards to your comments. If you could refactor the code with separate files, it would be great, this way I could see what exact file structure you have in mind. |
Added solutions for chapter 1, exercise 1 to 5 and chapter 2 exercise 1 to 3
Just saw the hint on the exercise 4, that's exactly what I was looking for, thanks! |
You're welcome, and thank you for contributing! :) Here's the structure I meant: |
Given #5 here are some solutions to the exercises solved so far (for ch1 and some of ch2) just to show that there is some progress in the 'exercise' package.
I will submit solutions to following chapters as soon as they are solved.