toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Core.Semiring

Description

Semiring. I usually use Num + Monoid as an implicit Semiring though.

Synopsis

Documentation

class Semiring s where #

Semiring @(s, +, .)`. Sometimes called "deoid" (double monoid).

Methods

(<+>) :: s -> s -> s #

Plus (addition) opeator of the communicative monoid (s, +, szero).

szero :: s #

Identical element of the communicative monoid (s, +, szero).

(<.>) :: s -> s -> s #

Times (mulitplication) operator of the monoid (s, ., sone).

sone :: s #

Identical element of the monoid (s, ., sone)

Instances

Instances details
Semiring Boolean # 
Instance details

Defined in Data.Core.Semiring

(Num a, Bounded a, Ord a) => Semiring (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(<+>) :: MaxPlus a -> MaxPlus a -> MaxPlus a #

szero :: MaxPlus a #

(<.>) :: MaxPlus a -> MaxPlus a -> MaxPlus a #

sone :: MaxPlus a #

(Num a, Bounded a, Ord a) => Semiring (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(<+>) :: MinPlus a -> MinPlus a -> MinPlus a #

szero :: MinPlus a #

(<.>) :: MinPlus a -> MinPlus a -> MinPlus a #

sone :: MinPlus a #

foldP :: (Semiring a, Vector v a) => v a -> a #

Fold using the <+> (plus) opreator.

foldT :: (Semiring a, Vector v a) => v a -> a #

Fold using the <.> (times) opreator.

newtype MaxPlus a #

Max-Plus semiring

Constructors

MaxPlus 

Fields

Instances

Instances details
Prim a => Vector Vector (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Prim a => MVector MVector (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

basicLength :: MVector s (MaxPlus a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (MaxPlus a) -> MVector s (MaxPlus a) #

basicOverlaps :: MVector s (MaxPlus a) -> MVector s (MaxPlus a) -> Bool #

basicUnsafeNew :: Int -> ST s (MVector s (MaxPlus a)) #

basicInitialize :: MVector s (MaxPlus a) -> ST s () #

basicUnsafeReplicate :: Int -> MaxPlus a -> ST s (MVector s (MaxPlus a)) #

basicUnsafeRead :: MVector s (MaxPlus a) -> Int -> ST s (MaxPlus a) #

basicUnsafeWrite :: MVector s (MaxPlus a) -> Int -> MaxPlus a -> ST s () #

basicClear :: MVector s (MaxPlus a) -> ST s () #

basicSet :: MVector s (MaxPlus a) -> MaxPlus a -> ST s () #

basicUnsafeCopy :: MVector s (MaxPlus a) -> MVector s (MaxPlus a) -> ST s () #

basicUnsafeMove :: MVector s (MaxPlus a) -> MVector s (MaxPlus a) -> ST s () #

basicUnsafeGrow :: MVector s (MaxPlus a) -> Int -> ST s (MVector s (MaxPlus a)) #

Show a => Show (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

showsPrec :: Int -> MaxPlus a -> ShowS #

show :: MaxPlus a -> String #

showList :: [MaxPlus a] -> ShowS #

Eq a => Eq (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(==) :: MaxPlus a -> MaxPlus a -> Bool #

(/=) :: MaxPlus a -> MaxPlus a -> Bool #

Ord a => Ord (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

compare :: MaxPlus a -> MaxPlus a -> Ordering #

(<) :: MaxPlus a -> MaxPlus a -> Bool #

(<=) :: MaxPlus a -> MaxPlus a -> Bool #

(>) :: MaxPlus a -> MaxPlus a -> Bool #

(>=) :: MaxPlus a -> MaxPlus a -> Bool #

max :: MaxPlus a -> MaxPlus a -> MaxPlus a #

min :: MaxPlus a -> MaxPlus a -> MaxPlus a #

Prim a => Prim (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

(Num a, Bounded a, Ord a) => Semiring (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(<+>) :: MaxPlus a -> MaxPlus a -> MaxPlus a #

szero :: MaxPlus a #

(<.>) :: MaxPlus a -> MaxPlus a -> MaxPlus a #

sone :: MaxPlus a #

Prim a => Unbox (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype MVector s (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype MVector s (MaxPlus a) = MV_MaxPlus (MVector s (MaxPlus a))
newtype Vector (MaxPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype Vector (MaxPlus a) = V_MaxPlus (Vector (MaxPlus a))

newtype MinPlus a #

Min-Plus semiring

Constructors

MinPlus 

Fields

Instances

Instances details
Prim a => Vector Vector (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Prim a => MVector MVector (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

basicLength :: MVector s (MinPlus a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (MinPlus a) -> MVector s (MinPlus a) #

basicOverlaps :: MVector s (MinPlus a) -> MVector s (MinPlus a) -> Bool #

basicUnsafeNew :: Int -> ST s (MVector s (MinPlus a)) #

basicInitialize :: MVector s (MinPlus a) -> ST s () #

basicUnsafeReplicate :: Int -> MinPlus a -> ST s (MVector s (MinPlus a)) #

basicUnsafeRead :: MVector s (MinPlus a) -> Int -> ST s (MinPlus a) #

basicUnsafeWrite :: MVector s (MinPlus a) -> Int -> MinPlus a -> ST s () #

basicClear :: MVector s (MinPlus a) -> ST s () #

basicSet :: MVector s (MinPlus a) -> MinPlus a -> ST s () #

basicUnsafeCopy :: MVector s (MinPlus a) -> MVector s (MinPlus a) -> ST s () #

basicUnsafeMove :: MVector s (MinPlus a) -> MVector s (MinPlus a) -> ST s () #

basicUnsafeGrow :: MVector s (MinPlus a) -> Int -> ST s (MVector s (MinPlus a)) #

Show a => Show (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

showsPrec :: Int -> MinPlus a -> ShowS #

show :: MinPlus a -> String #

showList :: [MinPlus a] -> ShowS #

Eq a => Eq (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(==) :: MinPlus a -> MinPlus a -> Bool #

(/=) :: MinPlus a -> MinPlus a -> Bool #

Ord a => Ord (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

compare :: MinPlus a -> MinPlus a -> Ordering #

(<) :: MinPlus a -> MinPlus a -> Bool #

(<=) :: MinPlus a -> MinPlus a -> Bool #

(>) :: MinPlus a -> MinPlus a -> Bool #

(>=) :: MinPlus a -> MinPlus a -> Bool #

max :: MinPlus a -> MinPlus a -> MinPlus a #

min :: MinPlus a -> MinPlus a -> MinPlus a #

Prim a => Prim (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

(Num a, Bounded a, Ord a) => Semiring (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

Methods

(<+>) :: MinPlus a -> MinPlus a -> MinPlus a #

szero :: MinPlus a #

(<.>) :: MinPlus a -> MinPlus a -> MinPlus a #

sone :: MinPlus a #

Prim a => Unbox (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype MVector s (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype MVector s (MinPlus a) = MV_MinPlus (MVector s (MinPlus a))
newtype Vector (MinPlus a) # 
Instance details

Defined in Data.Core.Semiring

newtype Vector (MinPlus a) = V_MinPlus (Vector (MinPlus a))

newtype Boolean #

Boolean semiring

Constructors

Boolean 

Fields

Instances

Instances details
Show Boolean # 
Instance details

Defined in Data.Core.Semiring

Eq Boolean # 
Instance details

Defined in Data.Core.Semiring

Methods

(==) :: Boolean -> Boolean -> Bool #

(/=) :: Boolean -> Boolean -> Bool #

Ord Boolean # 
Instance details

Defined in Data.Core.Semiring

Semiring Boolean # 
Instance details

Defined in Data.Core.Semiring

Unbox Boolean # 
Instance details

Defined in Data.Core.Semiring

Vector Vector Boolean # 
Instance details

Defined in Data.Core.Semiring

MVector MVector Boolean # 
Instance details

Defined in Data.Core.Semiring

IsoUnbox Boolean Bool # 
Instance details

Defined in Data.Core.Semiring

newtype Vector Boolean # 
Instance details

Defined in Data.Core.Semiring

newtype MVector s Boolean # 
Instance details

Defined in Data.Core.Semiring