🔧 Running with --fix will automatically remove some of the reported errors.
config =
[ NoUnused.Parameters.rule
]
This rule looks within function arguments, let functions and lambdas to find any values that are unused. It will report any parameters that are not used.
Fixes for lambdas
We're only offering fixes for lambdas here because we believe unused parameters in functions are a code smell that should be refactored.
Fail
Value number is not used:
add1 number =
1
The rule will also report parameters that are only used to be passed again to the containing recursive function:
last list unused =
case list of
[] ->
Nothing
[ a ] ->
Just a
_ :: rest ->
last rest unused
Success
add1 number =
number + 1
Try it out
You can try this rule out by running the following command:
Report parameters that are not used.
🔧 Running with
--fixwill automatically remove some of the reported errors.This rule looks within function arguments, let functions and lambdas to find any values that are unused. It will report any parameters that are not used.
Fixes for lambdas
We're only offering fixes for lambdas here because we believe unused parameters in functions are a code smell that should be refactored.
Fail
Value
numberis not used:The rule will also report parameters that are only used to be passed again to the containing recursive function:
Success
Try it out
You can try this rule out by running the following command: