Heidi's rings at the heart and welcome to the next valley of this Mordy or high level functions and
Landau's.
Now this video is actually the continuation of the previous video.
So make sure you have lost my previous video and then only continue with this video.
So in this video we talk about the landers and High-Level level functions in deep detail so as to clear
your concept with more clarity and also check out various ways to parse Lamda to the higher level functions
that are present in case of Cartland.
So first of all it does not exclude the lambdas in High-Level functions.
So as seen in the previous video the lambda expression looks like this.
That Gurli Blackard open and close.
Within this we have the lambda expression.
Now each lambda expression is actually the function.
So x and y are promotors and after their dash and add.
OPERATOR We have explicit VI which is actually the mentored body.
So x and y are weaker and explicit phi is actually the Metford body.
There are simply returns some value explicitly.
We can assign this lambda expression to this.
My lambda function very well.
So this is a variable of this signature.
So here we have colon followed by that type of variable that we have here.
Now their type of variable of the land expression will have the signature is similar to the expression.
So here X is indeed a value.
VI is a integer value and then we have the return type as and that is explicit Y which is the method
Bardy simply returns the integer value so that is why I have written here.
So here we can see this is a variable name and here this is the method signature or the lambda signature
that is.
These are there to be reminders.
X and Y and the Metford body returns in value.
Doctors x and y returns the sum as integer value.
Now then comes the calling of the High-Level function.
Now what does a higher level function.
The High-Level function actually contains simply accepts the lambda function as it did or it can also
return the lambda function.
So if a function follows either of these two that is accepting a lambda function or the expression or
returning some lambda value then the method is known as the High-Level functions.
So this is a Lambeck expression and this is the High-Level function that accepts my lambda function
right or the expression.
So here I have simply defined the function at two numbers.
This is the act of numbered and then 3 comes to a.
Which is the integer value it comes to be.
Which is again the integer value.
Then comes my lambda function.
So here I have simply defined my function galloon the signature.
Now if you compared Beco to an end you will find the same thing here.
My function which is actually the variable name followed by the signature.
So here it is a signature of this b variable.
So here in N followed by N is actually the signature of this function.
So this might function actually accepts two integer variables and then simply returns the endangered
type.
So inside the body of act two numbers we can simply write our code such as my function or B.
Now here this my function is actually just one my func Derek simply passes to be witness of in B.
So here a and b are these two variables that has a value of three and eight.
So we are simply passing 3 and 8 as a parameter.
So this is actually this X and this B is actually this vi so explicit y will be evaluated in place of
my function and B.
So instead of my function in B we can simply evaluate it as explicitly equal to LSV equal to the value
that is to replace it.
That simply returns 11 as desired that is.
Finally we are getting live in as a value.
So this Lebon will be stored inside.
That is a variable.
And finally we can simply playing the wizard and in the output console we will get live and as the output.
So this is all about the Landau's and high level functions right.
So just in place of my function and we simply replace it mentally by this explicit VI which is the Metford
body and power the values as this one equal to 11 is the desired as simple as that.
So he had inserted the intelligent ID.
I was simply cleaned up my code so as to make things more simple and more clear.
So now we're only left with the actual numbers method which is actually the High-Level function that
takes the actual function as a land expression.
Right and we are simply calling this function from here.
Programs are actually numbers and simply passing them my lambda expression which we saw in the previous
video.
So no doubt till now now he had previously we were just printing the value that is inside the Metford
body of this Lumba expression.
We are just printing out the value.
Now let us mortifies something such as.
Instead of s.
Let us see we have equal ma let's say X Y and then which is which is again of their type of an X and
Y N.
And then here let us use explicit WWAY.
Now here as a lambda experiencing nature.
We need to again change.
So here we have two metres of x and y.
So here we really use into coma and that is to beat on meters and then the return type is actually integer
value.
So instead of unit we can simply use an but I suppose if I say right here let's see a string value.
So here I need to write here string as simple as that that you saw in the previous video as well.
So here let us use and revert it back as well let's see explicit why doctors act with numbers.
And now here I'm simply parsing my land as an expression do this add two numbers method.
So I would simply modify my actual numbers metric so as to match the signature that we have defined
here this signature.
So simply copy this signature to control C and simply paste the signature here.
So now we have to be in the middle of an end.
There are simply returns the end value right now if you want it you can also make it flawed as well
and change it every year.
So as of now let's keep it in.
And now here variable sum equal to a plus b.
And then what we do is I will simply remove this chord here and now instead of this I'm having the method
of action.
So simply use action and then simply pause let's say a comma B.
So we don't need to have this variable sum here as well.
Just call action and B.
So this will simply be evaluated as.
Let's say the method body.
Now the method body is explicit Why so explicit why.
Now here the X is actually a and vi is actually be.
So the value is actually 2 and 7.
So we can simply use a class B equal to implies 2 plus 7.
Now the result will be 9.
So this action will again return the NBG value of 9.
Right because the return type is here.
So here I will simply define Val razored equal to action.
Right and now are the end.
But interline wizard.
So let us show them the code and see what happens.
So here we go nine in the output console.
We are getting.
Right.
So in this video we just mortified our Lamda of what high level function.
And also here we have that it don't type as in.
Instead of unit and we're simply pointing out that Izard inside this act two numbers mattered.
Now at the end of the previous video I told you instead of using this whole statement here very well
my Lamda and so-so begin simply or copy this Landale expression from.
And replace the variable name as with the land expression and simply command this line.
So here we're simply parsing.
And if you aren't you can also remove this.
And and in signature here.
X and Y are the parameters and X less y are actually limited body.
And similarly here as really going to remove the end and also end this simplify as are called non-leaders
render called.
So here again we get nine in the output console.
So our courts are working perfectly fine.
So you can simply pass the lambda expressions directly.
So this was one way and this is another way of calling the two numbers that has higher level functions.
Now apart from these two ways there exist two more these Let me show you.
So here I have two numbers simply passing my lambda function as a variable.
Now apart from this you can also passed the lambda expression very.
That is simply using x y followed by explicit VI here.
Actually right now similar to this.
We have one more alternative.
The is simply use Act Two numbers three and it then simply close the bracket.
Now if you look at this statement you will find the lambda expression is actually present right after
the end of the last parameter that is 8.
It is actually looking like a third body the two numbers.
And here as a metric body I have the lambda expression.
So is sort of losing the Blackard here.
We're simply closing down the Blackard here and then defining the lambda expression.
So these three are actually seems so all of these three could really give the same output.
Let me show you the code in action inside the intelligence the.
So here again let me copy discord and Peyster it again later make I in the line.
And now here instead of closing the Blackard here I simply use the Blackard here by removing the comma.
And now if you notice authored two and seven I'm simply having the lambda expression that appears to
be the mentor body right.
So it doesn't d'accord LHC what happens.
So here again we get the same output as nine.
So it makes no difference.
So all these three lines of code words are working perfectly fine.
You can use the variable name lambda expression directly or you can use this way of defining the expression
outside the method body like this.
Right.
So this is all about this video.
Now we take our discussion to the next level in the next video and we'll talk more about the lambda
expression and higher level functions in case of Cartland.
Now remember these two concepts are very very important.
Right.
So make sure you watch all these videos in this Marty.
Thanks for watching and have a good day.
Thank you.