HLearn-algebra-0.1.2.1: Algebraic foundation for homomorphic learning

HLearn.Algebra.Morphism

Description

A "morphism" is a general term for a function that converts one data structure into another. The HLearn library uses this module to allow arbitrary morphisms to be declared, chained together, and assigned properties like surjectivity and homomorphic.

NOTE: This module is still under heavy development and will probably change drastically!

Synopsis

# Morphisms

class Morphism domain params codomain | params -> codomain whereSource

A Morphism converts from a domain to a codomain using the given parameters. We perform the actual conversion using the `\$>` operator.

Methods

morph' :: domain -> params -> codomainSource

(\$>) :: domain -> params -> codomainSource

(<.>) :: params -> domain -> codomainSource

Instances

 (Morphism domain params1 interdomain, Morphism interdomain params2 codomain) => Morphism domain (MorphismComposition domain params1 interdomain params2 codomain) codomain

class Morphism domain params codomain => DefaultMorphism domain params codomain | domain codomain -> params whereSource

If there is a reasonable default parameter (or no parameters at all) for performing the morphism, this class provides a shortcut syntax.

Methods

defMorphParams :: domain -> codomain -> paramsSource

morph :: domain -> codomainSource

# Morphism properties

class Morphism domain params codomain => Surjective domain params codomain Source

Instances

 (Surjective domain params1 interdomain, Surjective interdomain params2 codomain) => Surjective domain (MorphismComposition domain params1 interdomain params2 codomain) codomain

class Morphism domain params codomain => Injective domain params codomain Source

Instances

 (Injective domain params1 interdomain, Injective interdomain params2 codomain) => Injective domain (MorphismComposition domain params1 interdomain params2 codomain) codomain

class Morphism domain params codomain => Homomorphism domain params codomain Source

Instances

 (Homomorphism domain params1 interdomain, Homomorphism interdomain params2 codomain) => Homomorphism domain (MorphismComposition domain params1 interdomain params2 codomain) codomain

# Chaining morphisms

data (Morphism domain params1 interdomain, Morphism interdomain params2 codomain) => MorphismComposition domain params1 interdomain params2 codomain Source

This data structure allow us to chain arbitrary morphisms together to generate a new morphism.

Constructors

 :. params2 params1

Instances

 (Homomorphism domain params1 interdomain, Homomorphism interdomain params2 codomain) => Homomorphism domain (MorphismComposition domain params1 interdomain params2 codomain) codomain (Injective domain params1 interdomain, Injective interdomain params2 codomain) => Injective domain (MorphismComposition domain params1 interdomain params2 codomain) codomain (Surjective domain params1 interdomain, Surjective interdomain params2 codomain) => Surjective domain (MorphismComposition domain params1 interdomain params2 codomain) codomain (Morphism domain params1 interdomain, Morphism interdomain params2 codomain) => Morphism domain (MorphismComposition domain params1 interdomain params2 codomain) codomain