A Bag is a data structure, like a list, that stores items with no concept of order. The only operations on the structure is to add an item and then iterate through the items with no guarantee as to the order of iteration. We see it in Sedgewick's Algorithms book. This has to be a Monad, as it I am guessing this is a data structure, and it could be Comonad ormonad since it could not beis very much like the list monad. What is the Monad for the bag? Is it a Comonad?
A more technical and mathematical definition for a bag would be a set with finite multiplicities. What is the monad for that? Is that functor also a comonad with suitable natural transformations?