anchor.diff:      | ("Cos", "Operators") -> Some("cos", argList)
       | ("ToInt", "Operators") -> Some("(int)", argList)
       | ("GetArraySlice", "OperatorIntrinsics") -> 
  -      Some("array_slice", List.map (fun x -> match x with 
  +      Some("array_slice", List.map (fun x -> 
  +         match x with 
            | Patterns.NewUnionCase(_, [v]) -> v
            | _ -> x) argList)
  -    | (methodName, moduleName) when (List.exists (fun (x, y) -> x = moduleName && y = methodName) existingMethods) -> Some(sprintf "%s_%s" moduleName methodName, argList)
  +    | (methodName, moduleName) when 
  +        (List.exists (fun (x, y) -> x = moduleName && y = methodName) existingMethods) -> 
  +        Some(sprintf "%s_%s" moduleName methodName, argList)
       | _ when not(Seq.isEmpty (op.GetCustomAttributes(typeof<CMirror>, true))) -> 
  -       let attr = Seq.head (op.GetCustomAttributes(typeof<CMirror>, true)) :?> CMirror
  -       Some(attr.Method, argList)
  +        let attr = Seq.head (op.GetCustomAttributes(typeof<CMirror>, true)) :?> CMirror
  +        Some(attr.Method, argList)
       | _ -> None 
     | _ -> None
   
  
positive.code: 
  
  let compileModule (moduleName: string) = 
    let methods = List.map (fun (x: System.Reflection.MethodInfo) -> x.Name) (List.filter (fun (x: System.Reflection.MethodInfo) -> 
        x.DeclaringType.Name = moduleName) (List.ofArray (assembly.GetType(moduleName).GetMethods())))
    let generatedMethods = compileSeveral moduleName methods
    let header = """#include "runtime/fsharp.h"
  #include <stdio.h>
  
negative.code:   let (rhs, funs, includesLhs) = 
      match e with 
      | Patterns.NewArray(tp, elems) -> 
        let args = String.concat "\n\t" (List.mapi (fun index elem -> sprintf "%s->arr[%d] = %s;" var.Name index (ccodegen elem)) elems)
        let arrTp = ccodegenType (tp.MakeArrayType()) 
        let elemTp = (ccodegenType tp)
        let rhs = sprintf "(%s)malloc(sizeof(int) * 2);\n\t%s->length=%d;\n\t%s->arr = (%s*)malloc(sizeof(%s) * %d);\n\t%s" 
                    arrTp var.Name (List.length elems)  var.Name elemTp elemTp (List.length elems) args
        (rhs, [], false)
      | MakeClosure(envVar, lamBody, fields) ->
        let lambdaName = newVar "lambda"
        let id = variable_counter
        let envName = sprintf "env_t_%d" id
        let fieldsDeclList = List.map (fun (tp, v) -> ccodegenType(tp) + " " + v) fields
        let fieldsStructDecl = 
          match fieldsDeclList with 
          | [] -> 
             (* This is because C does not accept structs without any member *)
            (ccodegenType (typeof<AnyNumeric>)) + " dummy_variable;"
          | _ ->
            String.concat "\n\t" (List.map (fun x -> x + ";") fieldsDeclList)
        let envStruct = sprintf "typedef struct %s {\n\t%s\n} %s;" envName fieldsStructDecl envName
        let fieldsDecl = String.concat "," fieldsDeclList
        let fieldsInit = String.concat "\n\t" (List.map (fun (_, v) -> sprintf "env->%s = %s;" v v) fields)
        let makeEnvDef = sprintf "%s* make_%s(%s) {\n\t%s* env = (%s*)malloc(sizeof(%s));\n\t%s\n\treturn env;\n}" 
                           envName envName fieldsDecl envName envName envName fieldsInit
        let makeEnvInvoke = sprintf "make_%s(%s)" envName (String.concat "," (List.map (fun (_, v) -> v) fields))
        (sprintf "make_closure(%s, %s)" lambdaName makeEnvInvoke, 
          [envStruct; makeEnvDef; ccodegenFunction (Expr.Lambda(envVar, lamBody)) lambdaName true], 
          false)
      | Patterns.IfThenElse(cond, e1, e2) ->
        let ccodegenStatements exp = 
          let (stmts, res) = 
            match exp with 
            | LetN(stmts, res) -> stmts, res
            | _ -> [], exp
          let (statementsCodeList, closuresList) = List.unzip (List.map ccodegenStatement stmts)
          let statementsCode = (String.concat "\n\t\t" statementsCodeList)
          (sprintf "%s\n\t\t%s = %s;" statementsCode (var.Name) (ccodegen res), List.concat closuresList)
  