Hello every one,
I'm reading "Programming with Categories Brendan Fong Bartosz Milewski David I. Spivak"
and here there's an example of monoid in Haskell:
Consider the monoids Z× � (Z, 1, ×) and BAND � (B, true, AND). Let
is_odd : Z → B be the function that sends odd numbers to true and even numbers to
false. This is a monoid homomorphism. It preserves identities because 1 is odd, and
it preserves composition because the product of any two odd numbers is odd, but the
product of anything with an even number is even.
I'd like representing it graphically I mean the object Zx and arrows about is_odd function,
but I do not know how can do it.
This is a valid example of monoid homomorphism and I'd like to know
the Haskell implementation and the corresponding categorically view.
Thanks
Co