How are functors in Haskell related to functors in category theory?
问题 For as far as I understand, a functor is a mapping between two categories, for example from objects in to objects in where and are categories. In Haskell there is Hask in which the objects are Haskell types and the morphisms are Haskell functions. However, the Functor type class has a function fmap which maps between these types (which are thus objects and not categories themselves): fmap :: (a -> b) -> f a -> f b f a and f b are both objects in Hask . Does this mean every instance of Functor