Commits

Even Wiik Thomassen committed 3ac6a10 Merge

Merged in even branch

  • Participants
  • Parent commits 790fdcc, da0ee95
  • Branches khs

Comments (0)

Files changed (19)

 *.o
 *.pyc
 *.swp
+tests/*/*.hcj
+tests/*/*.hcr
 parsertests.py
 core/core2js
 *.vim
+# -*- coding: utf-8 -*-
+
 from pypy.rlib import jit, unroll
 
 

File jscparser.py

+# -*- coding: utf-8 -*-
+
 from pypy.rlib.parsing.ebnfparse import parse_ebnf, make_parse_function
 from pypy.rlib.parsing.tree import (RPythonVisitor, Nonterminal, 
                                     Node, Symbol, VisitError)
-#!/usr/bin/python2.7
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
 
 import sys
-import jscparser as c
-import haskell as p
-import libraries as libs
+import jscparser
+import haskell
+import libraries
+
 
 sys.setrecursionlimit(2500)
 
+
 def interp(path):
-    js = c.parse_js(path)
-    ast = c.AST()
+    js = jscparser.parse_js(path)
+    ast = jscparser.AST()
     mod = ast.get_ast(js)
 
-    main = libs.coremods["main:Main"].qvars["ZCMain.main"]
+    main = libraries.coremods["main:Main"].qvars["ZCMain.main"]
 
-    p.evaluate_hnf(main)
+    haskell.evaluate_hnf(main)
 
 
 def jitpolicy(self):

File makegraph.py

-#!/usr/bin/python2.7
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
 from pypy.rlib.parsing.ebnfparse import parse_ebnf, make_parse_function
 from pypy.rlib.parsing.tree import RPythonVisitor, Nonterminal, Node, Symbol, VisitError
 import sys

File module.py

File contents unchanged.
-#!/usr/bin/pypy
+#!/usr/bin/env pypy
+# -*- coding: utf-8 -*-
 
 import sys
 import os
     print "-----------------------------------"
     print ""
 
-    test = "./tests/" + test_dir + "/" + test_dir
+    test = "./tests/%s/%s" % (test_dir, test_dir)
 
     ghc = "ghc"
     core2js = os.path.realpath("./core/core2js")
     hcj = test + ".hcj"
 
     print "-- Making external core using ghc"
-    # make extcore, force recompilation, make no binary
-    make_hcr = [ghc, \
-               "-fext-core", \
-               "-fno-code", \
-               hs]
+    # make extcore, force recompilation, todo: make no binary
+    make_hcr = [ghc, "-fext-core", "-fforce-recomp", hs]
     call(make_hcr)
 
     print "-- Making JSCore using core2js"
-    make_hcj = [core2js, \
-                hcr, \
-                hcj]
+    make_hcj = [core2js, hcr, hcj]
     call(make_hcj)
 
     print "-- Running program"
-    run_hcj = [pypy, \
-               "./main.py", \
-               hcj]
+    run_hcj = [pypy, "./main.py", hcj]
     res = call(run_hcj)
 
+    print "-- Cleaning up"
+    # remove generated files, except .hcj and .hcr for debugging
+    for path in (test, '%s.o' % test, '%s.hi' % test):
+        os.remove(path)
+
     if res == 0:
         results[test_dir] = "Success"
     else:
+# -*- coding: utf-8 -*-
+
 from haskell import *
 
+
 class ForwardReference(object):
     def become(self, x):
         self.__class__ = x.__class__
         self.__dict__.update(x.__dict__)
+
     def enumerate(self, subst):
         return self
 
+
 def enum(rule, subst):
     patterns, body = rule
     patterns = [p.enumerate(subst) for p in patterns]
     body = body.enumerate(subst)
     return patterns, body
 
+
 def function(name, rules):
     subst = {}
     rules = [enum(rule, subst) for rule in rules]
     return Function(name, rules, len(subst))
 
+
 def app(func, *args):
     return Cell(Application(func, list(args)))

