In trying to answer this SO question i wondered:
Suppose I want to be able to write fmap (+1) [Just 2] instead of (fmap.fmap) (+1) [Just 2] (after all, the composition of two functors is another functor)
I then could try and declare a Functor instance for the composition of [] and Maybe (i.e. two constructors with kind * -> *)
instance Functor ..eh??? where
fmap f [Nothing] = [Nothing]
fmap f [] = []
-- ...etc.
However, without a type-level lambda (\Lambda a -> [Maybe a] :: * -> *) I don't see how to write the instance declaration part:
instance Functor Maybe([])
is nonsense, and doens't even kind check, of course.
Is there any way around this? Of course, if the constructors happen to be monads (like in this case) I could use monad transformers (i.e. constructors of kind * -> * -> * ), and the composition would become an application like ListT Maybe, which is perfectly legal. However, that is not the case generally.