Ratification for my understanding of functors

Hi, Thanks to Luke Palmer's explanation. I got a better idea of functors. I just want to ratify my understanding of what a functor is - according to category theory, functors are arrows between categories ... these arrows map objets and arrows from one category into another. So, would it be right to say that the list type constructor + the map function form the functor? Saying "list is a functor then is a convenient approximation right? In this context, could someone please point me to some writeup on co-variant/contravariant type constructors? Googling for it seems to only give a lot of C++/Java/C# hits. Regards, Kashyap

It's covariant if the parameter is to the left of an even number of arrows. For instance (-> a) is co, (a ->) is contra, (a -> b) -> b is co wrt a and neither co nor contra wrt b, etc. Read the c#-related stuff on variance, I am sure it is completely relevant.
08.01.2011, в 13:23, C K Kashyap
Hi,
Thanks to Luke Palmer's explanation. I got a better idea of functors. I just want to ratify my understanding of what a functor is - according to category theory, functors are arrows between categories ... these arrows map objets and arrows from one category into another.
So, would it be right to say that the list type constructor + the map function form the functor? Saying "list is a functor then is a convenient approximation right?
In this context, could someone please point me to some writeup on co-variant/contravariant type constructors? Googling for it seems to only give a lot of C++/Java/C# hits.
Regards, Kashyap
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 1/8/11 5:23 AM, C K Kashyap wrote:
Hi,
Thanks to Luke Palmer's explanation. I got a better idea of functors. I just want to ratify my understanding of what a functor is - according to category theory, functors are arrows between categories ... these arrows map objets and arrows from one category into another.
Yes, provided the mappings on objects and arrows behaves in the right way, namely preserving identities and compositions: F(id_A) = id_(FA) F(f.g) = F(f) . F(g) That is, functors are exactly category homomorphisms (i.e., mappings which preserve the categorical structure).
So, would it be right to say that the list type constructor + the map function form the functor? Saying "list is a functor then is a convenient approximation right?
Yes, the combination of the type constructor (mapping from types/objects to types/objects) and the fmap instance (mapping from functions/arrows to functions/arrows) together constitute the functor. Saying "list is a functor" is a common sloppiness just like saying "list is a monad". -- Live well, ~wren

Yes, the combination of the type constructor (mapping from types/objects to types/objects) and the fmap instance (mapping from functions/arrows to functions/arrows) together constitute the functor. Saying "list is a functor" is a common sloppiness just like saying "list is a monad".
Thanks Wren and Eugene. Regards, Kashyap
participants (3)
-
C K Kashyap
-
Eugene Kirpichov
-
wren ng thornton