How to resolve this problem with type inference?
open Microsoft.FSharp.Linq.RuntimeHelpers
open System
open System.Linq.Expressions
open Accord.Math.Optimization
module Vector=
let compareScalarProcut(a:double[])(b:double[])(greaterOrEqualThen:float)=
Array.map2 (*) a b
|> Array.sum
|> fun x-> x >= greaterOrEqualThen
module Lambda =
let toExpression (``f# lambda`` : Quotations.Expr<'a>) =
``f# lambda``
|> LeafExpressionConverter.QuotationToExpression
|> unbox<Expression<'a>>
let LambdaExpression (coefficients:double[]) =
<@ Func<double[], bool>(fun i -> (Vector.compareScalarProcut(i,coefficients,0)) @>
|> Lambda.toExpression
