Type inference monad