semirings-0.1.0: two monoids as one, in holy haskimony
Data.Star
Synopsis
class Semiring a => Star a where Source #
A Star semiring adds one operation, star to a Semiring, such that it follows the law:
star
Semiring
star x = one + x * star x = one + star x * x
one
+
*
Another operation, aplus, can be defined in terms of star:
aplus
aplus x = x * star x
Minimal complete definition
star | aplus
Methods
star :: a -> a Source #
aplus :: a -> a Source #
Instances
star :: Bool -> Bool Source #
aplus :: Bool -> Bool Source #
star :: () -> () Source #
aplus :: () -> () Source #
star :: Endo a -> Endo a Source #
aplus :: Endo a -> Endo a Source #
star :: (a -> b) -> a -> b Source #
aplus :: (a -> b) -> a -> b Source #