Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It seems to me that you omitted important things:</p> <ul> <li>There is the word “monoid” in the definition. You did not consider it in your post.</li> <li>It is better to replace it with “monoid object” in order to be precise. Monoids live in abstract algebra, monoid objects live in category theory. Different species. <ul> <li>Monoids are monoid objects in some category, but this is not relevant here.</li> </ul></li> <li>A monoid object may be defined in a monoidal category only.</li> </ul> <p>So, a path to understanding the definition is as follows.</p> <ul> <li>You consider a category of endofunctors (lets call it <strong>E</strong>) on the category of Haskell types and functions <strong>Hask</strong>. Its objects are functors on <strong>Hask</strong>, a morphism in it from F to G is a polymorphic function of type F a -> G a with some property.</li> <li>You consider a structure on <strong>E</strong> which turns it into a monoidal category, i.e. composition of functors and the identity functors.</li> <li>You consider definition of a monoid object, e.g. from Wikipedia.</li> <li>You consider what it means in your specific category <strong>E</strong>. It means that M is an endofunctor, and μ has the same type as “join”, and η has the same type as “return”.</li> <li>“(>>=)” is defined via “join”.</li> </ul> <p>An advice. Do not try to express everything in Haskell. It is designed for writing programs, not mathematics. Mathematical notation is more convenient here because you can write composition of functors as “∘” without going into trouble with type checker.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload