functor, applicative and monad instances