Haskell Tutorial

  Рет қаралды 895,996

Derek Banas

Derek Banas

Күн бұрын

Пікірлер: 1 100
@derekbanas
@derekbanas 5 жыл бұрын
Learn in One Videos for Every Programming Language Subscribe to Bookmark them: bit.ly/2FWQZTx C++ : kzbin.info/www/bejne/iKbFXn2pn7Kbjbs Python : kzbin.info/www/bejne/hGXQdq18ec-kqqM Java : kzbin.info/www/bejne/pF7bcqSZd6iqqZY PHP : kzbin.info/www/bejne/bYWpYWOef65qbrs MySQL : kzbin.info/www/bejne/r4HYZ6SMasesq5Y JavaScript : kzbin.info/www/bejne/nJvYapyfbb6mfdU C# : kzbin.info/www/bejne/oprWmqqLj6-Lp7M HTML5 : kzbin.info/www/bejne/oXXce4FtprZ4iqM CSS3 : kzbin.info/www/bejne/eYbbeZKojLh8Z80 JQuery : kzbin.info/www/bejne/eIi7mJp4YrlkoLM TypeScript : kzbin.info/www/bejne/Y4G1kIunjJ59gLc ECMAScript : kzbin.info/www/bejne/gJLOoJxmfJ2feMk Swift : kzbin.info/www/bejne/mnzEoJ2Fj5KUsJo R : kzbin.info/www/bejne/qWSpoK2Mm8lqp5Y Haskell : kzbin.info/www/bejne/ZmPCeWaCn9aAqJo Handlebars : kzbin.info/www/bejne/annYcqGDa8dlmpo Bootstrap : kzbin.info/www/bejne/naKydqKLh5qFfsk Rust : kzbin.info/www/bejne/i2Kod5p5g7F3eJo Matlab : kzbin.info/www/bejne/hIS2hZ6hgLeUmKs Arduino : kzbin.info/www/bejne/h4DCe5-wZtajetk Crystal : kzbin.info/www/bejne/eqmpgWCNn9anqcU Emacs : kzbin.info/www/bejne/f5LKk6lvbJl6orM Clojure : kzbin.info/www/bejne/mZqqqnuhedqDd6c Shell : kzbin.info/www/bejne/nqjVn6CHqtKnhtk Perl : kzbin.info/www/bejne/jXbKmXyOqJ15bMU Perl6 : kzbin.info/www/bejne/omHdgaqenLyHna8 Elixir : kzbin.info/www/bejne/pnOxgJSsh9SBgpI D : kzbin.info/www/bejne/qKi9d4ekm56Verc Fortran : kzbin.info/www/bejne/lZCVhpp8g76anJo LaTeX : kzbin.info/www/bejne/jJnQnH-ohM9_qdk F# : kzbin.info/www/bejne/mWjIf3eAg5xobrc Kotlin : kzbin.info/www/bejne/fpDSeJxuqtp3pqM Erlang : kzbin.info/www/bejne/f3bLqJZoppatfZY Groovy : kzbin.info/www/bejne/eGqbm5Zuncmob8k Scala : kzbin.info/www/bejne/equppWOPoL-ibq8 Lua : kzbin.info/www/bejne/n37ElKuQhrKDjtU Ruby : kzbin.info/www/bejne/epvManSCeMyZpq8 Go : kzbin.info/www/bejne/eXechGeHj9qJaZI Objective C : kzbin.info/www/bejne/a5bWgqSQfq9rack Prolog : kzbin.info/www/bejne/iarOqYqme9yAfdU LISP : kzbin.info/www/bejne/r562ometfdekr7c Express : kzbin.info/www/bejne/rnWmfJaEd6umq6s Jade : kzbin.info/www/bejne/omakiZaOdrVnqJo Sass : kzbin.info/www/bejne/rauWnHiigcd4fqc
@chasejefferson2022
@chasejefferson2022 3 жыл бұрын
I guess Im pretty off topic but does anybody know a good place to watch new series online ?
@kaimarcus7966
@kaimarcus7966 3 жыл бұрын
@Chase Jefferson I use Flixzone. Just search on google for it :)
@mustafazion1737
@mustafazion1737 3 жыл бұрын
@Kai Marcus Definitely, been watching on Flixzone for months myself :D
@chasejefferson2022
@chasejefferson2022 3 жыл бұрын
@Kai Marcus Thanks, I went there and it seems like they got a lot of movies there =) Appreciate it!!
@kaimarcus7966
@kaimarcus7966 3 жыл бұрын
@Chase Jefferson happy to help =)
@derekbanas
@derekbanas 9 жыл бұрын
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 KZbin 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 :)
@afonsolfm
@afonsolfm 9 жыл бұрын
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!
@derekbanas
@derekbanas 9 жыл бұрын
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.
@iMaxos
@iMaxos 9 жыл бұрын
+Derek Banas You probably already know about this website, but Project Euler is really good for getting better at problem solving and programming.
@OliverBenson2024
@OliverBenson2024 9 жыл бұрын
+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 :)
@Xnoob545
@Xnoob545 5 жыл бұрын
GOOGLE+? Ewwww
@fedos
@fedos 3 жыл бұрын
If you add the 00:00 timestamp to the description, KZbin 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.
@petergunter3939
@petergunter3939 3 жыл бұрын
would be very helpful
@JesseChampion
@JesseChampion 3 жыл бұрын
I second this
@musicislander
@musicislander 3 жыл бұрын
I third this
@agustinranieri
@agustinranieri 3 жыл бұрын
I fourth this
@vajbon3419
@vajbon3419 3 жыл бұрын
I fifth this
@danielhmorgan
@danielhmorgan 2 жыл бұрын
still great after 6 years. thank you very much
@derekbanas
@derekbanas 2 жыл бұрын
Thank you :) I'm very happy that I could help
@bibliophileanki
@bibliophileanki 5 жыл бұрын
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 !!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you for the nice compliments :)
@mitchmitch555
@mitchmitch555 8 жыл бұрын
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.
@derekbanas
@derekbanas 8 жыл бұрын
+mitchmitch555 Thank you for the compliment :) I'm glad I could clear it up
@charliemeyersohn9371
@charliemeyersohn9371 8 жыл бұрын
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!
@derekbanas
@derekbanas 8 жыл бұрын
Thank you very much :) I did my best with it. Best of luck on your interview.
@p1neapple_pizza522
@p1neapple_pizza522 4 жыл бұрын
The dislikes were from university lecturers
@derekbanas
@derekbanas 9 жыл бұрын
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.
@PrimeFxcus
@PrimeFxcus 9 жыл бұрын
Wow
@rafsanjanimuhammod309
@rafsanjanimuhammod309 9 жыл бұрын
Derek Banas Really you're a great man. Sir, will you make a tutorial for Assembly Programming Language.
@derekbanas
@derekbanas 9 жыл бұрын
Rafsanjani Muhammod Thank you for the nice compliment :) Sure I can cover assembler. I'd love to make a fun electronics tutorial as well.
@zeuglcockatrice4633
@zeuglcockatrice4633 9 жыл бұрын
Derek Banas yes,yes electronics tutorial please
@FSHnegativ
@FSHnegativ 9 жыл бұрын
Derek Banas Microcontrollers could be a really interesting topic!
@yKrishG
@yKrishG Жыл бұрын
Best Haskell video after 7 years as well .thanks
@petermacdonald1008
@petermacdonald1008 8 жыл бұрын
Amazingly to-the-point and clear coverage of some very difficult material. Thanks!
@derekbanas
@derekbanas 8 жыл бұрын
Thank you very much :)
@3croN
@3croN 9 жыл бұрын
22:20 Divisible by 13 AND divisible by 9, not OR. :)
@slidenerd
@slidenerd 7 жыл бұрын
my boi derek banas is unstoppable :)
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) Your channel is looking awesome like always!
@JustADuck
@JustADuck 2 жыл бұрын
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.
@ScottRehorn
@ScottRehorn Жыл бұрын
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 :)
@SamuelHauptmannvanDam
@SamuelHauptmannvanDam 5 жыл бұрын
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
@DarshanParajuli
@DarshanParajuli 9 жыл бұрын
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!
@derekbanas
@derekbanas 9 жыл бұрын
+Darshan Parajuli You're very welcome :) I'm glad you liked it.
@colin398
@colin398 Жыл бұрын
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)
@pol...
@pol... 8 жыл бұрын
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).
@woobilicious.
@woobilicious. 8 жыл бұрын
+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
@Liftwithsepi
@Liftwithsepi 8 жыл бұрын
Thanks for the comment, I was really confused about that part.
@kpmaynard
@kpmaynard 8 жыл бұрын
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
@sara-hc7wb
@sara-hc7wb 8 жыл бұрын
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.
@kpmaynard
@kpmaynard 8 жыл бұрын
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?
@shawnbadger2737
@shawnbadger2737 7 жыл бұрын
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.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) Yes I definitely need to make a tutorial just about the technical aspects of writing functional code
@Ateia22
@Ateia22 9 жыл бұрын
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
@derekbanas
@derekbanas 9 жыл бұрын
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.
@MasterNoxob
@MasterNoxob 8 жыл бұрын
51:21 "Because we are angry and they shouldn't have passed garbage into our function." LOL. As always very good tutorial btw.
@derekbanas
@derekbanas 8 жыл бұрын
Thank you :) I'm glad you enjoyed it
@jasperwes
@jasperwes 5 жыл бұрын
Just about to write this exact comment; but you've beat me to it! I agree; good tutorial.
@TheJpmaster69
@TheJpmaster69 5 жыл бұрын
People like you are criminally undervalued, you possibly save student's careers with such amazing tutorials.
@derekbanas
@derekbanas 5 жыл бұрын
Thank you for the compliment :) It is nice to know I'm helping the world in my small part
@afonsolfm
@afonsolfm 9 жыл бұрын
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!
@kevinparsley6806
@kevinparsley6806 7 жыл бұрын
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.
@TheRealIceman10
@TheRealIceman10 7 жыл бұрын
You really should work on how to use feedback you get. PS: I know you're just some random dude.
@johnappleseed8839
@johnappleseed8839 9 жыл бұрын
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.
@derekbanas
@derekbanas 9 жыл бұрын
+John Appleseed Haskell is very very cool language. I'm glad you liked it :)
@UpgrayeDDDDDD
@UpgrayeDDDDDD 8 жыл бұрын
24:27 You could've explained what the second parameter does in foldl.
@lincolnsand5127
@lincolnsand5127 6 жыл бұрын
It's kinda simple if you try using it tho.
@anselmschueler
@anselmschueler 5 жыл бұрын
++
@washingtonlgois
@washingtonlgois 3 жыл бұрын
6 years later and this videos is saving my life. Thank you so much!
@derekbanas
@derekbanas 3 жыл бұрын
I'm very happy that I could help :)
@Willis-no9ym
@Willis-no9ym 6 жыл бұрын
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)
@simrandotdev
@simrandotdev 2 жыл бұрын
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.
@derekbanas
@derekbanas 2 жыл бұрын
Thank you for taking the time to tell me I helped :) Congratulations on your Masters!!!
@nesciusnomen9119
@nesciusnomen9119 6 жыл бұрын
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.
@MxMxffin
@MxMxffin 2 жыл бұрын
"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
@anonymous1177
@anonymous1177 8 жыл бұрын
Set replay speed to 0.5 and you might have a chance to code along.
@luuclucas
@luuclucas 5 жыл бұрын
i set the speed to 1.25
@ewertonal
@ewertonal 4 жыл бұрын
Do you know the pause feature?
@Raleighthrbub123
@Raleighthrbub123 3 жыл бұрын
Or. Or... Hear me out... use vim.
@unperrier5998
@unperrier5998 3 жыл бұрын
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.
@matiziel1
@matiziel1 2 жыл бұрын
it make sense, Int -> Int -> Int and Int -> (Int -> Int) are equivalent in Haskell, you can read about partial application and currying
@wesleyshann6524
@wesleyshann6524 5 жыл бұрын
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
@derekbanas
@derekbanas 5 жыл бұрын
That's great! I'm happy I could help 😁
@theloopyproducer3361
@theloopyproducer3361 2 жыл бұрын
Getting started working with Plutus contracts and this got me going in one succinct video on the Haskell front. Many thanks 🙏
@maneeshreddy3825
@maneeshreddy3825 6 жыл бұрын
I think the max value of int is (2^63)-1.
@cameronmyron5776
@cameronmyron5776 4 жыл бұрын
Yep, got to love Two’s Compliment.
@uzKantHarrison
@uzKantHarrison 6 жыл бұрын
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.
@derekbanas
@derekbanas 6 жыл бұрын
Thank you for the compliment :) I think I have gotten better over time through pure repetition
@RoryMag
@RoryMag 8 жыл бұрын
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?
@eNSWE
@eNSWE 8 жыл бұрын
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.
@anselmschueler
@anselmschueler 5 жыл бұрын
@@eNSWE ++
@devocracy1089
@devocracy1089 Жыл бұрын
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!"
@ole4707
@ole4707 8 жыл бұрын
Never worked with Haskell before, but couldn't the last example be simplified to: fib = 1 : 1 : zipWith (+) fib (tail fib)
@derickd6150
@derickd6150 8 жыл бұрын
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...
@avi3681
@avi3681 5 жыл бұрын
I don’t understand why fib gets the value of the second to last list item.
@JaapvanderVelde
@JaapvanderVelde 8 жыл бұрын
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)
@derekbanas
@derekbanas 8 жыл бұрын
Sorry about misspeaking
@JaapvanderVelde
@JaapvanderVelde 8 жыл бұрын
Haha, no worries, good stuff
@royalnamikaze1646
@royalnamikaze1646 4 жыл бұрын
Hs: *Main> whatage Me: its my birthday today, finally 17 Hs:"Nothing Important"
@Feelyourbodyallways
@Feelyourbodyallways 9 жыл бұрын
At 22:25, it's divisible by 9 AND 13 right, not OR, that would print alot more numbers I'm sure
@xcvsdxvsx
@xcvsdxvsx 7 жыл бұрын
THE best coding channel on youtube.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you for the nice compliment :)
@xcvsdxvsx
@xcvsdxvsx 7 жыл бұрын
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.
@xcvsdxvsx
@xcvsdxvsx 5 жыл бұрын
@@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.
@xcvsdxvsx
@xcvsdxvsx 5 жыл бұрын
@@freshprince4552 ZzZzZz
@sagitswag1785
@sagitswag1785 4 жыл бұрын
@@freshprince4552 ok boomer
@khushaalnandwani3372
@khushaalnandwani3372 9 ай бұрын
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
@salmandjingueinabaye396
@salmandjingueinabaye396 4 жыл бұрын
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?
@insertoyouroemail
@insertoyouroemail 4 жыл бұрын
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)
@salmandjingueinabaye396
@salmandjingueinabaye396 4 жыл бұрын
@@insertoyouroemail That makes sense. Thank you
@MsEady123
@MsEady123 2 жыл бұрын
Thank you for this tutorial. I've followed you for years; I think you have one of the best tutorials on KZbin. 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.
@derekbanas
@derekbanas 2 жыл бұрын
Thank you for the nice compliment :) I'm very happy you have found my videos useful. I'll look into making more Haskell videos
@NareshKumar-sm9yz
@NareshKumar-sm9yz 2 жыл бұрын
@@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?
@manuelnovella39
@manuelnovella39 9 жыл бұрын
Where did you learn to code in so many languages?
@tcroyce8128
@tcroyce8128 7 жыл бұрын
this reply kinda works for everything nowadays
@macward3041
@macward3041 7 жыл бұрын
most languages are similar
@RedEyedJedi
@RedEyedJedi 7 жыл бұрын
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
@kevinparsley6806
@kevinparsley6806 7 жыл бұрын
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.
@kevinparsley6806
@kevinparsley6806 7 жыл бұрын
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."
@aes0p895
@aes0p895 Жыл бұрын
unless i'm misunderstanding, you misspoke at 10:41; you said floor rounds up but it rounds down (to nearest int).
@MisterComment25
@MisterComment25 8 жыл бұрын
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?
@derekbanas
@derekbanas 8 жыл бұрын
+Nicolas Torres Thank you :) Yes I hope to do more with Haskell soon and yes Elixir is on the list
@PheonxD
@PheonxD 3 жыл бұрын
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
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :) I'm happy you enjoyed it
@fadisoliman9637
@fadisoliman9637 6 жыл бұрын
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
@ione6391
@ione6391 4 жыл бұрын
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.
@goncalvesalves3007
@goncalvesalves3007 2 жыл бұрын
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! 😄
@Faisalk786HD
@Faisalk786HD 9 жыл бұрын
at 21:20 why did you add "x * 3 >= 50" if the list will only go up to 30?
@jonny5825
@jonny5825 8 жыл бұрын
+FaisalK786 Yeah, I also found it interesting that "[x * 3 | x
@arkajyotipal5843
@arkajyotipal5843 5 жыл бұрын
To the point and very clear coverage, that too at the right speed. Thank you so much man!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you very much :) I'm happy I could help
@TheoAddis
@TheoAddis 8 жыл бұрын
26:57 Finally! Lists done!
@MrSama1000
@MrSama1000 3 жыл бұрын
After all this time, this is still the best tutorial. Better than what I had at university. Thank you very much!
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :) Happy I could help
@leoalcock
@leoalcock 8 жыл бұрын
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.
@sara-hc7wb
@sara-hc7wb 8 жыл бұрын
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)".
@derickd6150
@derickd6150 8 жыл бұрын
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
@GertCuykens
@GertCuykens 8 жыл бұрын
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.
@jonathanlevi2458
@jonathanlevi2458 6 жыл бұрын
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)
@boroborable
@boroborable 4 жыл бұрын
first time looking at haskell, couldn't decide which is more amazing, your teaching skills or the haskell language!
@avishekghosh2589
@avishekghosh2589 8 жыл бұрын
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.
@harryhowley77
@harryhowley77 8 жыл бұрын
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!
@0LoneTech
@0LoneTech 6 жыл бұрын
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.
@tobiasschoofs7006
@tobiasschoofs7006 3 жыл бұрын
foldl and foldr: the suffix does *not* mean from the left/right. You can apply foldr on an infinite list if your operator is not strict. But you cannot do it with foldl; e.g. foldr (:) [] is the identity. For foldl it would be the reverse. But with foldl it doesn't work, because foldl goes to the last value first (i.e. it folds "from the right"). My intuition of the suffix is: fold *to the* left/right.
@bencurtis214
@bencurtis214 9 жыл бұрын
Hi Derek, In your Fibonacci sequence function why does the fib call get the first value.
@bobeflick
@bobeflick 9 жыл бұрын
+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)
@makmak-zt6md
@makmak-zt6md 5 жыл бұрын
great tutorial, the 1 hr video taught me more than the 4 lectures I attended. very good explanations, and easy to follow
@derekbanas
@derekbanas 5 жыл бұрын
Thank you :) I'm happy it helped
@rock3tcatU233
@rock3tcatU233 9 жыл бұрын
Can you do a BASH programming tutorial?
@derekbanas
@derekbanas 9 жыл бұрын
rock3tcat (ⵙⴰⵔⵓⵅ) Sure I'll see what I can do
@DGDG0000000
@DGDG0000000 5 жыл бұрын
It should be actually the best Haskell beginner tuto i ever see. That's great. Thank you, very clear.
@crimsun7186
@crimsun7186 9 жыл бұрын
@Derek Banas No Monads? Why? :(
@eNSWE
@eNSWE 8 жыл бұрын
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 :)
@crimsun7186
@crimsun7186 8 жыл бұрын
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.
@eNSWE
@eNSWE 8 жыл бұрын
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.
@crimsun7186
@crimsun7186 8 жыл бұрын
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.
@eNSWE
@eNSWE 8 жыл бұрын
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.
@awilliamwest
@awilliamwest 9 жыл бұрын
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.
@derekbanas
@derekbanas 9 жыл бұрын
+Aaron West Thank you :) Yes I agree that I could have spent more time explaining jargon.
@sanshinron
@sanshinron 9 жыл бұрын
You're reading putStrLn as "put string length". Obviously I'm just beggining Haskell, but I think it actually means "put string line" :)
@ernestboston7707
@ernestboston7707 3 жыл бұрын
Wow, I have been working on Haskell for several weeks, already working my way through the textbook mentioned, and this is a great video!
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :)
@slackbraham
@slackbraham 8 жыл бұрын
The thumbnail makes me wanna learn it so bad.
@derekbanas
@derekbanas 8 жыл бұрын
That's funny :)
@tareksellami7346
@tareksellami7346 5 жыл бұрын
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
@tyh7388
@tyh7388 2 жыл бұрын
This video has helped me immensely. Thanks a bunch Derek!
@Rjsipad
@Rjsipad 8 жыл бұрын
How were you able to just type haskell-tut.hs and not the whole users/derek/documents/.... etc thingy?
@Rjsipad
@Rjsipad 8 жыл бұрын
ty!!! :)
@XyntXII
@XyntXII 6 жыл бұрын
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
@Relseg
@Relseg 9 жыл бұрын
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.
@HodlTWashington
@HodlTWashington 9 жыл бұрын
I have a request for a "MIPS assembly language Tutorial" please. these are great btw thank you.
@derekbanas
@derekbanas 9 жыл бұрын
Brandon561 I could cover x86 assembly if you're interested? I could cover AVR programming as well.
@HodlTWashington
@HodlTWashington 9 жыл бұрын
yes that would be helpful and much appreciated.
@hideakinakano520
@hideakinakano520 2 ай бұрын
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!
@liptherapy
@liptherapy 5 жыл бұрын
2:23 English level 100
@LooJulian
@LooJulian 8 жыл бұрын
Thanks Derek Banas for showing me all about Haskell language.
@derekbanas
@derekbanas 8 жыл бұрын
I'm very happy that I could help :)
@user-hh2pr1gq7c
@user-hh2pr1gq7c 9 жыл бұрын
can you do an Arduino tutorial
@derekbanas
@derekbanas 9 жыл бұрын
PrestigeBernese Sure I'd be very happy to cover electronics :D
@tobiasjennerjahn8659
@tobiasjennerjahn8659 3 жыл бұрын
Wow. This is still probably the best haskell video on youtube. Thanks!
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :) I'm happy I could help
@nhanang7289
@nhanang7289 3 жыл бұрын
Cardano bring me here :)))
@tommychentw
@tommychentw 6 ай бұрын
The same here 😂
@alexcarr793
@alexcarr793 6 жыл бұрын
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!
@derekbanas
@derekbanas 6 жыл бұрын
Thank you :) I'm very happy that you found the video useful
@ker-balkanrider
@ker-balkanrider 5 жыл бұрын
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
@bradleybaylis7229
@bradleybaylis7229 2 жыл бұрын
I am really enjoying this tutorial. I do have problem with guards. 40:51 and 42:15. The pipes don't work when using guard. I have done exactly as you do, and it keeps showing this error " batAverage :: Double -> Double -> String batAverage hits avgBat | avg
@marklewis1438
@marklewis1438 9 жыл бұрын
This is great as a refresher if you haven't written in Haskell for a while. Thanks man.
@derekbanas
@derekbanas 9 жыл бұрын
+Mark Lewis Thank you :) I'm glad you found it useful.
@ArgumentumAdHominem
@ArgumentumAdHominem 5 жыл бұрын
+ All examples you presented are clear and understandable - Not enough focus on non-intuitive differences between Haskell and C, for example, how to handle huge immutable arrays without running out of memory
@OptimalLivingVision
@OptimalLivingVision 8 жыл бұрын
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
@derekbanas
@derekbanas 8 жыл бұрын
+selam araya You're very welcome :) I'm glad you like them
@MrX-mh7uu
@MrX-mh7uu 3 жыл бұрын
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?
@TheJpwzrd
@TheJpwzrd 3 жыл бұрын
Same
@honglangford9733
@honglangford9733 5 жыл бұрын
@21:14 I think it would be better to use a number smaller than 30, say 20, instead of 50.
@filiplazov5895
@filiplazov5895 7 жыл бұрын
I allways wanted to check out haskell and this video is probably the best intro i found, thank you!
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) I'm glad it helped
@C4rb0neum
@C4rb0neum 5 жыл бұрын
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
@derekbanas
@derekbanas 5 жыл бұрын
It is a beautiful language I agree. The only negative is the lack of libraries in comparison to other languages
@osmantoplica8912
@osmantoplica8912 8 жыл бұрын
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.
@derekbanas
@derekbanas 8 жыл бұрын
Sorry about that. I get tongue tied some times
@osmantoplica8912
@osmantoplica8912 8 жыл бұрын
No problem man, great tutorial! Helps a lot for my project :)
@MrVbarroso
@MrVbarroso 8 жыл бұрын
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! :)
@derekbanas
@derekbanas 8 жыл бұрын
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.
@Mr_BetaMax
@Mr_BetaMax 7 жыл бұрын
Whenever I search a programming lang or framework on KZbin, there you are. You know everything.
@derekbanas
@derekbanas 7 жыл бұрын
I'm very lucky to rank so high! I have no idea how that happens. Just lucky I guess
@brianevans4
@brianevans4 4 жыл бұрын
Great video. My only piece of feedback is it would be very helpful if you said which parts are specific to the language and which parts you are making up as you go along, such as variable names can be anything by built in functions must be called by name. Because there isn't any syntax highlighting in your text editor, its tough to tell, coming from a completely different language, I struggled to see what words could be anything, and what was a keyword. But thanks for the video, very helpful!
@Zegrento7
@Zegrento7 9 жыл бұрын
I love this, thanks! Very useful! One thing: maybe only I missed it, but I think that at the 'Returning functions' part, you forgot to talk about partial application. (That is, EVERY function will return a function if not all of its parameters are supplied, and that the returned function will take the rest of the parameters and compute the final value.) (Then there's also Currying, where each function takes one parameter and either returns a function requiring the next parameter or the final value, and is the reason behind the arrows between the parameters in the type signatures of functions)
@derekbanas
@derekbanas 9 жыл бұрын
***** You're very welcome :) Thanks for taking the time to help others.
@JiffyJames85
@JiffyJames85 7 жыл бұрын
my only complaint with this video is the coverage of the Fibonacci sequence at the end. (zip a b) does not take the second to last character of a and the Las character of b. it takes all of a and all of b. (zip fib (tail fib)) zips together the entire fib sequence with the entire fib sequence minus the first value. The reason this works is because the zip clause is lazy loaded. It doesn't look for the next value in fib until the last one is done loading.
@supposetobenick
@supposetobenick 9 жыл бұрын
your shoot _ _ ="error" as troubleshooting didnt work... is is perhaps a solution if u had: shoot RPS _ ="error" shoot _ RPS= "erorr" also when u were defining a fuct to return in cases whether is rock and paper is simular to situation at 44:40ish how does the compiler decides which to choose at getListItems whether x:y:[] or x:xs or other and then print (i havent actually tried coding by myself-(in Haskell .. i have OOP experience in JAVA and C even if not super advanced )- and still not watched the video after RPS but wanted to ask those b4 i forget about it)
@animowany111
@animowany111 9 жыл бұрын
+supposetobenick it would work, the error was caused by the function ONLY accepting RPS as defined in 'shoot :: RPS -> RPS -> String'. It would work for 'shoot S S' which would give "error"
@TheHaughtsauce
@TheHaughtsauce 9 жыл бұрын
I swear on my life I searched for this on your channel this afternoon. Amazing, thanks.
@derekbanas
@derekbanas 9 жыл бұрын
hman I'm happy that I could help :) I made it because I got a ton of requests.
@bozidarmitrovic894
@bozidarmitrovic894 4 жыл бұрын
On 53:36 you defined a function that takes in ONE integer and returns a function that takes in integer and returns an integer. But when you implemented the function, you gave it 2 parameters, x and y. Why does that work?
@insertoyouroemail
@insertoyouroemail 4 жыл бұрын
It's called currying. All functions in Haskell are curried by default. The parentheses in the type signature are redundant. He could just as well have written getAddFunc :: Int -> Int -> Int
What is a Monad? - Computerphile
21:50
Computerphile
Рет қаралды 611 М.
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Prolog Tutorial
1:03:37
Derek Banas
Рет қаралды 934 М.
JSON Parser 100% From Scratch in Haskell (only 111 lines)
1:50:07
Rust Tutorial Full Course
2:35:11
Derek Banas
Рет қаралды 552 М.
Recursion - To hone a skill, one must practice.
10:54
peppidesu
Рет қаралды 25 М.
Functional Programming & Haskell - Computerphile
9:19
Computerphile
Рет қаралды 675 М.
Your code can be beautiful AND fast (Higher order functions)
8:13
How to read Haskell code (in 7 minutes)
6:51
peppidesu
Рет қаралды 74 М.
Lambda Calculus - Computerphile
12:40
Computerphile
Рет қаралды 1 МЛН
Learn Python - Full Course for Beginners [Tutorial]
4:26:52
freeCodeCamp.org
Рет қаралды 45 МЛН