What the FUCK is a monad

what the FUCK is a monad

Other urls found in this thread:

adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html
twitter.com/SFWRedditImages

Literally the first link on Google.... Jesus fucking Christ are you that fucking lazy??!!?!?

>In functional programming, a monad is a design pattern that defines how functions, actions, inputs, and outputs can be used together to build generic types,[1] with the following organization:

>Define a data type, and how values of that data type are combined.
>Create functions that use the data type, and compose them together into actions, following the rules defined in the first step.

What the fuck man, I just need the layman explanation

Not sure, however, a monadnock is a very interesting thing. It's basically a giant boulder around which the earth has eroded over the years to expose a mountain. Stone Mountain and Ayers Rock are both example of monadnocks

If you are a programmer you would understand that definition pleb

Like a gonad but just one

Monads are literally transplants from category theory on immunosuppressant drugs. Why do you expect them to be pleb-tier?

Go get your bachelor's in Mathematics, brainlet, then you can come back to programming.

>doesn't understand what a class is
>thinks it's just an alias for struct

google the JUST monad

> being a Google pleb

Often definitions and specially design pattern definitions can be overly complicated when it's actually really simple.
Just keep looking for examples and read everything a few times.

Not him but I use google because it's much faster than any other search engine because of where I live.

Your convenience is more important than your privacy?

monads is how elitist purist functional pricks deal with having to deal with low-level non-abstract obstacles to making pure functional programs

They're just a design pattern.

Anything which satisfies the monad laws. Ie it has certain morphisms(functions) that adhere to certain properties.

What programming language(s) do you use user? Do you know go for example? I will try to help you.

> design pattern
Please stop using that expression. It fills me with disgust. Just remove "design" from it and it will be fine.

Monad for niggers:
class Example(object):
def __init__(self):
self.x = 5

def one(self, val):
self.x += val
return self

def two(self, val):
self.x += val
return self

def three(self, val):
self.x += val
return self


ex = Example()
ex.one(1).two(2).three(3)
print(ex.x)

This is not like a monad at all.

type prescription of a function

it's really not as complicated as all the silly definitions out there make it out to be:
adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html

that's more like a Functor than a monad. Monads involve unwrapping and joining wrapped values together, not just performing a sequence of actions, despite what the "IO Monad" might make you believe.

I think you need to brush up on what a monad is

When did we stop pointing out underappreciated writings?

Ok ok
First link on whatever search engine you choose.
Is that better?!?

>design pattern
Stopped reading there.

Mathfag here. I'm currently doing my undergrad project on monads and functional programming.

I promise you anons that I will make a short book titled "Monads with lolis" to help you all understand.

Stay tuned.

D-Do you know about calculus of constructions?