8.4 Functors

Module: sage.categories.functor

Author Log:

Module-level Functions

ForgetfulFunctor( domain, codomain)

Construct the forgetful function from one category to another.

sage: rings = Rings()
sage: abgrps = AbelianGroups()
sage: F = ForgetfulFunctor(rings, abgrps)
sage: F
The forgetful functor from Rings to AbelianGroups

is_Functor( x)

Class: ForgetfulFunctor_generic

class ForgetfulFunctor_generic

Special Functions: __cmp__,$  $ __reduce__,$  $ __repr__,$  $ _apply_functor

__reduce__( self)

sage: F = ForgetfulFunctor(Groups(), Sets())
sage: loads(F.dumps()) == F
True

Class: Functor

class Functor

sage: rings  = Rings()
sage: abgrps = AbelianGroups()
sage: F = ForgetfulFunctor(rings, abgrps)
sage: F.domain()
Category of rings
sage: F.codomain()
Category of abelian groups
sage: is_Functor(F)
True
sage: I = IdentityFunctor(abgrps)
sage: I
The identity functor on AbelianGroups
sage: I.domain()
Category of abelian groups
sage: is_Functor(I)
True
Functor( self, domain, codomain)

Functions: codomain,$  $ domain

Special Functions: __call__,$  $ __repr__

Class: IdentityFunctor

class IdentityFunctor
IdentityFunctor( self, C)

Special Functions: __call__,$  $ __reduce__,$  $ __repr__,$  $ _apply_functor

__reduce__( self)

sage: F = IdentityFunctor(Groups())
sage: loads(F.dumps()) == F
True

See About this document... for information on suggesting changes.