definition: |
checkApply :: Expression a -> CSM () checkApply e = case checkApplyCompare 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 a comparison operator is applied to the empty list -- (e.g., `(==) x []`). If so, a warning is emitted (use 'null' instead). |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_) |-> _} |
name: |
checkApply |
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 |