[Haskell-cafe] Re: [Haskell] ANN: HLint 1.0

Neil Mitchell ndmitchell at gmail.com
Sat Dec 20 10:06:30 EST 2008


> I noticed that you convert point-wise into point-free.
> Perhaps you could add some point-free transformations to remove redundancy
> in certain cases.
> Is that a goal of the library?

It does some transformations of th at nature, but the idea isn't to
remove redundancy, its to make the code clearer. Do you have any
suggestions for things it could easily do to remove redundancy? It
already does a few relating to if expressions.

> a suggestion for a rule: dollar eta: f $ x -> f x

That can easily be added.

> Why not:
> ("TAG " `isPrefixOf` just_name pinfo)

That's an open bug: http://code.google.com/p/ndmitchell/issues/detail?id=109

In general, most of the hints are "replace this with this" -
evaluating the new bit (even to remove easy constants) is beyond it
for the moment. Some people theorised it might be too hard,
non-terminating, or incorrect. As it happens this rule only fires when
"TAG " is either a string literal or a list literal, and when the
number is a constant, so its always safe and the guard could always be

> 1) How does one actually use the CLI tool? You didn't say. It *seems*
> that one just feeds it a list of random filepaths, so on Mueval, say,
> the command would be 'hlint main.hs Mueval/*.hs' (and not, say, 'hlint
> mueval.cabal'). But I'm not actually sure.

The filenames are either filenames, or directories which are
recursively searched, i.e cd mueval && hlint . is probably sufficient.
I should document it more clearly in the manual.



More information about the Haskell-Cafe mailing list