# Catecon: Data Morphisms

Data morphisms in Catecon contain information that can be used in a composite.  For example, f(2) = 6.  The domain for a data morphism is generally ℕ, but the codomain may have a complex form such as (𝔽×𝔽)×(ℤ×ℤ)×(ℕ×ℕ).

The old data morphisms in Catecon were simply a mapping from an index to a value which was good for testing.  But this can take a lot of memory.  Now contiguous, random, and url ranges are included for a more compact representation.

A single data morphism can have as many data values as memory allows, followed by a sequence of ranges.  To evaluate a data morphism at some index, the data values are first consulted.  If there is a value for specified index it is returned.  If not, the ranges are searched in sequence for one that contains the specified index.

##### Contiguous Range

A contiguous range, denoted more simply as range in Catecon for space consideration, is given by a starting index, a count for the number of succeeding indices, and a start value to increment for each index.

##### Random Range

A random range also has a starting index and a count, but also a min and max for the interval in which to generate a random number.  Each time you compose with a data morphism containing a random range you get different random numbers.  Compose with an identity map to have “static” random numbers, but at the cost of storage.