applicative instance for monad.