oalg-base-1.1.4.0: Algebraic structures on oriented entities and limits as a tool kit to solve algebraic problems.
Copyright(c) Erich Gut
LicenseBSD3
Maintainerzerich.gut@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

OAlg.Data.Reducible

Contents

Description

reducing values to there canonical value.

Synopsis

Reducible

class Reducible e where Source #

types admitting reducible values.

Definition reduce e is called the algebraic value of e.

Reducing an e twice yield the 'same' value and the idea is that in an algebraic calculation it will be 'safe' to substitute any occurrence of e by its reduced value, i.e. both calculations will yield the same result.

Property Let e be a reducible type admitting equality, then for all e in e holds: reduce (reduce e) == reduce e.

Minimal complete definition

Nothing

Methods

reduce :: e -> e Source #

reducing e to its algebraic value.

Note The default implementation is reduce = id.

Instances

Instances details
Eq i => Reducible (PermutationForm i) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Permutation

(Oriented a, Integral r) => Reducible (ProductForm r a) Source # 
Instance details

Defined in OAlg.Entity.Product.Definition

Methods

reduce :: ProductForm r a -> ProductForm r a Source #

(Fibred a, Ord a, Semiring r, Commutative r) => Reducible (SumForm r a) Source # 
Instance details

Defined in OAlg.Entity.Sum.Definition

Methods

reduce :: SumForm r a -> SumForm r a Source #

Reducible (PathHomOp s a b) Source # 
Instance details

Defined in OAlg.Hom.Oriented.Definition

Methods

reduce :: PathHomOp s a b -> PathHomOp s a b Source #

Reducible (PathOpMap f s a b) Source # 
Instance details

Defined in OAlg.Hom.Oriented.Definition

Methods

reduce :: PathOpMap f s a b -> PathOpMap f s a b Source #

reduceWith :: (x -> Rdc x) -> x -> x Source #

reduces x by the given rules until no more reductions are applicable.

(>>>=) :: (x -> Rdc x) -> (x -> Rdc x) -> x -> Rdc x infixr 1 Source #

composition of two reductions.

type Rdc = Action RdcState Source #

Action according to the state type RdcState.

data RdcState Source #

reduction state.

Constructors

Unchanged

no reduction has been applied.

Changed

a reduction has been applied.

reducesTo :: x -> Rdc x Source #

indicates that a term has the given reduction step, i.e. returns the given value and sets the state to Changed.