     errors: checkTypes ctx
 
 compileExpression = (source, moduleName = '@unnamed') ->
-  module = lookupInMap compiledModules, moduleName
-  toInject = concatSets (collectRequiresFor moduleName), (newSetWith moduleName)
-  ctx = injectedContext toInject
   ast = (astFromSource "(#{source})", -1, -1)
-  [expression] = _terms ast
-  {js} = compileCtxAstToJs topLevelExpression, ctx, expression
-  (attachPrintedTypes ctx, expression)
-  js: library + immutable + (listOfLines map lookupJs, setToArray toInject) + js
-  ast: ast
-  errors: checkTypes ctx
+  if _empty _terms ast
+    {
+      ast: ast
+      js: ''
+    }
+  else
+    module = lookupInMap compiledModules, moduleName
+    toInject = concatSets (collectRequiresFor moduleName), (newSetWith moduleName)
+    ctx = injectedContext toInject
+    [expression] = _terms ast
+    {js} = compileCtxAstToJs topLevelExpression, ctx, expression
+    (attachPrintedTypes ctx, expression)
+    js: library + immutable + (listOfLines map lookupJs, setToArray toInject) + js
+    ast: ast
+    errors: checkTypes ctx
 
 # Primitive type checking for now
 checkTypes = (ctx) ->

    [o t r] g
  """
  "o", 4
  # The following doesn't work because the Collection type class specifies
  # that the constructor takes only one argument.
  #

    (all zipWith typeEq, a.constraints, b.constraints) and
      (typeEq a.type, b.type)
  else if a instanceof ClassConstraint and b instanceof ClassConstraint
    a.className is b.className and typeEq a.types, b.types
  else if a instanceof Types and b instanceof Types
    all zipWith typeEq, a.types, b.types
  else
    no

