Haskell Tutorial

preview_player
Показать описание


MY UDEMY COURSES ARE 87.5% OFF TIL December 19th ($9.99) ONE IS FREE

00:00 Intro
01:13 Installation
03:12 Comments
03:46 Data Types
06:46 Math Functions
08:52 :t
12:23 Lists
13:07 : Operator
14:52 !! Operator
15:10 Head / Last
15:43 Take
16:14 Elem
17:24 Create Range
19:50 Cycle
20:10 | Operator
20:57 Filter
23:00 ZipWith
23:29 More Filters
23:45 TakeWhile
24:22 Foldl
25:18 List Comprehension
26:52 Tuples
28:10 Zip
28:27 Functions
30:01 Compiling
30:31 Type Declarations
34:58 Recursive Functions
37:27 Guards
40:51 Where
42:56 (x:y)
44:50 As
45:45 Higher Order Functions
46:13 Map
46:51 (x:xs)
51:49 Pass Function into a Function
53:08 Returning a Function
54:23 Lambda
55:09 If
56:19 Case
57:07 Modules
57:52 Enumerations
1:01:51 Polymorphic Type
1:03:13 $ Operator
1:03:42 . Operator
1:05:00 Type Classes
1:07:09 Type Instance
1:08:55 Custom Typeclass
1:10:30 File I/O
1:12:16 Fibonacci Sequence

This time we'll learn Haskell in one video. This has been the most requested language and since I've been working on a project with it I thought I'd make the most all encompassing Haskell tutorial online.

Like the channel? Consider becoming a Patreon! Check it out here:

*Watch More Learn in One Videos*
Рекомендации по теме
Комментарии
Автор

Learn in One Videos for Every Programming Language

derekbanas
Автор

If you add the 00:00 timestamp to the description, YouTube 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.

fedos
Автор

The dislikes were from university lecturers

pneapple_pizza
Автор

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 YouTube 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 :)

derekbanas
Автор

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.

derekbanas
Автор

still great after 6 years. thank you very much

danielhmorgan
Автор

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.

mitchmitch
Автор

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 !!

bibliophileanki
Автор

Best Haskell video after 7 years as well .thanks

yKrishG
Автор

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!

charliemeyersohn
Автор

22:20 Divisible by 13 AND divisible by 9, not OR. :)

croN
Автор

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

SamuelHauptmannvanDam
Автор

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.

JustADuck
Автор

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!"

devocracy
Автор

51:21 "Because we are angry and they shouldn't have passed garbage into our function." LOL. As always very good tutorial btw.

MasterNoxob
Автор

Amazingly to-the-point and clear coverage of some very difficult material. Thanks!

petermacdonald
Автор

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 :)

ScottRehorn
Автор

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).

pol...
Автор

People like you are criminally undervalued, you possibly save student's careers with such amazing tutorials.

TheJpmaster
Автор

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!

afonsolfm