Its possible to create this in f#?
public TTarget Map<TTarget>(string SQL) where TTarget : new()
{
}
let map<'T when 'T: (new: unit -> 'T)> (sql: string) =
new 'T()
Actually, the constraint is unnecessary. This works just as well.
let map (sql: string) = new 'T()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With