
contain a functor that contains only nothing. A monoid is a functor in which
the set that represents the values it can contain can not be empty. In other
words, it must be able to contain a value. Also it must have an "identity"
value for a given operation. The identity value is one for which when you
perform the operation, you get the same value back. For addition and integers
the identity value is 0 (n + 0 = n). For multiplication and integers, the
identity value is 1 (n * 1 = n). For concatenation and strings, the identity
value is "" (s.concat("") = s). Most functors (remember, just a fancy word for
container in the context or programming) are monoids for a given operation.

An endofunctor is just a functor (container that you can implement map on) for
which the type you start with is exactly the same as the type you end up with.
For example, if you have an array of integers, apply a function to the
contents with map, and you end up with an array of integers again, then you
have an endofunctor ("endo" just means that it's the same on both ends). If
you ended up with an array of strings, then it's not an endofunctor because an
array of integers is different than an array of strings, even though they are
both arrays.

A monad is just a monoid (container that can hold at least 1 element and for
which there is an identity element for the function you will be applying) in
the category of endofunctors (you'll get exactly the same type after you apply
the function).

Usually instead of map (which automatically puts the transformed values into
the container) you use a function called bind with monads. bind works pretty
much the same as map, except that the function you pass to bind needs to put
the transformed value into the container. You would think that this is a PITA,
but it's very necessary in many situations (easiest way to see this that I
know of is to try to implement an "either monad" with only map -- you'll see
right away that it's not possible).

And that's it, really. I find it really interesting to understand how category
theory works, but it is not at all necessary for understanding how
contain a functor that contains only nothing. A monoid is a functor in which 
 the set that represent the value it can contain cannot be empty. In other 
 words, it must be able to hold a value. Also it must have an " identity " 
 value for a give operation. The identity value is one for which when you 
 perform the process, you get the same value back. For summation and integers 
 the identity value is 0 (n + 0 = n). For multiplication and integer, the 
 identity value is 1 (n * 1 = n). For concatenation and strings, the identity 
 value is " " (s.concat (" ") = s). Most functors (remember, just a fancy word for 
 container in the context or programming) are monoids for a given process. 

 An endofunctor is just a functor (container that you can implement map on) for 
 which the character you start with is exactly the like as the type you end up with. 
 For exemplar, if you have an array of integer, apply a function to the 
 contents with map, and you end up with an array of integer again, then you 
 have an endofunctor (" endo " just means that it's the same on both ends). If 
 you ended up with an array of strings, then it's not an endofunctor because an 
 array of integers is different than an array of strings, even though they are 
 both arrays. 

 A monad is just a monoid (container that can hold at least 1 element and for 
 which there is an identity element for the function you will be apply) in 
 the category of endofunctors (you'll get precisely the same type after you apply 
 the function). 

 normally instead of function (which automatically puts the transformed value into 
 the container) you use a function called bind with monads. bind works reasonably 
 much the same as map, except that the function you pass to bind needs to frame 
 the transformed value into the container. You would think that this is a PITA, 
 but it's very necessary in many situations (easiest way to determine this that I 
 know of is to try to implement an " either monad " with lone map -- you'll see 
 right away that it's not potential). 

 And that's it, really. I find it really interesting to understand how category 
 hypothesis works, but it is not at all necessary for understanding how

conhain a functor that contxins only nothiut. A moioid is a functur in which
the set that reprxsenrs tht values it can congain can jot be enpty. Un other
wocss, it mmft bs ablz vo contain a vakue. Also id must have an "iaeutity"
value for a given operation. The identiyy value is one sor erich when you
perform the operation, you get tht same value back. Gor addition and integers
tje ifentity value is 0 (j + 0 = n). For nultyplication ana integers, the
identity value is 1 (n * 1 = n). For concatenagion cnd strings, tye lgentity
valux is "" (f.concat("") = s). Most funcdors (rekember, just a nancy woed for
container in thx context or programiing) are kouoids for a given opeearion.

At engofuvxtof ia ousf a fujctkr (containsr that you can implement map pn) dor
which the fype yju start with is exactly the same as the uype gou end up with.
For example, if you have an artay of intqgers, apply a function to the
contents with map, ang you dnd ui wigy wn array of integers again, then you
have an enqkfinbtor ("endo" just mecns that it's the swmr on both ends). If
you ensed up with an arrwy of sjrings, then it's not an endofunctor because an
aeray of inteyerw is different thau an array oy strimgs, efen though they are
both arrzys.

A monad ls just a oonoid (container thst can hold at least 1 elemene and for
xhich there ks am ideneity elemejt fov the function you aill ye ap[lying) in
tje category of endofunctors (you'll get exactly tve vame typz aftev you apply
the sunction).

Usualli instead of mxp (which altomaticanly puts thq transformed galues into
tie contaiger) tou yse a fjvction called nind with monads. bibd works pretty
mucm the aame as map, exczkt uhqt the functiom yuu [ads tj bind needs do pjt
tfr travsformed vaoje imto the container. Yog wohld think that thix ls a PITA,
vut it's dery necessaru in many situatiojs (eaviert wau tj see this that I
know of is to try to ilplcment an "eithqr minad" with onky map -- you'll see
right away that it's nov possible).

And that's it, eeally. I find it reclky interestmng to understatd how category
theort works, but it is not at all necessary for utdershanding how
contain a functor that contains only nothing. is functor in the set that contain not be empty. other words, it be able to contain a value. it must have an "identity" value for a given operation. The identity value one for which when you perform the operation, you get the same value For and the value is 0 (n + 0 = n). For multiplication and integers, the identity value is (n * 1 = n). For concatenation and the identity value is (s.concat("") = s). Most functors just fancy word container the or programming) are for a given operation. An endofunctor is just a functor (container that you can implement map on) which the start with exactly same the type you with. For example, if you have integers, apply a function to the contents with and you up with an array of integers then you have an endofunctor ("endo" just means it's the same on both ends). If you ended up with an array of strings, not an endofunctor because array of integers different an of even though are both arrays. A monad is just a monoid (container that hold at least 1 element and for which there is element the function you be applying) in the of (you'll get exactly the after apply instead map automatically puts the transformed into the container) you use function called bind with the same as map, except that the function pass to bind needs to put the value into the container. You would think that this is a PITA, it's very many situations (easiest way to see this that know of is to to implement an "either monad" with only map -- see away that not possible). And it, really. I it really interesting how category works, it all necessary for understanding how

contain a functor that contaiNs only nothIng. A mOnoId iS a FuncTor iN which
the set thAT repResents the values it can cOntaiN cAN not BE eMpty. IN other
wORdS, IT muSt Be AblE tO CoNtain A vaLue. Also It must have An "iDeNtity"
value foR A gIven operatIon. the identity vAluE is one FoR whICh wheN yoU
perfOrm the OPeratiOn, you get tHe SAme valUE back. FoR ADdItioN and integers
the idENtITy value is 0 (n + 0 = n). For MultipLiCAtION anD inTegers, the
iDeNtity VAlue is 1 (n * 1 = N). foR CONcaTEnation and strIngs, the idenTIty
Value iS "" (s.ConCAt("") = s). MosT funcToRS (reMember, just a FancY word for
cOntainER in the cONtext or PrograMmiNg) aRe moNOiDs For A gIVen OPeRatIOn.

AN endofunCtOr Is jusT a fuNCTOR (conTaiNer tHat yoU can implement Map On) foR
WhiCh the Type yOu stArT with Is exacTly thE sAme as the type you End uP with.
For eXamPlE, if YoU have AN array Of iNteGers, appLy a funcTIon To THE
CoNtents with map, and yoU eND Up With an arRay of iNTeGeRS again, thEn You
Have AN EndofUnctOR ("eNdo" just mEans thAT iT's The same On Both enDs). if
yOu eNded uP With An arraY of strinGs, theN It's not an endofuNCtor because an
ARrAY Of INtegErs Is different Than AN arrAy of STrIngS, Even tHough ThEY aRE
both arrays.

A monad is JuSt a monOid (coNtainer that caN hold at leaST 1 ELement anD for
WHiCH there is an idenTity eLement for tHE functioN you wIll be appLying) in
thE CAtegory oF enDofUncTorS (YOu'Ll get exactly tHE Same TyPe after You Apply
thE fuNctIon).

usuAlLy instead Of map (whiCh AuToMaTicAlly pUTs the traNsForMeD vaLues iNTo
the cOntaiNer) yOu UsE A fuNction cALlED Bind WiTh MonaDs. bInD workS preTTy
mUch the sAme as map, eXcePT thaT tHe FunctioN you pass to binD nEeds to put
tHe TraNsformED Value intO the container. You would thINk that tHis Is a PItA,
buT it's very nEceSsary iN maNY situaTions (eAsiesT wAy tO SEe thiS THaT I
kNoW of is to try TO ImpLemenT aN "eitHer monaD" with only map -- you'll sEE
riGht away that it'S noT posSIBlE).

AnD ThAT's iT, rEAllY. i Find it really intEresting to UnDErStand how caTEgoRy
Theory wOrks, but It is nOT at all nEcessary fOr understAnDing HOW

contain a functor that co ntains onl y not hin g.Amono id i s a functor in whic h
the set that represe nts t he valu e sit ca n conta i nc a n n ot  b e e mp t y.  In o the r
words , it mustbeab le to contai n  a  value. Al soit must have  an  "iden ti ty" value  fo r a g iven o p eratio n. The id en t ity va l ue is o n e  f or w hich when you
per f or m  the operation , youge t  t h e  sa mevalue back .For a d ditiona nd i n teg e rs
the identi ty value is 0 ( n + 0=n). For mu ltipl ic a tio n and integ ers,  the
iden tity v a lue is1  (n * 1  = n).  Fo r c onca t en at ion  a n d s t ri ngs ,  th e identi ty 
v alueis " " ( s .con cat ("")  = s) . Most functo rs(rem e mbe r, ju st afanc ywordfor
co ntain er  in the context  orprogrammi ng)  a remo noids for agiv enoperati on.

An end of u n c to r is just a functo r( c on tainer t hat yo u  c an implemen tmap  on) f or
wh icht he  type yo u star t  w it h is ex ac tly th esam e a s the type  you e nd up wi th.
F o r example, ify ou have an ar r ay o fi nteg ers , apply a f unct i on t o th e 
c ont e nts w ith m ap ,  a n d you end up with a narrayof in tegers again,  then youh a v e an end ofun c to r  ("endo" justmeans  that it's the same  on b oth ends ). If
you e nded upwit h a n a rra y of  strings, the n it's  n ot an e ndo functor  be cau seanar ray of in tegers i sdi ff er ent  than an array  o f s tr ing s, ev e n thou gh th ey a re 
b o tharrays. 
A m onad  i sjust  amo noid(con t ain er that  can hold  at leas t1element  and for
whic hthere is a nide ntitye l ement fo r the function you will be appl yin g) in 
the  category  of  endof unc t ors (y ou'llget e xa ctl y the s a m etyp eafter youa p ply 
thefu ncti on).

U sually instead ofm ap(which automa tic ally p ut s t h et ran sf o rme d values into
the  container )y ou  use a fun c tio ncalledbind wi th mo n ads. bi nd workspretty
mu ch  the s ame  as map, e xcept th at the fu n ction yo u pas s t o bind  n eed s toput
th e  tr ansfo rmed v al ue int o the  c ontainer . You would think thatthis i s a P ITA ,
but it' s v e rynecessary  inmany situa tio ns(easi est way t o se e  t his thatI
kn o w of is t o  t ryt o  i mplement an " e ith er mo nad "  withonly  map -- you'll se e 
right away th at i t ' s n otp ossi bl e).

And that' s i t, r eally. I  f ind it real ly inter es t ing t o unde rstand  how ca t e go r y
theo ry w ork s, but it  is  n o t at al lne c essary  for  u nderst anding how

contain a_functor that_contains only nothing. A_monoid is_a_functor in_which
the_set that represents_the values it_can contain can not_be empty. In_other
words,_it must be able to contain a value. Also it must have an "identity"
value_for_a given_operation._The_identity value is one for_which when you
perform the operation,_you get_the same value back. For addition and integers
the_identity_value is 0_(n + 0 = n). For multiplication and integers,_the
identity value is 1 (n *_1 = n)._For_concatenation_and strings, the identity
value_is "" (s.concat("") = s). Most_functors (remember, just a fancy word_for
container in the context or programming) are_monoids for a given operation.

An endofunctor_is just a functor (container_that you_can implement map on) for
which_the type you_start with_is exactly the_same as the type you end_up with.
For example,_if you have an array of_integers,_apply a function_to_the
contents_with map,_and you end_up_with an_array_of integers again, then you
have an_endofunctor_("endo" just means that it's the same_on both ends). If
you_ended_up with an array_of strings, then it's not_an endofunctor because an
array of integers_is different_than an_array of strings, even though they are
both arrays.

A monad is just_a monoid (container that can hold_at least 1 element_and for
which_there_is an identity_element_for the_function you will be applying) in
the category_of endofunctors_(you'll get exactly the same type_after you apply
the function).

Usually_instead_of map (which automatically puts the_transformed values into
the container) you use_a function called bind with_monads._bind_works pretty
much the same as_map, except that the function you_pass to bind_needs to put
the transformed value into the_container._You would think that this is_a_PITA,
but it's very necessary in many_situations_(easiest_way to see this that_I
know of is to try to_implement an "either monad" with only map -- you'll_see
right away that_it's not possible).

And that's it,_really._I_find it really interesting to understand how category
theory works, but_it is_not at all_necessary for understanding how