## `Cat::HomogeneousFiniteProduct` -- the category of homogeneous finite products

#### Introduction

``Cat::HomogeneousFiniteProduct`(T)` represents the category of homogeneous finite products of elements of the domain `T`.

#### Generating the category

`Cat::HomogeneousFiniteProduct(T)`

#### Parameters

`T` | - | A domain which must be from the category `Cat::BaseCategory`. This defines the domain of the products elements.

#### Categories

if `T` is a `Cat::DifferentialRing` then
`Cat::DifferentialRing`
if `T` is a `Cat::PartialDifferentialRing` then
`Cat::PartialDifferentialRing`
if `T` is a `Cat::CommutativeRing` then
`Cat::CommutativeRing`
if `T` is a `Cat::SkewField` then
`Cat::SkewField`
if `T` is a `Cat::Ring` then
`Cat::Ring`
if `T` is a `Cat::Rng` then
`Cat::Rng`
if `T` is a `Cat::AbelianGroup` then
`Cat::AbelianGroup`
if `T` is a `Cat::CancellationAbelianMonoid` then
`Cat::CancellationAbelianMonoid`
if `T` is a `Cat::AbelianMonoid` then
`Cat::AbelianMonoid`
if `T` is a `Cat::AbelianSemiGroup` then
`Cat::AbelianSemiGroup`
if `T` is a `Cat::Group` then
`Cat::Group`
if `T` is a `Cat::Monoid` then
`Cat::Monoid`
if `T` is a `Cat::SemiGroup` then
`Cat::SemiGroup`
if `T` is a `Cat::CommutativeRing` then
`Cat::Algebra``(T)`
if `T` is a `Cat::Ring` then
`Cat::LeftModule``(T)`
if `T` is a `Cat::Ring` then
`Cat::RightModule``(T)`
`Cat::HomogeneousFiniteCollection(T)`

#### Details

- A ``Cat::HomogeneousFiniteProduct`(T)` is a homogeneous finite collection where each collection has the same number of elements of the domain `T`.
- The number of elements must be given by the entry `"card"`, which must be defined by domains of this category. It is not given as a category parameter simply because it is not needed. Thus no unnecessary instances of the category are created.
- One could principally implement all the algebraic operations here, but they will be slow if the methods `"_index"` and `"set_index"` are slow, which most often will be the case. So we avoid the work and let the domain implementors do it.

#### Basic Entries

card

  Must hold the number of elements of a collection.

#### Entries

characteristic

  Defined if `T` is a ring: In this case the characteristic of the product domain is the same as that of `T`.

#### Method zip: combine elements

- `zip(dom x, dom y, function f)`
- - Must call `f(`x_i, `y_i`) for each pair `x_i`, `y_i` of elements from `x` and `y` and builds a new element of this domain from the results.

#### Method zipCanFail: combine elements, may fail

- `zipCanFail(dom x, dom y, function f)`
- - Must return the same as `zip(x, y, f)` with one difference: Must return `FAIL` if one of the results of `f` is `FAIL`.

#### Method nops: returns number of elements

- `nops(dom x)`
- - Returns the number of elements of `x`, which is simply the constant defined by the entry `"card"`.

#### Changes

- Has been renamed. Used to be `Cat::HomogeneousFiniteProductCat`.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000