If "List" is a monoid, what is its "set"?

haskell

Solution

Instead of saying "List is a Monoid", it would be more accurate to say "For all types a, the type `[a]` is a Monoid". So for any particular type `a`, your L will be `L = {set of all lists of as}`. And with that definition, L can of course not contain itself.

Problem

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!

Original source

Related problems