A SymmetricMonoidal class
This allows you to shuffle around a bifunctor nested in itself and swap the places of the two types held in the bifunctor. For instance, for tuples:
You can use
lassoc :: (a,(b,c)) %1-> ((a,b),c)and then use first to access theaYou can use the dual, i.e.,
rassoc :: ((a,b),c) %1-> (a,(b,c))and then secondYou can swap the first and second values with
swap :: (a,b) %1-> (b,a)
Laws
swap . swap = idrassoc . lassoc = idlassoc . rassoc = idsecond swap . rassoc . first swap = rassoc . swap . rassoc
Instances2SymmetricMonoidal
SymmetricMonoidal Either VoidDefined in linear-base-0.4.0 · Data.Bifunctor.Linear.Internal.SymmetricMonoidalSymmetricMonoidal Tuple2 ()Defined in linear-base-0.4.0 · Data.Bifunctor.Linear.Internal.SymmetricMonoidal