record Bag : Type -> TypeBag ~ Multiset, a set where each element can appear multiple times
Free *commutative* monoid on a set
Equivalently, a list without order, i.e. quotiented out by permutations
Using the list representation here, without enforcing permutation quotient
.toList : Bag a -> List a.toList : Bag a -> List atoList : Bag a -> List aMultiset : Type -> Typemultiplicities : Eq a => List a -> a -> Natmultiplicities : Eq a => Bag a -> a -> NatA multiset is equivalently a function `a -> Nat` with finite support
(++) : Bag a -> Bag a -> Bag aAll : (a -> Type) -> Bag a -> TypeAny : (a -> Type) -> Bag a -> Type