Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active November 14, 2018 13:39
Show Gist options
  • Save rexcfnghk/64364c05362b9dbaf1dd466b207a6aee to your computer and use it in GitHub Desktop.
Save rexcfnghk/64364c05362b9dbaf1dd466b207a6aee to your computer and use it in GitHub Desktop.
module CompositionRoot
let findPlayerNames' =
findPlayerNames "Data Source=localhost; Initial Catalog=MyDb; Integrated Security = True"
module Program
let main _ =
// Database queried once
let playerNames1 = findPlayerNames' () |> Seq.toList
// Database queried once again
// Same connection string is used due to closure created
// The function findPlayerNames is 'partially applied'
let playerNames2 = findPlayerNames' () |> Seq.toList
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment