semirings-0.1.3.0: two monoids as one, in holy haskimony

Safe HaskellNone
LanguageHaskell98

Data.Star

Synopsis

Documentation

class Semiring a => Star a where #

A Star semiring adds one operation, star to a Semiring, such that it follows the law:

star x = one + x * star x = one + star x * x

Another operation, aplus, can be defined in terms of star:

aplus x = x * star x

Minimal complete definition

star | aplus

Methods

star :: a -> a #

aplus :: a -> a #

Instances

Star Bool # 

Methods

star :: Bool -> Bool #

aplus :: Bool -> Bool #

Star () # 

Methods

star :: () -> () #

aplus :: () -> () #

(Eq a, Monoid a) => Star (Endo a) # 

Methods

star :: Endo a -> Endo a #

aplus :: Endo a -> Endo a #

Star b => Star (a -> b) # 

Methods

star :: (a -> b) -> a -> b #

aplus :: (a -> b) -> a -> b #