Home Links Blog About
# Pay No Attention to the Monads

###### Aug 7, 2024

This week I came across this great, humerous video by [Low Level Learning](https://youtu.be/dNi__BckudQ?si=VULGBU1tLz_koj2Z) about Haskell, and boy can I say I've been there before.

As someone who did go through with learning Haskell and now enjoys using Haskell, allow me share a helpful tip to you readers who wish to pursue learning Haskell yourselves: Ignore the definitions of things, and just focus on what they allow you to do. Haskell has a strong root in lambda calculus, and although it strengthens the inner working of the language, I know I personally don't know lambda calculus and lack the time to learn it.

You can remember the phrase "a Monad is just a Monoid in the category of Endofunctors" so you, too, can partake in the memery, but otherwise you really don't need to know what a Monad is to learn and use Haskell. In Haskell, a Monad is a typeclass, and a typeclass is much like an interface in Go, or a trait in Rust. It says "types that identify as this can use these special methods/functions". Thats all you need to know to use a Monad. I - to this day - don't even know what a Monad really is.

And to be quite honest, _I don't even really care_.

As far as I'm concerned, a Monad allows me to use `return`, double-pointy-equals (`>>=`), and double-pointy-no-equals (`>>`). It also allows me to use a Monad-identifying type in any non-method function that says it takes a Monad-identifying type as an argument. And since a Monad has to also be Applicative, I get all the methods of that too.

What does Applicative mean? If I were to take an educated guess, it means things can be applied to other things, _but I can't be bothered to care about that either_.

Applicative lets me use `pure` (which is actually the same thing as `return`, or rather `return` is by-default defined as `pure`, for some historic reason), `liftA2`, the Darth-Vader's-Tie-Fighter operator (`<*>`), and both directions of pointy-asterisk (`<*`, `*>`). And also any non-method that takes an Applicative. And also, Applicatives are Functors, so...

(_P.S.: I still don't care what the definition is._)

...Functor lets me use `fmap` and left-pointy-dollar-sign (`<$`) and any non-method that takes a Functor.

And the same idea goes for Monoid, Semigroup, Endo, all the "specialized Monads" like MonadPlus or MonadIO, and any other typeclass with a funny lambda calculus name.

A fair amount of typeclass names aren't confusing, like Traversable, or Foldable, or Alternative, or Fractional, or Eq, or Bounded. Still don't care about the definition of the words, though, at least though these ones I know or can deduce on my own.

### The Rest

Of course, there's still quite a bit of other stuff to Haskell, especially in the realms of Symbols, C-FFI, TemplateHaskell, QuasiQuoters, Pragmas, tooling, and everything else I don't know to mention because I myself am not a Haskell expert.

But for those, take things as they come, you mostly don't need to know these to _learn_ Haskell. Pick up enough of Cabal to build and run your code, pick up how to read and write Haskell, and give it a whirl just like any other language.

And most importantly, **pay no attention to the Monads.**