Haskell

Haskell 08: Lists functions Part 1 of 2

20 videos

111 minutes

Hello world as are my name is Jose, and I welcome this new tutorial course where you will learn Haskell different list management functions; well then we will do it in 2 videos because we several, so that the video not be so extensive and have the easiest data; then the first thing we do is a 'let list = [1,2,3,4,5,6,7,8,9]' list

and now if I call the list as I get all values, now we will see different functions, if I want to know how many elements here is my list, as long it is, then I call the 'lenght list' and tells me he has 7 elements, there are the seven: remember it is not the same 7 that the index; and know how to throw an index list if I put here !! 7 gives me an error rate in July there is no serious last list !! 6 and there if it's working,

then well with 'lenght' function tells me the items you have a list, if I had 'let listaDeLista = [[ 'a', 'b'], [ 'c', 'd']]' I want to know what the length of 'lenght listaDelista' I will leave that there are 2 elements, perfect; what happens is that your see are two different lists internal within a list, we have seen a 'lenght' function to know the length, very useful to roam around or anything we want to do;

Now we will see more features then for example if I have the list [1,2,3,4,5,6,7,8,9] and the first element I want to know what I do so, I do 'list head' and it is as if making reference to the head, which is spearheading the list is this, and if I want to see the body of the list all the rest make a 'tail list' and I get [2,3,4,5,6,7,8] all that is not the head, from the second to the end, so here divide

the head of the list of all the body with 'head' and 'tail'; well I can also do the same but in reverse if I want to know the last item in the list, because I put 'last list' and I get the last 7 and if I want to see everything there in the top of the list but to get to the end because I put a 'init list' and I get everything except the last, so these two 'last', 'init' are the inverses of these two 'head', 'tail' with head I see the first

and 'tail' I see the rest and 'last' last and 'init' the rest; well, well, this was the video for this time to see how to use different functions depending on the components that are taking place now for the next video we will see more and 2 functions as do also list calculations, but I hope you're enjoying it can give you like, share and subscribe and see on these videos.

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.