Where typeclass links to this other massive tutorial and then my eyes started to glaze over.
(Side note, this is probably the 50th or so Monad tutorial I've read and I still don't understand them. For context, I've been programming professionally for nearly 20 years now. My only conclusion at this point is either Monads aren't actually that important, or I actually do understand some useful subset of what Monads are and I just don't know it, and I just never had a need to use them "fully".)
Edited to add: I think my problem with Monad tutorials is that they all tend to explain the concepts using Haskell, and I can't read Haskell. It syntax is utterly impenetrable to me and I have no idea what any of the silly symbols mean. And any tutorial that tries to teach Monads using other languages ultimately feels like it's teaching me something I don't need to know... (how to do side effects in a pure functional language, when I don't code in pure functional languages and likely never will.)
As far as functors this could be rephrased more comprehensibly to those unfamiliar with Haskell as "What is a Functor, really? Functor is an interface here are some definitions:"
(typescript)
interface ArrayFunctor<A, B> {
map: (f: ((a: A) -> B), arr: Array<A>) -> Array<B>
}
interface PromiseFunctor<A, B> {
map: (f: ((a: A) -> B), arr: Promise<A>) -> Promise<B>
}
interface ObservableFunctor<A, B> {
map: (f: ((a: A) -> B), arr: Observable<A>) -> Observable<B>
}
"definitions" is plural here because typescript doesn't support higher-kinded types or else it might look like this: interface Functor<F, A, B> {
map: (f: ((a: A) -> B), arr: F<A>) -> F<B>
}
(note, there are ways around this used in the fp-ts library, see here: https://www.matechs.com/blog/encoding-hkts-in-ts4-1)> I actually do understand some useful subset of what Monads are and I just don't know it
This is certainly the case if you have ever used flatMap on an array or chained Promises (or other async structures like futures in other langs).