- = let
- (tvs, theta, tau) = tcSplitSigmaTy ty
- in
- check_valid_theta SigmaCtxt theta `thenM_`
- check_tau_type (decRank rank) ubx_tup tau `thenM_`
- checkFreeness tvs theta `thenM_`
- checkAmbiguity tvs theta (tyVarsOfType tau)
-
+ | null tvs && null theta
+ = check_tau_type rank ubx_tup ty
+ | otherwise
+ = do { check_valid_theta SigmaCtxt theta
+ ; check_poly_type rank ubx_tup tau -- Allow foralls to right of arrow
+ ; checkFreeness tvs theta
+ ; checkAmbiguity tvs theta (tyVarsOfType tau) }
+ where
+ (tvs, theta, tau) = tcSplitSigmaTy ty
+