What is a monad.If you can't explain it to a child then you don't understand it.
>>16927810You know that Canadian TV show "How It's Made"?I would put on an episode of that show, like, one where it shows the robots in the factories making coke bottles or toy cars or something, and explain that the factory is like a category, and the robots are like the monads. They check the object as it passes through and make sure it's exactly the same as all the others. If it's not, then it makes sure it is or it discards it.Or I would show the child like a fingerprint scanner on my tablet that I use to unlock it and say "this is like a monad, this monad checks to make sure I'm me. If I'm not me, it won't unlock. And that's all it does. It just checks to make sure it's me."These are all very basic and excellent examples of a monad that even a child would understand. But, now you will argue with me and call me a faggot and tell me I don't know what a monad is and be the stupid retarded nigger you came here to be. Since there's not a single fucking chance you came here to ask an honest simple question that has such an honest simple answer. You want to bicker and watch people argue for your own amusement. So, let's go then. Get on with it you fucking piece of shit.
>>16927810The Monad is the original substance of the universe from which all other things are derived. The most high and holy, from this singular point all others are subsidiary
>If you can't explain it to a child then you don't understand it.Holy retard cope.
>>16927815The leaf is fundamentally stupid.
>>16927815No child will ever abstract over your examples and actually arrive at a monad and I seriously doubt adults with no prior knowledge would have any clue what you're talking about, either.
>>16927857those are perfectly expected responses, monads only make sense with a highly sophisticated form of brain damage in the first placehowever, OP didn't demand the child to understand the explanation, so suck it
>>16927818this line has ethered mathfags lol
>>16927816What if its just hydrogen?I personally dont subscribe to the idea of "union of opposites" as that just creates contradictions that go nowhere. Legitimately. Its not at all that poetic, romantic idea of "opposites attract".In fact, Im thinking its just one huge scam for people to pin the blame for everything on a singular thing and call it a day.
generalized monoid, a monoid in the category of endofunctors, ie, an endofunctor, ie, a triple of functor T and 2 of its natural transformations n and u that satisfies associativity and unitality: (T, n, u)if category theory is a zooa monad is a transport crate, n is loading dock and u is the crate unpacker, and animals are objects of categories, endofunctor being it doesn't move the animals outside of the zoo, just transforms it from one place to anothert. pro
>>16927902My kid points out that you never specified what a category is in this analogy. You fail.
>>16927909zoo
>>16927810>What is a monad.A miserable pile of secrets!
>>16927810Service announcement:The anon who posts these threads is a 36 year old unemployed Mexican called Carlos, who lives with his alcoholic uncle. He copes about his situation by trying to learn math from ChatGPT and Wikipedia, however he can't understand it, which is why he repeatedly spams these questions.
>>16927945but chatgpt knows what a monad is
>>16927946Isn't that just a type in programming?
you don't learn category theory by learning monad, it's a special endofunctor to make it make sense, it's more of a definition thing, you need to understand the why, how category theory came to be, there is a reason why it's not taught, if you are learning math for application don't start with ct
>>16927948>not taughtnot taught at basic level*
say you have a collection of things in a bag. it could be a bag of marbles. you can arrange them in a whole bunch of ways, using a whole bunch of tricks. now let's say you made a list of all those ways, all those tricks.now you realize you can combine your tricks to make a new one. this applies to every single trick. your list includes every combination here.that's a monad. it's the list of all the tricks.
>>16927896The union of opposites is a direct requirement for comparison at all. The differences between things are along particular aspects which they share. A red ball and blue ball are different in the common aspect of color..>>16928020is this a category theory monad? Some kind of state space for morphisms?
>>16928024pretty much yeah i went with the category explanation, not the programming one although that probably would have worked better by using functions, but that goes back to just describing it as a box or conveyer belt type of analogy. i think having it just be a collection of things in a bag is as far as you can go with the analogy to a kid. trying to talk about how information in a box is swapped would lead to confusion no matter what.
>>16928025Would the monad operate on the entire state space of all morphisms within the graph or the space of morphisms at some defined boundary of the graph like an interface?
OP here.It's a conspiracy. It's literally never going to make sense. It's incredibly simple and applies to many things but literally no one is able to explain what it is.Other data structures have some kind of real life analogue. If you tell me what a tree is then I instantly get it because I've seen a tree before and I know how they work.When someone says monad I think of the floating black rectangle from 2001.Perhaps a monad is such a profound truth that as soon as you learn it it becomes you but then it robs you of the ability to explain it. It's a one way ticket.
>>16927947objects of various type can be set to Null. If the null case isn't handled, then bugs occur. This is the cause of so many issues that the creator of Null regretted it. To him it was easy and obvious, but in hindsight it's sorta bad. Having a box means you're forced to open the box to check if it's empty or not. If it's empty, then you're forced to handle it. If not, then you can use it.Obviously, you can do the same thing with if (x != null), but its easy to forget or to think, oh it'll never happen, until it does
>>16927946No it doesn't. Being able to chain operations is not enough.This code allows to chain operations but can't compose functions into a new function:https://godbolt.org/z/Y98fh71fj>>16927947Nope, a monad can be used to compose functions: https://godbolt.org/z/181PaYWrK
>>16927810 (OP)You can do it with a set of toys and cards with instructions that take a toy and return a toy.The domain is the set of toys. The cards are endofunctors. The monoid is the set of cards, and combining the operations of two cards always result in following the operations of another card. There must be also a card that takes and returns the same toy.A simple example:Two toys: A BFour cards: 1. Returns the same toy.2. Returns the other toy.3. Returns toy A.4. Returns toy B.
>>16927810>If you can't explain it to a child then you don't understand it.A cope meme for retarded faggots.
>>16927816OP didn't ask about The Monad, he asked about a monad and you completely skipped over that part to explain some greater context that depends on the underlying concept that you failed to explain in the first place.
>>16927863Children are literally retarded, though, we actually measure and scale retardation in how closely to early childhood the retarded person's thought processes are, so no matter how well you articulate something to an average child, they are either not going to understand or going to pretend they understand.
>>16927931>zooYou said category theory is a zoo. I'm pretty sure "category theory" and "category" mean different things.
>>16928128category theory is the principle of organizing category like a zoo, hence a zoo is a category, as there can be manyThe category is the zoo. Objects are enclosures. Morphisms are paths. A monad is a crate system for transporting animals around the zoo.
>>16928122>Children are incapable of learning anything Meanwhile, in reality, children learn all the time.
>>16928135OP didn't say to teach children anything, he said to explain it in a way they would already understand what you are talking about and children don't even learn through explanation, they learn through experience or teachers wouldn't even need 99% of the school curriculum since the majority of teaching to the point of understanding is about repetition rather than the base explanation.
>>16927810A monad is an endofunctor together with two natural transformations satifying the pentagon diagram and the unitor diagramHope this helps
>>16928083I mean, if null is the only issue you can just carefully construct the program and sanatize input such that unintentional nulls never occur and intentional ones are checked for... basically just a domain restriction... if a violation never occurs then how can you say that it doesn't pass...
You grasp abstractions by seeing enough concrete examples of those abstractions that you notice the underlying pattern and start to perceive it in new examples. The problem with monads and other such things is that they are abstractions over abstractions, many times over. Teaching this to a child is a monumental task that has little to do with explaining things and everything to do with slowly building up towards it. Nothing in this thread comes close to teaching anything and I'll readily admit I can't do better.
>>16927946No, it doesn't. The overwhelming majority of things that fit that description aren't monads.
>>16928122>>16928140mathfags still seething over this lol
If you can't explain a mathematical concept to a woman, you don't understand it.
>>16928158Yes, it is very annoying to mathfags and anyone who can develop an understanding of reality that human children are born completely retarded, too retarded to even walk or feed themselves, and it takes decades before they can actually understand anything if they ever actually understand anything at all instead of just falling into line.
adding integer is a monoid, 5,3 ->8flattening a list is a monad [5],[3]->[5,3]
>>16928040nta but a monad is an "interface" between a category and itselfpeano's successor function is an example of the free monad
>>16927934Mathkind ill needs an abstraction such as you!
>>16927810An array of numbers.
why even have numbers... their useless... i just want to play logic puzzles all day...
>>16928201there are no numbers in category theory
What happens if I add green to yellow then subtract blue and multiply by magenta? You should be able to solve this.
>>16928209abstractions say not what you get but what kind of answer do you want, transformation, literal brown goo, mapping, group, etc, it is all about how you formalize it
>>16928120An idiot admires complexity.This quote from Terry Davis, a man that has abstracted minimalism down to using a plastic milkcrate as a desk behind a Mcdonalds.
>>16928168Enough definitions. Have at you!
>>16928142That's like saying if you want to prevent memory leaks then just "carefully construct the program..." or if you want an 100% on your test, just don't give a wrong answer. Yeah no duh, but shit happens anyway.
>>16928546damn, crazy how all these programs written in c/c++ just work then and crashes are a rare anomaly
>>16928546What do you think a memory leak means in the pataphorical sense? The reason I say this is that good design and assembly isn't always sufficient for preventing leaks within the rated lifetime of a given feature.
>addition isn't a valid operation because you might accidentally add the numbers together wrong
>>16927815I used to watch that as a kid, good times
>>16927815Is each robot a monad or is the entire collection a monad, or is it just the validation robots that are gating? Or is it just the final robot at the end of the line with the go/no-go
>>16928564What if you add them carefully?
>>16928606write a proof showing that you have never made a mistake
>>16928619Theorem: I am always rightProof: Trivial
>>16927810Seems simple enough
>>16928606I already added them.
>>16928631Carbon is simple but explaining what a carbon based lifeform is is pretty difficult."It's so general that it can be almost anything" doesn't help much.
they're whatever you want them to behumans just made them up
>>16928166flattening a list is a monoid too though
>>16927810Put yourself in the designer's shoes:>be Simon Alex-Jones>be designing languge>want something that behaves like a "not const" tag in other languages, i.e. when you calculate something using a "not const" value the new value is "not const" too>but in our language, everything is a term like f(g(x),h(x)), so how?>solution: represent the tag with a new unary function symbol, say m()>add some rules saying it doesn't matter where in the term m is>e.g. f(g(m(x)),h(x)) is formally equivalent to m(f(g(x),h(x))>later, find "monad" in a category-theory bookThis is not an analogy or anything, this is literally how/why they came up with it and I have no clue why people try to understand it in any different way
>>16928819Programming languages shouldn't attempt to obfuscate the way the underlying hardware actually works.
>>16928821Why not?
>>16928821>I want my browser to download machine code from the internet and run it in order to render webpages
>>16928821CSlets should stop polluting languages with implementation details and UB obfuscating and subverting otherwise straightforward semantics >but if i add hackslop you can use it for systems programmingdon't care, fuck off to C
>>16930369I agree that no one should want to compute with real numbers, and that the attempt betrays a fundamental lack of understanding of the nature of computation.
>>16930369I think volatile accesses should have been implemented with intrinsicsArchitecture-dependent layout "guarantees" are fucking retarded
>>16930391At no point was the inclusion of a null pointer necessary, either, and even Ritchie doesn't excuse it.
>>16930483pointers be allowed to be null is literally half the point of pointers...
>>16928821>Programming languages shouldn't attempt to obfuscate the way the underlying hardware actually works.Name any programming language that does that besides C itself.
>>16930486It's the point of many things. Sometimes a pointer has to be nullable, sometimes it doesn't. Using an object that has more possible states is bad for optimisation, so it's really better if pointers aren't nullable by default. The concept of nullability can instead be implemented with the Maybe monad. This has the advantage that it can be applied to more general types, not just pointers.
>They took everything that wasn't nailed to the floor. Including my floor-nailing machine, which because it has to move from place to place to do so isn't itself nailed to the floor.This is an introduction to category theory. You can infer the nature of an object based on its relationship with other objects in the category.This doesn't explain what a monad is, but sets the stage for category theory and closed dynamical systems where causal relationships are downstream from the input.
>>16930486>one 'value' is categorically different in behaviour from all other values>shares none of the properties of other values of the type>it's the same type because it just is, ok??lol
>>16930702#1 it's programming not math (math does the same shit anyways)#2 the goal is to write performant and simple code, and allowing null is better for both compared to constructing an entire framework around which the pointer can never be null (which would also conflict with the physical reality of how the computer functions)
>>16930702>0+0i is a completely normal complex number guys
>>16930702This but with 0 and division
>>16930702Don't forget the one-past-the-end pointer
>>16930719>performance requires a dogshit type system that can't catch errors that are obvious at compile time>that is just how computers werkC's poor design has ruined generations of programmers making up ever new excuses why compilers should be "simple" (poorly designed) yet arbitrarily complicated (muh -O3 go brrr)
>>16930735>>16930754Which is exactly why there is specific sets (types) excluding it, yes. That is how it works.
You know, just stating that "pointers can't be null" doesn't magically make your program bug free. In fact it's worse - rather than crashing when you do something wrong it just silently lets you make mistakes which are probably going to crash the program at some later harder to diagnose point.
Bunch of retards arguing about nothing. TypeScript, of all things, implements the objectively correct answer to the null pointer question without any of that Maybe boilerplate nonsense.
>>16927816pseud schizo onions babble
>>16927810a set of possible choices
>>16927810excessive nothingness .. explicit 2-4 , 3-5 ...whole fuckin things the complete incomplete rn lol
>>16928587I am the Monard.
I reject your premise (stolen from the jew Einstein) and assert my own:dont try to explain things to retards, it is a massive waste of time
>>16930569>This is an introduction to category theory. You can infer the nature of an object based on its relationship with other objects in the category.Category theory is trans. I hate people making up random new names for things and being all smug about it. What the fuck is wrong with plain old sets.
>>16930781nocoder who never debugged a serious memory bug in his life thinks the program just crasheslmao