This project is read-only.
2
Vote

ToLinqExpression should simplify the results of splicing into delegate constructor

description

let f1 = <@ fun (i:int) -> i @>
<@ System.Func<,>(%f1) @>
begets the equivalent of
<@ System.Func<_,_(fun arg -> (fun i -> i) arg) @>
and the translation of that by current ToLinqExpression result in multiple ToFSharpFunc/FromFSharpFunc conversions which choke Linq providers (i.e. the following does not work very well:
let filter (f : Expr<'T -> bool>) (q : IQueryable<'T>) =
q.Where(<@System.Func(%f)@>.ToLinqExpression())

comments