-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hlint.html
272 lines (232 loc) · 13.2 KB
/
hlint.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>HLint Report</title>
<script type='text/javascript'>
/* == Algorithm for show/unshow ==
Each hint/file is given a number, hint# or file#
When we say showOnly with a class name we add the rules to
the css #content div {display:none}, #content div.className {display:block}
When going back to showAll we remove these results
*/
// CSS MANIPULATION //
function deleteRules(n)
{
var css = document.styleSheets[0];
for (var i = 0; i < n; i++)
css.deleteRule(css.cssRules.length-1);
}
function insertRule(s)
{
var css = document.styleSheets[0];
css.insertRule(s, css.cssRules.length);
}
// SHOW/HIDE LOGIC //
/**
* @param {bool} [initialise=false] - Used to signal we are loading the page, so
the current location doesn't match our presumed state.
*/
function show(id, initialise=false)
{
var last;
if (initialise)
{
last = "";
}
else
{
last = document.location.hash.slice(1);
}
if (id === last) return;
if (id.length === 0)
{
deleteRules(3);
insertRule(".all {font-weight: bold;}");
}
else
{
if (last.length === 0)
{
deleteRules(1);
insertRule("#content div {display:none;}");
}
else
{
deleteRules(2);
}
insertRule("#content div." + id + " {display:block;}");
insertRule("#" + id + "{font-weight:bold;}");
}
if (window.history)
history.replaceState("", document.title, window.location.pathname + window.location.search + (id === "" ? "" : "#" + id));
else
document.location.hash = '#'.concat(id);
}
</script>
<style type="text/css">
/* These rules are manipulated by the script.
The commented form is how it looks with an id selected */
.all {font-weight: bold;} /* #content div {display:none;} */
/* #content div.id {display:block;} */
/* #id {font-weight: bold;} */
</style>
<style type="text/css">
/* See http://www.webreference.com/programming/css_frames/ */
body {
margin:0;
border:0;
padding:0;
height:100%;
max-height:100%;
font-family: sans-serif;
font-size:76%;
overflow: hidden;
}
#leftbar {
position:absolute;
top:0px;
left:0px;
width: 215px;
bottom: 0px;
overflow:auto;
background:rgb(202,223,255);
margin: 10px;
padding-top: 0;
padding-left: 7px;
padding-right: 7px;
border-radius: 5px;
display:none; /* Override if script present */
}
#content {
position:absolute;
top:0;
bottom:0;
right:0;
overflow:auto;
padding-bottom: 15px;
padding-right: 7px;
left:10px; /* Override if script present */
}
#leftbar ul {margin-top: 0px; padding-left: 15px;}
#leftbar p {margin-bottom: 0px;}
.note {color: gray; font-size: smaller;}
pre {
font-family: "lucida console", monospace;
padding-left: 15px;
margin: 2px;
}
#content div {
margin-bottom: 10px;
margin-right: 10px;
padding-top: 4px;
border-top: 1px solid #ccc;
}
.script #content {left:250px;}
.script #leftbar {display: block;}
/* From HsColour */
.hs-keyglyph, .hs-layout {color: red;}
.hs-keyword {color: blue;}
.hs-comment, .hs-comment a {color: green;}
.hs-str, .hs-chr {color: teal;}
</style>
</head>
<body>
<script type='text/javascript'>
document.body.className = "script";
</script>
<div id="leftbar" valign="top" style="min-width:200px">
<p><a class="all" href="javascript:show('')">All hints</a></p>
<ul>
<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')">./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.5
- a tool to suggest improvements to your Haskell code.
</p>
<div class="hint1 file0">
hs/app/AppOptions.hs:(64,1)-(66,55): Warning: Redundant lambda<br/>
Found<br/>
<pre><span class='hs-definition'>calculatorParams</span>
<span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span> <span class='hs-varid'>o</span>
<span class='hs-keyglyph'>-></span> <span class='hs-keyword'>case</span> <span class='hs-varid'>calculatorType</span> <span class='hs-varid'>o</span> <span class='hs-keyword'>of</span>
<span class='hs-conid'>Lambda</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Params.Lambda</span> <span class='hs-layout'>(</span><span class='hs-varid'>lambdaType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>ilType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span>
<span class='hs-conid'>Combinators</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Params.Combinators</span> <span class='hs-layout'>(</span><span class='hs-varid'>combinatorsType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>calculatorParams</span> <span class='hs-varid'>o</span>
<span class='hs-keyglyph'>=</span> <span class='hs-keyword'>case</span> <span class='hs-varid'>calculatorType</span> <span class='hs-varid'>o</span> <span class='hs-keyword'>of</span>
<span class='hs-conid'>Lambda</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Params.Lambda</span> <span class='hs-layout'>(</span><span class='hs-varid'>lambdaType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-varid'>ilType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span>
<span class='hs-conid'>Combinators</span> <span class='hs-keyglyph'>-></span> <span class='hs-conid'>Params.Combinators</span> <span class='hs-layout'>(</span><span class='hs-varid'>combinatorsType</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span></pre>
</div>
<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>
<span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span> <span class='hs-varid'>o</span>
<span class='hs-keyglyph'>-></span> <span class='hs-keyword'>do</span> <span class='hs-varid'>hSetBuffering</span> <span class='hs-varid'>stdout</span> <span class='hs-conid'>IO.NoBuffering</span>
<span class='hs-varid'>source</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>readSourceFile</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.exec</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.file</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span>
<span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.printLogs</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.calculatorParams</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-varid'>source</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>runApp</span> <span class='hs-varid'>o</span>
<span class='hs-keyglyph'>=</span> <span class='hs-keyword'>do</span> <span class='hs-varid'>hSetBuffering</span> <span class='hs-varid'>stdout</span> <span class='hs-conid'>IO.NoBuffering</span>
<span class='hs-varid'>source</span> <span class='hs-keyglyph'><-</span> <span class='hs-varid'>readSourceFile</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.exec</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.file</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span>
<span class='hs-varid'>run</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.printLogs</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-layout'>(</span><span class='hs-conid'>App.calculatorParams</span> <span class='hs-varid'>o</span><span class='hs-layout'>)</span> <span class='hs-varid'>source</span></pre>
</div>
<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>
<span class='hs-keyglyph'>=</span> <span class='hs-keyglyph'>\</span> <span class='hs-varid'>printLogs</span> <span class='hs-varid'>calculatorParams</span> <span class='hs-varid'>source</span>
<span class='hs-keyglyph'>-></span> <span class='hs-varid'>controlTToIO</span> <span class='hs-varid'>printLogs</span> <span class='hs-layout'>(</span><span class='hs-varid'>evalSource</span> <span class='hs-varid'>calculatorParams</span> <span class='hs-varid'>source</span><span class='hs-layout'>)</span></pre>
Perhaps<br/>
<pre><span class='hs-definition'>run</span> <span class='hs-varid'>printLogs</span> <span class='hs-varid'>calculatorParams</span> <span class='hs-varid'>source</span>
<span class='hs-keyglyph'>=</span> <span class='hs-varid'>controlTToIO</span> <span class='hs-varid'>printLogs</span> <span class='hs-layout'>(</span><span class='hs-varid'>evalSource</span> <span class='hs-varid'>calculatorParams</span> <span class='hs-varid'>source</span><span class='hs-layout'>)</span></pre>
</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'><$></span> <span class='hs-varid'>convert</span> <span class='hs-varop'><$></span> <span class='hs-varid'>evalInternal</span> <span class='hs-varid'>source</span><span class='hs-layout'>)</span>
<span class='hs-varop'><$></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'><$></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'><$></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'><$></span> <span class='hs-varid'>convert</span> <span class='hs-varop'><$></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'><$></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'><$></span> <span class='hs-varid'>runExpressionList</span> <span class='hs-varop'><$></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'><$></span> <span class='hs-varid'>parse</span></pre>
</div>
<div class="hint2 file3">
hs/src/HelVM/HelTC/Calculators/Lambda/DefinitionExpander.hs:30:55-113: Warning: Use mapM<br/>
Found<br/>
<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'><$></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'>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>
</div>
<script type='text/javascript'>
show(window.location.hash.slice(1), true);
</script>
</body>
</html>