CurryInfo: stylechecker-2.0.0 / Check.AST.Pattern.EqualsEmptyList.checkInfix

definition:
checkInfix :: Expression a -> CSM ()
checkInfix e =
  case checkInfixCompare e of
    (sI, _, "==", (List _ _ []))
      -> report (Message
                  (getSpan sI)
                  (text "Do not use" <+> colorizeKey "a == []")
                  (text "Use" <+> colorizeKey "null a" <+> text "instead"))
    (sI, (List _ _ []), "==",  _)
      -> report (Message
                  (getSpan sI)
                  (text "Do not use" <+> colorizeKey "[] == a")
                  (text "Use" <+> colorizeKey "null a" <+> text "instead"))
    (sI, (List _ _ []), "/=",  _)
      -> report (Message
                  (getSpan sI)
                  (text "Do not use" <+> colorizeKey "[] /= a")
                  (text "Use" <+> colorizeKey "not (null a)" <+> text "instead"))
    (sI, _, "/=", (List _ _ []))
      -> report (Message
                  (getSpan sI)
                  (text "Do not use" <+> colorizeKey "a /= []")
                  (text "Use" <+> colorizeKey "not (null a)" <+> text "instead"))
    _ -> return ()
demand:
argument 1
deterministic:
deterministic operation
documentation:
-- Checks whether an infix comparison with the empty list (such as `x == []`) 
-- is used. If so, a warning is emitted (use 'null' instead).
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_) |-> _}
name:
checkInfix
precedence:
no precedence defined
result-values:
_
signature:
Curry.Types.Expression a
-> Control.Monad.Trans.State.StateT Types.CheckState Data.Functor.Identity.Identity ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term