[Haskell-cafe] Re: [Haskell] ANN: HLint 1.0
hpacheco at gmail.com
Sat Dec 20 10:30:45 EST 2008
On Sat, Dec 20, 2008 at 3:06 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> > I noticed that you convert point-wise into point-free.
> > Perhaps you could add some point-free transformations to remove
> > 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?
There are many simple ones, such as:
f . id -> f
filter true -> id
map id -> id
> already does a few relating to if expressions.
Yes, like map f . map g -> map (f . g)
You can find more in Transformation of Structure-Shy Programs - Applied to
XPath Queries and Strategic
> > 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:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe