What the FUCK is a monad

What the FUCK is a monad

Attached: F3030549-3231-4AB4-AE1F-1373A4D1F5D0.jpg (1333x900, 80K)

Other urls found in this thread:

youtube.com/watch?v=Nq-q2USYetQ
twitter.com/SFWRedditImages

It's just a monoid in the category of endofunctors, what's the problem?

>muh funkshuns of funkshuns
Can maths get any fancier then that?

do the monad challenges and you’ll learn them in depth

a nomad but he looks like a testicle

Yes.

Monoid *object* in the category of endofunctors, not a monoid.

As a mathematician, this sloppiness in language confused me for a while when I first saw it.

i thought learning haskell was cool till i realized no one actually uses it for anything

Monads are an integral part of Liebniz's metaphysics. They are the the simple, indivisible basic substances that have the properties that make us up.

Attached: InfiniteLoop.gif (500x500, 656K)

A Monad is a mathematical abstraction just like monoids, groups, functors, etc etc.

It happens to be very useful in programming because it's great at describing functions with some extra effect (not necessarily side effects, but also things like exceptions and errors, continuations & other nontrivial stack behaviour, parsing operations on a stream of text, etc etc). But outside of programmery things it's applicable to a much wider range of things than just that.

With that said, mathematicians don't call it anything since the definition is so terse, and would just repeat the expanded definition when they need the concept, since most of the cases they are interested in have additional structure beyond just the monad structure.

Monads are used in a lot of cases even outside of Haskell. You will see specific monads pop up in libraries every so often.

Also, promises and the async-await construct that you see in pretty much every cool language these days is a monad.

I had a dream where the jock who bullied me in high school laughed at me because i confessed to watching 30 minutes about monads and not getting it.

i never said anything about haskell being the only language where monads are relevant. his suggestion is a monad tutorial in haskell

youtube.com/watch?v=Nq-q2USYetQ

You'll understand by practice. Without looking it up, complete these:
data MState s a = MState { runS :: s -> (a, s) }

instance Functor (MState s) where
fmap = undefined

instance Applicative (MState s) where
pure = undefined
() = undefined

instance Monad (MState s) where
return = undefined
(>>=) = undefined

Imagine it as a box you can put values in :^)

This, but unironically

It's a way to compose functions together.

what language is this it looks pretty comfy

I'd also like a brainlet tier explanation for what a fucking monad is.

its just functions wrapped inside of functions that you compose together to model behavior
t. i have no fucking clue

so, a ...... nested function?

its haskell

Lol what a contrived brainlet definition.
It's just a horizontal categorification of monoid.

There's an epic russian hacker OS written in it. Looks like you are just a brainlet.

>epic russian hacker OS
cringe

Brainlet