GTALib-0.0.2: A library for GTA programming

Safe HaskellNone

GTA.Core

Documentation

data Bag a Source

Constructors

Bag [a] 

Instances

(Eq a, Ord a) => Eq (Bag a) 
Ord a => Ord (Bag a) 
Read a => Read (Bag a) 
Show a => Show (Bag a) 

data CommutativeMonoid a Source

Constructors

CommutativeMonoid 

Fields

oplus :: a -> a -> a
 
identity :: a
 

data GenericSemiring alg a Source

Constructors

GenericSemiring 

Fields

monoid :: CommutativeMonoid a
 
algebra :: alg a
 

class GenericSemiringStructure alg free uniformer | alg -> free, alg -> uniformer whereSource

Methods

freeSemiring :: GenericSemiring alg (Bag free)Source

liftedSemiring :: Ord c => GenericSemiring alg a -> alg c -> GenericSemiring alg (Map c a)Source

pairSemiring :: GenericSemiring alg a -> GenericSemiring alg b -> GenericSemiring alg (a, b)Source

shom :: GenericSemiring alg a -> Bag free -> aSource

makeAlgebra :: CommutativeMonoid m -> alg a -> (m -> [a]) -> (a -> m) -> alg mSource

pairAlgebra :: alg a -> alg b -> alg (a, b)Source

freeAlgebra :: alg freeSource

hom :: alg a -> free -> aSource

foldingAlgebra :: (a -> a -> a) -> a -> uniformer a -> alg aSource

bag :: forall a. [a] -> Bag aSource

(>==) :: forall alg free uniformer c b k. (GenericSemiringStructure alg free uniformer, Ord c) => (GenericSemiring alg (Map c b) -> Map k b) -> (k -> Bool, alg c) -> GenericSemiring alg b -> bSource

(>=>) :: forall alg free uniformer b k. GenericSemiringStructure alg free uniformer => (GenericSemiring alg b -> b) -> GenericSemiring alg b -> bSource

(>=<) :: forall alg free uniformer alg' free' uniformer' c. (GenericSemiringStructure alg free uniformer, GenericSemiringStructure alg' free' uniformer') => (GenericSemiring alg' c -> c) -> (GenericSemiring alg c -> GenericSemiring alg' c) -> GenericSemiring alg c -> cSource

(>##) :: GenericSemiringStructure alg free uniformer => (GenericSemiring alg (Bag free) -> Bag free) -> (b -> Bool, alg b) -> GenericSemiring alg (Bag free) -> Bag freeSource

(>#>) :: GenericSemiringStructure alg free uniformer => (GenericSemiring alg (Bag free) -> Bag free) -> GenericSemiring alg a -> aSource

(<.>) :: forall t t1. t -> t1 -> (t, t1)Source

items :: Bag a -> [a]Source

revOrd :: forall a. a -> RevOrd aSource

data RevOrd a Source

Constructors

RevOrd a 

Instances

Eq a => Eq (RevOrd a) 
Num a => Num (RevOrd a) 
Ord a => Ord (RevOrd a) 
Read a => Read (RevOrd a) 
Show a => Show (RevOrd a) 

maxsumBy :: forall free uniformer alg a. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a)Source

maxsumKBy :: forall a free uniformer alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => Int -> uniformer (AddIdentity a) -> GenericSemiring alg [AddIdentity a]Source

maxsumsolutionXKBy :: forall a free uniformer b alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => GenericSemiring alg b -> Int -> uniformer (AddIdentity a) -> GenericSemiring alg [(AddIdentity a, b)]Source

maxsumsolutionXBy :: forall free uniformer a t alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => GenericSemiring alg t -> uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a, t)Source

maxsumsolutionBy :: forall a alg free uniformer. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a, Bag free)Source

maxsumsolutionKBy :: forall a alg free uniformer. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => Int -> uniformer (AddIdentity a) -> GenericSemiring alg [(AddIdentity a, Bag free)]Source

maxprodBy :: forall free uniformer alg a. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a)Source

maxprodKBy :: forall a free uniformer alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => Int -> uniformer (AddIdentity a) -> GenericSemiring alg [AddIdentity a]Source

maxprodsolutionXKBy :: forall a free uniformer b alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => GenericSemiring alg b -> Int -> uniformer (AddIdentity a) -> GenericSemiring alg [(AddIdentity a, b)]Source

maxprodsolutionXBy :: forall free uniformer a t alg. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => GenericSemiring alg t -> uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a, t)Source

maxprodsolutionBy :: forall a alg free uniformer. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a, Bag free)Source

maxprodsolutionKBy :: forall a alg free uniformer. (GenericSemiringStructure alg free uniformer, Ord a, Num a) => Int -> uniformer (AddIdentity a) -> GenericSemiring alg [(AddIdentity a, Bag free)]Source

maxMonoSumBy :: forall free uniformer alg a. (GenericSemiringStructure alg free uniformer, Ord a) => (a -> a -> a) -> a -> uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a)Source

maxMonoSumsolutionXBy :: forall free uniformer a t alg. (GenericSemiringStructure alg free uniformer, Ord a) => (a -> a -> a) -> a -> GenericSemiring alg t -> uniformer (AddIdentity a) -> GenericSemiring alg (AddIdentity a, t)Source

maxMonoSumKBy :: forall a free uniformer alg. (GenericSemiringStructure alg free uniformer, Ord a) => (a -> a -> a) -> a -> Int -> uniformer (AddIdentity a) -> GenericSemiring alg [AddIdentity a]Source

maxMonoSumsolutionXKBy :: forall a free uniformer b alg. (GenericSemiringStructure alg free uniformer, Ord a) => (a -> a -> a) -> a -> GenericSemiring alg b -> Int -> uniformer (AddIdentity a) -> GenericSemiring alg [(AddIdentity a, b)]Source

addIdentity :: forall a. a -> AddIdentity aSource

data AddIdentity a Source

Constructors

AddIdentity a 
Identity 

Instances

Eq a => Eq (AddIdentity a) 
Ord a => Ord (AddIdentity a) 
Read a => Read (AddIdentity a) 
Show a => Show (AddIdentity a) 

sumproductBy :: forall free uniformer alg a. (GenericSemiringStructure alg free uniformer, Num a) => uniformer a -> GenericSemiring alg aSource

result :: forall alg free uniformer. GenericSemiringStructure alg free uniformer => GenericSemiring alg (Bag free)Source

filterBy :: forall alg free uniformer c b k. (GenericSemiringStructure alg free uniformer, Ord c) => (GenericSemiring alg (Map c b) -> Map k b) -> (k -> Bool, alg c) -> GenericSemiring alg b -> bSource

aggregateBy :: forall alg free uniformer b k. GenericSemiringStructure alg free uniformer => (GenericSemiring alg b -> b) -> GenericSemiring alg b -> bSource

transformBy :: forall alg free uniformer alg' free' uniformer' c. (GenericSemiringStructure alg free uniformer, GenericSemiringStructure alg' free' uniformer') => (GenericSemiring alg' c -> c) -> (GenericSemiring alg c -> GenericSemiring alg' c) -> GenericSemiring alg c -> cSource