Skip to content

Commit

Permalink
Fix reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Jul 29, 2024
1 parent 36d27ff commit 6aa01e3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@
<span class="lineno"> 27 </span>import qualified Data.Text.Lazy as LT
<span class="lineno"> 28 </span>
<span class="lineno"> 29 </span>evalSource :: BIO m =&gt; FormatType -&gt; Source -&gt; m Output
<span class="lineno"> 30 </span><span class="decl"><span class="nottickedoff">evalSource t s = wGetContentsText &gt;&gt;= (evalWithFormat t s)</span></span>
<span class="lineno"> 30 </span><span class="decl"><span class="nottickedoff">evalSource t s = wGetContentsText &gt;&gt;= evalWithFormat t s</span></span>
<span class="lineno"> 31 </span>
<span class="lineno"> 32 </span>evalWithFormat :: MonadSafe m =&gt; FormatType -&gt; Source -&gt; LT.Text -&gt; m Output
<span class="lineno"> 33 </span><span class="decl"><span class="istickedoff">evalWithFormat BinaryLabel source input = pure $ showFoldable $ evalInternal source input</span>
<span class="lineno"> 34 </span><span class="spaces"></span><span class="istickedoff">evalWithFormat TextLabel source input = (makeAsciiText28 . convert . evalInternal source) . showExpressionList =&lt;&lt; stringToDL (toString input)</span></span>
<span class="lineno"> 34 </span><span class="spaces"></span><span class="istickedoff">evalWithFormat TextLabel source input = (makeAsciiText28 &lt;$&gt; convert &lt;$&gt; evalInternal source) &lt;$&gt; showExpressionList =&lt;&lt; stringToDL (toString input)</span></span>
<span class="lineno"> 35 </span>
<span class="lineno"> 36 </span>evalInternal :: Source -&gt; LT.Text -&gt; ExpressionDList
<span class="lineno"> 37 </span><span class="decl"><span class="istickedoff">evalInternal source input = eval $ fromStrict source &lt;&gt; input</span></span>
<span class="lineno"> 38 </span>
<span class="lineno"> 39 </span>eval :: LT.Text -&gt; ExpressionDList
<span class="lineno"> 40 </span><span class="decl"><span class="istickedoff">eval = execWriter . runExpressionList . parse</span></span>
<span class="lineno"> 40 </span><span class="decl"><span class="istickedoff">eval = execWriter &lt;$&gt; runExpressionList &lt;$&gt; parse</span></span>

</pre>
</body>
Expand Down
70 changes: 42 additions & 28 deletions docs/reports/hlint.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,43 +161,28 @@

<p><a class="all" href="javascript:show('')">All hints</a></p>
<ul>
<li><a id="hint0" href="javascript:show('hint0')">Warning: Redundant lambda (3)</a></li>
<li><a id="hint1" href="javascript:show('hint1')">Suggestion: Reduce duplication (1)</a></li>
<li><a id="hint2" href="javascript:show('hint2')">Suggestion: Redundant bracket (1)</a></li>
<li><a id="hint0" href="javascript:show('hint0')">Warning: Functor law (3)</a></li>
<li><a id="hint1" href="javascript:show('hint1')">Warning: Redundant lambda (3)</a></li>
<li><a id="hint2" href="javascript:show('hint2')">Warning: Use mapM (1)</a></li>
</ul>

<p><a class="all" href="javascript:show('')">All files</a></p>
<ul>
<li><a id="file0" href="javascript:show('file0')">./dist-newstyle/src/helio-157a2fc26d319c83/hs/test/HelVM/HelIO/Collections/MapListSpec.hs (1)</a></li>
<li><a id="file1" href="javascript:show('file1')">./hs/app/AppOptions.hs (1)</a></li>
<li><a id="file2" href="javascript:show('file2')">./hs/app/Main.hs (2)</a></li>
<li><a id="file3" href="javascript:show('file3')">./hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs (1)</a></li>
<li><a id="file0" href="javascript:show('file0')">./hs/app/AppOptions.hs (1)</a></li>
<li><a id="file1" href="javascript:show('file1')">./hs/app/Main.hs (2)</a></li>
<li><a id="file2" href="javascript:show('file2')">./hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs (3)</a></li>
<li><a id="file3" href="javascript:show('file3')">./hs/src/HelVM/HelTC/Calculators/Lambda/DefinitionExpander.hs (1)</a></li>
</ul>

</div>
<div id="content" valign="top" width="100%">
<p>
Report generated by <a href="http://community.haskell.org/~ndm/hlint/">HLint</a>
v3.1.6
v3.5
- a tool to suggest improvements to your Haskell code.
</p>

