Inferring Algebraic Effects