File tests/enumerations/enumerations.hs

+--	Tests enumerations
+--  Copied from GHC testsuite:
+--  'ghc/testsuite/tests/numeric/should_run/arith010.hs'
+
+main = do
+	print [1..10]
+	print [10..1]		-- []
+	print [1,3..10]
+	print [10,8..1]
+	print ['a'..'f']
+	print ['f'..'a']	-- []
+	print ['a','c'..'m']
+	print ['m','l'..'a']

File tests/enumerations/enumerations.stdout

+[1,2,3,4,5,6,7,8,9,10]
+[]
+[1,3,5,7,9]
+[10,8,6,4,2]
+"abcdef"
+""
+"acegikm"
+"mlkjihgfedcba"

File tests/factorial/factorial.hcj

-{"%module": "main:Main",
-"tdefg": [],
-"vdefg": [{"%rec": [{"qvar": "main:Main.fac",
-"ty": {"bty": {"bty": {"qtycon": "ghczmprim:GHCziPrim.ZLzmzgZR"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"exp": {"lambda": {"vbind": {"var": "dsdmD",
-"ty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"exp": {"%case": {"qtycon": "ghczmprim:GHCziTypes.Int"},
-"exp": {"qvar": "dsdmD"},
-"%of": {"var": "wildB1",
-"ty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"alt": [{"qdcon": "ghczmprim:GHCziTypes.Izh",
-"tbind": [],
-"vbind": [{"var": "ds1dmE",
-"ty": {"qtycon": "ghczmprim:GHCziPrim.Intzh"}}],
-"exp": {"%case": {"qtycon": "ghczmprim:GHCziTypes.Int"},
-"exp": {"qvar": "ds1dmE"},
-"%of": {"var": "ds2XmJ",
-"ty": {"qtycon": "ghczmprim:GHCziPrim.Intzh"}},
-"alt": [{"%_": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziNum.zt"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziNum.zdfNumInt"}}},
-"args": {"aexp": {"qvar": "wildB1"}}},
-"args": {"aexp": {"aexp": {"qvar": "main:Main.fac"},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziNum.zm"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziNum.zdfNumInt"}}},
-"args": {"aexp": {"qvar": "wildB1"}}},
-"args": {"aexp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 1}}}}}}}}}},
-{"lit": 0,
-"exp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 1}}}}]}}]}}}]},
-{"qvar": "main:Main.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zd"},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.ZMZN"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}}},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}}},
-"args": {"aexp": {"qvar": "base:SystemziIO.putStrLn"}}},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zpzp"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}},
-"args": {"aexp": {"aexp": {"qvar": "base:GHCziBase.unpackCStringzh"},
-"args": {"aexp": {"lit": "Factorial 10 is: "}}}}},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zd"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.ZMZN"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}}},
-"args": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziShow.show"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziShow.zdfShowInt"}}}}},
-"args": {"aexp": {"aexp": {"qvar": "main:Main.fac"},
-"args": {"aexp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 10}}}}}}}}}}}},
-{"qvar": "main:ZCMain.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"qvar": "base:GHCziTopHandler.runMainIO"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}},
-"args": {"aexp": {"qvar": "main:Main.main"}}}}]}

File tests/factorial/factorial.hcr

-%module main:Main
-  %rec
-  {main:Main.fac :: ghczmprim:GHCziTypes.Int ->
-                    ghczmprim:GHCziTypes.Int =
-     \ (dsdmD::ghczmprim:GHCziTypes.Int) ->
-         %case ghczmprim:GHCziTypes.Int dsdmD
-         %of (wildB1::ghczmprim:GHCziTypes.Int)
-           {ghczmprim:GHCziTypes.Izh (ds1dmE::ghczmprim:GHCziPrim.Intzh) ->
-              %case ghczmprim:GHCziTypes.Int ds1dmE
-              %of (ds2XmJ::ghczmprim:GHCziPrim.Intzh)
-                {%_ ->
-                   base:GHCziNum.zt @ ghczmprim:GHCziTypes.Int base:GHCziNum.zdfNumInt
-                   wildB1
-                   (main:Main.fac
-                    (base:GHCziNum.zm @ ghczmprim:GHCziTypes.Int
-                     base:GHCziNum.zdfNumInt wildB1
-                     (ghczmprim:GHCziTypes.Izh (1::ghczmprim:GHCziPrim.Intzh))));
-                 (0::ghczmprim:GHCziPrim.Intzh) ->
-                   ghczmprim:GHCziTypes.Izh (1::ghczmprim:GHCziPrim.Intzh)}}};
-  main:Main.main :: (ghczmprim:GHCziTypes.IO
-                     ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziBase.zd
-    @ ((ghczmprim:GHCziTypes.ZMZN ghczmprim:GHCziTypes.Char))
-    @ ((ghczmprim:GHCziTypes.IO ghczmprim:GHCziUnit.Z0T))
-    base:SystemziIO.putStrLn
-    (base:GHCziBase.zpzp @ ghczmprim:GHCziTypes.Char
-     (base:GHCziBase.unpackCStringzh
-      ("Factorial 10 is: "::ghczmprim:GHCziPrim.Addrzh))
-     (base:GHCziBase.zd @ ghczmprim:GHCziTypes.Int
-      @ ((ghczmprim:GHCziTypes.ZMZN ghczmprim:GHCziTypes.Char))
-      (base:GHCziShow.show @ ghczmprim:GHCziTypes.Int
-       base:GHCziShow.zdfShowInt)
-      (main:Main.fac
-       (ghczmprim:GHCziTypes.Izh (10::ghczmprim:GHCziPrim.Intzh)))));
-  main:ZCMain.main :: (ghczmprim:GHCziTypes.IO
-                       ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziTopHandler.runMainIO @ ghczmprim:GHCziUnit.Z0T
-    main:Main.main;

File tests/fibonacci/fibonacci.hcj

-{"%module": "main:Main",
-"tdefg": [],
-"vdefg": [{"%rec": [{"qvar": "main:Main.fib",
-"ty": {"bty": {"bty": {"qtycon": "ghczmprim:GHCziPrim.ZLzmzgZR"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"exp": {"lambda": {"vbind": {"var": "dsdmG",
-"ty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"exp": {"%case": {"qtycon": "ghczmprim:GHCziTypes.Int"},
-"exp": {"qvar": "dsdmG"},
-"%of": {"var": "wildB1",
-"ty": {"qtycon": "ghczmprim:GHCziTypes.Int"}},
-"alt": [{"qdcon": "ghczmprim:GHCziTypes.Izh",
-"tbind": [],
-"vbind": [{"var": "ds1dmH",
-"ty": {"qtycon": "ghczmprim:GHCziPrim.Intzh"}}],
-"exp": {"%case": {"qtycon": "ghczmprim:GHCziTypes.Int"},
-"exp": {"qvar": "ds1dmH"},
-"%of": {"var": "ds2XmM",
-"ty": {"qtycon": "ghczmprim:GHCziPrim.Intzh"}},
-"alt": [{"%_": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziNum.zp"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziNum.zdfNumInt"}}},
-"args": {"aexp": {"aexp": {"qvar": "main:Main.fib"},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziNum.zm"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziNum.zdfNumInt"}}},
-"args": {"aexp": {"qvar": "wildB1"}}},
-"args": {"aexp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 1}}}}}}}}},
-"args": {"aexp": {"aexp": {"qvar": "main:Main.fib"},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziNum.zm"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziNum.zdfNumInt"}}},
-"args": {"aexp": {"qvar": "wildB1"}}},
-"args": {"aexp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 2}}}}}}}}}},
-{"lit": 0,
-"exp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 0}}}},
-{"lit": 1,
-"exp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 1}}}}]}}]}}}]},
-{"qvar": "main:Main.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zd"},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.ZMZN"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}}},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}}},
-"args": {"aexp": {"qvar": "base:SystemziIO.putStrLn"}}},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zpzp"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}},
-"args": {"aexp": {"aexp": {"qvar": "base:GHCziBase.unpackCStringzh"},
-"args": {"aexp": {"lit": "The 10. fibonacci number is: "}}}}},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zd"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.ZMZN"},
-"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}}},
-"args": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziShow.show"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Int"}}},
-"args": {"aexp": {"qvar": "base:GHCziShow.zdfShowInt"}}}}},
-"args": {"aexp": {"aexp": {"qvar": "main:Main.fib"},
-"args": {"aexp": {"aexp": {"qdcon": "ghczmprim:GHCziTypes.Izh"},
-"args": {"aexp": {"lit": 10}}}}}}}}}}}},
-{"qvar": "main:ZCMain.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"qvar": "base:GHCziTopHandler.runMainIO"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}},
-"args": {"aexp": {"qvar": "main:Main.main"}}}}]}

