F# Optional Record Field
- by akaphenom
I have a F# record type and want one of the fields to be optional:
type legComponents = {
shares : int<share> ;
price : float<dollar / share> ;
totalInvestment : float<dollar> ;
}
type tradeLeg = {
id : int ;
tradeId : int ;
legActivity : LegActivityType ;
actedOn : DateTime ;
estimates : legComponents ;
?actuals : legComponents ;
}
in the tradeLeg type I owuld like the the actuals field to be optional. I cant seem to figure it out nor can I seem to find a reliable example on the web. It seem like this sohuld be easy like
let ?t : int = None
but i realy can't seem to get this to work. Ugh - thank you
T