summaryrefslogtreecommitdiff
path: root/compiler/stgSyn/StgLint.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/stgSyn/StgLint.hs')
-rw-r--r--compiler/stgSyn/StgLint.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/stgSyn/StgLint.hs b/compiler/stgSyn/StgLint.hs
index 02d989cec0..7a1ed4df92 100644
--- a/compiler/stgSyn/StgLint.hs
+++ b/compiler/stgSyn/StgLint.hs
@@ -249,7 +249,7 @@ lintAlt scrut_ty (DataAlt con, args, rhs) = do
-- This does not work for existential constructors
checkL (con `elem` cons) (mkAlgAltMsg2 scrut_ty con)
- checkL (length args == dataConRepArity con) (mkAlgAltMsg3 con args)
+ checkL (args `lengthIs` dataConRepArity con) (mkAlgAltMsg3 con args)
when (isVanillaDataCon con) $
mapM_ check (zipEqual "lintAlgAlt:stg" arg_tys args)
return ()
@@ -398,7 +398,7 @@ checkFunApp fun_ty arg_tys msg
| Just (tc,tc_args) <- splitTyConApp_maybe fun_ty
, isNewTyCon tc
- = if length tc_args < tyConArity tc
+ = if tc_args `lengthLessThan` tyConArity tc
then WARN( True, text "cfa: unsaturated newtype" <+> ppr fun_ty $$ msg )
(Nothing, Nothing) -- This is odd, but I've seen it
else cfa False (newTyConInstRhs tc tc_args) arg_tys