Add Functor/Applicative instances to silence AMP warnings

This commit follows the suggestions from

 http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal#Future-proofing_current_code

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>