packages feed

hlint-1.0.0.0: data/report.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<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'>
var hints = {};
var files = {};
var items = [];

var link_sel = 1;
var link_count = 0;

// <CONTENT>
idea("Eta reduce","Data/Binary/Defer/Class.hs",31,1,"get0 f = return f","get0 = return");
idea("Eta reduce","Data/Binary/Defer/Class.hs",41,1,"getFixed0 f = return f","getFixed0 = return");
idea("Eta reduce","Data/Binary/Defer/Class.hs",51,1,"put1 x1 = put x1","put1 = put");
idea("Use on","Data/Binary/Defer/Class.hs",52,1,"put2 x1 x2 = put x1 >> put x2","put2 = (>>) `on` put");
idea("Use on","Data/Binary/Defer/Link.hs",48,5,"a == b = linkKey a == linkKey b","(==) = (==) `on` linkKey");
idea("Use concatMap","General/Util.hs",71,1,"concat $ map (\\ a -> zipWith f (inits a) (tails a)) (permute xs)","concatMap (\\ a -> zipWith f (inits a) (tails a)) (permute xs)");
// </CONTENT>

function idea(name,file,line,col,old,suggest)
{
	hints[name] = value(0, hints[name]) + 1;
	files[file] = value(0, files[file]) + 1;
	items[items.length+1] = {name:name, file:file, line:line, col:col, old:old, suggest:suggest};
}

function sum(xs)
{
	var n = 0;
	for (var i in xs)
		n += xs[i];
	return n;
}

function value(def, x)
{
	if (x) return x; else return def;
}

function show_item(x)
{
	var s = "";
	s += x.file + ":" + x.line + ":" + x.col + ": " + x.name + "<br/>";
	s += "Found:<br/><pre>" + x.old + "</pre>";
	s += "Why not:<br/><pre>" + x.suggest + "</pre><hr/>";
	return s;
}

function show_items(f)
{
	var s = "";
	for (i in items)
	{
		var x = items[i];
		if (f(x)) s += show_item(x);
	}
	return s;
}

function pick_link(i)
{
	document.getElementById("link_" + link_sel).style.fontWeight = "normal";
	document.getElementById("link_" + i).style.fontWeight = "bold";
	link_sel = i;
}

function show_hints(i, match)
{
	pick_link(i);
	var s = "";
	for (var i in hints)
	{
		if (i == match || match == "")
		{
			function f(x){return x.name == i};
			s += "<h2>" + i + "</h2>"
			s += show_items(f);
		}
	}
	document.getElementById('content').innerHTML = s;
}

function show_files(i, match)
{
	pick_link(i);
	var s = "";
	for (var i in files)
	{
		if (i == match || match == "")
		{
			function f(x){return x.file == i};
			s += "<h2>" + i + "</h2>"
			s += show_items(f);
		}
	}
	document.getElementById('content').innerHTML = s;
}

function on_load()
{
	function f(name,file,line,col,old,suggest)
	{
		hints[name] = value(0, hints[name]) + 1;
		files[file] = value(0, files[file]) + 1;
	}

	function shows(text, xs)
	{
		var s;
		link_count++;
		s = "<p><a id='link_" + link_count + "' href='javascript:show_" + text + "(" + link_count + ",\"\")'>All " + text + " (" + sum(xs) + ")</a></p><ul>";
		for (var i in xs)
		{
			link_count++;
			s += "<li><a id='link_" + link_count + "' href='javascript:show_" + text + "(" + link_count + ",\"" + i + "\")'>" + i + " (" + xs[i] + ")</a></li>";
		}
		s += "</ul>";
		return s;
	}

	var s = shows("hints",hints) + shows("files",files);
	document.getElementById('leftbar').innerHTML = s;

	show_hints(1,"");
}
</script>
<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;
}

h1 {
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:35px;
  overflow:auto;
  padding: 0;
  padding-left: 10px;
  margin: 0;
}

#leftbar {
  position:absolute;
  top:30px;
  left:0;
  width: 215px;
  bottom: 0px;
  overflow:auto;
  background:rgb(202,223,255);
  margin: 10px;
  padding-top: 0;
  padding-left: 7px;
  padding-right: 7px;
  -moz-border-radius: 5px;
}

#content {
  position:absolute;
  top:35px;
  left:250px;
  bottom:0;
  right:0;
  overflow:auto;
  padding-bottom: 15px;
}

#leftbar ul {margin-top: 0px; padding-left: 15px;}
#leftbar p {margin-bottom: 0px;}

pre{
	font-family: "lucida console", monospace;
}

</style>
</head>
<body onload='on_load()'>
<h1><a href="http://www.cs.york.ac.uk/~ndm/hlint/">HLint</a> report</h1>

<div id="leftbar" valign="top" style="min-width:200px">leftbar</div>
<div id="content" valign="top" width="100%">content</div>
</body>
</html>