0e52e1de

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

Stop the partial-function ban from reaching NonEmpty

The ban on head, tail, init and last names NonEmpty as the replacement
for three of the four, and then refused it: a bare name in an hlint
functions rule matches every function of that name whatever module it
came from, so Data.List.NonEmpty.head and its three siblings were
reported as partial, with a message telling the writer to use the thing
they had just used.

hlint concatenates the allowances of every rule matching a use, and a
rule with no allowance list at all allows everything, so a
module-qualified entry beside each ban lifts it for exactly that module
and leaves the ban broad everywhere else. Tried out against a fixture:
head, Data.List.head and Data.Text.head are all still refused, and so is
Data.List.NonEmpty.!!, which is as partial as indexing a list and is
deliberately not among the four.

HsNoSemigroupOnText was written around this: spanOfRun folded over the
operands to reach the last one rather than asking for it. That fold is
now the direct question again, and the comment justifying a constraint
that no longer exists is gone with it.

Also plans the walking that rule needed out of the rule: M5 is sixteen
rules that want declarations and expressions, one traversal of the whole
module each if nothing changes, and the three things this rule had to
work out about reading an expression are things every one of them needs.

Total

4h36m59s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 14m10s 0s 0s 14m11s 14m10s
Eval 14m15s 15s 15s 14m31s 4s
Build 14m23s 1m09s 4h36m46s 4h51m09s 4h35m59s
Suite 14m10s 1m26s 4h36m59s 4h51m09s 4h50m14s

Timeline

Config Eval Build Compressed gap
0s14m20s14m30s4h50m4h50m4h51m