<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><span style="font-family:Courier New,Courier,monospace;"><span style="font-size:12px;">Hello every one,<br/>
I'm reading </span>"Programming with Categories Brendan Fong Bartosz Milewski David I. Spivak"<br/>
<span style="font-size:12px;">and here there's an example of monoid in Haskell:<br/>
<br/>
<em><span dir="ltr" role="presentation" style="left: 270.895px; top: 756.961px; transform: scaleX(0.9146);">Consider the monoids</span><span dir="ltr" role="presentation" style="left: 453.022px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 459.333px; top: 756.222px;">Z</span><span dir="ltr" role="presentation" style="left: 471.023px; top: 763.443px;">×</span><span dir="ltr" role="presentation" style="left: 479.91px; top: 763.443px;"> </span><span dir="ltr" role="presentation" style="left: 488.25px; top: 756.961px;">�</span><span dir="ltr" role="presentation" style="left: 500.414px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 507.923px; top: 756.961px;">(</span><span dir="ltr" role="presentation" style="left: 514.213px; top: 756.222px;">Z</span><span dir="ltr" role="presentation" style="left: 526.45px; top: 756.961px;">,</span><span dir="ltr" role="presentation" style="left: 530.996px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 534.39px; top: 756.961px;">1</span><span dir="ltr" role="presentation" style="left: 544.027px; top: 756.961px;">,</span><span dir="ltr" role="presentation" style="left: 548.572px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 551.965px; top: 756.961px; transform: scaleX(0.826324);">×)</span><span dir="ltr" role="presentation" style="left: 570.42px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 576.735px; top: 756.961px; transform: scaleX(0.899178);">and</span><span dir="ltr" role="presentation" style="left: 607.517px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 613.833px; top: 756.222px;">B</span><span dir="ltr" role="presentation" style="left: 626.597px; top: 763.443px; transform: scaleX(1.08221);">AND</span><span dir="ltr" role="presentation" style="left: 658.251px; top: 763.443px;"> </span><span dir="ltr" role="presentation" style="left: 666.592px; top: 756.961px;">�</span><span dir="ltr" role="presentation" style="left: 678.755px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 686.265px; top: 756.961px;">(</span><span dir="ltr" role="presentation" style="left: 692.555px; top: 756.222px;">B</span><span dir="ltr" role="presentation" style="left: 705.865px; top: 756.961px;">,</span><span dir="ltr" role="presentation" style="left: 710.41px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 713.803px; top: 756.961px; transform: scaleX(0.871732);">true</span><span dir="ltr" role="presentation" style="left: 752.53px; top: 756.961px;">,</span><span dir="ltr" role="presentation" style="left: 757.075px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 760.47px; top: 756.961px; transform: scaleX(1.08183);">AND</span><span dir="ltr" role="presentation" style="left: 803.797px; top: 756.961px;">)</span><span dir="ltr" role="presentation" style="left: 810.088px; top: 756.961px;">.</span><span dir="ltr" role="presentation" style="left: 814.634px; top: 756.961px;"> </span><span dir="ltr" role="presentation" style="left: 826.507px; top: 756.961px; transform: scaleX(0.915124);">Let</span><br role="presentation"/>
<span dir="ltr" role="presentation" style="left: 164.832px; top: 782.929px; transform: scaleX(0.871732);">is</span><span dir="ltr" role="presentation" style="left: 183.923px; top: 782.929px;">_</span><span dir="ltr" role="presentation" style="left: 193.013px; top: 782.929px; transform: scaleX(0.871732);">odd</span><span dir="ltr" role="presentation" style="left: 221.65px; top: 782.929px;"> </span><span dir="ltr" role="presentation" style="left: 223.67px; top: 782.929px;">:</span><span dir="ltr" role="presentation" style="left: 228.215px; top: 782.929px;"> </span><span dir="ltr" role="presentation" style="left: 234.33px; top: 782.19px;">Z</span><span dir="ltr" role="presentation" style="left: 246.028px; top: 782.19px;"> </span><span dir="ltr" role="presentation" style="left: 251.345px; top: 782.929px;">→</span><span dir="ltr" role="presentation" style="left: 270.927px; top: 782.929px;"> </span><span dir="ltr" role="presentation" style="left: 276.248px; top: 782.19px;">B</span><span dir="ltr" role="presentation" style="left: 289.018px; top: 782.19px;"> </span><span dir="ltr" role="presentation" style="left: 293.755px; top: 782.929px; transform: scaleX(0.874525);">be the function that sends odd numbers to</span><span dir="ltr" role="presentation" style="left: 635.301px; top: 782.929px;"> </span><span dir="ltr" role="presentation" style="left: 640.033px; top: 782.929px; transform: scaleX(0.871732);">true</span><span dir="ltr" role="presentation" style="left: 678.215px; top: 782.929px;"> </span><span dir="ltr" role="presentation" style="left: 682.957px; top: 782.929px; transform: scaleX(0.868159);">and even numbers to</span><br role="presentation"/>
<span dir="ltr" role="presentation" style="left: 164.832px; top: 808.899px; transform: scaleX(0.871732);">false</span><span dir="ltr" role="presentation" style="left: 212.558px; top: 808.899px; transform: scaleX(0.88598);">. This is a monoid homomorphism. It preserves identities because</span><span dir="ltr" role="presentation" style="left: 744.25px; top: 808.899px;"> </span><span dir="ltr" role="presentation" style="left: 748.855px; top: 808.899px;">1</span><span dir="ltr" role="presentation" style="left: 757.946px; top: 808.899px;"> </span><span dir="ltr" role="presentation" style="left: 762.552px; top: 808.899px; transform: scaleX(0.893963);">is odd, and</span><br role="presentation"/>
<span dir="ltr" role="presentation" style="left: 164.832px; top: 834.867px; transform: scaleX(0.878098);">it preserves composition because the product of any two odd numbers is odd, but the</span><br role="presentation"/>
<span dir="ltr" role="presentation" style="left: 164.832px; top: 860.837px; transform: scaleX(0.87965);">product of anything with an even number is even.</span></em></span><br/>
<br/>
<br/>
I'd like representing it graphically I mean the object Zx and arrows about is_odd function,<br/>
but I do not know how can do it.</span></div>
<div><br/>
<span style="font-family:Courier New,Courier,monospace;">This is a valid example of monoid homomorphism and I'd like to know<br/>
the Haskell implementation and the corresponding categorically view.<br/>
<br/>
Thanks<br/>
Co</span></div></div></body></html>