Always worthy to watch your videos....superb content
@rockthejvm3 жыл бұрын
Thanks!
@awadheshsingh72992 жыл бұрын
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.
@rockthejvm2 жыл бұрын
Function instances have the apply method.
@shakilhaque18223 жыл бұрын
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.
@rockthejvm3 жыл бұрын
That's such high praise, thank you!
@d4devotion3 жыл бұрын
This was indeed a hard one to understand.
@sebimed59173 жыл бұрын
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)); }
@rheafernandeshallu4 жыл бұрын
This took a while to process. But good job on the video