<div class="hint1 file0">
dist-newstyle/src/helio-157a2fc26d319c83/hs/test/HelVM/HelIO/Collections/MapListSpec.hs:50:11-112: Suggestion: Reduce duplication<br/>
Found<br/>
<pre><span class='hs-definition'>it</span> <span class='hs-str'>"mapListToList . fromIntIndexedList"</span>
<span class='hs-varop'>$</span> <span class='hs-layout'>(</span><span class='hs-varid'>mapListToList</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromIntIndexedList</span><span class='hs-layout'>)</span> <span class='hs-varid'>input</span> <span class='hs-varop'>`shouldBe`</span> <span class='hs-varid'>output</span>
<span class='hs-definition'>it</span> <span class='hs-str'>"I.toList . fromIntIndexedList"</span>
<span class='hs-varop'>$</span> <span class='hs-layout'>(</span><span class='hs-conid'>I.toList</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromIntIndexedList</span><span class='hs-layout'>)</span> <span class='hs-varid'>input</span> <span class='hs-varop'>`shouldBe`</span> <span class='hs-varid'>output</span>
<span class='hs-definition'>it</span> <span class='hs-str'>"LL.toList . fromIntIndexedList"</span>
<span class='hs-varop'>$</span> <span class='hs-layout'>(</span><span class='hs-conid'>LL.toList</span> <span class='hs-varop'>.</span> <span class='hs-varid'>fromIntIndexedList</span><span class='hs-layout'>)</span> <span class='hs-varid'>input</span> <span class='hs-varop'>`shouldBe`</span> <span class='hs-varid'>output</span>
</pre>
Perhaps<br/>
<pre><span class='hs-conid'>Combine</span> <span class='hs-varid'>with</span> <span class='hs-varid'>dist</span><span class='hs-comment'>-</span><span class='hs-varid'>newstyle</span><span class='hs-varop'>/</span><span class='hs-varid'>src</span><span class='hs-varop'>/</span><span class='hs-varid'>helio</span><span class='hs-comment'>-</span><span class='hs-num'>157</span><span class='hs-varid'>a2fc26d319c83</span><span class='hs-varop'>/</span><span class='hs-varid'>hs</span><span class='hs-varop'>/</span><span class='hs-varid'>test</span><span class='hs-varop'>/</span><span class='hs-conid'>HelVM</span><span class='hs-varop'>/</span><span class='hs-conid'>HelIO</span><span class='hs-varop'>/</span><span class='hs-conid'>Collections</span><span class='hs-varop'>/</span><span class='hs-conid'>MapListSpec.hs</span><span class='hs-conop'>:</span><span class='hs-num'>59</span><span class='hs-conop'>:</span><span class='hs-num'>11</span><span class='hs-comment'>-</span><span class='hs-num'>112</span></pre>

</div>

<div class="hint0 file1">
hs/app/AppOptions.hs:(64,1)-(66,55): Warning: Redundant lambda<br/>
Found<br/>
<pre><span class='hs-definition'>calculatorParams</span>
Expand All @@ -213,7 +198,7 @@

</div>

<div class="hint0 file2">
<div class="hint1 file1">
hs/app/Main.hs:(25,1)-(28,55): Warning: Redundant lambda<br/>
Found<br/>
<pre><span class='hs-definition'>runApp</span>
Expand All @@ -229,7 +214,7 @@

</div>

<div class="hint0 file2">
<div class="hint1 file1">
hs/app/Main.hs:(35,1)-(36,61): Warning: Redundant lambda<br/>
Found<br/>
<pre><span class='hs-definition'>run</span>
Expand All @@ -241,12 +226,41 @@

</div>

<div class="hint0 file2">
hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:34:43-118: Warning: Functor law<br/>
Found<br/>
<pre><span class='hs-layout'>(</span><span class='hs-varid'>makeAsciiText28</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>convert</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>evalInternal</span> <span class='hs-varid'>source</span><span class='hs-layout'>)</span>
<span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>showExpressionList</span></pre>
Perhaps<br/>
<pre><span class='hs-layout'>(</span><span class='hs-layout'>(</span><span class='hs-varid'>makeAsciiText28</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>convert</span><span class='hs-layout'>)</span> <span class='hs-varop'>.</span> <span class='hs-varid'>evalInternal</span> <span class='hs-varid'>source</span>
<span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>showExpressionList</span><span class='hs-layout'>)</span></pre>

</div>

<div class="hint0 file2">
hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:34:44-94: Warning: Functor law<br/>
Found<br/>
<pre><span class='hs-definition'>makeAsciiText28</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>convert</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>evalInternal</span> <span class='hs-varid'>source</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>makeAsciiText28</span> <span class='hs-varop'>.</span> <span class='hs-varid'>convert</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>evalInternal</span> <span class='hs-varid'>source</span></pre>

</div>

<div class="hint0 file2">
hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:40:8-49: Warning: Functor law<br/>
Found<br/>
<pre><span class='hs-definition'>execWriter</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>runExpressionList</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>parse</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>execWriter</span> <span class='hs-varop'>.</span> <span class='hs-varid'>runExpressionList</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>parse</span></pre>

</div>

<div class="hint2 file3">
hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:30:39-58: Suggestion: Redundant bracket<br/>
hs/src/HelVM/HelTC/Calculators/Lambda/DefinitionExpander.hs:30:55-113: Warning: Use mapM<br/>
Found<br/>
<pre><span class='hs-definition'>wGetContentsText</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-layout'>(</span><span class='hs-varid'>evalWithFormat</span> <span class='hs-varid'>t</span> <span class='hs-varid'>s</span><span class='hs-layout'>)</span></pre>
<pre><span class='hs-definition'>sequence</span> <span class='hs-layout'>(</span><span class='hs-varid'>expandDefinitionByMap</span> <span class='hs-varid'>m</span> <span class='hs-varop'>&lt;$&gt;</span> <span class='hs-varid'>removeDefinitions</span> <span class='hs-varid'>il</span><span class='hs-layout'>)</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>wGetContentsText</span> <span class='hs-varop'>&gt;&gt;=</span> <span class='hs-varid'>evalWithFormat</span> <span class='hs-varid'>t</span> <span class='hs-varid'>s</span></pre>
<pre><span class='hs-definition'>mapM</span> <span class='hs-layout'>(</span><span class='hs-varid'>expandDefinitionByMap</span> <span class='hs-varid'>m</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>removeDefinitions</span> <span class='hs-varid'>il</span><span class='hs-layout'>)</span></pre>

</div>

Expand Down
Loading

0 comments on commit 6aa01e3

Please sign in to comment.