watching a video about what a monad is because i've never understood them despite trying. they set up this simple toy example to motivate everything and then went "so, where do monads come in? surprise: we just wrote one". screaming and crying and shitting my pants. i was deceived.
(posted it in a reply but: i actually want this link in the OP as well. https://youtu.be/C2w45qRc3aU)
monads spoilers
okay i've read explanations of monads that explained what they're for and didn't get it. and i've read explanations of monads that explained "a monad is just when you have these two functions" and didn't get it. but this video has both "here's what they're for. to accomplish that you just need these two functions" and i think i get it?? https://youtu.be/C2w45qRc3aU
monads spoilers
like "Option is a monad" didn't make sense to me but "Option is a monad, because we take a value and put it in its own little 'Option' ecosystem and pass any transformations we want to do into it, and the case of 'no value' is handled by the inner workings of that ecosystem without any extra work" kind of does
@monorail as far as the purractical considerations go, yes, you get it, that’s what you use a monad fur
the thing to observe that you didn’t mention is that the interface to this abstraction/contextualization is extremely general, and exactly reusable line-fur-line with other abstractions, which is neat