Hello /g/
Can someone explain to me what a monad is and when i should be using it. I have a vague understanding which is not enough.
>>58806826
Do you know what a Functor is?
>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.
>>58807765
No. But I know what a function is.
>>58808376
you aren't ready to understand monadic functors until you understand functors. the concept is cumulative. The most important thing in both cases, though, is to focus on grasping the types. Everything you need to know about functor is `map :: (a -> b) -> f a -> f b`; everything about monad is `bind :: (a -> f b) -> f a -> f b` and `return :: a -> f a`. There are some obvious laws, but you don't need to get to hung up on that, they're the obvious ones after all.
>>58806826
>a monoid in the category of endofunctors
>>58807791
my sides
>>58806826
lol who needs monads when you hava java