Generalized Monad typeclass