Is there a name for arrows like a & # 8594; a (in Haskell notation) in category theory?

What is the name of the arrows in category theory of this type:

a -> a 

"From type (?) To another object of the same type"

Or maybe there is no specific name for them?

In other words: is there a name for the set of all arrows that go from any type a to one type a? Examples of arrows (functions?) Of this set:

 \x->x+x :: Int->Int \x-> "hello, " ++ x :: String -> String ... 

Edit

@leftaroundabout says that I am using the OO definition of an object for category theory, which is wrong. Therefore, I really ask: "In category theory, in a category 𝓒 what is the name for morphism from any object O from 𝓒 to O itself?"

+6
source share
2 answers

If I correctly interpret your question as β€œwhat do we call morphisms from an object to ourselves in category theory?”, Then the word you are looking for is endomorphism .

+18
source

The word you are looking for, as many others have said, is "endomorphism." But in a more specific note, it is worth mentioning the Endo type in Data.Monoid :

 data Endo a = Endo { appEndo :: a -> a } instance Monoid (Endo a) where mempty = Endo id Endo f `mappend` Endo g = Endo (f . g) 

This type is sometimes useful. For example, as Brent Yorgi explains, the folds are made of monoids :

 import Data.Monoid foldr :: (a -> b -> b) -> b -> [a] -> b foldr fz xs = appEndo (mconcat (map (Endo . f) xs)) z foldl :: (b -> a -> b) -> b -> [a] -> b foldl fz xs = appEndo (mconcat (map (Endo . flip f) (reverse xs))) z 

Thus, since monoids are associative, folding can often be parallelized (with a division and rest strategy), first rewriting them in terms of Endo , and then replacing the specific Endo b for this fold with a slightly more specific type that allows you to do some work on each mappend step.

+7
source

All Articles