Imblying

Imblying

Attached: λ.png (450x450, 23K)

Other urls found in this thread:

en.wikipedia.org/wiki/Meme
rabuf.github.io/applied-category-theory/
fm2gp.com
twitter.com/NSFWRedditImage

A monoid in the taco of endo functors.

A monad is just a monoid in the category of endofunctors, what's the problem?

xmonad with an x

It's a box to put values in :^)

monad is a en.wikipedia.org/wiki/Meme

Some abstract bullshit nobody uses in the real world

monad is the female version of a gonad

in OOPsie terms, its like a container with some autistic requirements like composition and concatenation

A monad is like a burrito.

a Monad is a type that implements bind, return, and unit

Just a horizontal categorification of monoid.

The reason people can't explain it in 20 seconds is because it's similar to simple algebra.
Can you explain the Pythagorean theorem to someone who doesn't know algebra in 20 seconds?
The monad is similarly basic but you have to learn it.
You get segfaults and I never do, bitch.

In John Dee's Hieroglyphic Monad he describes that which perfects men's soul through the use of the Will. The Monad is the one single thing from which all things come from and to which all things move toward. It is the alpha and the omega, and yet is still happening. It is the past, the future and the present.


Realizing the Monad in a deep enough fashion so as to always remember it is our goal.

>Can you explain the Pythagorean theorem to someone who doesn't know algebra in 20 seconds?
Yes

Attached: pythagoras1.gif (577x462, 3K)

ads in the form of money

Leibniz

Bob sends Alice an encrypted message that shakes hands with Carol.

a monoid with ads

Attached: IMG_20180903_195657_928.jpg (316x404, 33K)

>"wtf? abc? I thought this was math"

An object whose functions returns a modified object of the same type.

its like an onion, it has layers

Haskell: A monad is a obfuscated way to pretend Haskell is a pure functional language.

Some kind of creature from ancient Greek mythology, I believe.

Monkey On Nigger Assemble Day

>You get segfaults and I never do, bitch.
Neither do I, and i don't use that crap.

>Haskell: A monad is a obfuscated way to pretend Haskell is an imperative language.
There we go.

the thing in itself.

That picture leaves out the part that shows that c2 is as big as a2 and b2 combined.

A design pattern to manage side effects mostly.

a programming pattern in which the final result is determined by a reduction where the elements within it must be performed in a known sequence; thus emulating imperitive languages.

>Can you explain the Pythagorean theorem to someone who doesn't know algebra in 20 seconds?
Yes. You can visualize a triangle, and then instantly imagine what you could use this information in the real world for.

"How tall does a lighthouse have to be"

I have no fucking idea how to put a monad in the context in the real world.
I'm not even sure you can.

It's a generic container that wraps another objects.
It then allows you to do operations to that object and return the result, where the result is also wrapped in a monad.

In functional programming, a monad is a design pattern[1] that allows structuring programs generically while automating away bookkeeping code needed by the program logic. Monads achieve this by providing their own data type, which represents a specific form of computation, along with one procedure to wrap values of any basic type within the monad (yielding a monadic value) and another to compose functions that output monadic values (called monadic functions).[2]

This allows monads to simplify a wide range of problems, like handling potential undefined values (with the Maybe monad), or keeping values within a flexible, well-formed list (using the List monad). With a monad, a programmer can turn a complicated sequence of functions into a succinct pipeline that abstracts away additional data management, control flow, or side-effects.[2][3]

To give an example:

A Divisible contravariant functor is a monoid object in the category of presheaves from Hask to Hask, equipped with Day convolution mapping the Cartesian product of the source to the Cartesian product of the target.

By way of contrast, an Applicative functor can be viewed as a monoid object in the category of copresheaves from Hask to Hask, equipped with Day convolution mapping the Cartesian product of the source to the Cartesian product of the target.

Given the canonical diagonal morphism:

delta a = (a,a)

divide delta should be associative with conquer as a unit

divide delta m conquer = m
divide delta conquer m = m
divide delta (divide delta m n) o = divide delta m (divide delta n o)

With more general arguments you'll need to reassociate and project using the monoidal structure of the source category. (Here fst and snd are used in lieu of the more restricted lambda and rho, but this construction works with just a monoidal category.)


divide f m conquer = contramap (fst . f) m
divide f conquer m = contramap (snd . f) m
divide f (divide g m n) o = divide f' m (divide id n o) where
f' a = let (bc, d) = f a; (b, c) = g bc in (b, (c, d))

It's a way to manage side effects and unexpected errors in a functional language while maintaining functional composition.

A Month in swedish

a sack with one ball

I get it now, thanks for the clear explanation.

lmao, best post today

A monad is a wrapper for certain computations with side effects, such that you can chain computations wrapped by the same monad in a way where subsequent computations may depend on the preceding ones.

Example:
- I read a string, then append an exclamation mark to it and print the result -> monad, because what I print depends on what I read.
- I read a string, then I print, "understood" -> not necessarily a monad.

Actually, scratch 'with side effects', that's not a requirement.

something funcional programming related, I don't actually give a fuck

A monad is a type `m` such that it support the following operation
join :: forall a. m (m a) -> m a

