<br><br><div class="gmail_quote">On Sat, Dec 20, 2008 at 3:06 PM, Neil Mitchell <span dir="ltr">&lt;<a href="mailto:ndmitchell@gmail.com">ndmitchell@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi<br>
<div class="Ih2E3d"><br>
&gt; I noticed that you convert point-wise into point-free.<br>
&gt; Perhaps you could add some point-free transformations to remove redundancy<br>
&gt; in certain cases.<br>
&gt; Is that a goal of the library?<br>
<br>
</div>It does some transformations of th at nature, but the idea isn&#39;t to<br>
remove redundancy, its to make the code clearer. Do you have any<br>
suggestions for things it could easily do to remove redundancy?</blockquote><div><br></div><div><div>There are many simple ones, such as:</div><div>f . id -&gt; f</div><div>filter true -&gt; id</div><div>map id -&gt; id</div>
<div>... etc</div></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">It<br>
already does a few relating to if expressions.<br>
<div class="Ih2E3d"></div></blockquote><div><br></div><div>Yes, like map f . map g -&gt; map (f . g)</div><div><br></div><div>You can find more in&nbsp;<a href="http://www.di.uminho.pt/~mac/Publications/pepm07corrected.pdf">Transformation of Structure-Shy Programs -
           Applied to XPath Queries and Strategic
           Functions,</a>&nbsp;page 4.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d"><br>
&gt; a suggestion for a rule: dollar eta: f $ x -&gt; f x<br>
<br>
</div>That can easily be added.<br>
<br>
&gt; Why not:<br>
<div class="Ih2E3d">&gt; (&quot;TAG &quot; `isPrefixOf` just_name pinfo)<br>
<br>
</div>That&#39;s an open bug: <a href="http://code.google.com/p/ndmitchell/issues/detail?id=109" target="_blank">http://code.google.com/p/ndmitchell/issues/detail?id=109</a><br>
<br>
In general, most of the hints are &quot;replace this with this&quot; -<br>
evaluating the new bit (even to remove easy constants) is beyond it<br>
for the moment. Some people theorised it might be too hard,<br>
non-terminating, or incorrect. As it happens this rule only fires when<br>
&quot;TAG &quot; is either a string literal or a list literal, and when the<br>
number is a constant, so its always safe and the guard could always be<br>
eliminated.<br>
<div class="Ih2E3d"><br>
&gt; 1) How does one actually use the CLI tool? You didn&#39;t say. It *seems*<br>
&gt; that one just feeds it a list of random filepaths, so on Mueval, say,<br>
&gt; the command would be &#39;hlint main.hs Mueval/*.hs&#39; (and not, say, &#39;hlint<br>
&gt; mueval.cabal&#39;). But I&#39;m not actually sure.<br>
<br>
</div>The filenames are either filenames, or directories which are<br>
recursively searched, i.e cd mueval &amp;&amp; hlint . is probably sufficient.<br>
I should document it more clearly in the manual.<br>
<br>
Thanks<br>
<font color="#888888"><br>
Neil<br>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.di.uminho.pt/~hpacheco">www.di.uminho.pt/~hpacheco</a><br>