Open ndmitchell opened 4 years ago
e78ed72f3b4616c0d49915693620147bd751429f shows some of the bits that need removing if we do decide to kill it.
It's not surprising that it's slower really. There's a lot of sorting goes on and when we moved to GHC we were forced to implement ordering for that via lexicographical comparison of strings.
Thanks for the pointers - that would definitely help us fix it. Question is whether we should bother at all? Does anyone like this hint?
I did find it quite useful in the context of DAML (scenarios). To be honest, getting it migrated was hard and keeping it going in 9.0.1 got even harder (where Ord
on SrcSpan
has been removed). I have always thought at least the idea of the hint has value. I appreciate though that you have reservations about the efficacy of the algorithm we employ and now we add to that the need for a rewrite that plays nicely with GHC.
I've had good success with https://www.harukizaemon.com/simian/ - which is cross-file and multi-language and well optimised - so I think in most cases I'd use that over the Duplicate hint in HLint. Sorry you put in so much effort!
As per @phadej at https://twitter.com/phadej/status/1316670026192224257 it seems to have regressed massively with the GHC parser on large files. I have no particular love for this hint - it just doesn't seem to have been all that useful, and causes lots of issues. My inclination is to delete it and say that duplicate code is out of scope for HLint. Leaving this ticket for the discussion, and then to either rehabilitate it, split it into a separate tool, or clean up the remnants (which includes cross-module hints).