Just reading through category theory book, and decided to apply it to haskell.
The author defines Monoid as:
Monoid is a set L equipped with a binary operation *:LxL->L and a distinguished unit element u in L such that etc...
Taking a "List" structure as a monoid, it is clear that binary operation is concat
and unit is []
.
But what is the set M here?
I tried L = {set of all lists}
but I think that leads me into trouble with "is L in L?" question, which seems to be the same problem as sets have.
Or am I thinking of something incorrectly?
EDIT: As pointed out by @applicative, Haskell's lists are monoids called the Free monoids!