make proc polymorphic over the monad type