anchor.diff:     "array_" + (ccodegenType (t.GetElementType()))
     else if(t.IsGenericParameter) then
       "number_t"
  -  else
  +  else if (t = typeof<double>) then
  +    "number_t"
  +  else 
       t.ToString()
   
   
   (* C code generation for an expression *)
   let rec ccodegen (e:Expr): string =
  -        match e with
  -        | Patterns.Lambda (x, body) -> sprintf "ERROR LAMBDA NOT SUPPORTED!"
  -        | Patterns.Call (None, op, elist) -> 
  -            match op.Name with
  -             | OperatorName opname -> sprintf "%s %s %s" (prettyprint elist.[0]) opname (prettyprint elist.[1]) 
  -             | "GetArray" -> sprintf "%s[%s]" (prettyprint elist.[0]) (prettyprint elist.[1])
  -             | _ -> sprintf "ERROR CALL %s(%s)" op.Name (String.concat ", " (List.map prettyprint elist))
  -        | Patterns.Var(x) -> sprintf "%s" x.Name
  -        | Patterns.NewArray(tp, elems) -> 
  -          sprintf "ERROR new array without let binding [%A]" e
  -        | Patterns.Value(v, tp) -> sprintf "%s" (v.ToString())
  -        | _ -> sprintf "ERROR[%A]" e
  +  match e with
  +  | Patterns.Lambda (x, body) -> sprintf "ERROR LAMBDA NOT SUPPORTED!"
  +  | Patterns.Call (None, op, elist) -> 
  +    match op.Name with
  +      | OperatorName opname -> sprintf "%s %s %s" (prettyprint elist.[0]) opname (ccodegen elist.[1]) 
  +      | "GetArray" -> sprintf "%s[%s]" (ccodegen elist.[0]) (ccodegen elist.[1])
  +      | _ -> sprintf "ERROR CALL %s(%s)" op.Name (String.concat ", " (List.map ccodegen elist))
  +  | Patterns.Var(x) -> sprintf "%s" x.Name
  +  | Patterns.NewArray(tp, elems) -> 
  +    sprintf "ERROR new array without let binding [%A]" e
  +  | Patterns.Value(v, tp) -> sprintf "%s" (v.ToString())
  +  | _ -> sprintf "ERROR[%A]" e
   
   (* C code generation for a statement in the form of `let var = e` *)
   let ccodegenStatement (var: Var, e: Expr): string = 
     match e with 
     | Patterns.NewArray(tp, elems) -> 
       sprintf "%s %s = malloc(sizeof(%s) * %d);\n\t%s" (ccodegenType var.Type) (var.Name) (ccodegenType tp) (List.length elems) 
  -      (String.concat "\n\t" (List.mapi (fun index elem -> sprintf "%s[%d] = %s;" var.Name index (prettyprint elem)) elems))
  +      (String.concat "\n\t" (List.mapi (fun index elem -> sprintf "%s[%d] = %s;" var.Name index (ccodegen elem)) elems))
     | _ -> 
       sprintf "%s %s = %s;" (ccodegenType var.Type) (var.Name) (ccodegen e)
   
   (* C code generation for a function *)
   let ccodegenFunction (e: Expr) (name: string): string =
     let rec extractHeader exp curInputs statements = match exp with 
  -    | Patterns.Lambda (x, body) -> extractHeader body (List.append curInputs [x]) statements
  +    | LambdaN (inputs, body) -> extractHeader body (List.append curInputs inputs) statements
       | Patterns.Let(x, e1, e2) -> extractHeader e2 curInputs (List.append statements [(x, e1)])
       | _ -> (exp, curInputs, statements)
     let (result, inputs, statements) = extractHeader e [] []
  
positive.code: ﻿module compiler
  
  open Microsoft.FSharp.Quotations
  
  let (|OperatorName|_|) methodName =
    match methodName with
  
negative.code:     | "op_Subtraction" -> Some("-")
      | _ -> None
  
  let (|LambdaN|_|) (e: Expr): (Var List * Expr) Option = 
    let rec lambdaNExtract exp = match exp with
      | Patterns.Lambda(x, body) -> 
        let (inputs, newBody) = lambdaNExtract body
        (x :: inputs, newBody)
      | _ -> ([], exp)
    match lambdaNExtract e with 
    | ([], _) -> None
    | (inputs, body) -> Some(inputs, body)
  
  let LambdaN (inputs: Var List, body: Expr): Expr =
    List.fold (fun acc cur -> Expr.Lambda(cur,  acc)) body (List.rev inputs)
  
  (* Pretty prints the given expression *)
  let rec prettyprint (e:Expr): string =
    match e with
    | Patterns.Lambda (x, body) -> sprintf "\%s. %s" (x.Name) (prettyprint body)
    | Patterns.Let(x, e1, e2) -> sprintf "let %s = %s in \n%s" (x.Name) (prettyprint e1) (prettyprint e2)
    | Patterns.Call (None, op, elist) -> 
      match op.Name with
        | OperatorName opname -> sprintf "%s %s %s" (prettyprint elist.[0]) opname (prettyprint elist.[1]) 
        | "GetArray" -> sprintf "%s[%s]" (prettyprint elist.[0]) (prettyprint elist.[1])
        | _ -> sprintf "ERROR CALL %s(%s)" op.Name (String.concat ", " (List.map prettyprint elist))
    | Patterns.Var(x) -> sprintf "%s" x.Name
    | Patterns.NewArray(tp, elems) -> sprintf "Array[%s](%s)" (tp.ToString()) (String.concat ", " (List.map prettyprint elems))
    | Patterns.Value(v, tp) -> sprintf "%s" (v.ToString())
    | _ -> sprintf "ERROR[%A]" e
  
  let mutable variable_counter = 0
  
  