IntroducedNameIsUsed
Report unused declared names.
check :
Check
Report unused module-defined variables, ports, type aliases, let-defined variables, pattern variables including punned fields and dependencies.
Unused imports, import aliases, import exposes and module exposes are allowed; reporting these would be more annoying than helpful.
reported
function unusedArgument =
""
not reported
function _unusedArgument =
""
potential future improvements
- report unused variants.
While possible, it would have false negatives (e.g. when constructing a variant for equality checking)
and impossible to fix as deciding which cases to remove from a
when isoften requires exhaustiveness analysis. - report unused fields. This may require type inference or similar
- unused function parameters. When a function ignores an incoming value, remove the corresponding argument in all call sites. Fixing this is non-trivial and the check is probably more controversial compared to the remaining unused checking
- report phantom type parameters. Also probably too controversial, can be a separate check
- report unused parameters across (mutual) recursion (in module- and let-defined variables). This is tricky! Help appreciated