The Functor class is defined as
class Functor f where
fmap :: (a -> b) -> f a -> f b
That is, the type constructor f must accept a single type argument (otherwise f a and f b in the type signature of fmap would be invalid).
Formally this means f must have kind Type -> Type (also known as * -> * in older versions of GHC).
This is different from e.g. Eq or Show, which look like this (simplified):
class Eq a where
(==) :: a -> a -> Bool
class Show a where
show :: a -> String
Here the parameter a is used as a type itself.
Your type, data MayFail e a, has two parameters. If we were to plug just MayFail into the Functor definition, as in
instance Functor MayFail where ...
this would implicitly declare fmap as
fmap :: (a -> b) -> MayFail a -> MayFail b
which is a kind error: MayFail a is not a type because MayFail takes two arguments.
Similarly, if we tried
instance Functor (MayFail x y) where ...
then fmap would end up having the type
fmap :: (a -> b) -> MayFail x y a -> MayFail x y b
which is also a kind error: MayFail only takes two arguments, not three.
The only way to form a sensible type signature is to set f = MayFail e, because then f a becomes MayFail e a (and f b becomes MayFail e b), which is well-formed.
instance Functor (Maybe a), instead it'sinstance Functor Maybe. A Functor has to be parametrised by another type, that is it is a "type level function" that takes one "concrete type" and produces another.MayFail ehas this property, butMayFail e adoesn't.