Man that tail recursive HOF incrementer in your topic of 'Higher-order-functions and curries' on your beginner Scala course is super hard to understand (not because of the lacking in your teaching but just hard)....staying optimistic and holding onto the your statement of "rewind and watch this again or play around with the code yourself, and you will be better than 99% of Scala programmers out there when you understand it". To be honest i feel like combining your yt vids with the course actually leads to a MUCH better understanding..like having a teacher explaining the same topic in a different way cause he knows i didn't fully understand it. P.S. for anyone reading this who is learning Scala, mark my words that the 1hour wage that Daniel's course is up on Udemy is the best investment you can ever make.
15:35 In line 64, nTimesOriginal(f, n-1).apply(f(x)) We invoke apply function of nTimesOriginal. But nTimesOriginal has no function apply defined. Can you please explain. Thanks.
For those interested in how this would look like in Java: public static void main(String[] args) { // Create Function objects Function baseFunction = i -> i + 1; Function modifiedFunction = nTimes(baseFunction, 4); // Result output System.out.println(baseFunction.apply(1)); System.out.println(modifiedFunction.apply(1)); } // Higher-order Function public static Function nTimes(Function function, int n) { if (n i; else return function.andThen(nTimes(function, n-1)); }
Best explanation I've ever seen. Thanks a lot!
Always worthy to watch your videos....superb content
Thanks!
Man that tail recursive HOF incrementer in your topic of 'Higher-order-functions and curries' on your beginner Scala course is super hard to understand (not because of the lacking in your teaching but just hard)....staying optimistic and holding onto the your statement of "rewind and watch this again or play around with the code yourself, and you will be better than 99% of Scala programmers out there when you understand it". To be honest i feel like combining your yt vids with the course actually leads to a MUCH better understanding..like having a teacher explaining the same topic in a different way cause he knows i didn't fully understand it.
P.S. for anyone reading this who is learning Scala, mark my words that the 1hour wage that Daniel's course is up on Udemy is the best investment you can ever make.
That's such high praise, thank you!
This was indeed a hard one to understand.
15:35 In line 64, nTimesOriginal(f, n-1).apply(f(x))
We invoke apply function of nTimesOriginal. But nTimesOriginal has no function apply defined.
Can you please explain. Thanks.
Function instances have the apply method.
For those interested in how this would look like in Java:
public static void main(String[] args) {
// Create Function objects
Function baseFunction = i -> i + 1;
Function modifiedFunction = nTimes(baseFunction, 4);
// Result output
System.out.println(baseFunction.apply(1));
System.out.println(modifiedFunction.apply(1));
}
// Higher-order Function
public static Function nTimes(Function function, int n) {
if (n i;
else
return function.andThen(nTimes(function, n-1));
}
This took a while to process. But good job on the video
Yep, this concept takes a bit to internalize.