Check out the DeriveFunctor
extension. As the name hints, it allows you to simply add Functor
to the deriving
list. Unfortunately, this doesn't extend to Applicative
and Monad
because, unlike Functor
, those generally don't have one way to define the instance, but multiple nonequivalent possibilities.
In your example, I'd simplify the data definition:
data VerbType = Look | LookExtra | ...
type Verb a = (VerbType, a)
-- or data Verb a = Verb { verbType :: VerbType, getPreps :: a }