AUTHORS:
Construct the forgetful function from one category to another.
EXAMPLES:
sage: rings = Rings()
sage: abgrps = AbelianGroups()
sage: F = ForgetfulFunctor(rings, abgrps)
sage: F
The forgetful functor from Rings to AbelianGroups
EXAMPLES:
sage: F = ForgetfulFunctor(Groups(), Sets())
sage: loads(F.dumps()) == F
True
EXAMPLES:
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: from sage.categories.functor import is_Functor
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
EXAMPLES:
sage: F = IdentityFunctor(Groups())
sage: loads(F.dumps()) == F
True