Haskell

Haskell 03: Min Max succ

20 videos

111 minutes

Hello they are like, my name is Joseph and I want to welcome this new course haskell tutorial. Where today we see as basic functions that are implemented for this language. And we begin to understand a little structure functions for example we see the succ functions min and max

and this simply serves good for different purposes for example, succ you return the row number you're going if I give succ 9 as there gives me 10 if I give 'a' me back b so haskell has implemented internal lists of data and what makes these data lists is that if one gives a figure he gives you the following from that list that is stored is that simple,

then we have to think about this is that when we make a call to a function normally as languages ​​java and c ++ what we do so we put in the name of the function and then pass the parameters in brackets for example, We can have a succ (10, 8) and what we do is separate them with a comma, for example, and already there but we put the semicolon

the thing is that the name of the function is passed by parentheses and separated by commas parameter in haskell not you put after you put the parameter separated by spaces without decimal point and with nothing and he knows they have to do with everything, so when I put succ he knows if I put succ -3 meda an error because it is not a fact that is not understood within that list, then now clear.

For example'll clean this good screen well'll leave this to you and see succ 2 it is 3 if you now for example I use the function min what I do is I will give the smallest number of which I will pass on June 3 min February 9 meda mistake because this function is created to receive two parameters, not many parameters such as if now I give min April 9 there if I get 4 if I say

2 min 4 September mistake again then meda meda min the smallest of which I will pass on July 1 min There is number two parameters give and measure the smallest (1). I'll delete it again from there I put succ 8 for us to have a reference min 5 2 is now and if we now say max I returns the value greater than haiga, so if I put aquímax 12 and 78.3 because they saw that there is not a problem if the data is integer

or decimal me simply returns the nearest value, and now, it can combine for example, I can say max 4 and now instead of passing 8'm going to pass this succ max 4 7 unforgivable miss me parenthesis max 4 (succ 8) They saw no need to specify the parentheses and then haskell is what makes this call to this function resolved,

returns the value and here plays an 8 and max calls the function and returns a 4 with 8 this serves to make different combinations. For example, if you put me here to tell me the next number, and now I put in brackets the following function to which I will call: max, maximum of 8 and 6, maximum 8 and 6 is 8 and the next number is 9 there gives me 9 and I can combine it more if I here

I put to me the maximum number of 8 and a minimum of 34.6 90 34.6 90 the minumo is 34.6 and the maximum of 8 is 34.6 and the following 34.6 35.6 as it is. There you have it. So get used to seeing this in haskell not work past the paramentaros in parentheses. but all the value that you want to have a return value of a quantity that is passed between parentheses if here what I want

with this it is that succ return a value that value me everything I put in brackets and will return the function with its parameters but, remember I'm not sending these parameters in parentheses, but I'm making the call to this function to return me the value and interpret that and that other function so blind haskell this we mean that it is a functional language where the weight of values

it has the functions and not variables as in other languages. Well but I hope you be enjoying these tutorials and next video we'll be seeing more issues can give like, subscribe and see more tutorials.

To find new courses, subscribe. There will be no spam, promised :)

About the Author

foto de jotajotavm
José Javier Villena

Biography: Analyst-Programmer in different languages. Tutor PREMIUM platforms recognized worldwide as CodigoFacilito. Editor Cristalab articles. My YouTube Channel is sponsored by the ANAYA and LaTostadora publisher. I like to explain in detail and give several examples for the avoidance of doubt.