File tests/fibonacci/fibonacci.hcr

-%module main:Main
-  %rec
-  {main:Main.fib :: ghczmprim:GHCziTypes.Int ->
-                    ghczmprim:GHCziTypes.Int =
-     \ (dsdmG::ghczmprim:GHCziTypes.Int) ->
-         %case ghczmprim:GHCziTypes.Int dsdmG
-         %of (wildB1::ghczmprim:GHCziTypes.Int)
-           {ghczmprim:GHCziTypes.Izh (ds1dmH::ghczmprim:GHCziPrim.Intzh) ->
-              %case ghczmprim:GHCziTypes.Int ds1dmH
-              %of (ds2XmM::ghczmprim:GHCziPrim.Intzh)
-                {%_ ->
-                   base:GHCziNum.zp @ ghczmprim:GHCziTypes.Int base:GHCziNum.zdfNumInt
-                   (main:Main.fib
-                    (base:GHCziNum.zm @ ghczmprim:GHCziTypes.Int
-                     base:GHCziNum.zdfNumInt wildB1
-                     (ghczmprim:GHCziTypes.Izh (1::ghczmprim:GHCziPrim.Intzh))))
-                   (main:Main.fib
-                    (base:GHCziNum.zm @ ghczmprim:GHCziTypes.Int
-                     base:GHCziNum.zdfNumInt wildB1
-                     (ghczmprim:GHCziTypes.Izh (2::ghczmprim:GHCziPrim.Intzh))));
-                 (0::ghczmprim:GHCziPrim.Intzh) ->
-                   ghczmprim:GHCziTypes.Izh (0::ghczmprim:GHCziPrim.Intzh);
-                 (1::ghczmprim:GHCziPrim.Intzh) ->
-                   ghczmprim:GHCziTypes.Izh (1::ghczmprim:GHCziPrim.Intzh)}}};
-  main:Main.main :: (ghczmprim:GHCziTypes.IO
-                     ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziBase.zd
-    @ ((ghczmprim:GHCziTypes.ZMZN ghczmprim:GHCziTypes.Char))
-    @ ((ghczmprim:GHCziTypes.IO ghczmprim:GHCziUnit.Z0T))
-    base:SystemziIO.putStrLn
-    (base:GHCziBase.zpzp @ ghczmprim:GHCziTypes.Char
-     (base:GHCziBase.unpackCStringzh
-      ("The 10. fibonacci number is: "::ghczmprim:GHCziPrim.Addrzh))
-     (base:GHCziBase.zd @ ghczmprim:GHCziTypes.Int
-      @ ((ghczmprim:GHCziTypes.ZMZN ghczmprim:GHCziTypes.Char))
-      (base:GHCziShow.show @ ghczmprim:GHCziTypes.Int
-       base:GHCziShow.zdfShowInt)
-      (main:Main.fib
-       (ghczmprim:GHCziTypes.Izh (10::ghczmprim:GHCziPrim.Intzh)))));
-  main:ZCMain.main :: (ghczmprim:GHCziTypes.IO
-                       ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziTopHandler.runMainIO @ ghczmprim:GHCziUnit.Z0T
-    main:Main.main;

File tests/helloworld/helloworld.hcj

-{"%module": "main:Main",
-"tdefg": [],
-"vdefg": [{"qvar": "main:Main.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"qvar": "base:SystemziIO.putStrLn"},
-"args": {"aexp": {"aexp": {"qvar": "base:GHCziBase.unpackCStringzh"},
-"args": {"aexp": {"lit": "Hello, world!",
-"ty": {"qtycon": "ghczmprim:GHCziPrim.Addrzh"}}}}}}},
-{"qvar": "main:ZCMain.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"qvar": "base:GHCziTopHandler.runMainIO"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}},
-"args": {"aexp": {"qvar": "main:Main.main"}}}}]}

