haskellfunctorcategory-theorycategory-abstractions

Is there a reason that `Functor` is not a superclass of `Category`?


It seems you can simply declare:

import qualified Control.Category as Cat
instance Cat.Category q => Functor (q r) where
     fmap = (Cat..)

Is there anything speaking against this?


Solution

  • That instance would overlap with many other useful instances, e.g. one could no longer add

    instance Functor (State s) where ...
    

    for the State s monad.