Add missing Functor/Applicative instances

This is needed to silence GHC 7.8's AMP warnings, see also

 http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal#Missing_superclasses

for more information.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>