Commit b9c697ee authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Print which flag controls emitted desugaring warnings

This is extends bb5afd3c to cover
warnings emitted during the desugaring phase.

This implements another part of #10752

Reviewed-by: quchen, bgamari

Differential Revision: https://phabricator.haskell.org/D1954
parent 3ee4fc04
...@@ -1242,15 +1242,19 @@ dsPmWarn dflags ctx@(DsMatchContext kind loc) pm_result ...@@ -1242,15 +1242,19 @@ dsPmWarn dflags ctx@(DsMatchContext kind loc) pm_result
exists_i = flag_i && notNull inaccessible exists_i = flag_i && notNull inaccessible
exists_u = flag_u && notNull uncovered exists_u = flag_u && notNull uncovered
when exists_r $ forM_ redundant $ \(L l q) -> do when exists_r $ forM_ redundant $ \(L l q) -> do
putSrcSpanDs l (warnDs (pprEqn q "is redundant")) putSrcSpanDs l (warnDs (Reason Opt_WarnOverlappingPatterns)
(pprEqn q "is redundant"))
when exists_i $ forM_ inaccessible $ \(L l q) -> do when exists_i $ forM_ inaccessible $ \(L l q) -> do
putSrcSpanDs l (warnDs (pprEqn q "has inaccessible right hand side")) putSrcSpanDs l (warnDs (Reason Opt_WarnOverlappingPatterns)
when exists_u $ putSrcSpanDs loc (warnDs (pprEqns uncovered)) (pprEqn q "has inaccessible right hand side"))
when exists_u $
putSrcSpanDs loc (warnDs flag_u_reason (pprEqns uncovered))
where where
(redundant, uncovered, inaccessible) = pm_result (redundant, uncovered, inaccessible) = pm_result
flag_i = wopt Opt_WarnOverlappingPatterns dflags flag_i = wopt Opt_WarnOverlappingPatterns dflags
flag_u = exhaustive dflags kind flag_u = exhaustive dflags kind
flag_u_reason = maybe NoReason Reason (exhaustiveWarningFlag kind)
-- Print a single clause (for redundant/with-inaccessible-rhs) -- Print a single clause (for redundant/with-inaccessible-rhs)
pprEqn q txt = pp_context True ctx (text txt) $ \f -> ppr_eqn f kind q pprEqn q txt = pp_context True ctx (text txt) $ \f -> ppr_eqn f kind q
...@@ -1270,7 +1274,7 @@ warnPmIters :: DynFlags -> DsMatchContext -> PmM () ...@@ -1270,7 +1274,7 @@ warnPmIters :: DynFlags -> DsMatchContext -> PmM ()
warnPmIters dflags (DsMatchContext kind loc) warnPmIters dflags (DsMatchContext kind loc)
= when (flag_i || flag_u) $ do = when (flag_i || flag_u) $ do
iters <- maxPmCheckIterations <$> getDynFlags iters <- maxPmCheckIterations <$> getDynFlags
putSrcSpanDs loc (warnDs (msg iters)) putSrcSpanDs loc (warnDs NoReason (msg iters))
where where
ctxt = pprMatchContext kind ctxt = pprMatchContext kind
msg is = fsep [ text "Pattern match checker exceeded" msg is = fsep [ text "Pattern match checker exceeded"
...@@ -1287,17 +1291,23 @@ dots qs | qs `lengthExceeds` maximum_output = text "..." ...@@ -1287,17 +1291,23 @@ dots qs | qs `lengthExceeds` maximum_output = text "..."
-- | Check whether the exhaustiveness checker should run (exhaustiveness only) -- | Check whether the exhaustiveness checker should run (exhaustiveness only)
exhaustive :: DynFlags -> HsMatchContext id -> Bool exhaustive :: DynFlags -> HsMatchContext id -> Bool
exhaustive dflags (FunRhs {}) = wopt Opt_WarnIncompletePatterns dflags exhaustive dflags = maybe False (`wopt` dflags) . exhaustiveWarningFlag
exhaustive dflags CaseAlt = wopt Opt_WarnIncompletePatterns dflags
exhaustive _dflags IfAlt = False -- | Denotes whether an exhaustiveness check is supported, and if so,
exhaustive dflags LambdaExpr = wopt Opt_WarnIncompleteUniPatterns dflags -- via which 'WarningFlag' it's controlled.
exhaustive dflags PatBindRhs = wopt Opt_WarnIncompleteUniPatterns dflags -- Returns 'Nothing' if check is not supported.
exhaustive dflags ProcExpr = wopt Opt_WarnIncompleteUniPatterns dflags exhaustiveWarningFlag :: HsMatchContext id -> Maybe WarningFlag
exhaustive dflags RecUpd = wopt Opt_WarnIncompletePatternsRecUpd dflags exhaustiveWarningFlag (FunRhs {}) = Just Opt_WarnIncompletePatterns
exhaustive _dflags ThPatSplice = False exhaustiveWarningFlag CaseAlt = Just Opt_WarnIncompletePatterns
exhaustive _dflags PatSyn = False exhaustiveWarningFlag IfAlt = Nothing
exhaustive _dflags ThPatQuote = False exhaustiveWarningFlag LambdaExpr = Just Opt_WarnIncompleteUniPatterns
exhaustive _dflags (StmtCtxt {}) = False -- Don't warn about incomplete patterns exhaustiveWarningFlag PatBindRhs = Just Opt_WarnIncompleteUniPatterns
exhaustiveWarningFlag ProcExpr = Just Opt_WarnIncompleteUniPatterns
exhaustiveWarningFlag RecUpd = Just Opt_WarnIncompletePatternsRecUpd
exhaustiveWarningFlag ThPatSplice = Nothing
exhaustiveWarningFlag PatSyn = Nothing
exhaustiveWarningFlag ThPatQuote = Nothing
exhaustiveWarningFlag (StmtCtxt {}) = Nothing -- Don't warn about incomplete patterns
-- in list comprehensions, pattern guards -- in list comprehensions, pattern guards
-- etc. They are often *supposed* to be -- etc. They are often *supposed* to be
-- incomplete -- incomplete
......
...@@ -563,7 +563,7 @@ dsRule (L loc (HsRule name rule_act vars lhs _tv_lhs rhs _fv_rhs)) ...@@ -563,7 +563,7 @@ dsRule (L loc (HsRule name rule_act vars lhs _tv_lhs rhs _fv_rhs))
-- Substitute the dict bindings eagerly, -- Substitute the dict bindings eagerly,
-- and take the body apart into a (f args) form -- and take the body apart into a (f args) form
; case decomposeRuleLhs bndrs'' lhs'' of { ; case decomposeRuleLhs bndrs'' lhs'' of {
Left msg -> do { warnDs msg; return Nothing } ; Left msg -> do { warnDs NoReason msg; return Nothing } ;
Right (final_bndrs, fn_id, args) -> do Right (final_bndrs, fn_id, args) -> do
{ let is_local = isLocalId fn_id { let is_local = isLocalId fn_id
...@@ -598,7 +598,8 @@ warnRuleShadowing rule_name rule_act fn_id arg_ids ...@@ -598,7 +598,8 @@ warnRuleShadowing rule_name rule_act fn_id arg_ids
| isLocalId lhs_id || canUnfold (idUnfolding lhs_id) | isLocalId lhs_id || canUnfold (idUnfolding lhs_id)
-- If imported with no unfolding, no worries -- If imported with no unfolding, no worries
, idInlineActivation lhs_id `competesWith` rule_act , idInlineActivation lhs_id `competesWith` rule_act
= warnDs (vcat [ hang (text "Rule" <+> pprRuleName rule_name = warnDs (Reason Opt_WarnInlineRuleShadowing)
(vcat [ hang (text "Rule" <+> pprRuleName rule_name
<+> text "may never fire") <+> text "may never fire")
2 (text "because" <+> quotes (ppr lhs_id) 2 (text "because" <+> quotes (ppr lhs_id)
<+> text "might inline first") <+> text "might inline first")
...@@ -608,7 +609,8 @@ warnRuleShadowing rule_name rule_act fn_id arg_ids ...@@ -608,7 +609,8 @@ warnRuleShadowing rule_name rule_act fn_id arg_ids
| check_rules_too | check_rules_too
, bad_rule : _ <- get_bad_rules lhs_id , bad_rule : _ <- get_bad_rules lhs_id
= warnDs (vcat [ hang (text "Rule" <+> pprRuleName rule_name = warnDs (Reason Opt_WarnInlineRuleShadowing)
(vcat [ hang (text "Rule" <+> pprRuleName rule_name
<+> text "may never fire") <+> text "may never fire")
2 (text "because rule" <+> pprRuleName (ruleName bad_rule) 2 (text "because rule" <+> pprRuleName (ruleName bad_rule)
<+> text "for"<+> quotes (ppr lhs_id) <+> text "for"<+> quotes (ppr lhs_id)
......
...@@ -620,16 +620,16 @@ dsSpec :: Maybe CoreExpr -- Just rhs => RULE is for a local binding ...@@ -620,16 +620,16 @@ dsSpec :: Maybe CoreExpr -- Just rhs => RULE is for a local binding
dsSpec mb_poly_rhs (L loc (SpecPrag poly_id spec_co spec_inl)) dsSpec mb_poly_rhs (L loc (SpecPrag poly_id spec_co spec_inl))
| isJust (isClassOpId_maybe poly_id) | isJust (isClassOpId_maybe poly_id)
= putSrcSpanDs loc $ = putSrcSpanDs loc $
do { warnDs (text "Ignoring useless SPECIALISE pragma for class method selector" do { warnDs NoReason (text "Ignoring useless SPECIALISE pragma for class method selector"
<+> quotes (ppr poly_id)) <+> quotes (ppr poly_id))
; return Nothing } -- There is no point in trying to specialise a class op ; return Nothing } -- There is no point in trying to specialise a class op
-- Moreover, classops don't (currently) have an inl_sat arity set -- Moreover, classops don't (currently) have an inl_sat arity set
-- (it would be Just 0) and that in turn makes makeCorePair bleat -- (it would be Just 0) and that in turn makes makeCorePair bleat
| no_act_spec && isNeverActive rule_act | no_act_spec && isNeverActive rule_act
= putSrcSpanDs loc $ = putSrcSpanDs loc $
do { warnDs (text "Ignoring useless SPECIALISE pragma for NOINLINE function:" do { warnDs NoReason (text "Ignoring useless SPECIALISE pragma for NOINLINE function:"
<+> quotes (ppr poly_id)) <+> quotes (ppr poly_id))
; return Nothing } -- Function is NOINLINE, and the specialiation inherits that ; return Nothing } -- Function is NOINLINE, and the specialiation inherits that
-- See Note [Activation pragmas for SPECIALISE] -- See Note [Activation pragmas for SPECIALISE]
...@@ -646,7 +646,7 @@ dsSpec mb_poly_rhs (L loc (SpecPrag poly_id spec_co spec_inl)) ...@@ -646,7 +646,7 @@ dsSpec mb_poly_rhs (L loc (SpecPrag poly_id spec_co spec_inl))
-- , text "spec_co:" <+> ppr spec_co -- , text "spec_co:" <+> ppr spec_co
-- , text "ds_rhs:" <+> ppr ds_lhs ]) $ -- , text "ds_rhs:" <+> ppr ds_lhs ]) $
case decomposeRuleLhs bndrs ds_lhs of { case decomposeRuleLhs bndrs ds_lhs of {
Left msg -> do { warnDs msg; return Nothing } ; Left msg -> do { warnDs NoReason msg; return Nothing } ;
Right (rule_bndrs, _fn, args) -> do Right (rule_bndrs, _fn, args) -> do
{ dflags <- getDynFlags { dflags <- getDynFlags
...@@ -717,7 +717,7 @@ dsMkUserRule this_mod is_local name act fn bndrs args rhs = do ...@@ -717,7 +717,7 @@ dsMkUserRule this_mod is_local name act fn bndrs args rhs = do
let rule = mkRule this_mod False is_local name act fn bndrs args rhs let rule = mkRule this_mod False is_local name act fn bndrs args rhs
dflags <- getDynFlags dflags <- getDynFlags
when (isOrphan (ru_orphan rule) && wopt Opt_WarnOrphans dflags) $ when (isOrphan (ru_orphan rule) && wopt Opt_WarnOrphans dflags) $
warnDs (ruleOrphWarn rule) warnDs (Reason Opt_WarnOrphans) (ruleOrphWarn rule)
return rule return rule
ruleOrphWarn :: CoreRule -> SDoc ruleOrphWarn :: CoreRule -> SDoc
......
...@@ -1005,8 +1005,8 @@ warnDiscardedDoBindings rhs rhs_ty ...@@ -1005,8 +1005,8 @@ warnDiscardedDoBindings rhs rhs_ty
-- Warn about discarding non-() things in 'monadic' binding -- Warn about discarding non-() things in 'monadic' binding
; if warn_unused && not (isUnitTy norm_elt_ty) ; if warn_unused && not (isUnitTy norm_elt_ty)
then warnDs (badMonadBind rhs elt_ty then warnDs (Reason Opt_WarnUnusedDoBind)
(text "-fno-warn-unused-do-bind")) (badMonadBind rhs elt_ty)
else else
-- Warn about discarding m a things in 'monadic' binding of the same type, -- Warn about discarding m a things in 'monadic' binding of the same type,
...@@ -1015,20 +1015,20 @@ warnDiscardedDoBindings rhs rhs_ty ...@@ -1015,20 +1015,20 @@ warnDiscardedDoBindings rhs rhs_ty
do { case tcSplitAppTy_maybe norm_elt_ty of do { case tcSplitAppTy_maybe norm_elt_ty of
Just (elt_m_ty, _) Just (elt_m_ty, _)
| m_ty `eqType` topNormaliseType fam_inst_envs elt_m_ty | m_ty `eqType` topNormaliseType fam_inst_envs elt_m_ty
-> warnDs (badMonadBind rhs elt_ty -> warnDs (Reason Opt_WarnWrongDoBind)
(text "-fno-warn-wrong-do-bind")) (badMonadBind rhs elt_ty)
_ -> return () } } } _ -> return () } } }
| otherwise -- RHS does have type of form (m ty), which is weird | otherwise -- RHS does have type of form (m ty), which is weird
= return () -- but at lesat this warning is irrelevant = return () -- but at lesat this warning is irrelevant
badMonadBind :: LHsExpr Id -> Type -> SDoc -> SDoc badMonadBind :: LHsExpr Id -> Type -> SDoc
badMonadBind rhs elt_ty flag_doc badMonadBind rhs elt_ty
= vcat [ hang (text "A do-notation statement discarded a result of type") = vcat [ hang (text "A do-notation statement discarded a result of type")
2 (quotes (ppr elt_ty)) 2 (quotes (ppr elt_ty))
, hang (text "Suppress this warning by saying") , hang (text "Suppress this warning by saying")
2 (quotes $ text "_ <-" <+> ppr rhs) 2 (quotes $ text "_ <-" <+> ppr rhs)
, text "or by using the flag" <+> flag_doc ] ]
{- {-
************************************************************************ ************************************************************************
......
...@@ -387,12 +387,15 @@ putSrcSpanDs (UnhelpfulSpan {}) thing_inside ...@@ -387,12 +387,15 @@ putSrcSpanDs (UnhelpfulSpan {}) thing_inside
putSrcSpanDs (RealSrcSpan real_span) thing_inside putSrcSpanDs (RealSrcSpan real_span) thing_inside
= updLclEnv (\ env -> env {dsl_loc = real_span}) thing_inside = updLclEnv (\ env -> env {dsl_loc = real_span}) thing_inside
warnDs :: SDoc -> DsM () -- | Emit a warning for the current source location
warnDs warn = do { env <- getGblEnv warnDs :: WarnReason -> SDoc -> DsM ()
; loc <- getSrcSpanDs warnDs reason warn
; dflags <- getDynFlags = do { env <- getGblEnv
; let msg = mkWarnMsg dflags loc (ds_unqual env) warn ; loc <- getSrcSpanDs
; updMutVar (ds_msgs env) (\ (w,e) -> (w `snocBag` msg, e)) } ; dflags <- getDynFlags
; let msg = makeIntoWarning reason $
mkWarnMsg dflags loc (ds_unqual env) warn
; updMutVar (ds_msgs env) (\ (w,e) -> (w `snocBag` msg, e)) }
failWithDs :: SDoc -> DsM a failWithDs :: SDoc -> DsM a
failWithDs err failWithDs err
......
...@@ -217,7 +217,7 @@ match vars@(v:_) ty eqns -- Eqns *can* be empty ...@@ -217,7 +217,7 @@ match vars@(v:_) ty eqns -- Eqns *can* be empty
case p of PgView e _ -> e:acc case p of PgView e _ -> e:acc
_ -> acc) [] group) eqns _ -> acc) [] group) eqns
maybeWarn [] = return () maybeWarn [] = return ()
maybeWarn l = warnDs (vcat l) maybeWarn l = warnDs NoReason (vcat l)
in in
maybeWarn $ (map (\g -> text "Putting these view expressions into the same case:" <+> (ppr g)) maybeWarn $ (map (\g -> text "Putting these view expressions into the same case:" <+> (ppr g))
(filter (not . null) gs)) (filter (not . null) gs))
......
...@@ -139,9 +139,9 @@ warnAboutIdentities dflags (Var conv_fn) type_of_conv ...@@ -139,9 +139,9 @@ warnAboutIdentities dflags (Var conv_fn) type_of_conv
, idName conv_fn `elem` conversionNames , idName conv_fn `elem` conversionNames
, Just (arg_ty, res_ty) <- splitFunTy_maybe type_of_conv , Just (arg_ty, res_ty) <- splitFunTy_maybe type_of_conv
, arg_ty `eqType` res_ty -- So we are converting ty -> ty , arg_ty `eqType` res_ty -- So we are converting ty -> ty
= warnDs (vcat [ text "Call of" <+> ppr conv_fn <+> dcolon <+> ppr type_of_conv = warnDs (Reason Opt_WarnIdentities)
(vcat [ text "Call of" <+> ppr conv_fn <+> dcolon <+> ppr type_of_conv
, nest 2 $ text "can probably be omitted" , nest 2 $ text "can probably be omitted"
, parens (text "Use -fno-warn-identities to suppress this message")
]) ])
warnAboutIdentities _ _ _ = return () warnAboutIdentities _ _ _ = return ()
...@@ -173,7 +173,8 @@ warnAboutOverflowedLiterals dflags lit ...@@ -173,7 +173,8 @@ warnAboutOverflowedLiterals dflags lit
check :: forall a. (Bounded a, Integral a) => Integer -> Name -> a -> DsM () check :: forall a. (Bounded a, Integral a) => Integer -> Name -> a -> DsM ()
check i tc _proxy check i tc _proxy
= when (i < minB || i > maxB) $ do = when (i < minB || i > maxB) $ do
warnDs (vcat [ text "Literal" <+> integer i warnDs (Reason Opt_WarnOverflowedLiterals)
(vcat [ text "Literal" <+> integer i
<+> text "is out of the" <+> ppr tc <+> ptext (sLit "range") <+> text "is out of the" <+> ppr tc <+> ptext (sLit "range")
<+> integer minB <> text ".." <> integer maxB <+> integer minB <> text ".." <> integer maxB
, sug ]) , sug ])
...@@ -209,7 +210,7 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr ...@@ -209,7 +210,7 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr
, let check :: forall a. (Enum a, Num a) => a -> DsM () , let check :: forall a. (Enum a, Num a) => a -> DsM ()
check _proxy check _proxy
= when (null enumeration) $ = when (null enumeration) $
warnDs (text "Enumeration is empty") warnDs (Reason Opt_WarnEmptyEnumerations) (text "Enumeration is empty")
where where
enumeration :: [a] enumeration :: [a]
enumeration = case mThn of enumeration = case mThn of
......
DsStrictWarn.hs:7:11: warning: DsStrictWarn.hs:7:11: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive Pattern match(es) are non-exhaustive
In a pattern binding: Patterns not matched: [] In a pattern binding: Patterns not matched: []
GadtOverlap.hs:19:1: Warning: GadtOverlap.hs:19:1: warning: [-Wincomplete-patterns (in -Wextra)]
Pattern match(es) are non-exhaustive Pattern match(es) are non-exhaustive
In an equation for ‘h’: Patterns not matched: T3 In an equation for ‘h’: Patterns not matched: T3
T10662.hs:3:3: warning: T10662.hs:3:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘[Char]’ A do-notation statement discarded a result of type ‘[Char]’
Suppress this warning by saying Suppress this warning by saying
‘_ <- ($) return let a = "hello" in a’ ‘_ <- ($) return let a = "hello" in a’
or by using the flag -fno-warn-unused-do-bind
T2395.hs:13:1: warning: T2395.hs:13:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘bar’: bar _ = ... In an equation for ‘bar’: bar _ = ...
T3263-1.hs:25:3: Warning: T3263-1.hs:25:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘Int’ A do-notation statement discarded a result of type ‘Int’
Suppress this warning by saying ‘_ <- nonNullM’ Suppress this warning by saying ‘_ <- nonNullM’
or by using the flag -fno-warn-unused-do-bind
T3263-1.hs:35:3: Warning: T3263-1.hs:35:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘Int’ A do-notation statement discarded a result of type ‘Int’
Suppress this warning by saying ‘_ <- nonNullM’ Suppress this warning by saying ‘_ <- nonNullM’
or by using the flag -fno-warn-unused-do-bind
T3263-2.hs:25:3: Warning: T3263-2.hs:25:3: warning: [-Wwrong-do-bind (in -Wdefault)]
A do-notation statement discarded a result of type ‘m Int’ A do-notation statement discarded a result of type ‘m Int’
Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’ Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
or by using the flag -fno-warn-wrong-do-bind
T3263-2.hs:37:3: Warning: T3263-2.hs:37:3: warning: [-Wwrong-do-bind (in -Wdefault)]
A do-notation statement discarded a result of type ‘m Int’ A do-notation statement discarded a result of type ‘m Int’
Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’ Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
or by using the flag -fno-warn-wrong-do-bind
T4488.hs:11:11: Warning: T4488.hs:11:11: warning: [-Widentities]
Call of fromIntegral :: Int -> Int Call of fromIntegral :: Int -> Int
can probably be omitted can probably be omitted
(Use -fno-warn-identities to suppress this message)
T4488.hs:17:11: Warning: T4488.hs:17:11: warning: [-Widentities]
Call of toInteger :: Integer -> Integer Call of toInteger :: Integer -> Integer
can probably be omitted can probably be omitted
(Use -fno-warn-identities to suppress this message)
T4488.hs:23:11: Warning: T4488.hs:23:11: warning: [-Widentities]
Call of toRational :: Rational -> Rational Call of toRational :: Rational -> Rational
can probably be omitted can probably be omitted
(Use -fno-warn-identities to suppress this message)
T4488.hs:29:11: Warning: T4488.hs:29:11: warning: [-Widentities]
Call of realToFrac :: Float -> Float Call of realToFrac :: Float -> Float
can probably be omitted can probably be omitted
(Use -fno-warn-identities to suppress this message)
T5117.hs:16:1: warning: T5117.hs:16:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f3’: f3 (MyString "a") = ... In an equation for ‘f3’: f3 (MyString "a") = ...
T5455.hs:8:11: warning: T5455.hs:8:11: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive Pattern match(es) are non-exhaustive
In a pattern binding: Patterns not matched: [] In a pattern binding: Patterns not matched: []
T5455.hs:13:13: warning: T5455.hs:13:13: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive Pattern match(es) are non-exhaustive
In a pattern binding: Patterns not matched: [] In a pattern binding: Patterns not matched: []
ds002.hs:8:1: warning: ds002.hs:8:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f y = ... In an equation for ‘f’: f y = ...
ds002.hs:9:1: warning: ds002.hs:9:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f z = ... In an equation for ‘f’: f z = ...
ds002.hs:14:1: warning: ds002.hs:14:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘g’: g x y z = ... In an equation for ‘g’: g x y z = ...
ds003.hs:7:1: warning: ds003.hs:7:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f (x : x1 : x2 : x3) ~(y, ys) z = ... In an equation for ‘f’: f (x : x1 : x2 : x3) ~(y, ys) z = ...
ds003.hs:8:1: warning: ds003.hs:8:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f x y True = ... In an equation for ‘f’: f x y True = ...
ds019.hs:6:1: warning: ds019.hs:6:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f d (j, k) p = ... In an equation for ‘f’: f d (j, k) p = ...
ds019.hs:7:1: warning: ds019.hs:7:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f (e, f, g) l q = ... In an equation for ‘f’: f (e, f, g) l q = ...
ds019.hs:8:1: warning: ds019.hs:8:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f h (m, n) r = ... In an equation for ‘f’: f h (m, n) r = ...
ds020.hs:9:1: warning: ds020.hs:9:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘a’: a ~(~[], ~[], ~[]) = ... In an equation for ‘a’: a ~(~[], ~[], ~[]) = ...
ds020.hs:12:1: warning: ds020.hs:12:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘b’: b ~(~x : ~xs : ~ys) = ... In an equation for ‘b’: b ~(~x : ~xs : ~ys) = ...
ds020.hs:19:1: warning: ds020.hs:19:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘d’: d ~(n+43) = ... In an equation for ‘d’: d ~(n+43) = ...
ds020.hs:20:1: warning: ds020.hs:20:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘d’: d ~(n+999) = ... In an equation for ‘d’: d ~(n+999) = ...
ds020.hs:23:1: warning: ds020.hs:23:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘f’: f x@(~[]) = ... In an equation for ‘f’: f x@(~[]) = ...
ds022.hs:24:1: warning: ds022.hs:24:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘i’: i 1 0.011e2 = ... In an equation for ‘i’: i 1 0.011e2 = ...
ds022.hs:25:1: warning: ds022.hs:25:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In an equation for ‘i’: i 2 2.20000 = ... In an equation for ‘i’: i 2 2.20000 = ...
ds043.hs:10:3: warning: ds043.hs:10:3: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant Pattern match is redundant
In a case alternative: B {e = True, f = False} -> ... In a case alternative: B {e = True, f = False} -> ...
ds051.hs:7:1: warning: ds051.hs:7:1: warning: [-Woverlapping-patterns (in -Wdefault)]