   for k,v of @exports when v.plv8_signature?
       sig = v.plv8_signature
       params = parse_params(v.toString())[1..-1]
-      module.exports[k] ={
+
+      if Array.isArray(sig)
+        returns = sig[(sig.length - 1)]
+        args = zip(params, sig)
+      else if sig.returns
+        returns = sig.returns
+        args = zip(params, sig.arguments)
+        immutable = sig.immutable
+      else
+        throw new Error('plv8_signature should be array or object')
+
+      module.exports[k] =
         name: k
-        returns: sig[(sig.length - 1)]
-        params: zip(params, sig)
+        returns: returns
+        params: args
         filename: filename
-      }
+        immutable: immutable
   res
 
 _isAbsolute = (pth)->

  params = (x.join(" ") for x in info.params).join(', ')
  pass_params = (x for [x,_] in info.params).join(', ')
  declaration = "#{mod.schema}.#{name}(#{params})"

  """
  ---

Module::_compile = (answer, filename) ->
  dir = path.dirname(filename)
  basename = path.basename(filename, '.coffee')
  module =
    key: "#{dir}/#{basename}"
    filename: filename
    basename: basename
    dir: dir
    exports: {}

  module.code = module_code(module, answer)
  plv8_exports[currentModule] = module
  res = oldcompile.apply(this, arguments)
