anchor.diff:              Expression.Assign (linqVariable, linqValue)|> asExpr
   
           | Patterns.Lambda (firstVar, firstBody) as lambda ->
  -            let rec getVars vars maybeBody = function
  -            | Lambda (v, body) -> getVars (v::vars) (Some body) body
  -            | _ -> List.rev vars, maybeBody.Value
  -
  -            let vars, body = getVars [] None lambda
  +            let rec getArguments args maybeBody = function
  +            | Lambda (v, body) -> getArguments (v::args) (Some body) body
  +            | _ -> List.rev args, maybeBody.Value
  +
  +            let arguments, body =
  +                getArguments [] None lambda
   
               let capturedVars =
  -                let parameterVars = Set vars
  +                let parameterVars = Set arguments
   
                   body.GetFreeVars ()
                   |> Seq.filter (fun freeVar -> not <| Set.contains freeVar parameterVars)
                   |> Seq.sortBy (fun freeVar -> freeVar.Name)
                   |> Seq.toList
   
  -            let varsCount = vars.Length
  -            if varsCount <= 19 then
  +            let argsCount = arguments.Length
  +            if argsCount > 19 then
  +                // due to limitations of compiling linq quotations we have this fallback where we just pop
  +                // off a single argument and try again. This gives very poor runtime performance, but I'm
  +                // guessing (hoping?) that there aren't too many real world functions that have > 19 arguments.
  +                let v, body = firstVar, firstBody
  +
  +                let vP = ConvVar v
  +                let env = { env with varEnv = Map.add v (vP |> asExpression) env.varEnv }
  +                let tyargs = [| v.Type; body.Type |]
  +                let bodyP = ConvExpr env body
  +                let convType = typedefof<System.Converter<obj,obj>>.MakeGenericType tyargs
  +                let convDelegate = Expression.Lambda(convType, bodyP, [| vP |]) |> asExpression
  +                Expression.Call(typeof<FuncConvert>,"ToFSharpFunc",tyargs,[| convDelegate |]) |> asExpr
  +            else
                   let stateType, makeStateConstructor =
                       match capturedVars |> List.map (fun v -> v.Type) |> List.toArray with
                       | [|t|] -> t, (fun x -> Seq.head x)
  
positive.code:     let asExpr x = AsExpression x
      let asExpression x = (x :> Expression)
  
      let bindingFlags = BindingFlags.Public ||| BindingFlags.NonPublic
      let instanceBindingFlags = BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.DeclaredOnly
      let isNamedType(typ:Type) = not (typ.IsArray || typ.IsByRef || typ.IsPointer)
      let equivHeadTypes (ty1:Type) (ty2:Type) = 
          isNamedType(ty1) &&
          if ty1.IsGenericType then 
            ty2.IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(ty2.GetGenericTypeDefinition())
          else 
            ty1.Equals(ty2)
  
      let isFunctionType typ = equivHeadTypes typ (typeof<(int -> int)>)
      let getFunctionType typ = 
          if not (isFunctionType typ) then invalidArg "typ" "cannot convert recursion except for function types"
          let tyargs = typ.GetGenericArguments()
          tyargs.[0], tyargs.[1]
  
  
negative.code:     type This = 
          static member Assembly = typeof<This>.Assembly
  
      let hashCompareType      = typeof<list<_>>.Assembly.GetType("Microsoft.FSharp.Core.LanguagePrimitives+HashCompare")
      let extraHashCompareType = This.Assembly.GetType("FSharp.Quotations.Evaluator.ExtraHashCompare")
  
      let genericEqualityIntrinsic        = "GenericEqualityIntrinsic"       |> hashCompareType.GetMethod
      let genericNotEqualIntrinsic        = "GenericNotEqualIntrinsic"       |> extraHashCompareType.GetMethod
      let genericLessThanIntrinsic        = "GenericLessThanIntrinsic"       |> hashCompareType.GetMethod
      let genericGreaterThanIntrinsic     = "GenericGreaterThanIntrinsic"    |> hashCompareType.GetMethod
      let genericGreaterOrEqualIntrinsic  = "GenericGreaterOrEqualIntrinsic" |> hashCompareType.GetMethod
      let genericLessOrEqualIntrinsic     = "GenericLessOrEqualIntrinsic"    |> hashCompareType.GetMethod
  
      type ConvEnv = {
          eraseEquality : bool
  