_"After many years drinking the functional Kool-Aid, which had no side effects by the way"_ LOL I love that line so much This was so helpful, thank you so much!! This video explains it better than others have. Thank you!
@Bobbias
3 жыл бұрын
This video is gold. I'm finally beginning to understand monads better.
@leonf.7893
3 жыл бұрын
The dude where's my car reference to explain a monad 🤣
@OscarSouth
3 жыл бұрын
Watched pretty much all the 'what is a monad' videos (apart from any where some guy is making a silly face on the front). This is a very good one.
@levibanks7138
2 жыл бұрын
This video is incredible. Most people view monads as a mathematical concept which only the most elite of programmers can learn which often leads to over-complicated explanations. This video shows a great representation about monads while being incredibly easy to understand.
@therru1768
3 жыл бұрын
This video is perfect, useful example, clear example and a touch of humor (that match the explanation, no less). You have broken the curse of the monad, as you can comprehend it as well as explain it. Congratulations and thanks a lot
@raghav5354
3 ай бұрын
What my professor at a T10 University couldn’t explain in a 1 hour lecture, this guy explained it in 5 minutes. Thanks a ton.
@J2DOLARownsU
2 жыл бұрын
Probably the most useful explanation of a monad I've ever seen. Thank you!
@renni9813
2 жыл бұрын
Hands down the best Monad explanation I've ever heard. I've heard 10+ minute technical ramblings on youtube that couldn't explain their point as well as this guy did in 1 minute with a movie and a short animated clip
@JackDespero
29 күн бұрын
The best explanation of a monad in my opinion is a function that returns the same type of object that it is given. If you could use the result of a function as the input for the same function again, then the function is a monad. (Well and technically there must be an input which result is itself, because monoids require identity).
@MrRedstonefreedom
Жыл бұрын
It's hilarious that every single description given on monads, of which I've now watched or read ~20, will say: "people over-complicate monads, here's a simple explanation", but then go on to give a completely unique & different take on monads. If 20 completely different, yet correct, explanations (totaling over 10 hours of sense description) on a concept can be given... maybe it's not so simple :p This one added something great though, as they all do, so thanks. Monads are very very complex; you essentially must look at it from many different perspectives to fully grok their power as a pattern in programming & category theory. The maybe monad is straight forwards and probably most programmers have implemented it even without realizing. But it is complex even if you don't decompose it back into monoids, consider their relation, and then consider what happens with variants on type signatures, expressions, or generalities. And then considering what may constitute a monad (eg an object may implement it with a method that injects this as the first arg of the binary operation). And then there are extensions like if you want to define overridable default behavior, or optionalness of promotion into the monadic type (which, by necessitating kick-outs into global state in some way, are not possible in haskell but in others).
@dk5146
Жыл бұрын
This guy deserves a prize. Thank you so much
@mohammedahmed9491
2 жыл бұрын
Thank you so much for such an amazing video. You explained it so well.
@ratfuk9340
5 ай бұрын
This is cool. I like going back-and-forth between practical and intuitive explanations like this, and the more formal ones.
@ardwalker
2 жыл бұрын
Great explanation Stephen, much appreciated!
@user-fo5pb5ro6l
8 ай бұрын
Incredible video to get me started with monads!
@super-khan3311
Жыл бұрын
"he clearly forgot how to use the return operator" that line is when i realised this is my new favourite channel
@DanShepherd72
3 жыл бұрын
and then....
@MidnightSt
3 жыл бұрын
I don't understand, but based on what John Blow said about people explaining monads ("they are simple but every explanation i've ever come across is absolute overcomplicated crap") I believe that I would understand even less from any other explanation. (This is the first monad explanation that I've ever heard.)
@igolfs
3 жыл бұрын
Thanks for this video. It helped me to understand the basics. Just a heads up to anyone else watching that would like to try running the code in the video, the ifJust implementation should have an = instead of the -> on the last 2 lines.
@stephen70edwards
Жыл бұрын
Oops. I didn't run the animation through GHC
@jimoshellen
3 жыл бұрын
Thank you, this is really helpful!
@viktorijazelnicki7032
8 ай бұрын
Great video. As a side note, there is slight omission in the type of the prelude lookup function, and should be: _lookup :: Eq a => a -> [(a, b)] -> Maybe b_
@JannisAdmek
Жыл бұрын
This video blow my mind!
@themfu
2 жыл бұрын
Super explanation.
@Supakills101
3 жыл бұрын
I was blind but now I see.
@servantofthelord8147
3 ай бұрын
This was so cool! I wish you were a professor at my school - I literally go to Harvard 😂 but the teaching and humor doesn't compare to your style!
@rursus8354
Жыл бұрын
So monads are actually an admission that sometimes an imperative program solves the problem better, and we produce some elaborate syntactical sugar to return them back into existence. For me it looks like the do-construction is ambiguous.
@ICopiedJohnOswald
6 күн бұрын
It allows you to emulate an imperative syntax to sequence arbitrary effects. The example in the video allows you to automate short circuiting behavior for computations that can fail. You can use the same `do` syntax for IO effects, parsers, non-determinism, state machines, dependency injection, etc.
@mumk
2 жыл бұрын
The joke is gold.
@thepaulcraft957
2 жыл бұрын
THANK YOU! this video is so valuable!
@JohnHidey
2 жыл бұрын
Very clear, simple explanation.
@itzluku
2 жыл бұрын
banger
@photon_phi902
3 жыл бұрын
How about starting with identity arrow in category theory the best way for mass effect the same time like this article helpful votes for mass of this server for it possible.
@YannMetalhead
Жыл бұрын
Good video.
@freeideas
Жыл бұрын
So, a modad is just a state that is passed through a list of functions, with the output of each function becoming the state for the next function?
@Boxing_Gamer
Жыл бұрын
Funny never had any serious problems with Stack, but maybe I was just lucky. Now I'm making games and there's simply no libraries for that, so had to stop using Haskell. But there's just no language as fulfilling to work with as Haskell, so I'm pretty sure you will be back.
@lpi3
3 жыл бұрын
Just read comprehending monads by wadler and that's it
@attilatoth268
3 жыл бұрын
And then?
@user-xw6gr5qh4x
3 жыл бұрын
Can we have at least one Monet as well?
@stephen70edwards
3 жыл бұрын
Monads didn't make enough of an impression?
@waltermelo1033
Жыл бұрын
And then! And then! And then! And then! And then! And then! And then! And then! And then! And then! .... She just enter in a infinite loop XD
@Fine_Mouche
Жыл бұрын
does 'if' exist in haskell ? (i ask because no 'if' in maths, no if (it's in logic where the 'if' exist), and haskell is know to be a maths-like langage)
@gfixler
Жыл бұрын
If exists, but unlike in a language with statements, Haskell works in expressions, where everything has a value, so the if must have both possibilities - the positive and the negative case - and they must have (i.e. evaluate to) the same type, so the entire if expression has that type, and can be used as a value of that type in further expressions. So I can do `3 + (if x > 2 then 4 else 5)`, but I can't do `if True then 3 else "hello"`, because 3 and "hello" are of different types.
@ancalagonyt
Ай бұрын
This is yet another example of the Monad Tutorial fallacy. Monads seem intimidatingly complicated at first, but they basically aren't. But they are a little bit. Just enough to cause every person who has ever understood them to try to make their own Monad Tutorial. But a tutorial is a simple explanation that anyone reading it can easily follow. And monads are a bit too complicated for that. Therefore, every single attempt at a Monad Tutorial fails. All of them. They're either technically inaccurate, or they're weird and difficult to follow. Monads in the abstract are a pattern with just the right complexity to make explaining them clearly using analogies both impossible, and yet tempting. If you don't need to know about monads, don't worry about them. If you need to use a specific monad in a specific programming language, look up what the syntax is for monads in your specific language, look up the details of the specific monad you're using, and then mess with it a bit until it clicks, which won't be long, as monads are pretty easy, and one specific monad is easier than monads in general. If you need to be able to write your own monads, just look up the formal definition of monads, and fiddle around with enough specific monads that you're comfortable using them. Then write a monad to solve your problem, if it actually would solve your problem. Learning monads is more like getting used to them than understanding them. There is no analogy of any real-world thing with monads that can possibly explain what they are. They're mildly complicated, but they aren't hard. Just fiddle around with them until you're used to them. But then you'll be tempted to try to explain them to others, just like everybody else, and your explanation will not be understandable except to people who already understand them, just like everybody else's explanations. Resist the temptation. Every Monad Tutorial ever written is either easy to understand yet incomplete, or it's technically correct and even harder to understand than monads themselves, because it's got exactly all the details of the technical definition wrapped into the analogy, plus also the extra work of converting the analogy thing to the technical details.
@DDDDD428
8 ай бұрын
What if you want to return a more informative error than just returning "Nothing"?
@stephen70edwards
8 ай бұрын
The Either typeclass is also a Monad that's designed to do this
@Djellowman
Жыл бұрын
wtf is a maybe string
@stephen70edwards
Жыл бұрын
Either a normal string or nothing at all. It's Haskell's equivalent to a null pointer
@Djellowman
Жыл бұрын
@@stephen70edwards ok that's exactly what i imagined, great syntax actually :')
@AlexanderSuraphel
Жыл бұрын
Anyone who finds this video a bit hard to understand, start with this 3 minute video kzitem.info/news/bejne/t513mqt5mqqhYIY
@siotube
3 жыл бұрын
3:03 ifJust Nothing _ = Nothing ifJust (Just k) f = f k
@BreakTheBeat852
3 жыл бұрын
Yes.
@douglasemsantos
2 ай бұрын
The more I study, the less I understand
@redcollard3586
11 ай бұрын
Well I'm pretty sure I could watch this at 0.5 speed and still have no idea WTF you are talking about. Back to the literature it is for me...
@Fine_Mouche
Жыл бұрын
association list = dictionary ?
@stephen70edwards
Жыл бұрын
A simple implementation of a dictionary. If the dictionary is big, you'd want to use something else
@HaskallMonitor
Жыл бұрын
How is that possible that lookup can get 2 parameters. It’s just a function that can get one or not (at least by ur definition). Your definition of the first lookup is not correct. It should be: lookup :: Eq a => a -> [(a, b)] -> Maybe b Don’t know why someone wasn’t noticing before.
@stephen70edwards
Жыл бұрын
You're right. I copied the type signature incorrectly. I think the rest is OK
Пікірлер: 65