How to read Haskell code (in 7 minutes)

preview_player
Показать описание
Hope you liked the video! This took a while to make (mostly bc of uni stuff getting in the way).

In this video, I will be going over the basics of Haskell syntax. Haskell is syntactically very different from other languages, so this video should clear up a lot of confusion around Haskell code. I won't assume you understand everything covered in this video going onward, this is just to make sure I can explain the more interesting stuff without having to explain syntax-related tangents in full detail.

==============================================================

*Fonts used:*
- *Presentation:* Comfortaa, Lexend Deca
- *Code:* Iosevka SSO7

*Color theme:* Ayu Mirage

*Tools used:* MS PowerPoint, Adobe Premiere Pro, Visual Studio Code

*Timestamps:*
- [0:00] Intro
- [0:16] Functions
- [1:10] Calling functions
- [1:27] Infix functions
- [1:43] Types
- [2:20] Type variables
- [2:55] Typeclasses
- [3:40] Currying
- [4:35] Branching
- [5:09] Pattern matching
- [5:35] Guards
- [6:16] Let-in and where
- [6:33] Outro

#haskell #functionalprogramming #tutorial #syntax #programming #computerscience
Рекомендации по теме
Комментарии
Автор

watching this at 2x so i can do it in 3.5min

TheOrbital
Автор

The sentence "Haskell doesn't even feature variables" deals immense psychic damage to most programmers

clligo
Автор

thank you very much! i'm getting into haskell after doing python at my university and this video has everything i need. certainly a sub justified

pomo
Автор

After watching this it's so much clearer where a lot of ideas of Rust came from :)

KnightMirkoYo
Автор

great video, your first video actually motivated me to start learning haskell :)

gareth
Автор

One more excellent haskell tutorial series!

cllve
Автор

Hmm... I think the function type arrow has a better explanation. lets say we have a function f :: a -> a -> a -> a, so it "has three arguments" (which is not the whole truth) and returns a value of the same type. The reason why there are only arrows has indeed something to do with currying, but I think it's best explained with implicit braces. if you call the function you can do it like that: f x y z, but there you are leaving off unnecessary braces, equivalent to: (((f x) y) z), and here comes the interesting part. It's the other way around in the type, here we're leaving off these braces: f :: a -> (a -> (a -> a)). So every function ever only takes a single argument, and just returns another function. In practice it doesn't really hurt to think of function taking multiple arguments, but to really understand the syntax it's not that helpful.

okdoomer
Автор

Funnily enough, I think Rust may be a very good transitional language to help programmers familiar with IP get started with FP. It allows you to do everything you can do in an imperative language, but it has many functional elements that often make your code cleaner and more concise.

This is all to say, that instead of nosediving into insanity land, you get to ease into it 😅

scheimong
Автор

Haskell, one language to curry them all, one to map them, One to <*> all, and in the darkness >>= them

nomoredarts
Автор

Cool video. Subbed! I've been curious about Haskell for a while, but with all the hype around zig, go and rust, I dunno which path to take 😖😖. I'm presently a web developer.

Hope you make more videos like this 😀

uchennaofoma
Автор

Thank you! I've always wanted to learn Haskell!

leana
Автор

Awesome video! Hope your channel blows up

oPatrickVico
Автор

Haskell syntax is so simple and pretty... When you are doing tiny to small things. The moment you do medium or larger, the syntax becomes unreadable.

aev
Автор

Amazing content my nakama!!!! Im glad i found you while youre just starting your channel. I hope that one day you post haskell solutions of leetcode problems one day. I feel like if you show elegeant and juicy looking haskell solutions to all of those in the leetcode rat race, thats the easiest way to attract a lot of coders towards haskell as most of us are looking for easy to understand code.

samuraijosh
Автор

as someone who mainly uses rust and has used lisps, i recognize a lot of similarity.
type variables are like rust's generics, guards are like lisp if

callyral
Автор

YES, NEW PEPSI VIDEO DROPPED; ILY! (THIS WAS SO MUCH FUN TO WATCH) 🥳♥

crrww
Автор

Never moved to see what's the matter with Haskell, this seems like a interesting topic.

markell
Автор

Finally I can at least barely understand my xmonad config lol. Great video!

itstoly
Автор

Wow! Just amazing. Incredible video, highly detailed and well explaining, while still remaining very short and concise. Great job!

crazymarxistguy
Автор

Excellent video! 🎉I think the currying part might be a little bit wrong though. Calling a function with only some of the arguments is called Partial Application. Currying is afaik know the process of turning a “normal “ function in to a curried function. Other than that very nice video, great visuals and clear explanations 🤩

perarneng