I\'m just starting to learn F#. I wrote this F#/ADO.NET code last night. In what ways would you improve the syntax - make it feel like idiomatic F#?
let cn =
I wrote a functional wrapper over ADO.NET for F#. With this library your example looks like this:
let openConn() =
let cn = new OleDbConnection(cnstr)
cn.Open()
cn :> IDbConnection
let query sql = Sql.execReader (Sql.withNewConnection openConn) sql
let people = query "select * from people" |> List.ofDataReader
printfn "%d" people.Length
people |> Seq.iter (fun r -> printfn "%s" (r?LastName).Value)