File tests/helloworld/helloworld.hcr

-%module main:Main
-  main:Main.main :: (ghczmprim:GHCziTypes.IO
-                     ghczmprim:GHCziUnit.Z0T) =
-    base:SystemziIO.putStrLn
-    (base:GHCziBase.unpackCStringzh
-     ("Hello, world!"::ghczmprim:GHCziPrim.Addrzh));
-  main:ZCMain.main :: (ghczmprim:GHCziTypes.IO
-                       ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziTopHandler.runMainIO @ ghczmprim:GHCziUnit.Z0T
-    main:Main.main;

File tests/helloworld2/helloworld2.hcj

-{"%module": "main:Main",
-"tdefg": [],
-"vdefg": [{"qvar": "main:Main.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"qvar": "base:SystemziIO.putStrLn"},
-"args": {"aexp": {"aexp": {"aexp": {"aexp": {"qvar": "base:GHCziBase.zpzp"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziTypes.Char"}}},
-"args": {"aexp": {"aexp": {"qvar": "base:GHCziBase.unpackCStringzh"},
-"args": {"aexp": {"lit": "Hello, "}}}}},
-"args": {"aexp": {"aexp": {"qvar": "base:GHCziBase.unpackCStringzh"},
-"args": {"aexp": {"lit": "world!"}}}}}}}},
-{"qvar": "main:ZCMain.main",
-"ty": {"bty": {"qtycon": "ghczmprim:GHCziTypes.IO"},
-"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}},
-"exp": {"aexp": {"aexp": {"qvar": "base:GHCziTopHandler.runMainIO"},
-"args": {"aty": {"qtycon": "ghczmprim:GHCziUnit.Z0T"}}},
-"args": {"aexp": {"qvar": "main:Main.main"}}}}]}

File tests/helloworld2/helloworld2.hcr

-%module main:Main
-  main:Main.main :: (ghczmprim:GHCziTypes.IO
-                     ghczmprim:GHCziUnit.Z0T) =
-    base:SystemziIO.putStrLn
-    (base:GHCziBase.zpzp @ ghczmprim:GHCziTypes.Char
-     (base:GHCziBase.unpackCStringzh
-      ("Hello, "::ghczmprim:GHCziPrim.Addrzh))
-     (base:GHCziBase.unpackCStringzh
-      ("world!"::ghczmprim:GHCziPrim.Addrzh)));
-  main:ZCMain.main :: (ghczmprim:GHCziTypes.IO
-                       ghczmprim:GHCziUnit.Z0T) =
-    base:GHCziTopHandler.runMainIO @ ghczmprim:GHCziUnit.Z0T
-    main:Main.main;

File tests/quicksort/quicksort.hs

+main = putStrLn ("Sorted?: " ++ (show (quicksort [10,2,5,3,1,6,7,4,2,3,4,8,9])))
+
+quicksort :: (Ord a) => [a] -> [a]
+quicksort [] = []
+quicksort (x:xs) =
+    let smallerSorted = quicksort [a | a <- xs, a <= x]
+        biggerSorted = quicksort [a | a <- xs, a > x]
+    in  smallerSorted ++ [x] ++ biggerSorted
+