I have a console app that has an example function:
let aFxUsedFromTheEntryPoint () =
let aHelperFx (cThing) (iThing) (qThing) =
Unchecked.defaultof<Quote>
let c =
thisFx() //this line reads in and process lots of data; takes some time
let i =
thatFx() //this line also reads in and processes lots of data; takes some time
aList
|> List.map (fun q -> aHelperFx c i q)
How are the c
and i
variables used in the function? Are they read in once before last two lines and just used repeatedly, for however long aList
is? Or are they executed once for every q
in `aList'?
If the latter, is there a better way to go about writing a function like this? Can I somehow write the function so that c
and i
are run only once, yet passed however many times it's necessary in aList
?