Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (36 sloc) 1.302 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Haskelltolk i Javascript</title>
<script src="lib/jsparse.js" type="text/javascript"></script>
<script src="haskell.js" type="text/javascript"></script>
<script src="haskell.ast.js" type="text/javascript"></script>
<script src="haskell.parser.js" type="text/javascript"></script>
<script src="haskell.interpreter.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var test1 = "module Test (asd,ysd) where { import Test }";
var test2 = "import Test";
var test3 = <><![CDATA[
module Test where {
cons x y = \f -> f x y;
car f = f (\x y -> x);
cdr f = f (\x y -> y);
main = alert (car (cons 1 2))
}
]]></>.toString()
var test4 = "1 * 3 + 2 * (4 + 1)";
var res = haskell.parser.parse(test3).ast;
var res2 = haskell.interpreter.execute(res);
console.log("%o", res2);
$("#output").text(res2);
});
</script>
</head>
<body>
<div id="output">This is a test page</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.