1323c04e

Created Started Finished

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Report an argument named only to be taken apart

HsLambdaCase, at the module level, over both shapes the guide names: one
equation that names its last argument and then cases on it, and one equation
per pattern with the function's name repeated in each. hlint covers neither, so
the rule stays a check of its own rather than a delegation.

The name is what is reported rather than the equations. A where-bound helper's
equations reach to the end of its own where clause, so they contain the
bindings written in it, and a finding drawn over another finding reads as one
thing to fix rather than as three.

Both shapes err towards silence. An equation that takes an earlier argument
apart, or names it differently from its neighbour, is doing something one
\case cannot say. A last argument whose name is written anywhere else in the
equation is a name with a use, and any occurrence of the spelling counts,
shadowing included, because deciding which occurrence is which is renaming.

Fourteen findings in this repository, all fixed here. Seventy-nine in nix-ci,
nineteen of them the named-and-cased shape and sixty the multi-equation one.