a dude with one testicle

a design pattern that's used to model different types of computation within functional programming, including but not limited to exception handling (error/maybe monads) nondeterminism (list monad) I/O and wanky imperative stuff (IO) mutable state (state/ST/IOrefs) etc.

A 'design pattern' is a set of vague guidelines of how to do things in order to make the spaghetti-producing shit paradigm you're trying to program with bearable.

A monad is a well defined typeclass with rules. Saying a monad (together with the bind operation) is a 'design pattern' is like saying differentiable functions (together with the derivative) is a 'design pattern'.

A monad is an abstraction with well defined laws.

true.

gallon of milk a day

A way to fake imperative programming within functional programming

Explain as though the reader doesn't know that some of those symbols and the order of their interpretation have special meaning.

>I have no fucking idea how to put a monad in the context in the real world.
>I'm not even sure you can.
It's not hard to find things in the real world that are monadic. For example, putting stuff in a box:

return - if you have a thing, you can put it in a box (e.g. if you have an apple, you can put it in a box)
bind - if you know how to manipulate a thing in some way, you can turn a thing in a box into a manipulated thing in a box (e.g. if you know how to eat an apple and turn it into an apple core, you can turn an apple in a box into an apple core in a box)

>if you have a thing, you can put it in a box
Wow, that's a useful analogy.

It's such a great analogy that it can be used for literally anything.

That's what an analogy is supposed to do right?

>bind - if you know how to manipulate a thing in some way
>if you know how to manipulate a thing
Yes this isn't incredibly ambiguous and definitely helps to paint a picture.

I'm going to open you up to the possibility that half the reason that this is hard to explain is because of people like you that just jerk yourself off with obtuse rhetoric that means nothing to people that haven't been programming long enough to start getting philosophical about it.

can someone explain to me why category theory is useful in understanding concepts in c++20?

Books
rabuf.github.io/applied-category-theory/
fm2gp.com
Using Math invariants/structures in type system for correctness,modularity and simple code
C++ 20 Concepts begin reduce ideas concept from Bjarne Stroustrup Concepts maybe full concepts until C++26

Hey google!
*du run~*
What's a monad?
*...*
*run du~*
>According to wikiepedia...

It's an applied monoid

>Wow, that's a useful analogy
... it's not an analogy. It's a concrete example of something in the world that behaves monadically. That's what you asked for. That's what I gave you

>if you know how to manipulate a thing
>Yes this isn't incredibly ambiguous and definitely helps to paint a picture.
Lol if that's too ambiguous for you maybe try reading the rest of the sentence where I give a concrete example: "e.g. if you know how to eat an apple and turn it into an apple core"

>I'm going to open you up to the possibility that half the reason that this is hard to explain is because of people like you that just jerk yourself off with obtuse rhetoric
>obtuse rhetoric

>if you have an apple, you can put it in a box
>if you know how to eat an apple and turn it into an apple core, you can turn an apple in a box into an apple core in a box

I'm not sure how I could make this example less obtuse or rhetorical. I'm going to open you up to the possibility that you're a goddamn retard

>... it's not an analogy. It's a concrete example of something in the world that behaves monadically. That's what you asked for. That's what I gave you
It's potentially the most useless "example" that has ever existed.

Literally everything in the corporeal world can be "put in a box"

>Lol if that's too ambiguous for you maybe try reading the rest of the sentence where I give a concrete example: "e.g. if you know how to eat an apple and turn it into an apple core"
"Doing something to something else" is not a useful example either. I don't even know if it's possible to get more ambiguous than that in the confines of the English language

If your understanding of something is "You can put it in a box and do something to it" then I don't think you understand it well at all. Einstein said "If you can't explain it to a 5 year old, you don't understand it"

You can't explain it to someone with 5 years of programming experience that has written a compiler. If you were explaining the differences between a horse and a semi-truck to a 5 year old you'd probably say "They both have 4 things that touch the ground and they both go fast"

Please stop just coming into these threads to shit out these absolutely useless rhetorics. All you're doing is discouraging anyone that actually wants to learn programming by making them think that they aren't cut out for something because they don't understand what you mean when you say "You can put it in a box"

Attached: ss+(2013-12-29+at+12.55.39).jpg (541x398, 62K)

Just a byproduct of an adjunction.

>It's potentially the most useless "example" that has ever existed.
>Literally everything in the corporeal world can be "put in a box"
Yes. So? Literally any type of object can be put inside, say, a maybe monad

Abstract mathematical structures can apply to lots of stuff. Literally any countable thing in the corporeal world can be added together with behaviour that matches the arithmetic of natural numbers. Does that mean an example of adding 3 apples to 2 apples and getting 5 apples is useless for understanding addition?

Again, consider that you have no idea what you are talking about

>"Doing something to something else" is not a useful example either
Agreed. That's why I gave a concrete example. It's right there at the end of the sentence, like I said

>If your understanding of something is "You can put it in a box and do something to it" then I don't think you understand it well at all
I said that putting manipulable things in a box is a real world example of something that is monadic, not that this is my understanding of monads. You said you have no idea how to put a monad in the context of the real world. So I am giving you a real world example. I'm giving you what you wanted, you fucking idiot

>Einstein said "If you can't explain it to a 5 year old, you don't understand it"
Lol I don't care who said it, if you think a 5 year old can understand everything in this world you are completely retarded

>You can't explain it to someone with 5 years of programming experience that has written a compiler
I wasn't *trying* to explain monads to you, I was giving you a real world example because that's what you said you could't think of. You're admitting now that you don't understand monads to begin with, so it's not surprising that you don't understand the significance of a simple real world example

>Abstract mathematical structures can apply to lots of stuff. Literally any countable thing in the corporeal world can be added together with behaviour that matches the arithmetic of natural numbers.
Explaining what something is by starting off by explaining a fundamental law of the universe is not a good way to start

You show a toddler that the square peg fits in the square whole. You don't start off by explaining to them what topology is and how "topology is just math under the constraints of the laws of physics"

Here's a brief list of questions any reasonable person would have given that information:

- Can a monad be added to a monad?
- What kind of things do not "go in the box"
- Can you only use parts of a monad?
- Do monads only work in computers?

A brief list out of the infinite amount of combinations within the logical confines of "It's something you can put in a box"

>Agreed. That's why I gave a concrete example. It's right there at the end of the sentence, like I said
I am not exaggerating when I say that it's potentially the most useless "example" that you can formulate with the english language

I'm serious. If you think I'm wrong, try and formulate a more useless analogy

>Lol I don't care who said it, if you think a 5 year old can understand everything in this world you are completely retarded
The 5 year old doesn't need to understand how a rotary engine and airbrakes work. They only need to know that "A truck is a thing that carries people and things places because pushing them is too hard"

>I wasn't *trying* to explain monads to you, I was giving you a real world example
>A real world example
Your "example" being limited to "The real world".
Thank your limiting the applicability of your example to the corporeal dimension.

The "fedora" insult seriously needs to make a comeback if this website is populated by people like you.

imagine being this mentally incapacitated holy shit

A single ad

this faggot does not topology

MERRRR

a fucking abstract concept

which in the context of CS is just a fucking ADT - a Type Class (which could be instantiated/parametrized to yield a new Type) plus an Interface to implement, which is constrained by so-called Monadic laws, which endure composeability.

Wrong

It is a type class, which when parameteized with another type yield a new type.

The concept require to implement an interface, which consist of bind and >>= with certain signatures and constrained by so called Monadic laws (constraints)

/thread

that ho from ergo proxy
anyways how is that about technology

It is not a container, you retard, It is much more general and abstract bullshit.

Monad could be *viewed as* a container (by retards) but it *is not* one.

No. What you describe is just an interface to implement to be an instance of a Monad type-class

you forget the laws and that it is a higher kinded type

being this much retarded!

Hegel is rolling in his coffin.

A monad is any generic type M supporting two functions: Bind and Return.

Return takes a value of type T and returns a value of type M.
Bind takes a value of type M and a function mapping a type A to a type M, and returns a value of type M

In Rust, a canonical example of a monad is the Option type. The constructor Some(value) is your "Return" function, while the method "and_then" is your "Bind" method.

fuck you, javascript cuck

Something something endofuctor

I will kill you in your sleep if you don't repent RIGHT FUCKING NOW

Attached: patrick.png (500x365, 231K)

I do not program in Javascript.

How to use a monad is more important than specifying exactly what it is (hur dur endofunctor).

A monad is an abstraction that allows you to separate value and effect (not necessarily a side effect)

For instance in scala we might do
val a: Option[Int] = Some(3)
val b: Option[Int] = Some(4)
val c: Option[Int] = None
for {
fuck_niggers

good

can you read

You are my hero

Attached: 47473874_1964115643664630_409324492276367360_n.jpg (720x960, 52K)

A type of mongoloid.

Miss me with that js shit f.am

light, on a quantum mechanical level, is a monad

my dick is a monad

overloaded semicolon operator

Some meme that has zero applications in real life.

really like this post

I don't understand a single post ITT and I've been programming for over a decade

Attached: ᒚᕼᕴᒚᕼᖽᐸ.jpg (941x730, 173K)

bro
a monad is just a monoid in the category of endofunctors

If you look at how they're defined you won't get why they're useful or what they really do.
Pure, bind and friends doesn't really give you an intuition. I'm the one who wrote this , which should have looked like this instead:

val a: Option[Int] = Some(3)
val b: Option[Int] = Some(4)
val c: Option[Int] = None
for {
fuck_niggers

Just tell me what the fuck is the use of monads and I'll be on my merry way

Attached: 2-mary-poppins.jpg (298x413, 93K)

It lets you not care about the context. a, b, c could be async values, they could be automatically logging, it doesn't matter, you'd still use them the exact same way.
The gist of my example is that I never have to check if an option exists or not before I use it since that is all handled at the statement boundary (i.e between each line in the for comprehension).

Spbp

"Think of a monad as a spacesuite full of nuclear waste in the ocean next to a container of apples. now, you can't put oranges in the space suite or the nucelar waste falls in the ocean, *but* the apples are carried around anyway, and you just take what you need"