Sciweavers

PPDP
2015
Springer

From monoids to near-semirings: the essence of MonadPlus and alternative

8 years 8 months ago
From monoids to near-semirings: the essence of MonadPlus and alternative
It is well-known that monads are monoids in the category of endofunctors, and in fact so are applicative functors. Unfortunately, the benefits of this unified view are lost when the additional nondeterminism structure of MonadPlus or Alternative is required. This article recovers the essence of these two type classes by extending monoids to near-semirings with both additive and multiplicative structure. This unified algebraic view enables us to generically define the free construction as well as a novel double Cayley representation that optimises both left-nested sums and left-nested products. Keywords monoid, near-semiring, monad, monadplus, applicative functor, alternative, free construction, Cayley representation
Exequiel Rivas, Mauro Jaskelioff, Tom Schrijvers
Added 16 Apr 2016
Updated 16 Apr 2016
Type Journal
Year 2015
Where PPDP
Authors Exequiel Rivas, Mauro Jaskelioff, Tom Schrijvers
Comments (0)