add Applicative and Functor insts

This kinda broke my head when writing it