MiniAgda
Safe HaskellNone
LanguageHaskell98

Semiring

Description

Semirings. Original: Agda.Terminatio.Semiring

Synopsis

Documentation

class Eq a => HasZero a where Source #

HasZero is needed for sparse matrices, to tell which is the element that does not have to be stored. It is a cut-down version of SemiRing which is definable without the implicit ?cutoff.

Methods

zeroElement :: a Source #

Instances

Instances details
HasZero Order Source # 
Instance details

Defined in Termination

HasZero Integer Source #

Semiring invariant.

The standard semiring on Integers.

Instance details

Defined in Semiring

class (Eq a, Monoid a) => SemiRing a where Source #

SemiRing type class. Additive monoid with multiplication operation. Inherit addition and zero from Monoid.

Methods

multiply :: a -> a -> a Source #

data Semiring a Source #

Semirings.

Constructors

Semiring 

Fields

  • add :: a -> a -> a

    Addition.

  • mul :: a -> a -> a

    Multiplication.

  • zero :: a

    Zero. The one is never used in matrix multiplication , one :: a -- ^ One.

boolSemiring :: Semiring Bool Source #

The standard semiring on Bools.