In the list monad, your map $TT \rightarrow T$ takes a list of lists and concatenates them to form a list. There is another way to take a list of lists and create a list, which is to shuffle randomly the two lists together. You can also imagine taking a list of lists and mapping that to a set of every shuffle. I do not think you can create a Monad with this map because there is a number of ways to shuffle two lists. I guess I want to know if there is a shuffle monad, or how would you model this with functors and natural transformations? Interestingly, people doing functional programming have done something like this
2 Answers
$\begingroup$
$\endgroup$
The haskell monad you mention models the process of drawing from a sequence at random. It is a state monad--with underlying map of objects $X \mapsto (S\times X)^S$--where the state includes the remaining list of elements and a 'source of randomness'. Every object $S$ of a Cartesian closed category induces a state monad on that category.