git @ Cat's Eye Technologies Quylthulg / 86f0a19
Use haste-compiler to demo interpreting Quylthulg in a web browser. Chris Pressey 1 year, 5 months ago
4 changed file(s) with 39 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
00 *.hi
11 *.o
2 *.jsmod
23 bin/*
4 demo/qlzqqlzuup.js
1818 EOF
1919 chmod 755 bin/$PROG
2020 else
21 cd src && ghc --make Main.hs -o ../bin/$PROG
21 (cd src && ghc --make Main.hs -o ../bin/$PROG)
2222 fi
23
24 ### haste
25 (cd src && hastec --make HasteMain.hs -o ../demo/qlzqqlzuup.js)
0 <!DOCTYPE html>
1 <head>
2 <meta charset="utf-8">
3 <title>Quylthulg</title>
4 </head>
5 <body>
6
7 <h1>Quylthulg</h1>
8
9 <p>(Qlzqqlzuup.hs compiled to .js by Haste, running in HTML5 document)</p>
10
11 <input type="text" id="prog">
12
13 <pre id="result">
14
15 <script src="qlzqqlzuup.js"></script>
16 </body>
0 module Main where
1
2 import Haste
3 import Haste.DOM
4 import Haste.Events
5
6 import Qlzqqlzuup
7
8 main = withElems ["prog", "result"] driver
9
10 driver [progElem, resultElem] = do
11 onEvent progElem Change $ \_ -> execute
12 where
13 execute = do
14 Just prog <- getValue progElem
15 setProp resultElem "innerHTML" (showRun prog)