objectmap

package
v0.0.2-0...-db6250e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: CC0-1.0, CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(x object.Element) (object.Element, error)

Func defines a function that can be evaluated at x.

type Interface

type Interface interface {
	fmt.Stringer
	Domain() object.Parent                             // Domain returns the domain.
	Codomain() object.Parent                           // Codomain returns the codomain.
	Evaluate(x object.Element) (object.Element, error) // Evaluate returns the image of x.
}

Interface defines the interface satisfied by a map between parents.

func Compose

func Compose(f1 Interface, fi ...Interface) (Interface, error)

Compose return the composition h of the maps f1, f2, ..., fk, given by:

h(x) = (fk ○ ... ○ f2 ○ f1)(x) = fk(...(f2((f1(x))))...).

func New

func New(domain object.Parent, codomain object.Parent, f Func) Interface

New returns a new map from the given domain to the given codomain defined by the function f.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL