You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
m :+: n is the coproduct of monoids m and n. Values of type m :+: n consist of alternating lists of m and n values.
That much is true, in the internal presentation, but there is no way to actually access this structure. Specifically there should be a Bifoldable instance, to make good on the universal property of the coproduct:
For all monoid homomorphisms f₁ :: M₁ → M, f₂ :: M₂ → M there is a unique monoid homomorphism bifoldMap f₁ f₂ :: M₁ :+: M₂ → M, such that bifoldMap f₁ f₂ . inL = f₁ and bifoldMap f₁ f₂ . inR = f₂.
Instead the only way to get anything out of M₁ :+: M₂ is untangle, which as far as I can tell just maps the coproduct to the semidirect product M₁ ⋉ M₂. Moreover the strict version already does this reduction directly.
But there already is Data.Monoid.SemiDirectProduct, which seems to be the same thing, but with it's variables flipped, slightly different presentation, constraints and function names.
Am I missing something? Is Data.Monoid.Coproduct the coproduct in some other category than the category of monoids? Is there a difference between Data.Monoid.Coproduct and Data.Monoid.SemiDirectProduct that I missed?
The text was updated successfully, but these errors were encountered:
juliapath
changed the title
Why is the Data.Monoid.Coproduct the semi-direct product?
Why is Data.Monoid.Coproduct the semi-direct product?
Aug 30, 2021
No particular reason --- mostly because when I wrote that module 9 years ago, I didn't even know what a semi-direct product was. untangle was not added for any particularly principled reason, but just because I needed it for something in diagrams. The Data.Monoid.SemiDirectProduct module was added much later (and I didn't notice the overlap). I'm very happy to entertain any changes you might like to suggest!
The documentation for the lazy version says
That much is true, in the internal presentation, but there is no way to actually access this structure. Specifically there should be a Bifoldable instance, to make good on the universal property of the coproduct:
Instead the only way to get anything out of M₁ :+: M₂ is untangle, which as far as I can tell just maps the coproduct to the semidirect product M₁ ⋉ M₂. Moreover the strict version already does this reduction directly.
But there already is Data.Monoid.SemiDirectProduct, which seems to be the same thing, but with it's variables flipped, slightly different presentation, constraints and function names.
Am I missing something? Is Data.Monoid.Coproduct the coproduct in some other category than the category of monoids? Is there a difference between Data.Monoid.Coproduct and Data.Monoid.SemiDirectProduct that I missed?
The text was updated successfully, but these errors were encountered: