If you add the 00:00 timestamp to the description, TH-cam will create chapters allowing viewers to find the topic they want on the video's progress bar. Edit: He's since made the update, so there's no need for people to pile on the "second"ing.
Afonso Matos Thank you for all the great input on the video! Sorry I can't respond to you directly because you don't have a Google+ account, or for what ever reason TH-cam has decided. Your points are great and very much appreciated. My main goal here was to cover all of the topics that confuse people about Haskell so that they could easily transfer to a confusing book and understand everything. The script I work off of is basically the list of topics you see in the description. I look at what i want to remember to cover and write code out of my head. I basically set a timer for 2 1/2 hours and cover as much as I can knowing that I'll be able to edit that down to about an hour long video. I know I missed a couple things, and I'm sorry about that, but I figure if I can cover 90% of the basic syntax that that should be enough. I hope that all makes sense. Again thank you for pointing out how I can improve while helping others :)
Derek Banas Could you answer my 3rd question? 3) Can you give me any tips as a 15 years-old programmer and wanna-be professional game developer? I started programming watching your Javascript and Java tutorials, so I am very grateful to you , thanks once again!
Afonso Matos I knew a guy that got a job at EA many years ago. He went on to work for a couple other game companies. He was one of the best programmers I have ever met. The best would be to strengthen your problem solving abilities. Get good at understanding and creating optimized algorithms. Strengthen your math skills. Programming at high levels is all about getting very good at problem solving. I want to focus more on these skills. That is why I started teaching the languages again with a special focus on languages that help people get better at programming.
+Afonso Matos Hi Alfonso, my advice to any wanna-be game developer would be to learn some low-level languages e.g. C++, C, Java, and C# (in that order if you can). I'd also recommend getting a degree - preferably a good games degree. For example I'm doing a course in Computer Games Programming which focusses a lot on game programming. It's not essential though. If not, do get a degree - Computer Science would be just as good. Finally, start working on a portfolio - create a website and make videos of projects you've created. Hope that helps and feel free to ask me any other questions :)
That explanation of how the recursive factorial function worked around 36:30 was beautifully explained, much better than my Programming Languages professor has ever explained recursion. I've learned Ruby, Prolog, Scala, and now Haskell in that class and your videos on those languages have been an enormous help to me.
One of the best resources for Haskell on internet. Explained with such a clear and lucid understanding that even the lay man can well grasp all the arcane concepts. The voice clarity is great and adds to the charm. Thank you for such a great content !!
Sorry I couldn't respond to you directly Manuel Lehertu. I have been programming for 30 years. I have done a ton of consulting work which requires knowing a bunch of languages. I probably learned most of them because I often donate time to help students with research projects at local universities.
Fantastic tutorial! I could have spent days perusing articles, books, and the like only to come up with nothing more than a few trivial lines of code at best. You have brought the whole thing about Haskell into the light. I have a challenge to complete for a job interview, and there is no way I could have completed it in time without your tutorial. Thank you so much Derek you rock!
75 minutes and they were worth it sooo much. Thank you for this video. You explained everything I could have imagined of. Unfortunately at my university they don‘t give such an overview. Very understandable, with good examples, exactly on point when it comes to giving necessary explaination. Must be the best learning video for a programming language I‘ve seen so far. Especially the vocabulary was very confident and without mistakes which made it great to listen to. My prof sometimes calls things the wrong way.
Hello Derek! I hope you read this: I have just watched your Haskell tutorial, and I have written some notes on typos, suggestions and other annotations (both from the Video and the CheatSheet) Your video was a pretty good introduction, I liked it a lot. I have a few questions for you: 1) Do you use autocompletion or edit the entire video ? 2) How are you able to talk non-stop? Do you follow a guide on what you're going to say? 3) Can you give me any tips as a 15 years-old programmer and wanna-be professional game developer? I love that you answer all the comments and help people who watch your videos and want some feedback. Keep up the good work! ===================================== ============== NOTES ================ ===================================== (I am not a native english speaker, so if you don't understand something, please ask) I thought these could be useful for you (don't ask me how) 0:03 - Hello! Let's go! 10:15 - (**) requires both numbers to be floatings, (^) is prefered for integral exponential > 2 ** 3 -- Both are coerced to floatings > (2 :: Integer) ** 3 -- Error > 2 ^ 3 -- 3 is coerced to an integral 10:38 - floor doesn't round up, it rounds down 11:15 - Why the parentheses in `not(True)` ? Seems unnecessary and confusing for beginners. 13:39 - I would expect you to declare the type of at least one list before jumping into their definitions. 15:52 - You forgot to mention the tail function 23:47 - Typo: listBiggerThen5 -> listBiggerThan5 (this is on the cheatsheet too) 29:56 - If I remember, you haven't said that strings are lists of characters yet. It might be confusing for a beginner to see `++` there. 35:39 - Integers seem more useful in this case, since the result can become enormous. 38:31 - Confusing explanation of the otherwise value. Just say that it's equal to True, therefore everything passes it. >> :t otherwise >> otherwise :: Bool 40:30 - What a mess, haha! You could check for the bigger values first. >> whatGrade age >> | age > 18 = "Go to college" >> | age > 14 = "High School" >> | age > 10 = "Middle School" >> | age > 6 = "Elementary school" >> | otherwise = "Kindergarten" 44:41 - I would use [x] and [x, y] but probably just a style preference. 54:03 - (->) has right precende, so no need for the parentheses in the type declaration (as it could also confuse the student). Also, this is a good time to explain currying in more detail (but maybe it would take too much time and there are more things to cover). 55:58 - Unnecessary parentheses. 56:43 - Worth mentioning that `case .. of .. ` pattern matches against a value, just like function pattern matching. 56:43 - Worth mentioning case of guards. 1:01:48 - "Error" seems pretty weird to me. Something like "Draw" or "Try again" would look better (as the type declaration requires the arguments to be from type RPS) 1:07:11 - You could introduce Type constructors. 1:16:08 - fibs = 1 : 1 : zipWith (+) fibs (tail fibs) 1:16:47 - Till next time!
it sounds like you should have made these notes to make your own video. i certainly was better off after watching this one than before i watched it. a lot of your corrections were for things that are the same from language to language. haskell isnt usually a first language, so these corrections would generally be inferred by the viewer.. if you really wanted to be helpful to someone, the notes probably would have been better addressed to the viewers than the author of the video. and certainly more brief than what you have posted. many of them are your own preferences and not required.
I've always been on a look out for a good Haskell tutorial that is easy to understand for someone coming from imperative programming. So, thank you! This is fantastic!
Notes: - functions can only start with small letters(is said later in video.) -At: 44:40 when he skips to: show xs, the complete line needs additional " ++ ". The line would look like this: getListItems (x:xs) = "first item " ++ show x ++ " and the rest are" ++ show xs - At 101:46 shoot _ _ = "Error", can only be reached if you use items in scope, twice. Doesn't catch bullet, but catches: shoot Rock Rock
You sir are a mind reader. Just yesterday I was thinking Haskell looks like a pretty interesting language, It would be cool if Derek did a video on it... and here it is lol
Kevin Baez It is gaining a lot of interest lately. It is a very powerful and fast language. Local universities are using it a lot lately and i was lucky to be able to help them.
First of all thank you very much for the video. A head start is just what I needed. :) I want to ask you (or anyone reading this) about the Fibonacci series example. I've been thinking about it and think that you are kinda wrong in the Fibonacci example. I mean, it works, but what is not true is that fib = 1 and tail fib = 1 at first, but fib = [1,1] and tail fib = [1]. Afterwards fib is longer and equals [1,1,2] and fib tail [1,2] and so on. When one zips [1,2,3] with [4,5] one becomes [(1,4),(2,5)]. If fib is to be, let's say [1,1,2,3,5,8,13] than zip fib (tail fib) becomes zip [1,1,2,3,5,8,13] [1,2,3,5,8,13] and that is [(1,1),(1,2),(2,3),(3,5),(5,8),(8,13)] not taking into account the last member in the fib list. Then you add the pairs in the tuples and you get the list. I mean, it's mostly what you said, only that fib and tail fib are not equal to 1 or 2 but are the lists (which actually makes much more sense knowing how lists and the tail method works).
+Smalde yes I think you've got it correct it's like: [1, 1, 2, 3..] + + + ... [1, 2, 3..] I think he means that the first value is 1 You can also write it like : fibs = 1 : 1 : zipWith (+) fibs (tail fibs) or put this at the top of your file: {-# LANGUAGE ParallelListComp } and try: fibs' = 1 : 1 : [a+b | a
The trick is laziness. If you call fib you only receive the NEXT fib not the whole list... That is why it works as he has explained it. If you want more than one value from the list you must use 'take' e.g. take 5
Keith Maynard no, fib is always a reference to the entire list. the laziness just means that the entire list isn't computed until needed. but it's "still there" the entire time. if you try to print fib to the console your program won't terminate since it'd be trying to output an infinite list.
Thank you so much for correcting my whopper :). I did run fib and had to escape out of a large stream of beautiful numbers :). I was forced to re-examine the code. Do you understand which mechanism iterates through the (a,b) tuples? Seems to me that the zip fib (tail fib) recomputes some values. How does the concatenation operator 'remove' these duplicates?
Excellent work - as a longtime programmer I am very happy about your pace and assumptions about prior experience - too many tutorials will stop to explain something like "what is mod?" rather than just showing what mod looks like in Haskell. Also +1 for clean edits and bookmarks :)
I really enjoyed this video. You've got a knack for boiling complexity down to simplicity, and I appreciated the pace at which you moved through the topics. I would love to see a follow-on video talking about the boundaries of pure and impure code, monads, state, other types of IO, etc... I'm at the point where I feel somewhat fluid with the language in the pure functional domain, but struggle translating that into real-world applications.
Min 44:00. (×:[]) is the same as ([x]) so technichally you are covering the pattern match for a singleton. And not " your list starts with". Maybe you meant (x:[_]). Correct me if i am wrong.
Hey Derek, I just came here to thank you that because 6 years ago your this video helped me pass the programming languages exam that eventually helped me graduate from my masters degree. A functional language was a requirement and I chose Haskel because you had the video for it and it helped me solve the problems in the exam.
Great video. Question: At 54:08 for the getAddFunc, the definition (line 7) says it takes one integer but on line 9, it looks like its taking two arguments (x and y). Is y the function that is being returned?
y is the argument for the function being returned by getAddFunc. It looks a little confusing but it makes perfect sense when you get used to it. The "pattern" is called currying. You can do it in classical languages as well. For example in javascript it would be getAddFunc = x => y => x + y and you would invoke it like this getAddFunc(3)(4)
Just for clarification at 17:05, product calculates the product of all the numbers in the list, not necessarily the least common multiple of all the numbers in the list (that would be the smallest number that all the numbers in the list divide evenly)
51:16 "Because we're angry and they shouldn't have passed in garbage into our function" 😂 Such a perfect delivery, also I'm doing this tutorial in 2023 and I'm loving it, your method of explaining these concepts is excellent!"
I think I am going to watch this kind of videos of yours every time I get started with a new language. The Kotlin one was sooo helpful. This one is good, too, even though I have to say the first part was a bit slow for me, while the second part was definitely too fast (custom types etc). You're a great explainer anyway. What I'm trying to learn from you is also how to be so clear when teaching, as I might be interested in teaching.
I would like to thank you for posting this amazing and comprehensive tutorial. I was struggling to understand Haskell through other tutorials, yet you made things a lot clear. Thank you very much =D
I cannot stress how useful this video was! I am an intermediate advanced programmer and just wanted to know a few things about haskell coz I have this course at university taught by two bozos. This man covered it all. and beautifully! Thanks so much Derek Bhai. On a side note, wheres your accent from? love the voice
Hello Derek, how are you? Thank you very much for this Haskell tutorial! Right now, I'm taking half a college period programming in Haskell, and this is exactly what I needed to get through. Even if I don't have a chance to use Haskell again, it is a great language to improve your programming skills, especially expressivity. Just so you know, I've watched it till the very end. Great job! 😄
You are a legend, this video saved my life. Because Haskell uses so much recursion, is it a smart idea to use tail recursion for all/ most of my functions?
most times you don't need to recurse explicitly. you can use stuff like foldl/r and fmap that encapsulate a lot of the most common ways to recurse. it gives you more readable code and saves you from writing the same thing over and over again.
I could never have imagined how amazing haskell is... I laughed out of surprise a few times when I realized the things you can do. I think my life changed today.
Thank YOU for saving me hours and hours and hours of my life. I love bucky over at thenewboston dont get me wrong but you can say in 10 minutes what takes that boy 10 hours.
@@freshprince4552 I said from the outset that I love bucky and his channel. I've spent hours and hours of my life over there and im very grateful. BUT, as stated previously, this guy "can say in 10 minutes what takes that boy 10 hours". Thats just the truth.
Really nice tutorial that covers a lot of Haskell ground. Great that you showed how powerful the language is and gives a lot of insight of how it might differ from OOP languages and what we can reuse there. Thanks a lot
Great video! thank you very much for making this and explaining everything so well. Are you planning on covering Monads and such in a future video? And is there a chance for you to do an Erlang or Elixir tutorial?
Yes I also thought that and tried it. It can indeed. It's funny though, I was able to work that out without really understanding the last example at all...
Damn, you sure do cover a lot of languages, and the videos are exceptionally informative. The only language I looked for that you haven't covered is ActionScript 3.0, although that language is a bit different in my opinion from other OO languages. AS was probably the first language I ever tried programming in when I was around 11-12 trying to make flash games. 8 years later and I know Java, C++ and some Lua(thanks to your Lua tutorial) and still want to learn AS.
Most popular programming languages are C based i.e. C++, C#, Java, ObjectiveC, PHP, JavaScript etc. What he really learned is how to write code. Languages are just tools, once you understand the logic of how to program, learning a new language is just learning the different syntax. Plus, he's smarter than your average haha
haskell doesnt fit into the learning a new language is just learning the different syntax basket, unless you're talking about functional programming languages.. I actually think the question as it is is valuable, and the answer Derek provided was equally valuable.
For the benefit of others, Derek's response, which could not be included in this branch of conversation "Sorry I couldn't respond to you directly Manuel Lehertu. I have been programming for 30 years. I have done a ton of consulting work which requires knowing a bunch of languages. I probably learned most of them because I often donate time to help students with research projects at local universities."
It amazes me how many constructs from Haskell have found their way to other languages (I know for sure Julia, Python, Javascript, and even C# nowadays contain a lot of Haskell ideas). Still, Haskell seems to be still ahead in some aspects if you ask me. For example, the enum type definition and pattern matching function definition around 1:01:10. I'm amazed
Hi, I had the same problem and I was searching for an answer, maybe others will have too. I used Visual Studio Code insted and it worked in his terminal.
I couldn't understand the Fibonacci series. fib is a List right so how can you add a value to the list because you are saying a->fib summed with the tail of that same list i.e. b. P.S: Loved the video, Helped a lot.
The reason it works is because your not directly adding values to whole lists, you're isolating pairs of values (one from each list) with zip then adding them and sticking them into the list you're taking from (recursion). For example: In the first pass; the first element from the initial 'fib' list ('a' / 1) gets paired into a tuple with the first element of the 'tail fib' list ('b' / also 1) which is everything in the initial 'fib' list expect from 'a', i.e. the second element. This tuple is shown in (a,b) which would be (1,1) in the first pass. These two values are then added by the code at the start of the list comprehension - (... [a + b | ...]) and this value (2) becomes the value for the first pass and is immediately added to the initial 'fib' list, making it [1,1,2]. This is done again and again; with each pass matching the two consecutive values from the 'fib' list as its generated, adding them together, and then placing it into the list (which makes 'fib' as a function an infinite list generator). Hope this helps!
The key is Haskell's lazy evaluation. It only needs to know how to continue the list to make the list, and the zip always reads a little behind the new values, so will never run out. As this plan for how the list is constructed is part of how the list was created, it's already defined even when it's not yet evaluated.
Thank you for this tutorial. I've followed you for years; I think you have one of the best tutorials on TH-cam. I'm learning Haskell for my PhD program research. I had to buy one of your Udemy classes to refresh on my python. You are the best. If you every make a tutorial on the Haskell Yampa package, then that would be awesome.
+Ben Curtis fib actually refers to the list [1,1], so the first zip would be (zip [1,1] [1]) so 1+1 is 2 which is added to fib. The 2 lists are of different lengths, but this is okay because of how zip is implemented. Also these two lists are recursively referring to fib, so zip will actually see that the lists are changing! The next zip is (zip [1,1,2] [1,2]), but it is not a separate call to zip. It is actually the same call to zip! This is because the inputs to zip were both recursively modified. So after zip does 1+1 first, it "magically" sees 1+2, then 2+3, then 3+5, and so on. Of course all of this is lazily computed so if you try (take 2 fib), zip is never actually called. You can verify this by (import Debug.Trace) and trying (take 2 $ 1:1:[a+b | (a,b)
You're welcome :) Yes for best results it is best to pause a lot as you type in the code and practice. I guess that is my niche? I'm glad you liked it.
Hi Derek. A confusion with the last example: You say at the beginning of the second iteration of the recursive definition that the list is now [1,1,2] but that the second time through fib is the second element. How come fib isn't [1,1,2]? On a side note: great video.
fib is always a reference to the entire list. I think some confusion occurs because the video made it sound like fib and tail fib actually change value. they don't. I think it's easier to visualize what's happening if you always view fib as the complete infinite list of fibonacci numbers, and what happens in the definition is that you simply say "the first element is 1, the second element is 1, and the rest of the list consists of a + b, where b is the element that comes after a (that's what zip fib (tail fib) gives you)".
I am also really confused on this. I see it as more of a list inside lists thing, like building a stack. That way of looking at it does give the right answer, but it leaves me confused as to how the compiler knew when it had reached the bottom of the stack. So the explanation presented by Derek must be right
I agree with Kai, picture adding 2 arrays together is better to understand the last example [1,1,2,3,5] + [1,2,3,5,8] also notice how internally your computer itself calculates the list completely differently compared how you read haskell syntax else you would be calculating the same numbers over and over again just to add one in the end.
Where is the `last` function defined? Is it a general function that can be used anywhere? And what does it do, technically? `last` obviously is not getting the last value of `fib` because `fib` is either infinite or a simple number as it is used in the case of a. Or if `fib` is the current iteration of `fib` how is it used as a number for `a`. I would have expected `(a,b)
I assume it would be opening the ghci where you have your files. so first you do cd myFolder1/myHaskellFolder then ghci and then you can just type :l myfile.hs or just :l myfile hope this is helping
there was IO with monadic do-notation and list comprehension (which is just syntactic sugar for the list monad), so there was some stuff there, only they didn't mention the m-word :)
eNSWE And a good portion of people tend to give up on Haskell simply because no one seems to be able to explain what monads are and how they work to a complete beginner without delving into unnecessary complexity like category theory and making them even more confused.
well monads are a fairly complex, but first and foremost very very very abstract, so explaining them to beginners takes time. I don't think it's even possible to explain monads to someone with no prior knowledge in one video like this. it takes exposure and several different explanations over a few days/weeks. it's like asking someone to explain reactive asynchronous design patterns for scalable systems in the cloud with no prior knowledge of programming in a 1h video. it simply can't be done.
eNSWE And that's why Haskell will probably only a be an intellectual meandering from smart people trying to impress themselves with their own intellect as oppsed to a general purpose language that could be used because of its benefits over other types of languages.
what? that makes no sense at all. first and foremost, haskell IS general purpose language that is used for a wide variety of purposes (facebook among others are using it in production code). secondly, it's not like monads are a haskell invention. it's a mathematical structure, same as a group or a ring. C# has monads. python does. C++ does. ruby does. EVERY turing complete language has monads. the thing is that few languages recognize them in the type system. C# has a kind of hacky way of doing it via LINQ. the point is, monads don't exist in haskell because someone wrote a Monad type-class. monads exist because there are types that have monadic structure. recognizing that isn't realted at all to haskell, it's inherent in the structure of lists, of nullable types, of tasks/futures etc. in a programming context, functions over monads is basically a design pattern. in haskell, the language designers have realized that monadic types are REALLY useful, and so there has been some syntactic sugar added to the language to make dealing with polymorphic monad types easier. it's kind of like how you CAN do OOP in C. you just gotta write some code to get v-tables and to get inheritance right, and you gotta solve the diamond problem and stuff like that, but no one is stopping you. it's just that more pure OOP languages make it MUCH easier by adding keywords and other language constructs that make declaring and using classes/objects much easier.
At 53:15 it doesn't make sense: getAddFunc takes a single argument (an Integer) and returns a function (that takes an Integer and returns an Integer) But right after (line 9) he defines getAddFunc with a different signature! (two input arguments) I undesrtand it's what other languages call "partial" (like "functools.partial" in Python) but it's not explicit hence confusing. I'd expect Haskell to choke on "getAddFunc x y = x + y" because there's no signature matching two input arguments.
Derek Banas thank you very much for the effort you putting in making all these languages, they are really helpful, keep up the good work and wish u all the best
The errors the Haskell interpreter throws are some of the most pedantic and nonsensical I have ever seen. To me this is the Dark Souls of programming :)))) hard but fun in a weird way
Excellent explanations even after 7 years. Thank you for a great video. This made me understand the haskell books I've been trying to learn for 2 years.
I learned more in 3 hours while coding and (generously) commenting along to this video than I would have in 8 weeks of a college course. Thanks so much!
Derek... you're the coding saint. Thank you really. Been watching your videos every time I'm lost, and every time I find the answer or at least a way to find it on my own.
I enjoyed your tutorial. I'm new to programming, so reading typical tutorials is a bit tedious. It's really useful to have shortcuts like this. Now I feel like I'm ready to read some code about Yoneda written in Haskell. Thanks!
Thank you so much. Fantastic work! This video was so helpful to get started! Functional programming requires you to think so differently! Your COBOL tutorial was really good too.
there's something wrong with fib explanation: tail fib ist not 2 but [1,2] so when you do zip with fib you'll get [(1,1)(1,2)]. Then add them you'll get 2,3 and then conc them to 1:1 -> 1:1:2:3
at around 10:30 you said round, ceiling and floor all round "up". I know that is not what you meant, but just to clarify for others: "round" rounds to nearest int (up or down), "ceiling" rounds up, "floor" rounds down.
Quite good. I would probably mention the appropriate terms after each example using that concept, like "pattern-matching" (used for deconstruction of tuples), "type class", "this is called a list comprehension", etc.
Thank you so much. I found this "in the last hour" for our class but most things are very clear now. May need Haskell for the future..who knows. Great job!
Learn in One Videos for Every Programming Language
Subscribe to Bookmark them: bit.ly/2FWQZTx
C++ : th-cam.com/video/Rub-JsjMhWY/w-d-xo.html
Python : th-cam.com/video/N4mEzFDjqtA/w-d-xo.html
Java : th-cam.com/video/n-xAqcBCws4/w-d-xo.html
PHP : th-cam.com/video/7TF00hJI78Y/w-d-xo.html
MySQL : th-cam.com/video/yPu6qV5byu4/w-d-xo.html
JavaScript : th-cam.com/video/fju9ii8YsGs/w-d-xo.html
C# : th-cam.com/video/lisiwUZJXqQ/w-d-xo.html
HTML5 : th-cam.com/video/kDyJN7qQETA/w-d-xo.html
CSS3 : th-cam.com/video/CUxH_rWSI1k/w-d-xo.html
JQuery : th-cam.com/video/BWXggB-T1jQ/w-d-xo.html
TypeScript : th-cam.com/video/-PR_XqW9JJU/w-d-xo.html
ECMAScript : th-cam.com/video/Jakoi0G8lBg/w-d-xo.html
Swift : th-cam.com/video/dKaojOZ-az8/w-d-xo.html
R : th-cam.com/video/s3FozVfd7q4/w-d-xo.html
Haskell : th-cam.com/video/02_H3LjqMr8/w-d-xo.html
Handlebars : th-cam.com/video/4HuAnM6b2d8/w-d-xo.html
Bootstrap : th-cam.com/video/gqOEoUR5RHg/w-d-xo.html
Rust : th-cam.com/video/U1EFgCNLDB8/w-d-xo.html
Matlab : th-cam.com/video/NSSTkkKRabI/w-d-xo.html
Arduino : th-cam.com/video/QO_Jlz1qpDw/w-d-xo.html
Crystal : th-cam.com/video/DxFP-Wjqtsc/w-d-xo.html
Emacs : th-cam.com/video/Iagbv974GlQ/w-d-xo.html
Clojure : th-cam.com/video/ciGyHkDuPAE/w-d-xo.html
Shell : th-cam.com/video/hwrnmQumtPw/w-d-xo.html
Perl : th-cam.com/video/WEghIXs8F6c/w-d-xo.html
Perl6 : th-cam.com/video/l0zPwhgWTgM/w-d-xo.html
Elixir : th-cam.com/video/pBNOavRoNL0/w-d-xo.html
D : th-cam.com/video/rwZFTnf9bDU/w-d-xo.html
Fortran : th-cam.com/video/__2UgFNYgf8/w-d-xo.html
LaTeX : th-cam.com/video/VhmkLrOjLsw/w-d-xo.html
F# : th-cam.com/video/c7eNDJN758U/w-d-xo.html
Kotlin : th-cam.com/video/H_oGi8uuDpA/w-d-xo.html
Erlang : th-cam.com/video/IEhwc2q1zG4/w-d-xo.html
Groovy : th-cam.com/video/B98jc8hdu9g/w-d-xo.html
Scala : th-cam.com/video/DzFt0YkZo8M/w-d-xo.html
Lua : th-cam.com/video/iMacxZQMPXs/w-d-xo.html
Ruby : th-cam.com/video/Dji9ALCgfpM/w-d-xo.html
Go : th-cam.com/video/CF9S4QZuV30/w-d-xo.html
Objective C : th-cam.com/video/5esQqZIJ83g/w-d-xo.html
Prolog : th-cam.com/video/SykxWpFwMGs/w-d-xo.html
LISP : th-cam.com/video/ymSq4wHrqyU/w-d-xo.html
Express : th-cam.com/video/xDCKcNBFsuI/w-d-xo.html
Jade : th-cam.com/video/l5AXcXAP4r8/w-d-xo.html
Sass : th-cam.com/video/wz3kElLbEHE/w-d-xo.html
I guess Im pretty off topic but does anybody know a good place to watch new series online ?
@Chase Jefferson I use Flixzone. Just search on google for it :)
@Kai Marcus Definitely, been watching on Flixzone for months myself :D
@Kai Marcus Thanks, I went there and it seems like they got a lot of movies there =) Appreciate it!!
@Chase Jefferson happy to help =)
If you add the 00:00 timestamp to the description, TH-cam will create chapters allowing viewers to find the topic they want on the video's progress bar.
Edit: He's since made the update, so there's no need for people to pile on the "second"ing.
would be very helpful
I second this
I third this
I fourth this
I fifth this
Afonso Matos Thank you for all the great input on the video! Sorry I can't respond to you directly because you don't have a Google+ account, or for what ever reason TH-cam has decided. Your points are great and very much appreciated. My main goal here was to cover all of the topics that confuse people about Haskell so that they could easily transfer to a confusing book and understand everything. The script I work off of is basically the list of topics you see in the description. I look at what i want to remember to cover and write code out of my head. I basically set a timer for 2 1/2 hours and cover as much as I can knowing that I'll be able to edit that down to about an hour long video. I know I missed a couple things, and I'm sorry about that, but I figure if I can cover 90% of the basic syntax that that should be enough. I hope that all makes sense. Again thank you for pointing out how I can improve while helping others :)
Derek Banas Could you answer my 3rd question?
3) Can you give me any tips as a 15 years-old programmer and wanna-be professional game developer?
I started programming watching your Javascript and Java tutorials, so I am very grateful to you , thanks once again!
Afonso Matos I knew a guy that got a job at EA many years ago. He went on to work for a couple other game companies. He was one of the best programmers I have ever met. The best would be to strengthen your problem solving abilities. Get good at understanding and creating optimized algorithms. Strengthen your math skills. Programming at high levels is all about getting very good at problem solving. I want to focus more on these skills. That is why I started teaching the languages again with a special focus on languages that help people get better at programming.
+Derek Banas You probably already know about this website, but Project Euler is really good for getting better at problem solving and programming.
+Afonso Matos Hi Alfonso, my advice to any wanna-be game developer would be to learn some low-level languages e.g. C++, C, Java, and C# (in that order if you can). I'd also recommend getting a degree - preferably a good games degree. For example I'm doing a course in Computer Games Programming which focusses a lot on game programming. It's not essential though. If not, do get a degree - Computer Science would be just as good. Finally, start working on a portfolio - create a website and make videos of projects you've created. Hope that helps and feel free to ask me any other questions :)
GOOGLE+? Ewwww
The dislikes were from university lecturers
still great after 6 years. thank you very much
Thank you :) I'm very happy that I could help
That explanation of how the recursive factorial function worked around 36:30 was beautifully explained, much better than my Programming Languages professor has ever explained recursion. I've learned Ruby, Prolog, Scala, and now Haskell in that class and your videos on those languages have been an enormous help to me.
+mitchmitch555 Thank you for the compliment :) I'm glad I could clear it up
One of the best resources for Haskell on internet. Explained with such a clear and lucid understanding that even the lay man can well grasp all the arcane concepts. The voice clarity is great and adds to the charm. Thank you for such a great content !!
Thank you for the nice compliments :)
Sorry I couldn't respond to you directly Manuel Lehertu. I have been programming for 30 years. I have done a ton of consulting work which requires knowing a bunch of languages. I probably learned most of them because I often donate time to help students with research projects at local universities.
Wow
Derek Banas Really you're a great man.
Sir, will you make a tutorial for Assembly Programming Language.
Rafsanjani Muhammod Thank you for the nice compliment :) Sure I can cover assembler. I'd love to make a fun electronics tutorial as well.
Derek Banas yes,yes electronics tutorial please
Derek Banas Microcontrollers could be a really interesting topic!
Fantastic tutorial! I could have spent days perusing articles, books, and the like only to come up with nothing more than a few trivial lines of code at best. You have brought the whole thing about Haskell into the light. I have a challenge to complete for a job interview, and there is no way I could have completed it in time without your tutorial. Thank you so much Derek you rock!
Thank you very much :) I did my best with it. Best of luck on your interview.
22:20 Divisible by 13 AND divisible by 9, not OR. :)
Amazingly to-the-point and clear coverage of some very difficult material. Thanks!
Thank you very much :)
75 minutes and they were worth it sooo much. Thank you for this video. You explained everything I could have imagined of. Unfortunately at my university they don‘t give such an overview. Very understandable, with good examples, exactly on point when it comes to giving necessary explaination.
Must be the best learning video for a programming language I‘ve seen so far. Especially the vocabulary was very confident and without mistakes which made it great to listen to. My prof sometimes calls things the wrong way.
Hello Derek! I hope you read this:
I have just watched your Haskell tutorial, and I have written some notes on typos, suggestions and other annotations (both from the Video and the CheatSheet)
Your video was a pretty good introduction, I liked it a lot. I have a few questions for you:
1) Do you use autocompletion or edit the entire video ?
2) How are you able to talk non-stop? Do you follow a guide on what you're going to say?
3) Can you give me any tips as a 15 years-old programmer and wanna-be professional game developer?
I love that you answer all the comments and help people who watch your videos and want some feedback.
Keep up the good work!
=====================================
============== NOTES ================
=====================================
(I am not a native english speaker, so if you don't understand something, please ask)
I thought these could be useful for you (don't ask me how)
0:03 - Hello! Let's go!
10:15 - (**) requires both numbers to be floatings, (^) is prefered for integral exponential
> 2 ** 3 -- Both are coerced to floatings
> (2 :: Integer) ** 3 -- Error
> 2 ^ 3 -- 3 is coerced to an integral
10:38 - floor doesn't round up, it rounds down
11:15 - Why the parentheses in `not(True)` ? Seems unnecessary and confusing for beginners.
13:39 - I would expect you to declare the type of at least one list before jumping into their definitions.
15:52 - You forgot to mention the tail function
23:47 - Typo: listBiggerThen5 -> listBiggerThan5 (this is on the cheatsheet too)
29:56 - If I remember, you haven't said that strings are lists of characters yet. It might be confusing for a beginner to see `++` there.
35:39 - Integers seem more useful in this case, since the result can become enormous.
38:31 - Confusing explanation of the otherwise value. Just say that it's equal to True, therefore everything passes it.
>> :t otherwise
>> otherwise :: Bool
40:30 - What a mess, haha! You could check for the bigger values first.
>> whatGrade age
>> | age > 18 = "Go to college"
>> | age > 14 = "High School"
>> | age > 10 = "Middle School"
>> | age > 6 = "Elementary school"
>> | otherwise = "Kindergarten"
44:41 - I would use [x] and [x, y] but probably just a style preference.
54:03 - (->) has right precende, so no need for the parentheses in the type declaration (as it could also confuse the student). Also, this is a good time to explain currying in more detail (but maybe it would take too much time and there are more things to cover).
55:58 - Unnecessary parentheses.
56:43 - Worth mentioning that `case .. of .. ` pattern matches against a value, just like function pattern matching.
56:43 - Worth mentioning case of guards.
1:01:48 - "Error" seems pretty weird to me. Something like "Draw" or "Try again" would look better (as the type declaration requires the arguments to be from type RPS)
1:07:11 - You could introduce Type constructors.
1:16:08 - fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
1:16:47 - Till next time!
it sounds like you should have made these notes to make your own video. i certainly was better off after watching this one than before i watched it. a lot of your corrections were for things that are the same from language to language. haskell isnt usually a first language, so these corrections would generally be inferred by the viewer..
if you really wanted to be helpful to someone, the notes probably would have been better addressed to the viewers than the author of the video. and certainly more brief than what you have posted. many of them are your own preferences and not required.
You really should work on how to use feedback you get.
PS: I know you're just some random dude.
Best Haskell video after 7 years as well .thanks
my boi derek banas is unstoppable :)
Thank you :) Your channel is looking awesome like always!
51:21 "Because we are angry and they shouldn't have passed garbage into our function." LOL. As always very good tutorial btw.
Thank you :) I'm glad you enjoyed it
Just about to write this exact comment; but you've beat me to it! I agree; good tutorial.
I've always been on a look out for a good Haskell tutorial that is easy to understand for someone coming from imperative programming.
So, thank you! This is fantastic!
+Darshan Parajuli You're very welcome :) I'm glad you liked it.
Notes:
- functions can only start with small letters(is said later in video.)
-At: 44:40 when he skips to: show xs, the complete line needs additional " ++ ". The line would look like this: getListItems (x:xs) = "first item " ++ show x ++ " and the rest are" ++ show xs
- At 101:46 shoot _ _ = "Error", can only be reached if you use items in scope, twice. Doesn't catch bullet, but catches: shoot Rock Rock
You sir are a mind reader. Just yesterday I was thinking Haskell looks like a pretty interesting language, It would be cool if Derek did a video on it... and here it is lol
Kevin Baez It is gaining a lot of interest lately. It is a very powerful and fast language. Local universities are using it a lot lately and i was lucky to be able to help them.
First of all thank you very much for the video. A head start is just what I needed. :)
I want to ask you (or anyone reading this) about the Fibonacci series example. I've been thinking about it and think that you are kinda wrong in the Fibonacci example. I mean, it works, but what is not true is that fib = 1 and tail fib = 1 at first, but fib = [1,1] and tail fib = [1]. Afterwards fib is longer and equals [1,1,2] and fib tail [1,2] and so on.
When one zips [1,2,3] with [4,5] one becomes [(1,4),(2,5)].
If fib is to be, let's say [1,1,2,3,5,8,13] than zip fib (tail fib) becomes zip [1,1,2,3,5,8,13] [1,2,3,5,8,13] and that is [(1,1),(1,2),(2,3),(3,5),(5,8),(8,13)] not taking into account the last member in the fib list. Then you add the pairs in the tuples and you get the list.
I mean, it's mostly what you said, only that fib and tail fib are not equal to 1 or 2 but are the lists (which actually makes much more sense knowing how lists and the tail method works).
+Smalde yes I think you've got it correct it's like:
[1, 1, 2, 3..]
+ + + ...
[1, 2, 3..]
I think he means that the first value is 1
You can also write it like :
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
or put this at the top of your file:
{-# LANGUAGE ParallelListComp }
and try:
fibs' = 1 : 1 : [a+b | a
Thanks for the comment, I was really confused about that part.
The trick is laziness. If you call fib you only receive the NEXT fib not the whole list... That is why it works as he has explained it. If you want more than one value from the list you must use 'take' e.g. take 5
Keith Maynard no, fib is always a reference to the entire list. the laziness just means that the entire list isn't computed until needed. but it's "still there" the entire time. if you try to print fib to the console your program won't terminate since it'd be trying to output an infinite list.
Thank you so much for correcting my whopper :). I did run fib and had to escape out of a large stream of beautiful numbers :). I was forced to re-examine the code. Do you understand which mechanism iterates through the (a,b) tuples? Seems to me that the zip fib (tail fib) recomputes some values. How does the concatenation operator 'remove' these duplicates?
Excellent work - as a longtime programmer I am very happy about your pace and assumptions about prior experience - too many tutorials will stop to explain something like "what is mod?" rather than just showing what mod looks like in Haskell. Also +1 for clean edits and bookmarks :)
I really enjoyed this video. You've got a knack for boiling complexity down to simplicity, and I appreciated the pace at which you moved through the topics. I would love to see a follow-on video talking about the boundaries of pure and impure code, monads, state, other types of IO, etc... I'm at the point where I feel somewhat fluid with the language in the pure functional domain, but struggle translating that into real-world applications.
Thank you :) Yes I definitely need to make a tutorial just about the technical aspects of writing functional code
Min 44:00. (×:[]) is the same as ([x]) so technichally you are covering the pattern match for a singleton. And not " your list starts with". Maybe you meant (x:[_]). Correct me if i am wrong.
Hey Derek, I just came here to thank you that because 6 years ago your this video helped me pass the programming languages exam that eventually helped me graduate from my masters degree.
A functional language was a requirement and I chose Haskel because you had the video for it and it helped me solve the problems in the exam.
Thank you for taking the time to tell me I helped :) Congratulations on your Masters!!!
Great video. Question: At 54:08 for the getAddFunc, the definition (line 7) says it takes one integer but on line 9, it looks like its taking two arguments (x and y). Is y the function that is being returned?
y is the argument for the function being returned by getAddFunc. It looks a little confusing but it makes perfect sense when you get used to it. The "pattern" is called currying. You can do it in classical languages as well. For example in javascript it would be
getAddFunc = x => y => x + y
and you would invoke it like this
getAddFunc(3)(4)
@@insertoyouroemail That makes sense. Thank you
Just for clarification at 17:05, product calculates the product of all the numbers in the list, not necessarily the least common multiple of all the numbers in the list (that would be the smallest number that all the numbers in the list divide evenly)
10:44 floor rounds down, and I don't think you mentioned (explicitly) here that round converts to int (although you did say it a minute earlier or so)
51:16 "Because we're angry and they shouldn't have passed in garbage into our function" 😂 Such a perfect delivery, also I'm doing this tutorial in 2023 and I'm loving it, your method of explaining these concepts is excellent!"
Set replay speed to 0.5 and you might have a chance to code along.
i set the speed to 1.25
Do you know the pause feature?
Or. Or... Hear me out... use vim.
I think I am going to watch this kind of videos of yours every time I get started with a new language.
The Kotlin one was sooo helpful. This one is good, too, even though I have to say the first part was a bit slow for me, while the second part was definitely too fast (custom types etc).
You're a great explainer anyway. What I'm trying to learn from you is also how to be so clear when teaching, as I might be interested in teaching.
Thank you for the compliment :) I think I have gotten better over time through pure repetition
I would like to thank you for posting this amazing and comprehensive tutorial. I was struggling to understand Haskell through other tutorials, yet you made things a lot clear.
Thank you very much =D
That's great! I'm happy I could help 😁
I cannot stress how useful this video was! I am an intermediate advanced programmer and just wanted to know a few things about haskell coz I have this course at university taught by two bozos. This man covered it all. and beautifully! Thanks so much Derek Bhai. On a side note, wheres your accent from? love the voice
24:27 You could've explained what the second parameter does in foldl.
It's kinda simple if you try using it tho.
++
Hello Derek, how are you?
Thank you very much for this Haskell tutorial! Right now, I'm taking half a college period programming in Haskell, and this is exactly what I needed to get through. Even if I don't have a chance to use Haskell again, it is a great language to improve your programming skills, especially expressivity.
Just so you know, I've watched it till the very end. Great job! 😄
You are a legend, this video saved my life.
Because Haskell uses so much recursion, is it a smart idea to use tail recursion for all/ most of my functions?
most times you don't need to recurse explicitly. you can use stuff like foldl/r and fmap that encapsulate a lot of the most common ways to recurse. it gives you more readable code and saves you from writing the same thing over and over again.
@@eNSWE ++
I could never have imagined how amazing haskell is... I laughed out of surprise a few times when I realized the things you can do. I think my life changed today.
+John Appleseed Haskell is very very cool language. I'm glad you liked it :)
THE best coding channel on youtube.
Thank you for the nice compliment :)
Thank YOU for saving me hours and hours and hours of my life. I love bucky over at thenewboston dont get me wrong but you can say in 10 minutes what takes that boy 10 hours.
@@freshprince4552 I said from the outset that I love bucky and his channel. I've spent hours and hours of my life over there and im very grateful. BUT, as stated previously, this guy "can say in 10 minutes what takes that boy 10 hours". Thats just the truth.
@@freshprince4552 ZzZzZz
@@freshprince4552 ok boomer
Really nice tutorial that covers a lot of Haskell ground. Great that you showed how powerful the language is and gives a lot of insight of how it might differ from OOP languages and what we can reuse there. Thanks a lot
Thank you very much :) I'm happy you enjoyed it
Hs: *Main> whatage
Me: its my birthday today, finally 17
Hs:"Nothing Important"
After all this time, this is still the best tutorial. Better than what I had at university. Thank you very much!
Thank you very much :) Happy I could help
I think the max value of int is (2^63)-1.
Yep, got to love Two’s Compliment.
It should be actually the best Haskell beginner tuto i ever see. That's great. Thank you, very clear.
at 21:20 why did you add "x * 3 >= 50" if the list will only go up to 30?
+FaisalK786 Yeah, I also found it interesting that "[x * 3 | x
To the point and very clear coverage, that too at the right speed. Thank you so much man!
Thank you very much :) I'm happy I could help
Great video! thank you very much for making this and explaining everything so well.
Are you planning on covering Monads and such in a future video?
And is there a chance for you to do an Erlang or Elixir tutorial?
+Nicolas Torres Thank you :) Yes I hope to do more with Haskell soon and yes Elixir is on the list
People like you are criminally undervalued, you possibly save student's careers with such amazing tutorials.
Thank you for the compliment :) It is nice to know I'm helping the world in my small part
Never worked with Haskell before, but couldn't the last example be simplified to:
fib = 1 : 1 : zipWith (+) fib (tail fib)
Yes I also thought that and tried it. It can indeed. It's funny though, I was able to work that out without really understanding the last example at all...
I don’t understand why fib gets the value of the second to last list item.
Damn, you sure do cover a lot of languages, and the videos are exceptionally informative. The only language I looked for that you haven't covered is ActionScript 3.0, although that language is a bit different in my opinion from other OO languages. AS was probably the first language I ever tried programming in when I was around 11-12 trying to make flash games. 8 years later and I know Java, C++ and some Lua(thanks to your Lua tutorial) and still want to learn AS.
26:57 Finally! Lists done!
great tutorial, the 1 hr video taught me more than the 4 lectures I attended. very good explanations, and easy to follow
Thank you :) I'm happy it helped
Where did you learn to code in so many languages?
this reply kinda works for everything nowadays
most languages are similar
Most popular programming languages are C based i.e. C++, C#, Java, ObjectiveC, PHP, JavaScript etc. What he really learned is how to write code. Languages are just tools, once you understand the logic of how to program, learning a new language is just learning the different syntax. Plus, he's smarter than your average haha
haskell doesnt fit into the learning a new language is just learning the different syntax basket, unless you're talking about functional programming languages..
I actually think the question as it is is valuable, and the answer Derek provided was equally valuable.
For the benefit of others, Derek's response, which could not be included in this branch of conversation
"Sorry I couldn't respond to you directly Manuel Lehertu. I have been programming for 30 years. I have done a ton of consulting work which requires knowing a bunch of languages. I probably learned most of them because I often donate time to help students with research projects at local universities."
first time looking at haskell, couldn't decide which is more amazing, your teaching skills or the haskell language!
You're reading putStrLn as "put string length". Obviously I'm just beggining Haskell, but I think it actually means "put string line" :)
6 years later and this videos is saving my life. Thank you so much!
I'm very happy that I could help :)
The thumbnail makes me wanna learn it so bad.
That's funny :)
It amazes me how many constructs from Haskell have found their way to other languages (I know for sure Julia, Python, Javascript, and even C# nowadays contain a lot of Haskell ideas). Still, Haskell seems to be still ahead in some aspects if you ask me. For example, the enum type definition and pattern matching function definition around 1:01:10. I'm amazed
It is a beautiful language I agree. The only negative is the lack of libraries in comparison to other languages
I keep getting a "variable not in scope" when I try to use notepad++ and terminal. Can't get past the first 10 mins of this tutorial! @Derek Banes
Hi, I had the same problem and I was searching for an answer, maybe others will have too. I used Visual Studio Code insted and it worked in his terminal.
Can you do a BASH programming tutorial?
rock3tcat (ⵙⴰⵔⵓⵅ) Sure I'll see what I can do
Wow. This is still probably the best haskell video on youtube. Thanks!
Thank you very much :) I'm happy I could help
2:23 English level 100
At 22:25, it's divisible by 9 AND 13 right, not OR, that would print alot more numbers I'm sure
I couldn't understand the Fibonacci series. fib is a List right so how can you add a value to the list because you are saying a->fib summed with the tail of that same list i.e. b.
P.S: Loved the video, Helped a lot.
The reason it works is because your not directly adding values to whole lists, you're isolating pairs of values (one from each list) with zip then adding them and sticking them into the list you're taking from (recursion).
For example:
In the first pass; the first element from the initial 'fib' list ('a' / 1) gets paired into a tuple with the first element of the 'tail fib' list ('b' / also 1) which is everything in the initial 'fib' list expect from 'a', i.e. the second element.
This tuple is shown in (a,b) which would be (1,1) in the first pass. These two values are then added by the code at the start of the list comprehension - (... [a + b | ...]) and this value (2) becomes the value for the first pass and is immediately added to the initial 'fib' list, making it [1,1,2].
This is done again and again; with each pass matching the two consecutive values from the 'fib' list as its generated, adding them together, and then placing it into the list (which makes 'fib' as a function an infinite list generator).
Hope this helps!
The key is Haskell's lazy evaluation. It only needs to know how to continue the list to make the list, and the zip always reads a little behind the new values, so will never run out. As this plan for how the list is constructed is part of how the list was created, it's already defined even when it's not yet evaluated.
Thank you for this tutorial. I've followed you for years; I think you have one of the best tutorials on TH-cam. I'm learning Haskell for my PhD program research. I had to buy one of your Udemy classes to refresh on my python. You are the best. If you every make a tutorial on the Haskell Yampa package, then that would be awesome.
Thank you for the nice compliment :) I'm very happy you have found my videos useful. I'll look into making more Haskell videos
@@derekbanas I thought you're a great tutor but you also a legend, still replying a 7 yrs old video
@@derekbanas Is Haskell relevant outside of math? What's your opinion?
Hi Derek,
In your Fibonacci sequence function why does the fib call get the first value.
+Ben Curtis fib actually refers to the list [1,1], so the first zip would be (zip [1,1] [1]) so 1+1 is 2 which is added to fib. The 2 lists are of different lengths, but this is okay because of how zip is implemented. Also these two lists are recursively referring to fib, so zip will actually see that the lists are changing! The next zip is (zip [1,1,2] [1,2]), but it is not a separate call to zip. It is actually the same call to zip! This is because the inputs to zip were both recursively modified. So after zip does 1+1 first, it "magically" sees 1+2, then 2+3, then 3+5, and so on. Of course all of this is lazily computed so if you try (take 2 fib), zip is never actually called. You can verify this by (import Debug.Trace) and trying (take 2 $ 1:1:[a+b | (a,b)
Although the video is a bit more than an hour long, it took me many more hours to grasp it. Thanks Derek, your videos saves us quite a lot of time! :)
You're welcome :) Yes for best results it is best to pause a lot as you type in the code and practice. I guess that is my niche? I'm glad you liked it.
Hi Derek. A confusion with the last example: You say at the beginning of the second iteration of the recursive definition that the list is now [1,1,2] but that the second time through fib is the second element. How come fib isn't [1,1,2]? On a side note: great video.
fib is always a reference to the entire list. I think some confusion occurs because the video made it sound like fib and tail fib actually change value. they don't.
I think it's easier to visualize what's happening if you always view fib as the complete infinite list of fibonacci numbers, and what happens in the definition is that you simply say "the first element is 1, the second element is 1, and the rest of the list consists of a + b, where b is the element that comes after a (that's what zip fib (tail fib) gives you)".
I am also really confused on this. I see it as more of a list inside lists thing, like building a stack. That way of looking at it does give the right answer, but it leaves me confused as to how the compiler knew when it had reached the bottom of the stack. So the explanation presented by Derek must be right
I agree with Kai, picture adding 2 arrays together is better to understand the last example [1,1,2,3,5] + [1,2,3,5,8] also notice how internally your computer itself calculates the list completely differently compared how you read haskell syntax else you would be calculating the same numbers over and over again just to add one in the end.
Where is the `last` function defined? Is it a general function that can be used anywhere? And what does it do, technically?
`last` obviously is not getting the last value of `fib` because `fib` is either infinite or a simple number as it is used in the case of a. Or if `fib` is the current iteration of `fib` how is it used as a number for `a`.
I would have expected `(a,b)
Wow, I have been working on Haskell for several weeks, already working my way through the textbook mentioned, and this is a great video!
Thank you very much :)
How were you able to just type haskell-tut.hs and not the whole users/derek/documents/.... etc thingy?
ty!!! :)
I assume it would be opening the ghci where you have your files.
so first you do
cd myFolder1/myHaskellFolder
then
ghci
and then you can just type
:l myfile.hs
or just
:l myfile
hope this is helping
unless i'm misunderstanding, you misspoke at 10:41; you said floor rounds up but it rounds down (to nearest int).
@Derek Banas No Monads? Why? :(
there was IO with monadic do-notation and list comprehension (which is just syntactic sugar for the list monad), so there was some stuff there, only they didn't mention the m-word :)
eNSWE And a good portion of people tend to give up on Haskell simply because no one seems to be able to explain what monads are and how they work to a complete beginner without delving into unnecessary complexity like category theory and making them even more confused.
well monads are a fairly complex, but first and foremost very very very abstract, so explaining them to beginners takes time. I don't think it's even possible to explain monads to someone with no prior knowledge in one video like this. it takes exposure and several different explanations over a few days/weeks. it's like asking someone to explain reactive asynchronous design patterns for scalable systems in the cloud with no prior knowledge of programming in a 1h video. it simply can't be done.
eNSWE And that's why Haskell will probably only a be an intellectual meandering from smart people trying to impress themselves with their own intellect as oppsed to a general purpose language that could be used because of its benefits over other types of languages.
what? that makes no sense at all. first and foremost, haskell IS general purpose language that is used for a wide variety of purposes (facebook among others are using it in production code).
secondly, it's not like monads are a haskell invention. it's a mathematical structure, same as a group or a ring.
C# has monads. python does. C++ does. ruby does. EVERY turing complete language has monads. the thing is that few languages recognize them in the type system. C# has a kind of hacky way of doing it via LINQ. the point is, monads don't exist in haskell because someone wrote a Monad type-class. monads exist because there are types that have monadic structure. recognizing that isn't realted at all to haskell, it's inherent in the structure of lists, of nullable types, of tasks/futures etc.
in a programming context, functions over monads is basically a design pattern. in haskell, the language designers have realized that monadic types are REALLY useful, and so there has been some syntactic sugar added to the language to make dealing with polymorphic monad types easier.
it's kind of like how you CAN do OOP in C. you just gotta write some code to get v-tables and to get inheritance right, and you gotta solve the diamond problem and stuff like that, but no one is stopping you. it's just that more pure OOP languages make it MUCH easier by adding keywords and other language constructs that make declaring and using classes/objects much easier.
"round" is going to round to the next integer
"ceiling" is going to round up
"floor" is going to round down
round 9.01=9
ceiling 9.01=10
floor 9.01=9
Cardano bring me here :)))
The same here 😂
Getting started working with Plutus contracts and this got me going in one succinct video on the Haskell front. Many thanks 🙏
I have a request for a "MIPS assembly language Tutorial" please. these are great btw thank you.
Brandon561 I could cover x86 assembly if you're interested? I could cover AVR programming as well.
yes that would be helpful and much appreciated.
At 53:15 it doesn't make sense: getAddFunc takes a single argument (an Integer) and returns a function (that takes an Integer and returns an Integer)
But right after (line 9) he defines getAddFunc with a different signature! (two input arguments)
I undesrtand it's what other languages call "partial" (like "functools.partial" in Python) but it's not explicit hence confusing. I'd expect Haskell to choke on "getAddFunc x y = x + y" because there's no signature matching two input arguments.
it make sense, Int -> Int -> Int and Int -> (Int -> Int) are equivalent in Haskell, you can read about partial application and currying
can you do an Arduino tutorial
PrestigeBernese Sure I'd be very happy to cover electronics :D
Derek Banas thank you very much for the effort you putting in making all these languages, they are really helpful, keep up the good work and wish u all the best
+selam araya You're very welcome :) I'm glad you like them
The errors the Haskell interpreter throws are some of the most pedantic and nonsensical I have ever seen. To me this is the Dark Souls of programming :)))) hard but fun in a weird way
I allways wanted to check out haskell and this video is probably the best intro i found, thank you!
Thank you :) I'm glad it helped
Excellent explanations even after 7 years. Thank you for a great video. This made me understand the haskell books I've been trying to learn for 2 years.
I learned more in 3 hours while coding and (generously) commenting along to this video than I would have in 8 weeks of a college course. Thanks so much!
Thank you :) I'm very happy that you found the video useful
This is great as a refresher if you haven't written in Haskell for a while. Thanks man.
+Mark Lewis Thank you :) I'm glad you found it useful.
omg thank you, dude, I had huge issues in understanding Haskell..now it's all clearer! subscribed
Thank you :) I'm glad it helped
There's an error at 10:42 - "floor is going to round up", it will actually round down (i.e. return the greatest integer not greater than the argument)
Sorry about misspeaking
Haha, no worries, good stuff
29:58 when I type "ghc --make (name of program)", I get : "error: module `(name of program)' cannot be found locally". How can I fix that?
Same
Derek... you're the coding saint. Thank you really. Been watching your videos every time I'm lost, and every time I find the answer or at least a way to find it on my own.
Thank you for the compliment :) I'm very happy that my videos help
Thanks for the video, that's about the most effective hour I have ever sat in front of a computer. Good pace, excellent explanations. Appreciated!
Thank you very much :) I'm glad it helped
This was super helpful, I studied this slowly and using the cheat sheet over the course of a few days.
Thank you :) I'm happy it helped
I enjoyed your tutorial. I'm new to programming, so reading typical tutorials is a bit tedious. It's really useful to have shortcuts like this. Now I feel like I'm ready to read some code about Yoneda written in Haskell. Thanks!
Couldn't Ask for a better explaination! Nailed it out there brother! keep it up
Thank you very much :)
Thank you so much. Fantastic work! This video was so helpful to get started! Functional programming requires you to think so differently! Your COBOL tutorial was really good too.
there's something wrong with fib explanation: tail fib ist not 2 but [1,2] so when you do zip with fib you'll get [(1,1)(1,2)]. Then add them you'll get 2,3 and then conc them to 1:1 -> 1:1:2:3
11/10 video helped me me soooo much with my degree coursework, Derek your'e a hero :)
Thank you :) I'm very happy I could help
at around 10:30 you said round, ceiling and floor all round "up". I know that is not what you meant, but just to clarify for others: "round" rounds to nearest int (up or down), "ceiling" rounds up, "floor" rounds down.
Sorry about that. I get tongue tied some times
No problem man, great tutorial! Helps a lot for my project :)
Quite good. I would probably mention the appropriate terms after each example using that concept, like "pattern-matching" (used for deconstruction of tuples), "type class", "this is called a list comprehension", etc.
+Aaron West Thank you :) Yes I agree that I could have spent more time explaining jargon.
Thank you so much. I found this "in the last hour" for our class but most things are very clear now. May need Haskell for the future..who knows. Great job!
Thank you for taking the time to tell me I helped :) Best of luck with your class
I swear on my life I searched for this on your channel this afternoon. Amazing, thanks.
hman I'm happy that I could help :) I made it because I got a ton of requests.
7 Years old, vedio but yet the best Haskell Tutorial, thanks a lot Derek!
Thank you for the nice compliment :)
Whenever I search a programming lang or framework on TH-cam, there you are. You know everything.
I'm very lucky to rank so high! I have no idea how that happens. Just lucky I guess
Thanks Derek Banas for showing me all about Haskell language.
I'm very happy that I could help :)